From aaaeb6d0b14c39fec75f357cb1ea687a532fe06d Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 8 Nov 2024 15:57:39 +0000 Subject: [PATCH] Bug 22421: (QA follow-up) Update API mapping and specs We missed some cases where the API specs and mappings were missing for the new old_issue_id field. Signed-off-by: Martin Renvoize --- Koha/Account/Credit.pm | 1 + Koha/Account/Debit.pm | 1 + Koha/Account/Line.pm | 1 + api/v1/swagger/definitions/account_line.yaml | 5 +++++ api/v1/swagger/definitions/debit.yaml | 5 +++++ t/db_dependent/api/v1/patrons_accounts.t | 2 +- 6 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Koha/Account/Credit.pm b/Koha/Account/Credit.pm index e3ffa39244b..aed89932e2e 100644 --- a/Koha/Account/Credit.pm +++ b/Koha/Account/Credit.pm @@ -48,6 +48,7 @@ sub to_api_mapping { borrowernumber => 'patron_id', branchcode => 'library_id', issue_id => undef, + old_issue_id => undef, itemnumber => undef, manager_id => 'user_id', note => 'internal_note', diff --git a/Koha/Account/Debit.pm b/Koha/Account/Debit.pm index e48cd2bffa5..b113003bdad 100644 --- a/Koha/Account/Debit.pm +++ b/Koha/Account/Debit.pm @@ -48,6 +48,7 @@ sub to_api_mapping { borrowernumber => 'patron_id', branchcode => 'library_id', issue_id => 'checkout_id', + old_issue_id => 'old_checkout_id', itemnumber => 'item_id', manager_id => 'user_id', note => 'internal_note', diff --git a/Koha/Account/Line.pm b/Koha/Account/Line.pm index 16752ff0329..a82ad434146 100644 --- a/Koha/Account/Line.pm +++ b/Koha/Account/Line.pm @@ -982,6 +982,7 @@ sub to_api_mapping { borrowernumber => 'patron_id', branchcode => 'library_id', issue_id => 'checkout_id', + old_issue_id => 'old_checkout_id', itemnumber => 'item_id', manager_id => 'user_id', note => 'internal_note', diff --git a/api/v1/swagger/definitions/account_line.yaml b/api/v1/swagger/definitions/account_line.yaml index cbf71f22b0a..1fe078417c2 100644 --- a/api/v1/swagger/definitions/account_line.yaml +++ b/api/v1/swagger/definitions/account_line.yaml @@ -24,6 +24,11 @@ properties: - integer - "null" description: Internal identifier for the checkout the account line is related to + old_checkout_id: + type: + - integer + - "null" + description: Internal identifier for the old checkout the account line is related to credit_number: type: - string diff --git a/api/v1/swagger/definitions/debit.yaml b/api/v1/swagger/definitions/debit.yaml index c3cc06096f4..07ea7d7884d 100644 --- a/api/v1/swagger/definitions/debit.yaml +++ b/api/v1/swagger/definitions/debit.yaml @@ -23,6 +23,11 @@ properties: - integer - "null" description: Internal identifier for the checkout the account line is related to + old_checkout_id: + type: + - integer + - "null" + description: Internal identifier for the old checkout the account line is related to date: type: string format: date-time diff --git a/t/db_dependent/api/v1/patrons_accounts.t b/t/db_dependent/api/v1/patrons_accounts.t index 6fbb726b7df..31d395ace64 100755 --- a/t/db_dependent/api/v1/patrons_accounts.t +++ b/t/db_dependent/api/v1/patrons_accounts.t @@ -90,7 +90,7 @@ subtest 'get_balance() tests' => sub { $debit_2->discard_changes; $t->get_ok("//$userid:$password@/api/v1/patrons/$patron_id/account") - ->status_is(200)->json_is( + ->status_is(200)->or(sub { diag $t->tx->res->body } )->json_is( { balance => 100.01, outstanding_debits => { -- 2.47.0