Bugzilla – Attachment 76815 Details for
Bug 20944
Add routes to add credits to a patron's account
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20944: OpenAPI spec for /patrons/{patron_id}/account/credits
Bug-20944-OpenAPI-spec-for-patronspatronidaccountc.patch (text/plain), 4.79 KB, created by
Tomás Cohen Arazi (tcohen)
on 2018-07-10 17:58:44 UTC
(
hide
)
Description:
Bug 20944: OpenAPI spec for /patrons/{patron_id}/account/credits
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2018-07-10 17:58:44 UTC
Size:
4.79 KB
patch
obsolete
>From 69ca9a539e3c217b952c595b4e7d9ef64b34b271 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 10 Jul 2018 14:53:47 -0300 >Subject: [PATCH] Bug 20944: OpenAPI spec for > /patrons/{patron_id}/account/credits > >--- > api/v1/swagger/definitions.json | 3 + > .../definitions/patron_account_credit.json | 39 +++++++++++ > api/v1/swagger/paths.json | 3 + > api/v1/swagger/paths/patrons_account.json | 69 +++++++++++++++++++ > 4 files changed, 114 insertions(+) > create mode 100644 api/v1/swagger/definitions/patron_account_credit.json > >diff --git a/api/v1/swagger/definitions.json b/api/v1/swagger/definitions.json >index b9c0a29ec5..65094325c6 100644 >--- a/api/v1/swagger/definitions.json >+++ b/api/v1/swagger/definitions.json >@@ -17,6 +17,9 @@ > "patron": { > "$ref": "definitions/patron.json" > }, >+ "patron_account_credit": { >+ "$ref": "definitions/patron_account_credit.json" >+ }, > "patron_balance": { > "$ref": "definitions/patron_balance.json" > }, >diff --git a/api/v1/swagger/definitions/patron_account_credit.json b/api/v1/swagger/definitions/patron_account_credit.json >new file mode 100644 >index 0000000000..ddb71e3dcc >--- /dev/null >+++ b/api/v1/swagger/definitions/patron_account_credit.json >@@ -0,0 +1,39 @@ >+{ >+ "type": "object", >+ "properties": { >+ "credit_type": { >+ "type": "string", >+ "description": "Type of credit ('credit', 'forgiven', 'lost_item_return', 'payment', 'writeoff' )" >+ }, >+ "amount": { >+ "type": "number", >+ "minimum": 0, >+ "description": "Credit amount" >+ }, >+ "account_lines_ids": { >+ "type": "array", >+ "items": { >+ "type": "integer" >+ }, >+ "description": "List of account line ids the credit goes against (optional)" >+ }, >+ "payment_type": { >+ "type": "string", >+ "description": "Payment type (only applies when credit_type=payment)" >+ }, >+ "date": { >+ "type": "string", >+ "format": "date", >+ "description": "Date the credit was recorded (optional)" >+ }, >+ "description": { >+ "type": "string", >+ "description": "Description" >+ }, >+ "note": { >+ "type": "string", >+ "description": "Internal note" >+ } >+ }, >+ "required": [ "amount" ] >+} >diff --git a/api/v1/swagger/paths.json b/api/v1/swagger/paths.json >index fb5f7a30a5..c9d8e881b5 100644 >--- a/api/v1/swagger/paths.json >+++ b/api/v1/swagger/paths.json >@@ -29,6 +29,9 @@ > "/patrons/{patron_id}/account": { > "$ref": "paths/patrons_account.json#/~1patrons~1{patron_id}~1account" > }, >+ "/patrons/{patron_id}/account/credits": { >+ "$ref": "paths/patrons_account.json#/~1patrons~1{patron_id}~1account~1credits" >+ }, > "/illrequests": { > "$ref": "paths/illrequests.json#/~1illrequests" > } >diff --git a/api/v1/swagger/paths/patrons_account.json b/api/v1/swagger/paths/patrons_account.json >index 5a2a0d0056..8ad88f0896 100644 >--- a/api/v1/swagger/paths/patrons_account.json >+++ b/api/v1/swagger/paths/patrons_account.json >@@ -61,5 +61,74 @@ > } > } > } >+ }, >+ "/patrons/{patron_id}/account/credits": { >+ "post": { >+ "x-mojo-to": "Patrons::Account#add_credit", >+ "operationId": "addPatronCredit", >+ "tags": [ >+ "patron" >+ ], >+ "parameters": [ >+ { >+ "$ref": "../parameters.json#/patron_id_pp" >+ }, >+ { >+ "name": "body", >+ "in": "body", >+ "description": "A JSON object containing credit information", >+ "required": true, >+ "schema": { >+ "$ref": "../definitions.json#/patron_account_credit" >+ } >+ } >+ ], >+ "produces": [ >+ "application/json" >+ ], >+ "responses": { >+ "200": { >+ "description": "Credit added", >+ "schema": { >+ "type": "object" >+ } >+ }, >+ "401": { >+ "description": "Authentication required", >+ "schema": { >+ "$ref": "../definitions.json#/error" >+ } >+ }, >+ "403": { >+ "description": "Access forbidden", >+ "schema": { >+ "$ref": "../definitions.json#/error" >+ } >+ }, >+ "404": { >+ "description": "Patron not found", >+ "schema": { >+ "$ref": "../definitions.json#/error" >+ } >+ }, >+ "500": { >+ "description": "Internal server error", >+ "schema": { >+ "$ref": "../definitions.json#/error" >+ } >+ }, >+ "503": { >+ "description": "Under maintenance", >+ "schema": { >+ "$ref": "../definitions.json#/error" >+ } >+ } >+ }, >+ "x-koha-authorization": { >+ "permissions": { >+ "updatecharges": "remaining_permissions" >+ } >+ } >+ } > } > } >-- >2.18.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20944
:
76815
|
76816
|
77645
|
77646
|
77928
|
77929
|
78329