[Koha-bugs] [Bug 15165] REST API routes to list, edit and pay borrower's accountlines

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Apr 27 13:54:20 CEST 2017


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

--- Comment #54 from Josef Moravec <josef.moravec at gmail.com> ---
Created attachment 62774
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62774&action=edit
[SIGNED-OFF] Bug 15165: Set amount parameter required, define its data type and
confirm amount > 0

This patch enforces "amount" to be required when paying towards accountline(s).
It also specifies the data type of amount, so that nonsense amounts like
"strings"
cannot go through. Also, defines minimum amount as 0 and exclusiveMinimum true
so
that the amount must be greater than 0 (and not equal).

This patch also wraps the operations in try/catch as now recommended. Possible
enhancements to Koha::Account->pay could also be done so that we would catch
Koha::Exceptions in the case of invalid input. However, this is probably
outside
the scope of this bug and would require more testing on other components as
well.
After all, we can handle the input nicely with Swagger alone.

To test:
1. prove t/db_dependent/api/v1/accountlines.t
2. prove t/db_dependent/api/v1/patrons.t

Signed-off-by: Josef Moravec <josef.moravec at gmail.com>

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


More information about the Koha-bugs mailing list