[Koha-bugs] [Bug 21043] Add routes to add debits to a patron's account

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri May 5 16:52:52 CEST 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21043

--- Comment #23 from Kyle M Hall <kyle at bywatersolutions.com> ---
Created attachment 150766
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=150766&action=edit
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 at ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list