Bug 24609 - Add routes for getting and setting checkout due date
Summary: Add routes for getting and setting checkout due date
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: REST API (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Andrew Isherwood
QA Contact:
URL:
Keywords:
Depends on:
Blocks: 24608
  Show dependency treegraph
 
Reported: 2020-02-07 10:50 UTC by Andrew Isherwood
Modified: 2020-02-14 19:34 UTC (History)
0 users

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 24609: Create PUT /checkouts/{checkout_id} (5.53 KB, patch)
2020-02-14 10:51 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 24609: Add API unit tests (1.45 KB, patch)
2020-02-14 10:51 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 24609: Create PUT /checkouts/{checkout_id} (5.58 KB, patch)
2020-02-14 19:33 UTC, Lisette Scheer
Details | Diff | Splinter Review
Bug 24609: Add API unit tests (1.50 KB, patch)
2020-02-14 19:34 UTC, Lisette Scheer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Isherwood 2020-02-07 10:50:00 UTC
To allow the work in bug 24608 to proceed, we need an API route to allow the setting of a checkout's due date. I will add a GET route also.

The proposed endpoints are:

Return a checkout's due date:
Method: GET
URL: /checkouts/{checkout_id}/date_due

Set a checkout's due date:
Method: POST
URL: /checkouts/{checkout_id}/date_due
Body: { date_due: '2020-02-07 10:49:08' }
Comment 1 Andrew Isherwood 2020-02-07 13:46:45 UTC
Change of plan on this one. It's unnecessary to create a new endpoint for this. Following a discussion with Martin, I've realised we can just add a PUT endpoint for the /checkouts/{checkout_id} route, with whole checkout objects passed as the body.
Comment 2 Andrew Isherwood 2020-02-14 10:51:35 UTC
Created attachment 98924 [details] [review]
Bug 24609: Create PUT /checkouts/{checkout_id}

This patch creates a PUT /checkouts/{checkout_id} API route enabling
checkouts to be updated
Comment 3 Andrew Isherwood 2020-02-14 10:51:38 UTC
Created attachment 98925 [details] [review]
Bug 24609: Add API unit tests
Comment 4 Andrew Isherwood 2020-02-14 10:53:06 UTC
Test plan:

- Apply patch
- prove t/db_dependent/api/v1/checkouts.t
Comment 5 Lisette Scheer 2020-02-14 19:33:58 UTC
Created attachment 99021 [details] [review]
Bug 24609: Create PUT /checkouts/{checkout_id}

This patch creates a PUT /checkouts/{checkout_id} API route enabling
checkouts to be updated

Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org>
Comment 6 Lisette Scheer 2020-02-14 19:34:12 UTC
Created attachment 99022 [details] [review]
Bug 24609: Add API unit tests

Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org>