]> git.koha-community.org Git - koha.git/commit
Bug 20942: Add route to get patron's account balance
authorTomas Cohen Arazi <tomascohen@theke.io>
Wed, 13 Jun 2018 17:02:44 +0000 (14:02 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 2 Aug 2018 17:03:36 +0000 (18:03 +0100)
commit477cee1ae93307a0257001514d8f2d693fe2dcdd
treee63d33f3e9bfca529d22295f07a3fd39c137dda9
parent2dd7b408b3844d4b6a3d808c69f0a5d520132e29
Bug 20942: Add route to get patron's account balance

This patch implements the /patrons/{patron_id}/account endpoint. It can
be used to get the patron's balance information, including outstanding
lines.

To test:
- Apply this patchset
- Run:
  $ kshell
 k$ prove t/db_dependent/api/v1/patrons_accounts.t
=> SUCCESS: tests pass!
- Make your favourite REST testing tool (RESTer on Firefox?) do:
  GET /api/v1/patrons/{patron_id}/account
to a valid patron_id. Play with Koha's UI to add credits/payments and
notice the endpoint returns the right info following the voted RFC. [1]
- Sign off :-D

[1] https://wiki.koha-community.org/wiki/Patrons_account_lines_endpoint_RFC

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit d079c80b05b36a177c80d8f585ae1515092e6ddb)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Koha/REST/V1/Patrons/Account.pm [new file with mode: 0644]