Koha-clms/Koha/REST
Tomás Cohen Arazi f7caec076f
Bug 42679: Add GET /patrons/{patron_id}/overdues_count endpoint
Returns the count of overdue checkouts for a patron as a plain integer.
Computed live from the database (date_due < NOW()) to ensure accuracy,
as overdue status is time-based with no discrete event to trigger updates.

This endpoint is intended for async loading in the patron search table,
allowing the main search results to render immediately while overdues
are fetched separately per visible page.

Test plan:
1. Apply patch
2. Run:
   $ ktd --shell
   k$ prove t/db_dependent/api/v1/patrons_overdues_count.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-11 16:05:56 +00:00
..
Plugin Bug 43241: Fix datetime/boolean conversion in q= queries with DBIC operators 2026-08-28 16:36:36 +00:00
V1 Bug 42679: Add GET /patrons/{patron_id}/overdues_count endpoint 2026-09-11 16:05:56 +00:00
V1.pm Revert "Bug 34451: Add CSRF protection for REST API (cookie-auth only)" 2026-07-27 16:06:36 +00:00