Tomas Cohen Arazi
d383b49987
This patch adds the OpenAPI spec for the following paths: - /patrons/{patron_id}/account It also adds object definitions for: - balance - account line Account line is to be used on both /account/lines (when implemented) and for embeding the outstanding lines in the balance endpoint (/patrons/{patron_id}/account). Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
65 lines
1.5 KiB
JSON
65 lines
1.5 KiB
JSON
{
|
|
"/patrons/{patron_id}/account": {
|
|
"get": {
|
|
"x-mojo-to": "Patrons::Account#get",
|
|
"operationId": "getPatronAccount",
|
|
"tags": [
|
|
"patron"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"$ref": "../parameters.json#/patron_id_pp"
|
|
}
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Patron's account balance",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/patron_balance"
|
|
}
|
|
},
|
|
"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": {
|
|
"allow-owner": true,
|
|
"allow-guarantor": true,
|
|
"permissions": {
|
|
"borrowers": "edit_borrowers",
|
|
"updatecharges": "remaining_permissions"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|