Koha/api/v1/swagger
Martin Renvoize a702f57adf
Bug 21043: Handle exceptions and switch to debit response
We were cheating a bit here and expecting a 'debit' to be sent in but a
'line' to be returned.

We should really be sending a debit and returning a debit.. so I've
update the paths schema as such and we're now coercing the
Koha::Account::Line object that's returned by Koha::Account->add_debit
into a Koha::Account::Debit object. Longer term it would be nice to
convert returns from the various Koha::Account methods to their correct
Koha::Account:: objects as apposed to them all being the base ::Line

I've also added some code to catch exceptions that can be thrown by
Koha::Account->add_debit and added the appropriate 400 errors into the
path specs again.

Finally.. I added more unit tests to prove the above

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-05 12:13:52 -03:00
..
definitions Bug 21043: Add debit REST endpoint 2023-05-05 12:13:51 -03:00
paths Bug 21043: Handle exceptions and switch to debit response 2023-05-05 12:13:52 -03:00
swagger.yaml Bug 29453: Add endpoints for fetching patron credits & debits 2023-05-05 12:13:50 -03:00