From 28b326d3cbe9a687b249e0306797e2338417f026 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 2 May 2025 14:15:12 -0300 Subject: [PATCH] Bug 39816: Allow embedding `late_since_days` in baskets This patch adds the option to embed the return value of the `late_since_days` method in basket objects in the REST API. It does so by just adding it to the list of embeds in the spec. It is added in every place baskets can be returned. --- api/v1/swagger/definitions/basket.yaml | 7 ++++++- api/v1/swagger/paths/acquisitions_baskets.yaml | 10 ++++++++++ api/v1/swagger/paths/acquisitions_orders.yaml | 2 ++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/api/v1/swagger/definitions/basket.yaml b/api/v1/swagger/definitions/basket.yaml index 2006079fd7a..af08323abd8 100644 --- a/api/v1/swagger/definitions/basket.yaml +++ b/api/v1/swagger/definitions/basket.yaml @@ -84,4 +84,9 @@ properties: - null description: "When items should be created for orders in this basket (Options: 'ordering', 'receiving', 'cataloguing'. Null means system wide config)" -additionalProperties: false \ No newline at end of file + late_since_days: + type: + - integer + - "null" + description: The number of days the basket is late (x-koha-embed) +additionalProperties: false diff --git a/api/v1/swagger/paths/acquisitions_baskets.yaml b/api/v1/swagger/paths/acquisitions_baskets.yaml index eab24251181..06f77d6bdc2 100644 --- a/api/v1/swagger/paths/acquisitions_baskets.yaml +++ b/api/v1/swagger/paths/acquisitions_baskets.yaml @@ -14,6 +14,16 @@ - $ref: "../swagger.yaml#/parameters/per_page" - $ref: "../swagger.yaml#/parameters/q_param" - $ref: "../swagger.yaml#/parameters/q_body" + - name: x-koha-embed + in: header + required: false + description: Embed list sent as a request header + type: array + items: + type: string + enum: + - late_since_days + collectionFormat: csv produces: - application/json responses: diff --git a/api/v1/swagger/paths/acquisitions_orders.yaml b/api/v1/swagger/paths/acquisitions_orders.yaml index 034208ae7cd..85b88ac368d 100644 --- a/api/v1/swagger/paths/acquisitions_orders.yaml +++ b/api/v1/swagger/paths/acquisitions_orders.yaml @@ -75,6 +75,7 @@ - basket - basket.basket_group - basket.creator + - basket.late_since_days - basket.vendor - biblio - biblio.uncancelled_orders+count @@ -203,6 +204,7 @@ - basket - basket.basket_group - basket.creator + - basket.late_since_days - biblio - biblio.uncancelled_orders+count - biblio.holds+count -- 2.49.0