Bug 39830: Add order claim object definition

This patch adds the required mapping in
`Koha::Acquisition::Order::Claim` and adds it's definition to the API
spec.

To test:
1. Apply the patches
2. Verify the mapping makes sense and conforms to the current style and
   API coding guidelines.
3. Run:
   $ ktd --shell
  k$ prove xt/api.t
=> SUCCESS: Tests pass
4. Sign off :-D

Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
This commit is contained in:
Tomas Cohen Arazi 2025-05-05 08:26:16 -03:00 committed by Laura_Escamilla
parent 6967fe8d02
commit 4246222598
No known key found for this signature in database
GPG Key ID: 56A7626A071C052F
3 changed files with 30 additions and 0 deletions

View File

@ -29,8 +29,22 @@ Koha::Acquisition::Order::Claim - Koha Claim Object class
=head2 Class methods
=head3 to_api_mapping
This method returns the mapping for representing a Koha::Patron object
on the API.
=cut
sub to_api_mapping {
return {
id => 'order_claim_id',
ordernumber => 'order_id',
claimed_on => 'date_claimed',
};
}
=head2 Internal methods
=head3 _type

View File

@ -0,0 +1,14 @@
---
type: object
properties:
order_claim_id:
type: integer
description: Internally assigned order claim identifier
order_id:
type: integer
description: Internally assigned order identifier
date_claimed:
type: string
format: date
description: Date the claim was recorded
additionalProperties: false

View File

@ -142,6 +142,8 @@ definitions:
$ref: ./definitions/merge_biblios.yaml
order:
$ref: ./definitions/order.yaml
order_claim:
$ref: ./definitions/order_claim.yaml
patron:
$ref: ./definitions/patron.yaml
patron_account_credit: