Bug 26274: Add cashups api routes
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 19 Aug 2020 07:34:35 +0000 (08:34 +0100)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 12 Feb 2021 11:33:41 +0000 (12:33 +0100)
commit9ba40e1adf53ad84ac1e123ce08e2c7c242704ba
tree1ff3d0e25b72f7a05a2436371bfece6608d112ce
parent3cfa9b1e993481defd6e7ec796031ec31279bf71
Bug 26274: Add cashups api routes

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>
17 files changed:
Koha/Cash/Register.pm
Koha/Cash/Register/Action.pm
Koha/Cash/Register/Cashup.pm [new file with mode: 0644]
Koha/Cash/Register/Cashups.pm [new file with mode: 0644]
Koha/REST/V1/CashRegisters/Cashups.pm [new file with mode: 0644]
api/v1/swagger/definitions.json
api/v1/swagger/definitions/cashup.json [new file with mode: 0644]
api/v1/swagger/parameters.json
api/v1/swagger/parameters/cash_register.json [new file with mode: 0644]
api/v1/swagger/parameters/cashup.json [new file with mode: 0644]
api/v1/swagger/paths.json
api/v1/swagger/paths/cash_registers.json [new file with mode: 0644]
t/db_dependent/Koha/Cash/Register.t
t/db_dependent/Koha/Cash/Register/Action.t
t/db_dependent/Koha/Cash/Register/Cashup.t [new file with mode: 0644]
t/db_dependent/Koha/Cash/Register/Cashups.t [new file with mode: 0644]
t/db_dependent/api/v1/cashups.t [new file with mode: 0644]