Bug 20944 - Add routes to add credits to a patron's account
Summary: Add routes to add credits to a patron's account
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: REST API (show other bugs)
Version: master
Hardware: All All
: P5 - low new feature (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Josef Moravec
URL: https://wiki.koha-community.org/wiki/...
Keywords:
Depends on: 20942 20978 20997
Blocks: 15165 21786
  Show dependency treegraph
 
Reported: 2018-06-14 14:14 UTC by Tomás Cohen Arazi
Modified: 2022-01-07 13:36 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Introduces the API endpoint for dealing with patron account credits, a highly requested feature for third-party integrations.
Version(s) released in:


Attachments
Bug 20944: OpenAPI spec for /patrons/{patron_id}/account/credits (4.79 KB, patch)
2018-07-10 17:58 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 20944: Add route to add credits to a patron's account (9.60 KB, patch)
2018-07-10 17:58 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 20944: OpenAPI spec for /patrons/{patron_id}/account/credits (4.85 KB, patch)
2018-08-10 10:13 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 20944: Add route to add credits to a patron's account (9.67 KB, patch)
2018-08-10 10:14 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 20944: OpenAPI spec for /patrons/{patron_id}/account/credits (4.90 KB, patch)
2018-08-16 13:59 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 20944: Add route to add credits to a patron's account (9.72 KB, patch)
2018-08-16 13:59 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 20944: Fix perlcritic issues (979 bytes, patch)
2018-08-31 14:27 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi 2018-06-14 14:14:19 UTC

    
Comment 1 Tomás Cohen Arazi 2018-07-10 17:58:44 UTC
Created attachment 76815 [details] [review]
Bug 20944: OpenAPI spec for /patrons/{patron_id}/account/credits
Comment 2 Tomás Cohen Arazi 2018-07-10 17:58:49 UTC
Created attachment 76816 [details] [review]
Bug 20944: Add route to add credits to a patron's account

This patch adds the /patrons/{patron_id}/account/credits endpoint, that
can be used to add credits to a patron's account. It is implemented so
the new credits are used to pay existing debts.

To test:
- 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:
  POST /api/v1/patrons/{patron_id}/account/credits
{
  "amount": 100
}
- Play with other possible attributes on the credit object.
- Sign off :-D
Comment 3 Martin Renvoize 2018-08-10 10:13:59 UTC
Created attachment 77645 [details] [review]
Bug 20944: OpenAPI spec for /patrons/{patron_id}/account/credits

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize 2018-08-10 10:14:02 UTC
Created attachment 77646 [details] [review]
Bug 20944: Add route to add credits to a patron's account

This patch adds the /patrons/{patron_id}/account/credits endpoint, that
can be used to add credits to a patron's account. It is implemented so
the new credits are used to pay existing debts.

To test:
- 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:
  POST /api/v1/patrons/{patron_id}/account/credits
{
  "amount": 100
}
- Play with other possible attributes on the credit object.
- Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Martin Renvoize 2018-08-10 10:14:58 UTC
Ooops, I thought I'd already signed this one off..

Looks good, works well.. no breakages and completes the functionality off nicely for working with patron accounts.

Signing Off.
Comment 6 Josef Moravec 2018-08-16 13:59:23 UTC
Created attachment 77928 [details] [review]
Bug 20944: OpenAPI spec for /patrons/{patron_id}/account/credits

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 7 Josef Moravec 2018-08-16 13:59:28 UTC
Created attachment 77929 [details] [review]
Bug 20944: Add route to add credits to a patron's account

This patch adds the /patrons/{patron_id}/account/credits endpoint, that
can be used to add credits to a patron's account. It is implemented so
the new credits are used to pay existing debts.

To test:
- 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:
  POST /api/v1/patrons/{patron_id}/account/credits
{
  "amount": 100
}
- Play with other possible attributes on the credit object.
- Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 8 Nick Clemens 2018-08-31 12:57:27 UTC
Awesome work all!

Pushed to master for 18.11
Comment 9 Tomás Cohen Arazi 2018-08-31 14:27:23 UTC
Created attachment 78329 [details] [review]
Bug 20944: Fix perlcritic issues

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 10 Nick Clemens 2018-08-31 15:30:53 UTC
(In reply to Tomás Cohen Arazi from comment #9)
> Created attachment 78329 [details] [review] [review]
> Bug 20944: Fix perlcritic issues
> 
> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Followup pushed to master