From 83244195390d99ef47d4551667831e06fd7eae98 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 15 Sep 2025 14:13:05 +0100 Subject: [PATCH] Bug 40808: Add REST API embedding support for hold account_lines Adds support for embedding account lines in holds via the REST API: 1. api/v1/swagger/definitions/hold.yaml - Adds account_lines property to hold definition for API output when embedded 2. api/v1/swagger/paths/holds.yaml - Adds account_lines to the x-koha-embed enum for the GET /holds endpoint 3. api/v1/swagger/paths/patrons_holds.yaml - Adds account_lines to the x-koha-embed enum for GET /patrons/{patron_id}/holds endpoint Usage: GET /api/v1/holds?x-koha-embed=account_lines GET /api/v1/patrons/123/holds?x-koha-embed=account_lines This allows API consumers to retrieve holds with their associated charges/fees in a single request, enabling efficient access to hold-related financial information. --- api/v1/swagger/definitions/hold.yaml | 7 +++++++ api/v1/swagger/paths/holds.yaml | 1 + api/v1/swagger/paths/patrons_holds.yaml | 1 + 3 files changed, 9 insertions(+) diff --git a/api/v1/swagger/definitions/hold.yaml b/api/v1/swagger/definitions/hold.yaml index f09580f8747..a88f6103d73 100644 --- a/api/v1/swagger/definitions/hold.yaml +++ b/api/v1/swagger/definitions/hold.yaml @@ -144,6 +144,13 @@ properties: - object - "null" description: Patron for hold + debits: + type: + - array + - "null" + description: Debits (charges) linked to this hold (x-koha-embed) + items: + $ref: "./debit.yaml" _strings: type: - object diff --git a/api/v1/swagger/paths/holds.yaml b/api/v1/swagger/paths/holds.yaml index 388a446ab9d..d1d20715cb6 100644 --- a/api/v1/swagger/paths/holds.yaml +++ b/api/v1/swagger/paths/holds.yaml @@ -108,6 +108,7 @@ - pickup_library - item - patron + - debits collectionFormat: csv produces: - application/json diff --git a/api/v1/swagger/paths/patrons_holds.yaml b/api/v1/swagger/paths/patrons_holds.yaml index b8c28f30d83..739451e2fa9 100644 --- a/api/v1/swagger/paths/patrons_holds.yaml +++ b/api/v1/swagger/paths/patrons_holds.yaml @@ -34,6 +34,7 @@ - deleted_biblio - item - pickup_library + - account_lines collectionFormat: csv produces: - application/json -- 2.51.0