Bug 13895: (QA follow-up) Make the class plural
authorTomas Cohen Arazi <tomascohen@theke.io>
Wed, 27 Mar 2019 17:23:18 +0000 (14:23 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 28 Mar 2019 19:38:41 +0000 (19:38 +0000)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Koha/REST/V1/Checkouts.pm [moved from Koha/REST/V1/Checkout.pm with 92% similarity]
api/v1/swagger/paths/checkouts.json

similarity index 92%
rename from Koha/REST/V1/Checkout.pm
rename to Koha/REST/V1/Checkouts.pm
index e228216..6c1c5e3 100644 (file)
@@ -1,4 +1,4 @@
-package Koha::REST::V1::Checkout;
+package Koha::REST::V1::Checkouts;
 
 # This file is part of Koha.
 #
@@ -135,8 +135,8 @@ attribute names.
 sub _to_api {
     my $checkout = shift;
 
-    foreach my $column ( keys %{ $Koha::REST::V1::Checkout::to_api_mapping } ) {
-        my $mapped_column = $Koha::REST::V1::Checkout::to_api_mapping->{$column};
+    foreach my $column ( keys %{ $Koha::REST::V1::Checkouts::to_api_mapping } ) {
+        my $mapped_column = $Koha::REST::V1::Checkouts::to_api_mapping->{$column};
         if ( exists $checkout->{ $column } && defined $mapped_column )
         {
             $checkout->{ $mapped_column } = delete $checkout->{ $column };
@@ -158,8 +158,8 @@ attribute names.
 sub _to_model {
     my $checkout = shift;
 
-    foreach my $attribute ( keys %{ $Koha::REST::V1::Checkout::to_model_mapping } ) {
-        my $mapped_attribute = $Koha::REST::V1::Checkout::to_model_mapping->{$attribute};
+    foreach my $attribute ( keys %{ $Koha::REST::V1::Checkouts::to_model_mapping } ) {
+        my $mapped_attribute = $Koha::REST::V1::Checkouts::to_model_mapping->{$attribute};
         if ( exists $checkout->{ $attribute } && defined $mapped_attribute )
         {
             $checkout->{ $mapped_attribute } = delete $checkout->{ $attribute };
index 1729826..6293401 100644 (file)
@@ -1,7 +1,7 @@
 {
   "/checkouts": {
     "get": {
-      "x-mojo-to": "Checkout#list",
+      "x-mojo-to": "Checkouts#list",
       "operationId": "listCheckouts",
       "tags": ["patrons", "checkouts"],
       "parameters": [{
@@ -35,7 +35,7 @@
   },
   "/checkouts/{checkout_id}": {
     "get": {
-      "x-mojo-to": "Checkout#get",
+      "x-mojo-to": "Checkouts#get",
       "operationId": "getCheckout",
       "tags": ["patrons", "checkouts"],
       "parameters": [{
@@ -65,7 +65,7 @@
   },
   "/checkouts/{checkout_id}/renewal": {
     "post": {
-      "x-mojo-to": "Checkout#renew",
+      "x-mojo-to": "Checkouts#renew",
       "operationId": "renewCheckout",
       "tags": ["patrons", "checkouts"],
       "parameters": [{