From 67d5165e761cb648a0d7b6cd78acb28dbf052aca Mon Sep 17 00:00:00 2001
From: Nick Clemens <nick@bywatersolutions.com>
Date: Thu, 23 Jan 2020 02:36:29 +0000
Subject: [PATCH] Bug 24476: API Updates

Signed-off-by: Andrew <andrew@bywatersolutions.com>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
---
 Koha/Patron.pm                         | 1 +
 api/v1/swagger/definitions/patron.json | 4 ++++
 api/v1/swagger/paths/patrons.json      | 6 ++++++
 3 files changed, 11 insertions(+)

diff --git a/Koha/Patron.pm b/Koha/Patron.pm
index 8b8b6d5ec3..21a57a98ad 100644
--- a/Koha/Patron.pm
+++ b/Koha/Patron.pm
@@ -1616,6 +1616,7 @@ sub to_api_mapping {
         smsalertnumber      => 'sms_number',
         sort1               => 'statistics_1',
         sort2               => 'statistics_2',
+        autorenewal         => 'autorenewal',
         streetnumber        => 'street_number',
         streettype          => 'street_type',
         zipcode             => 'postal_code',
diff --git a/api/v1/swagger/definitions/patron.json b/api/v1/swagger/definitions/patron.json
index 06ed23b9ac..cf5eedf52d 100644
--- a/api/v1/swagger/definitions/patron.json
+++ b/api/v1/swagger/definitions/patron.json
@@ -191,6 +191,10 @@
       "type": ["string", "null"],
       "description": "a field that can be used for any information unique to the library"
     },
+    "autorenewal": {
+      "type": "boolean",
+      "description": "indicate whether auto-renewal is allowed for patron"
+    },
     "altcontact_firstname": {
       "type": ["string", "null"],
       "description": "first name of alternate contact for the patron"
diff --git a/api/v1/swagger/paths/patrons.json b/api/v1/swagger/paths/patrons.json
index 27bd08f69f..bb4efd3caf 100644
--- a/api/v1/swagger/paths/patrons.json
+++ b/api/v1/swagger/paths/patrons.json
@@ -296,6 +296,12 @@
         "required": false,
         "type": "string"
       }, {
+        "name": "autorenewal",
+        "in": "query",
+        "description": "Search on autorenewal",
+        "required": false,
+        "type": "boolean"
+      }, {
         "name": "altcontact_firstname",
         "in": "query",
         "description": "Case insensitive search on altcontact_firstname",
-- 
2.11.0