Bug 23336: Add checkout API's
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 5 May 2023 14:53:50 +0000 (15:53 +0100)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 3 Jul 2023 13:34:59 +0000 (10:34 -0300)
commit6db025bd9dfeecb1f59490578befafbe57a1548e
treec442e7697e2322347b1a95303535ac8079ac5fe0
parentdfc6da2df495a74b697ab450d38ae6b6e17a0a61
Bug 23336: Add checkout API's

This patch adds API's to allow for a checkout flow using the RESTful
API.

We add an availability endpoint to check an items current availability
status. The endpoint can be found at `/checkouts/availability` and is
a GET request that requires item_id and patron_id passed as parameters.

We return an availability object that includes blockers, confirms,
warnings and a confirmation token to be used for checkout.

We also add a corresponding checkout method to the `/checkouts` endpoint.
The method accepts a POST request with checkout details including item_id
, patron_id and the confirmation token in the body.

Future work: We should properly migrate CanBookBeIssued into Koha::* and
use that here instead of refering to C4::Circulation.

Signed-off-by: Silvia Meakins <smeakins@eso.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
C4/Circulation.pm
Koha/Item.pm
Koha/REST/V1/Checkouts.pm
api/v1/swagger/paths/checkouts.yaml
api/v1/swagger/swagger.yaml