Bug 38931 - Add endpoints for individual credits and debits
Summary: Add endpoints for individual credits and debits
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: REST API (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Tomás Cohen Arazi (tcohen)
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 38932
  Show dependency treegraph
 
Reported: 2025-01-20 19:45 UTC by Tomás Cohen Arazi (tcohen)
Modified: 2025-01-22 10:24 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 38931: Unit tests (4.25 KB, patch)
2025-01-20 19:59 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 38931: Add endpoints for individual credits and debits (6.58 KB, patch)
2025-01-20 19:59 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 38931: Unit tests (4.30 KB, patch)
2025-01-22 10:24 UTC, David Nind
Details | Diff | Splinter Review
Bug 38931: Add endpoints for individual credits and debits (6.62 KB, patch)
2025-01-22 10:24 UTC, David Nind
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 (tcohen) 2025-01-20 19:45:24 UTC
We have a way to retrieve the account lines using

* `GET /api/v1/patrons/:patron_id/account/debits`
* `GET /api/v1/patrons/:patron_id/account/credits`

but we are missing the individual ones.
Comment 1 Tomás Cohen Arazi (tcohen) 2025-01-20 19:59:36 UTC
Created attachment 176840 [details] [review]
Bug 38931: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 2 Tomás Cohen Arazi (tcohen) 2025-01-20 19:59:38 UTC
Created attachment 176841 [details] [review]
Bug 38931: Add endpoints for individual credits and debits

As the title says, we are missing such endpoints and this patch adds
them.

To test:
1. Apply this patches
2. Run:
   $ ktd --shell
  k$ yarn api:bundle
  k$ prove t/db_dependent/api/v1/patrons_accounts.t
=> SUCCESS: The spec builds!
=> SUCCESS: The tests pass!
3. Verify all the codepaths are covered by tests
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 3 David Nind 2025-01-22 10:24:00 UTC
Created attachment 176892 [details] [review]
Bug 38931: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Comment 4 David Nind 2025-01-22 10:24:03 UTC
Created attachment 176893 [details] [review]
Bug 38931: Add endpoints for individual credits and debits

As the title says, we are missing such endpoints and this patch adds
them.

To test:
1. Apply this patches
2. Run:
   $ ktd --shell
  k$ yarn api:bundle
  k$ prove t/db_dependent/api/v1/patrons_accounts.t
=> SUCCESS: The spec builds!
=> SUCCESS: The tests pass!
3. Verify all the codepaths are covered by tests
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>