Martin Renvoize
9ba40e1adf
This patch creates a Koha::Cash::Register::Cashup(s) class pair which subclass Koha::Cash::Register::Action(s) and moves the cashup specific code into these new classes to improve code separation. We then introduce API routes based on these classes to allow fetching a list of cashups associated to a cash register and a full cashup with emeddable summary for individual cashups. Test plan 1/ Run the updated unit tests. t/db_dependent/Koha/Cash/Register/Action.t t/db_dependent/Koha/Cash/Register/Cashup.t 2/ Run the incuded api tests. t/db_dependent/api/v1/cashups.t Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
104 lines
3.2 KiB
JSON
104 lines
3.2 KiB
JSON
{
|
|
"/cash_registers/{cash_register_id}/cashups": {
|
|
"get": {
|
|
"x-mojo-to": "CashRegisters::Cashups#list",
|
|
"operationId": "listCashups",
|
|
"tags": ["cash_registers", "cashups"],
|
|
"produces": ["application/json"],
|
|
"parameters": [{
|
|
"$ref": "../parameters.json#/cash_register_id_pp"
|
|
},
|
|
{
|
|
"$ref": "../parameters.json#/match"
|
|
},
|
|
{
|
|
"$ref": "../parameters.json#/order_by"
|
|
},
|
|
{
|
|
"$ref": "../parameters.json#/page"
|
|
},
|
|
{
|
|
"$ref": "../parameters.json#/per_page"
|
|
},
|
|
{
|
|
"$ref": "../parameters.json#/q_param"
|
|
},
|
|
{
|
|
"$ref": "../parameters.json#/q_body"
|
|
},
|
|
{
|
|
"$ref": "../parameters.json#/q_header"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Cashups performed on this register",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "../definitions.json#/cashup"
|
|
}
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Access forbidden",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/error"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Register not found",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/error"
|
|
}
|
|
}
|
|
},
|
|
"x-koha-authorization": {
|
|
"permissions": {
|
|
"cash_management": "cashup"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/cashups/{cashup_id}": {
|
|
"get": {
|
|
"x-mojo-to": "CashRegisters::Cashups#get",
|
|
"operationId": "getCashup",
|
|
"tags": ["cash_registers", "cashups"],
|
|
"parameters": [{
|
|
"$ref": "../parameters.json#/cashup_id_pp"
|
|
}],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "A cashup",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/cashup"
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Access forbidden",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/error"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Patron not found",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/error"
|
|
}
|
|
}
|
|
},
|
|
"x-koha-authorization": {
|
|
"permissions": {
|
|
"cash_management": "cashup"
|
|
}
|
|
},
|
|
"x-koha-embed": [
|
|
"summary"
|
|
]
|
|
}
|
|
}
|
|
}
|