From 1674725c6bb611fe337fe38b2dd302c36697b341 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 10 Jul 2024 13:23:04 +0000 Subject: [PATCH] Bug 37262: (follow-up) Rename types/tables Signed-off-by: Tomas Cohen Arazi Signed-off-by: Pedro Amorim --- Koha/AdditionalField.pm | 8 +++++--- Koha/REST/V1/ExtendedAttributeTypes.pm | 2 ++ api/v1/swagger/paths/extended_attribute_types.yaml | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Koha/AdditionalField.pm b/Koha/AdditionalField.pm index 25d6808c16..a9230ff666 100644 --- a/Koha/AdditionalField.pm +++ b/Koha/AdditionalField.pm @@ -55,9 +55,11 @@ sub to_api { my ( $self, $params ) = @_; my $table_to_resource = { - 'aqbasket' => 'basket', - 'aqinvoices' => 'invoice', - 'aqorders' => 'order', + 'accountlines:credit' => 'credit', + 'accountlines:debit' => 'debit', + 'aqbasket' => 'basket', + 'aqinvoices' => 'invoice', + 'aqorders' => 'order', }; my $json = $self->SUPER::to_api($params); diff --git a/Koha/REST/V1/ExtendedAttributeTypes.pm b/Koha/REST/V1/ExtendedAttributeTypes.pm index 528197ad0c..c49fddc232 100644 --- a/Koha/REST/V1/ExtendedAttributeTypes.pm +++ b/Koha/REST/V1/ExtendedAttributeTypes.pm @@ -47,6 +47,8 @@ sub list { # FIXME: Maybe not the best place for this mapping my $resource_to_table = { basket => 'aqbasket', + credit => 'accountlines:credit', + debit => 'accountlines:debit', invoice => 'aqinvoices', order => 'aqorders', }; diff --git a/api/v1/swagger/paths/extended_attribute_types.yaml b/api/v1/swagger/paths/extended_attribute_types.yaml index f49d54b91e..f20eb2ff58 100644 --- a/api/v1/swagger/paths/extended_attribute_types.yaml +++ b/api/v1/swagger/paths/extended_attribute_types.yaml @@ -15,11 +15,11 @@ type: string enum: - basket + - credit + - debit - invoice - order - subscription - - accountlines:credit - - accountlines:debit - $ref: "../swagger.yaml#/parameters/match" - $ref: "../swagger.yaml#/parameters/order_by" - $ref: "../swagger.yaml#/parameters/page" -- 2.39.2