[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
Mon Feb 6 15:42:41 CET 2017


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

Lari Taskula <lari.taskula at jns.fi> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #59933|0                           |1
        is obsolete|                            |

--- Comment #46 from Lari Taskula <lari.taskula at jns.fi> ---
Created attachment 59934
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59934&action=edit
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

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


More information about the Koha-bugs mailing list