Bug 30979 - Add ability for OPAC users to checkout to themselves
Summary: Add ability for OPAC users to checkout to themselves
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low new feature
Assignee: Martin Renvoize (ashimema)
QA Contact: Kyle M Hall (khall)
URL:
Keywords:
: 30444 (view as bug list)
Depends on: 23336 31699 33146
Blocks: 23641 35481 35482 36415 36615 37291 32711 34287
  Show dependency treegraph
 
Reported: 2022-06-16 14:54 UTC by Martin Renvoize (ashimema)
Modified: 2024-07-09 16:15 UTC (History)
12 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact: Caroline Cyr La Rose
Documentation submission: https://gitlab.com/koha-community/koha-manual/-/merge_requests/867
Text to go in the release notes:
This new feature adds a new `OpacTrustedCheckout` system preference. When enabled, OPAC users will see a new checkout option in the header of the page when logged in. This option displays a modal where they can scan barcodes to perform a self checkout. **Sponsored by** *European Southern Observatory*
Version(s) released in:
23.11.00
Circulation function:


Attachments
Bug 30979: Add 'OpacTrustedCheckout' preference (3.29 KB, patch)
2022-08-15 14:04 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add public items lookup route (4.05 KB, patch)
2022-08-15 14:04 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Checkout API's (12.30 KB, patch)
2022-08-15 14:04 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add checkout modal to the OPAC (13.55 KB, patch)
2022-08-15 14:04 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add 'OpacTrustedCheckout' preference (3.45 KB, patch)
2022-10-03 16:24 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add public items lookup route (4.07 KB, patch)
2022-10-03 16:24 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Checkout API's (12.66 KB, patch)
2022-10-03 16:25 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add checkout modal to the OPAC (14.34 KB, patch)
2022-10-03 16:25 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Fix inconsistent return of AddIssue (933 bytes, patch)
2022-10-03 16:25 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Handle more failure cases (1.71 KB, patch)
2022-10-03 16:25 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Handle more failure cases (2.91 KB, patch)
2022-10-04 09:40 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add 'OpacTrustedCheckout' preference (3.45 KB, patch)
2023-01-13 11:51 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add public items lookup route (4.07 KB, patch)
2023-01-13 11:51 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Public checkout API's (12.60 KB, patch)
2023-01-13 11:51 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Fix inconsistent return of AddIssue (904 bytes, patch)
2023-01-13 11:51 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add checkout modal to the OPAC (16.19 KB, patch)
2023-01-13 11:51 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Remove data from publically facing API (1.57 KB, patch)
2023-01-13 14:59 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add 'OpacTrustedCheckout' preference (3.45 KB, patch)
2023-01-13 15:53 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add public items lookup route (4.07 KB, patch)
2023-01-13 15:53 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Public checkout API's (12.60 KB, patch)
2023-01-13 15:54 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Remove data from publically facing API (2.28 KB, patch)
2023-01-13 15:54 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Fix inconsistent return of AddIssue (904 bytes, patch)
2023-01-13 15:54 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add checkout modal to the OPAC (16.56 KB, patch)
2023-01-13 15:54 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 31699: Add 'return' option to opac modal login (2.01 KB, patch)
2023-01-24 15:30 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 31699: (follow-up) Protect against unauthorized redirects (1.56 KB, patch)
2023-01-24 15:30 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 31699: (follow-up) Protect more against open redirects (1.69 KB, patch)
2023-01-24 15:30 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add 'OpacTrustedCheckout' preference (3.45 KB, patch)
2023-01-24 15:30 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add public items lookup route (4.07 KB, patch)
2023-01-24 15:30 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Public checkout API's (12.60 KB, patch)
2023-01-24 15:30 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Remove data from publically facing API (2.28 KB, patch)
2023-01-24 15:31 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Fix inconsistent return of AddIssue (904 bytes, patch)
2023-01-24 15:31 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add checkout modal to the OPAC (16.72 KB, patch)
2023-01-24 15:31 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Always show self-checkout when preference enabled (3.12 KB, patch)
2023-01-24 15:31 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Redirect to checkout summary (1.02 KB, patch)
2023-01-24 15:31 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Unit tests - Availability endpoint (7.38 KB, patch)
2023-05-09 14:45 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add checkout API's (11.97 KB, patch)
2023-05-09 14:45 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Fix inconsistent return of AddIssue (958 bytes, patch)
2023-05-09 14:45 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add public endpoints (8.14 KB, patch)
2023-05-09 14:45 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add 'OpacTrustedCheckout' preference (3.50 KB, patch)
2023-05-09 14:46 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Limit public checkout endpoint using preference (1.20 KB, patch)
2023-05-09 14:46 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add checkout modal to the OPAC (16.49 KB, patch)
2023-05-09 14:46 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Always show self-checkout when preference enabled (4.21 KB, patch)
2023-05-09 14:46 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Redirect to checkout summary (1.07 KB, patch)
2023-05-09 14:46 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add modal trigger to shibboleth target url (2.07 KB, patch)
2023-05-09 14:46 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 32711: Add biblio details to modal (8.68 KB, patch)
2023-05-09 14:46 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 32711: Add 'public_read_list' appropriately (2.81 KB, patch)
2023-05-09 14:46 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 32711: Fix biblio embeds (847 bytes, patch)
2023-05-09 14:46 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Unit tests - Availability endpoint (7.43 KB, patch)
2023-05-09 14:52 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add checkout API's (12.03 KB, patch)
2023-05-09 14:52 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Fix inconsistent return of AddIssue (1012 bytes, patch)
2023-05-09 14:52 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add public endpoints (8.19 KB, patch)
2023-05-09 14:52 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add 'OpacTrustedCheckout' preference (3.55 KB, patch)
2023-05-09 14:52 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Limit public checkout endpoint using preference (1.25 KB, patch)
2023-05-09 14:52 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add checkout modal to the OPAC (16.54 KB, patch)
2023-05-09 14:52 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Always show self-checkout when preference enabled (4.26 KB, patch)
2023-05-09 14:52 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Redirect to checkout summary (1.12 KB, patch)
2023-05-09 14:52 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add modal trigger to shibboleth target url (2.12 KB, patch)
2023-05-09 14:52 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Unit tests (6.54 KB, patch)
2023-05-10 11:15 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add public endpoints (10.24 KB, patch)
2023-05-10 11:15 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add 'OpacTrustedCheckout' preference (3.55 KB, patch)
2023-05-10 11:15 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Limit public checkout endpoint using preference (1.87 KB, patch)
2023-05-10 11:15 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add checkout modal to the OPAC (16.54 KB, patch)
2023-05-10 11:15 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Always show self-checkout when preference enabled (4.25 KB, patch)
2023-05-10 11:15 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Redirect to checkout summary (1.12 KB, patch)
2023-05-10 11:15 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add modal trigger to shibboleth target url (2.11 KB, patch)
2023-05-10 11:15 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Unit tests (6.54 KB, patch)
2023-05-16 09:55 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add public endpoints (10.09 KB, patch)
2023-05-16 09:55 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add 'OpacTrustedCheckout' preference (3.55 KB, patch)
2023-05-16 09:55 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Limit public checkout endpoint using preference (1.87 KB, patch)
2023-05-16 09:55 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add checkout modal to the OPAC (16.54 KB, patch)
2023-05-16 09:55 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Always show self-checkout when preference enabled (4.25 KB, patch)
2023-05-16 09:55 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Redirect to checkout summary (1.12 KB, patch)
2023-05-16 09:55 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add modal trigger to shibboleth target url (2.11 KB, patch)
2023-05-16 09:55 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Unit tests (6.31 KB, patch)
2023-05-17 17:12 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add public endpoints (10.09 KB, patch)
2023-05-17 17:12 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add 'OpacTrustedCheckout' preference (3.55 KB, patch)
2023-05-17 17:12 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Limit public checkout endpoint using preference (1.87 KB, patch)
2023-05-17 17:12 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add checkout modal to the OPAC (16.54 KB, patch)
2023-05-17 17:12 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Always show self-checkout when preference enabled (4.25 KB, patch)
2023-05-17 17:12 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Redirect to checkout summary (1.12 KB, patch)
2023-05-17 17:12 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add modal trigger to shibboleth target url (2.11 KB, patch)
2023-05-17 17:12 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Unit tests (6.26 KB, patch)
2023-05-17 19:00 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add public endpoints (10.15 KB, patch)
2023-05-17 19:00 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add 'OpacTrustedCheckout' preference (3.55 KB, patch)
2023-05-17 19:01 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Limit public checkout endpoint using preference (1.87 KB, patch)
2023-05-17 19:01 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add checkout modal to the OPAC (16.54 KB, patch)
2023-05-17 19:02 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Always show self-checkout when preference enabled (4.25 KB, patch)
2023-05-17 19:03 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Redirect to checkout summary (1.12 KB, patch)
2023-05-17 19:03 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add modal trigger to shibboleth target url (2.11 KB, patch)
2023-05-17 19:03 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: (follow-up) Fix public availability 500 (1.26 KB, patch)
2023-05-17 19:04 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Unit tests (6.26 KB, patch)
2023-06-28 12:41 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add public endpoints (10.15 KB, patch)
2023-06-28 12:42 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add 'OpacTrustedCheckout' preference (3.55 KB, patch)
2023-06-28 12:42 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Limit public checkout endpoint using preference (1.87 KB, patch)
2023-06-28 12:42 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add checkout modal to the OPAC (16.54 KB, patch)
2023-06-28 12:42 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Always show self-checkout when preference enabled (4.25 KB, patch)
2023-06-28 12:42 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Redirect to checkout summary (1.12 KB, patch)
2023-06-28 12:42 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add modal trigger to shibboleth target url (2.11 KB, patch)
2023-06-28 12:42 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: (follow-up) Fix public availability 500 (1.26 KB, patch)
2023-06-28 12:42 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Unit tests (6.26 KB, patch)
2023-07-14 11:29 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add public endpoints (10.12 KB, patch)
2023-07-14 11:29 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add 'OpacTrustedCheckout' preference (3.55 KB, patch)
2023-07-14 11:29 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Limit public checkout endpoint using preference (1.87 KB, patch)
2023-07-14 11:29 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add checkout modal to the OPAC (16.54 KB, patch)
2023-07-14 11:29 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Always show self-checkout when preference enabled (4.25 KB, patch)
2023-07-14 11:29 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Redirect to checkout summary (1.12 KB, patch)
2023-07-14 11:29 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: Add modal trigger to shibboleth target url (2.11 KB, patch)
2023-07-14 11:29 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: (follow-up) Fix public availability 500 (1.26 KB, patch)
2023-07-14 11:29 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30979: (QA follow-up) Add missing docs on error codes (1.28 KB, patch)
2023-07-14 19:32 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 30979: (QA follow-up) Tidy things (14.71 KB, patch)
2023-07-14 19:33 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 30979: Fix regression (1.45 KB, patch)
2023-07-14 19:33 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 30979: Fix xt/api.t (1008 bytes, patch)
2023-07-14 19:36 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize (ashimema) 2022-06-16 14:54:39 UTC
In some trusted environments libraries would like their users to self-issue without having to use the SCO or SIP checkouts.  i.e. once logged in a user should have the ability to check out to themselves much like they already have the option to renew and place holds etc.
Comment 1 David Cook 2022-08-09 23:18:17 UTC
(In reply to Martin Renvoize from comment #0)
> In some trusted environments libraries would like their users to self-issue
> without having to use the SCO or SIP checkouts.  i.e. once logged in a user
> should have the ability to check out to themselves much like they already
> have the option to renew and place holds etc.

I've had a number of libraries over the years who would be keen to make use of this.
Comment 2 Martin Renvoize (ashimema) 2022-08-10 14:09:06 UTC
Work in progress over at https://gitlab.com/mrenvoize/Koha/-/tree/bug_30979.

It's all API driven with a Modal interface for interactions.

So far it will look up an item from it's barcode, check it's availability and give various feedback based on that availability and then attempt to checkout (or require confirm is availability suggests that's required).

The checkout endpoint is still a work in progress.
Comment 3 Martin Renvoize (ashimema) 2022-08-10 14:09:41 UTC
https://gitlab.com/mrenvoize/Koha/-/tree/bug_30979 even
Comment 4 Martin Renvoize (ashimema) 2022-08-15 14:04:36 UTC Comment hidden (obsolete)
Comment 5 Martin Renvoize (ashimema) 2022-08-15 14:04:40 UTC Comment hidden (obsolete)
Comment 6 Martin Renvoize (ashimema) 2022-08-15 14:04:44 UTC Comment hidden (obsolete)
Comment 7 Martin Renvoize (ashimema) 2022-08-15 14:04:49 UTC Comment hidden (obsolete)
Comment 8 Martin Renvoize (ashimema) 2022-08-15 14:06:01 UTC
So, this clearly needs a bit more polishing (and unit tests for the new api routes).. but I'd love to get some feedback.. all the basics are working including a confirmation flow checkouts that require it.
Comment 9 Hugo Agud 2022-08-31 11:18:54 UTC
I have installed the patch in a sandbox, I have enabled syspref  OpacTrustedCheckout I. have logged to the opac

I am not able to see at opac-detail, opac-results or in my account the way to seld check out

I have also checked that circ rules are configured
I have also checked that the homebranch of books and users are the same
Comment 10 David Nind 2022-09-19 23:02:21 UTC
I had a go at testing what has been done so are - the basic checkout seems to work well.

An example use case could be a small corporate/in house library for an organisation without dedicated/full time library staff that wants to let staff "self-service" so they can checkout and return items without having to use a manual process (such as recording items checked out or in on a register at the door).

Here are my testing notes (using KTD):

Setup
1. Apply patches, updatedatabase, flush_memcached, restart_all
2. Enable OpacTrustedCheckout system preference

Testing the API
1. Get details of items for a record:
   - Visit http://127.0.0.1:8080/api/v1/public/items?external_id=39999000005097
     ==> should return details for the item

Test the self-checkout feature:
1. Go to the OPAC home page
2. Login as a patron (in this case I used koha), and note that in the OPAC header there is now a Self checkout option after Cart and Lists
3. Click on Self checkout ==> window pops up asking you to enter a barcode
4. Enter a barcode for an item that is available, for example: 39999000006094
   ==> Message should say: "Item '39999000006094' was checked out", and an option to enter another barcode, as well as Submit and Close buttons
5. Click close and check your account > your summary: item checked out should be listed
6. Repeat step 4 with the same barcode, this time the result should be:
   ==> Message says: "Item '39999000006094' needs confirmation for the following: RENEW_ISSUE" 
   . Click Confirm (note: currently does nothing, if this is allowed as can renew already from the your summary page)
7. Checkout an item to another patron using the staff interface
   . Example: checked out 39999000011418 to Mary Burton
9. Use the self-checkout to try and checkout this item:
   ==> Message says: "Item '39999000011418' needs confirmation for the following: ISSUED_TO_ANOTHERissued_borrowernumberissued_cardnumberissued_firstnameissued_surname"
   . Click confirm (note: currently does nothing)
10. Use the self-checkout to try and checkout an item on hold:
   . Place a hold for an item using the staff interface. Example: Placed a record level hold for Programming the Perl DBI (biblionumber = 13)
   ==> Message says "Item '39999000000559' needs confirmation for the following: RESERVEDresborrowernumberresbranchcoderescardnumberreserve_idresfirstnameresreservedateressurname" with Confirm and Close buttons
   . Click confirm (note: currently does nothing)
11. Use the self checkout to try and checkout an item on hold for your OPAC patron:
   . Place a record-level hold for an item using the staff interface (used Perl Better Practices, biblionumber = 19)
   . Check in an item for the record and confirm the hold (used 39999000008036), should show status as awaiting pickup
   . Use the self checkout to try and checkout this item to the patron the hold was placed for (39999000008036 and patron koha in this instance)
   ==> Item should be successfully checked out with message "Item '39999000008036' was checked out", with options to enter another barcode, Submit and Close buttons
   ==> Click close and check your account > your summary: item checked out should be listed
12. Try and checkout and item not for loan:
   . Update an item for a record so that is not for loan
   . Try and checkout using the self-checkout
   ==> message says: "Item '39999000005158' cannot be checked out for the following reasons: NOT_FOR_LOANitem_notforloan"
13. Try and checkout an item recorded as Withdrawn:
    . Update an item for a record so that it is withdrawn
   . Try and checkout using the self-checkout
   ==> message says: "Item '39999000005097' cannot be checked out for the following reasons: WTHDRAWN"
Comment 11 Martin Renvoize (ashimema) 2022-10-03 16:13:23 UTC
Thanks for the comprehensive testing David.

It appears some of the confirmation code got lost during rebases.. I've fixed that now and will upload an updated patchset soon.

You've also highlighted lots of cases where I've not yet fully dealt with error conditions.. I'll work through those now too
Comment 12 Martin Renvoize (ashimema) 2022-10-03 16:24:54 UTC
Created attachment 141274 [details] [review]
Bug 30979: Add 'OpacTrustedCheckout' preference

This patch adds a new 'OpacTrustedCheckout' system preference to govern
whether the library allows opac users to check out items to themselves
from their OPAC login.
Comment 13 Martin Renvoize (ashimema) 2022-10-03 16:24:58 UTC
Created attachment 141275 [details] [review]
Bug 30979: Add public items lookup route

This patch adds a /public equivilent to the item listing endpoint.

This allows us to search for an item by it's external_id (barcode).

Test plan
1. Apply patch
2. Perform a GET on /api/v1/public/items?external_id=some_barcode
3. Confirm that the above enpoint correctly returns items that should
   be visible in the OPAC
Comment 14 Martin Renvoize (ashimema) 2022-10-03 16:25:03 UTC
Created attachment 141276 [details] [review]
Bug 30979: Checkout API's

This patch adds an initial framework for adding/migrating AddIssue from
C4::Circulation into Koha::Checkout... but that feels a bit over scope.

Also.. should we do all the checks and return failure in
Koha::REST::V1::Checkout->add such that we require a new special header
for the equivilent of 'confirm' in the controller script route..

Should we accept an external_id in the checkout add route.. or chain two
ajax requests such that the first looks up the item from it's
external_id and then the second calls checkout upon it?

Should we have a 'CanBookBeIssued' equivilent on the API?

Bug 30979: Add confirmation token to API

This patch adds the creation of a confirmation token to the
get_availability method and then adds a test for the presence of that
same token later in the checkout routine.
Comment 15 Martin Renvoize (ashimema) 2022-10-03 16:25:09 UTC
Created attachment 141277 [details] [review]
Bug 30979: Add checkout modal to the OPAC

This patch adds a new self checkout modal to the OPAC when
OpacTrustedCheckout is enabled and a user is logged in.

The new modal allows an end user to scan an item barcode, check for item
existance and availability and then check the item out after any
confirmations have been displayed.
Comment 16 Martin Renvoize (ashimema) 2022-10-03 16:25:14 UTC
Created attachment 141278 [details] [review]
Bug 30979: Fix inconsistent return of AddIssue

AddIssue can on occasion create a renewal instead of a fresh issue and
in such a case we currently return undefined. We should be consistent
and return the existing issue object for the renewal.
Comment 17 Martin Renvoize (ashimema) 2022-10-03 16:25:18 UTC Comment hidden (obsolete)
Comment 18 Martin Renvoize (ashimema) 2022-10-04 09:40:49 UTC
Created attachment 141300 [details] [review]
Bug 30979: Handle more failure cases
Comment 19 David Nind 2022-10-05 22:10:36 UTC
I tested again using KTD and updated message changes for the test plan. I also added a test for when the patron account has outstanding charges.

Setup
1. Apply patches, updatedatabase, flush_memcached, restart_all
2. Enable OpacTrustedCheckout system preference

Testing the API
1. Get details of items for a record:
   - Visit http://127.0.0.1:8080/api/v1/public/items?external_id=39999000005097
     ==> should return details for the item

Test the self-checkout feature:
1. Go to the OPAC home page
2. Login as a patron (in this case I used koha), and note that in the OPAC header there is now a Self checkout option after Cart and Lists
3. Click on Self checkout ==> window pops up asking you to enter a barcode
4. Enter a barcode for an item that is available, for example: 39999000006094
   ==> Message should say: "Item '39999000006094' was checked out", and an option to enter another barcode, as well as Submit and Close buttons
5. Click close and check your account > your summary: item checked out should be listed
6. Repeat step 4 with the same barcode, this time the result should be:
   ==> Message says: "Item will be renewed" 
   . Click Confirm (note: currently this appears to do nothing - stays on the same screen - it does renew the item though (see your summary))
7. Checkout an item to another patron using the staff interface
   . Example: checked out 39999000011418 to Mary Burton
9. Use the self-checkout to try and checkout this item:
   ==> Message says: 
   "This item appears to be checked out to another patron, please return it to the desk
   Message code 'issued_borrowernumber' with data '49'
   Message code 'issued_cardnumber' with data '23529000651225'
   Message code 'issued_firstname' with data 'Mary'
   Message code 'issued_surname' with data 'Burton'"
   . Click confirm (note that nothing appears to change, however: item is returned, then checked out - no longer checked out to Mary)
10. Use the self-checkout to try and checkout an item on hold:
   . Place a hold for an item for another patron using the staff interface. Example: Placed a record level hold for Programming the Perl DBI (biblionumber = 13)
   ==> Message says:
    "This item appears to be reserved for another patron, please return it to the desk
    Message code 'resborrowernumber' with data '49'
    Message code 'resbranchcode' with data 'MPL'
    Message code 'rescardnumber' with data '23529000651225'
    Message code 'reserve_id' with data '1'
    Message code 'resfirstname' with data 'Mary'
    Message code 'resreservedate' with data '2022-10-05'
    Message code 'ressurname' with data 'Burton'"
   Has Confirm and Close buttons
   . Click confirm (checks item out to you, hold is still in place for the other patron)
11. Use the self checkout to try and checkout an item on hold for your OPAC patron:
   . Place a record-level hold for an item using the staff interface (used Perl Better Practices, biblionumber = 19)
   . Check in an item for the record and confirm the hold (used 39999000008036), should show status as awaiting pickup
   . Use the self checkout to try and checkout this item to the patron the hold was placed for (39999000008036 and patron koha in this instance)
   ==> Item should be successfully checked out with message "Item '39999000008036' was checked out", with options to enter another barcode, Submit and Close buttons
   ==> Click close and check your account > your summary: item checked out should be listed
12. Try and checkout and item not for loan:
   . Update an item for a record so that is not for loan
   . Try and checkout using the self-checkout
   ==> message says: 
      "This item is not normally for loan, please select another or ask at the desk
      Message code 'item_notforloan' with data '1'"
    Has Submit and Close buttons
   ==> Item does not check out, as expected. 
13. Try and checkout an item recorded as Withdrawn:
    . Update an item for a record so that it is withdrawn
   . Try and checkout using the self-checkout
   ==> message says: "This item is marked withdrawn, please select another or ask at the desk"
14. Add a manual charge for the koha patron then try and check out an item.
    . Add a manual invoice for the koha patron of $20.
    ==> message says: "Message code 'DEBT' with data '20'"
    ==> Does not checkout item.
Comment 20 David Cook 2022-10-16 22:46:27 UTC
I haven't looked into the code yet but I was wondering how you work out the branch for the checkout.

For a multi-branch library, they might need to self-checkout from multiple different locations. Do we just use the holdingbranch of the item in that case?
Comment 21 Martin Renvoize (ashimema) 2023-01-13 11:51:00 UTC
Created attachment 145264 [details] [review]
Bug 30979: Add 'OpacTrustedCheckout' preference

This patch adds a new 'OpacTrustedCheckout' system preference to govern
whether the library allows opac users to check out items to themselves
from their OPAC login.
Comment 22 Martin Renvoize (ashimema) 2023-01-13 11:51:05 UTC
Created attachment 145265 [details] [review]
Bug 30979: Add public items lookup route

This patch adds a /public equivilent to the item listing endpoint.

This allows us to search for an item by it's external_id (barcode).

Test plan
1. Apply patch
2. Perform a GET on /api/v1/public/items?external_id=some_barcode
3. Confirm that the above enpoint correctly returns items that should
   be visible in the OPAC
Comment 23 Martin Renvoize (ashimema) 2023-01-13 11:51:10 UTC
Created attachment 145266 [details] [review]
Bug 30979: Public 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 `/public/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 endpoint at `/public/checkouts`
that accepts a POST request with checkout details including item_id and
a confirmation token in the body.

Future work: We should properly migrate CanBookBeIssued into Koha::* and
use that here instead of refering to C4::Circulation.
Comment 24 Martin Renvoize (ashimema) 2023-01-13 11:51:15 UTC
Created attachment 145267 [details] [review]
Bug 30979: Fix inconsistent return of AddIssue

AddIssue can on occasion create a renewal instead of a fresh issue and
in such a case we currently return undefined. We should be consistent
and return the existing issue object for the renewal.
Comment 25 Martin Renvoize (ashimema) 2023-01-13 11:51:20 UTC
Created attachment 145268 [details] [review]
Bug 30979: Add checkout modal to the OPAC

This patch adds a new self checkout modal to the OPAC when
OpacTrustedCheckout is enabled and a user is logged in.

The new modal allows an end user to scan an item barcode to checkout.
We check for item existance and availability and then check the item
out after any confirmations have been displayed.
Comment 26 Martin Renvoize (ashimema) 2023-01-13 11:57:57 UTC
(In reply to David Cook from comment #20)
> I haven't looked into the code yet but I was wondering how you work out the
> branch for the checkout.
> 
> For a multi-branch library, they might need to self-checkout from multiple
> different locations. Do we just use the holdingbranch of the item in that
> case?

I don't touch the existing code for that at all.. we're calling 'AddIssue' within the API here and that uses the logic in '_GetCircControlBranch'.. which I believe looks at environment.
Comment 27 Martin Renvoize (ashimema) 2023-01-13 12:17:52 UTC
Rebased and tidied up a bit.. but I still need to take care of some of the reserves and checked out to another user related issues.. I feel we're leaking some details we shouldn't be on the public API at the current state.
Comment 28 Martin Renvoize (ashimema) 2023-01-13 14:59:01 UTC
Created attachment 145277 [details] [review]
Bug 30979: Remove data from publically facing API

The availability API was leaking some patron information for certain
cases.

This bug adds a deny-list to remove the leaked fields.
Comment 29 Martin Renvoize (ashimema) 2023-01-13 15:53:54 UTC
Created attachment 145280 [details] [review]
Bug 30979: Add 'OpacTrustedCheckout' preference

This patch adds a new 'OpacTrustedCheckout' system preference to govern
whether the library allows opac users to check out items to themselves
from their OPAC login.
Comment 30 Martin Renvoize (ashimema) 2023-01-13 15:53:59 UTC
Created attachment 145281 [details] [review]
Bug 30979: Add public items lookup route

This patch adds a /public equivilent to the item listing endpoint.

This allows us to search for an item by it's external_id (barcode).

Test plan
1. Apply patch
2. Perform a GET on /api/v1/public/items?external_id=some_barcode
3. Confirm that the above enpoint correctly returns items that should
   be visible in the OPAC
Comment 31 Martin Renvoize (ashimema) 2023-01-13 15:54:05 UTC
Created attachment 145282 [details] [review]
Bug 30979: Public 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 `/public/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 endpoint at `/public/checkouts`
that accepts a POST request with checkout details including item_id and
a confirmation token in the body.

Future work: We should properly migrate CanBookBeIssued into Koha::* and
use that here instead of refering to C4::Circulation.
Comment 32 Martin Renvoize (ashimema) 2023-01-13 15:54:10 UTC
Created attachment 145283 [details] [review]
Bug 30979: Remove data from publically facing API

The availability API was leaking some patron information for certain
cases.

This bug adds a deny-list to remove the leaked fields.
Comment 33 Martin Renvoize (ashimema) 2023-01-13 15:54:15 UTC
Created attachment 145284 [details] [review]
Bug 30979: Fix inconsistent return of AddIssue

AddIssue can on occasion create a renewal instead of a fresh issue and
in such a case we currently return undefined. We should be consistent
and return the existing issue object for the renewal.
Comment 34 Martin Renvoize (ashimema) 2023-01-13 15:54:20 UTC
Created attachment 145285 [details] [review]
Bug 30979: Add checkout modal to the OPAC

This patch adds a new self checkout modal to the OPAC when
OpacTrustedCheckout is enabled and a user is logged in.

The new modal allows an end user to scan an item barcode to checkout.
We check for item existance and availability and then check the item
out after any confirmations have been displayed.
Comment 35 Martin Renvoize (ashimema) 2023-01-13 15:56:16 UTC
Lots of little refinements went in this time.. I reckon we're back to NSO. :)
Comment 36 David Nind 2023-01-13 22:58:40 UTC
Updated test plan I used (using KTD).

Setup
1. Apply patches, updatedatabase, flush_memcached, restart_all
2. Enable OpacTrustedCheckout system preference

Testing the API
1. Get details of items for a record:
   - Visit http://127.0.0.1:8080/api/v1/public/items?external_id=39999000005097
     ==> should return details for the item

Test the self-checkout feature:
1. Go to the OPAC home page.
2. Login as a patron (in this case I used koha), and note that in the OPAC header there is now a Self checkout option after Cart and Lists.
3. Click on Self checkout ==> window pops up asking you to enter a barcode.
4. Enter a barcode for an item that is available, for example: 39999000006094
   ==> Message should say: "Item '39999000006094' was checked out", and an option to enter another barcode, as well as Submit and Close buttons.
5. Click close and check your account > your summary: item checked out should be listed.
6. Repeat step 4 with the same barcode, this time the result should be:
   ==> Message says: "Item will be renewed" 
   . Click Confirm
   ==> Message says "Item '39999000006094' was checked out". There is also an input box to enter another item barcode, and there may also be a list of barcodes checked out and the due date.
7. Checkout an item to another patron using the staff interface.
   . Example: checked out 39999000011418 to Mary Burton
9. As the patron in step 2, use the self-checkout to try and checkout this item:
   ==> Message says: "This item appears to be checked out to another patron, please return it to the desk"
   . Has Submit and Close buttons
   . Click the Close button
10. Use the self-checkout to try and checkout an item on hold:
   . Place a hold for an item for another patron using the staff interface. Example: Placed a record level hold for Programming the Perl DBI (biblionumber = 13)
   ==> Message says: "This item appears to be reserved for another patron, please return it to the desk"
   . Has Submit and Close buttons
   . Click the Close button
11. Use the self checkout to try and checkout an item on hold that is waiting for pickup for a patron (I used koha):
   . Place a record-level hold for an item using the staff interface (used Perl Better Practices, biblionumber = 19)
   . Check in an item for the record and confirm the hold (used 39999000008036), should show status as awaiting pickup
   . Use the self checkout to try and checkout this item to the patron the hold was placed for (39999000008036 and patron koha in this instance)
   ==> Item should be successfully checked out with message "Item '39999000008036' was checked out", with options to enter another barcode, Submit and Close buttons
   ==> Click close and check your account > your summary: item checked out should be listed
12. Repeat step 11, but use the self checkout to try and checkout an item that is on hold and waiting for pickup by another patron (I used Mary Burton to place the hold, and koha to check it out):
    ==> Message says: "Message code 'RESERVE_WAITING' with data '1' Message code 'reswaitingdate' with data '2023-01-13'"
    . Has Confirm and Close buttons
    . Confirm button: 
      - checks out item to patron who didn't have the hold waiting (koha)
      - item shows (in the staff interface) as checked out to koha, and also waiting for pickup (for Mary)
13. Try and checkout and item not for loan:
    . Update an item for a record so that is not for loan
    . Try and checkout using the self-checkout
    ==> message says: "This item is not normally for loan, please select another or ask at the desk"
    . Has Submit and Close buttons
    ==> Item does not check out, as expected. 
14. Try and checkout an item recorded as Withdrawn:
    . Update an item for a record so that it is withdrawn
    . Try and checkout using the self-checkout
    ==> message says: "This item is marked withdrawn, please select another or ask at the desk"
15. Add a manual charge for the koha patron then try and check out an item.
    . Add a manual invoice for the koha patron of $20.
    ==> message says: "Your account is currently in debt by '20'"
    ==> Does not checkout item.
Comment 37 David Nind 2023-01-13 23:05:38 UTC
Hi Martin.

The only wrinkles I found this time were:

1. Step 12 - checkout an item that is waiting for pickup by another patron: was able to checkout the item waiting, even though it wasn't for me.

 ==> Message says: "Message code 'RESERVE_WAITING' with data '1' Message code 'reswaitingdate' with data '2023-01-13'"
    . Has Confirm and Close buttons
    . Confirm button: 
      - checks out item to patron who didn't have the hold waiting (koha)
      - item shows (in the staff interface) as checked out to koha, and also waiting for pickup (for Mary)

2. Barcodes with a space before it - items aren't found: I recall testing another bug for this, but can't find it. But anyway, this is not specifically related to this bug.

I didn't try and use the public API to query for items that are hidden/not visible in the OPAC (not entirely sure how to set this up properly).
Comment 38 Martin Renvoize (ashimema) 2023-01-24 15:30:15 UTC
Created attachment 145620 [details] [review]
Bug 31699: Add 'return' option to opac modal login

This patch adds the option to trigger a redirect back to the current
context after successful login using modal logins triggered from various
places in the OPAC.

To make use of this, simply add 'data-return="true"' to the modal trigger link.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 39 Martin Renvoize (ashimema) 2023-01-24 15:30:26 UTC
Created attachment 145621 [details] [review]
Bug 31699: (follow-up) Protect against unauthorized redirects
Comment 40 Martin Renvoize (ashimema) 2023-01-24 15:30:35 UTC
Created attachment 145622 [details] [review]
Bug 31699: (follow-up) Protect more against open redirects

This change checks that the OPACBaseURL exists, and uses its scheme
and authority to rewrite the URL passed through the "return"
param.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 41 Martin Renvoize (ashimema) 2023-01-24 15:30:43 UTC
Created attachment 145623 [details] [review]
Bug 30979: Add 'OpacTrustedCheckout' preference

This patch adds a new 'OpacTrustedCheckout' system preference to govern
whether the library allows opac users to check out items to themselves
from their OPAC login.
Comment 42 Martin Renvoize (ashimema) 2023-01-24 15:30:50 UTC
Created attachment 145624 [details] [review]
Bug 30979: Add public items lookup route

This patch adds a /public equivilent to the item listing endpoint.

This allows us to search for an item by it's external_id (barcode).

Test plan
1. Apply patch
2. Perform a GET on /api/v1/public/items?external_id=some_barcode
3. Confirm that the above enpoint correctly returns items that should
   be visible in the OPAC
Comment 43 Martin Renvoize (ashimema) 2023-01-24 15:30:57 UTC
Created attachment 145625 [details] [review]
Bug 30979: Public 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 `/public/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 endpoint at `/public/checkouts`
that accepts a POST request with checkout details including item_id and
a confirmation token in the body.

Future work: We should properly migrate CanBookBeIssued into Koha::* and
use that here instead of refering to C4::Circulation.
Comment 44 Martin Renvoize (ashimema) 2023-01-24 15:31:04 UTC
Created attachment 145626 [details] [review]
Bug 30979: Remove data from publically facing API

The availability API was leaking some patron information for certain
cases.

This bug adds a deny-list to remove the leaked fields.
Comment 45 Martin Renvoize (ashimema) 2023-01-24 15:31:11 UTC
Created attachment 145627 [details] [review]
Bug 30979: Fix inconsistent return of AddIssue

AddIssue can on occasion create a renewal instead of a fresh issue and
in such a case we currently return undefined. We should be consistent
and return the existing issue object for the renewal.
Comment 46 Martin Renvoize (ashimema) 2023-01-24 15:31:19 UTC
Created attachment 145628 [details] [review]
Bug 30979: Add checkout modal to the OPAC

This patch adds a new self checkout modal to the OPAC when
OpacTrustedCheckout is enabled and a user is logged in.

The new modal allows an end user to scan an item barcode to checkout.
We check for item existance and availability and then check the item
out after any confirmations have been displayed.
Comment 47 Martin Renvoize (ashimema) 2023-01-24 15:31:26 UTC
Created attachment 145629 [details] [review]
Bug 30979: Always show self-checkout when preference enabled

This patch updates the display logic such that if the truested
self-checkout option is enabled we always show the checkout button and
prompt a login when no user is found.
Comment 48 Martin Renvoize (ashimema) 2023-01-24 15:31:32 UTC
Created attachment 145630 [details] [review]
Bug 30979: Redirect to checkout summary

This is a temporary solution whilst we wait for the biblio api endpoints
so we may include more biblio details in the checkout modal itself.
Comment 49 David Nind 2023-01-24 19:47:25 UTC
I've run the test plan in comment #36 again.

The issue for step 12 mention in comment #37 still applied. Would be happy for this to be treated as a separate bug if required, as it is possibly an edge case.

Also, if no user is logged in, I don't get a login prompt when I click on 'Self checkout'.
Comment 50 Katrin Fischer 2023-01-26 09:51:16 UTC
We had a discussion about a trusted self checkout feature this week and the question about checking out items already checked out to another came up. The request was, that it should be possible to do this in a trusted environment. I can imagine it makes sense and it avoids people taking the item anyway, writing a note etc. Maybe it could be handled differently here than in the normal SCO as we assume a higher level of trust or could be made configurable.
Comment 51 Magnus Enger 2023-01-26 11:14:08 UTC
Katrin, could you explain a bit more about what you mean by "trusted environment", please?
Comment 52 Katrin Fischer 2023-01-26 13:17:32 UTC
(In reply to Martin Renvoize from comment #0)
> In some trusted environments libraries would like their users to self-issue
> without having to use the SCO or SIP checkouts.  i.e. once logged in a user
> should have the ability to check out to themselves much like they already
> have the option to renew and place holds etc.

Mostly citing Martin :)

With this feature you do have to trust the people checking out and checking in, because they could practically do anything, they are probably alone in the rooms of the library. It will work from every computer, from a mobile phone etc. you won't be able to watch them. It will also work from their home computers, they could just check in whatever they had checked out before.

--> So if they can access an item that is checked out to someone else, we should maybe only warn, but assume that it's better to track than to forbid.
Comment 53 Christopher Brannon 2023-02-14 17:22:24 UTC
Perhaps we should have options to handle different cases.  For each case we have an option to check out or ask that the item be brought to a staff member for further action.  Maybe also an option to run this feature from a specific IP.  I could see this getting abused if a patron runs out of renewals, and (Is self check in a feature?  Not sure that it needs to be, but should be able to independently turn that off.) if they can check it in, the check it in and then check it out.  If the library gives rights to check out if it is in hand (like sco and staff might allow) then they could have something indefinitely.  There definitely needs to be some safeguards if self check in is a thing.
Comment 54 Martin Renvoize (ashimema) 2023-02-14 19:26:10 UTC
So, we now have a backported version of this (at 21.11) at one site and it's likely to hit landfall at a few more imminently.

I need to write unit tests and get community folks opinions on the API design.

Right now it's designed to mimick the behaviour of the normal SCO in terms of blocks and checks and. I think opening it up further should be proposed in their own follow-up bugs so we can get the core feature in sooner.

Really great to see people interested in this.
Comment 55 Alex Buckley 2023-02-21 01:05:49 UTC
*** Bug 30444 has been marked as a duplicate of this bug. ***
Comment 56 Kyle M Hall (khall) 2023-05-04 12:17:10 UTC
I've reviewed Martin's rebase and it's looking good! I've reset the status to assigned so Martin can change it back to NSO when the patch set is ready!
Comment 57 Martin Renvoize (ashimema) 2023-05-09 14:45:48 UTC Comment hidden (obsolete)
Comment 58 Martin Renvoize (ashimema) 2023-05-09 14:45:52 UTC Comment hidden (obsolete)
Comment 59 Martin Renvoize (ashimema) 2023-05-09 14:45:55 UTC Comment hidden (obsolete)
Comment 60 Martin Renvoize (ashimema) 2023-05-09 14:45:58 UTC Comment hidden (obsolete)
Comment 61 Martin Renvoize (ashimema) 2023-05-09 14:46:01 UTC Comment hidden (obsolete)
Comment 62 Martin Renvoize (ashimema) 2023-05-09 14:46:05 UTC Comment hidden (obsolete)
Comment 63 Martin Renvoize (ashimema) 2023-05-09 14:46:08 UTC Comment hidden (obsolete)
Comment 64 Martin Renvoize (ashimema) 2023-05-09 14:46:12 UTC Comment hidden (obsolete)
Comment 65 Martin Renvoize (ashimema) 2023-05-09 14:46:15 UTC Comment hidden (obsolete)
Comment 66 Martin Renvoize (ashimema) 2023-05-09 14:46:18 UTC Comment hidden (obsolete)
Comment 67 Martin Renvoize (ashimema) 2023-05-09 14:46:21 UTC Comment hidden (obsolete)
Comment 68 Martin Renvoize (ashimema) 2023-05-09 14:46:26 UTC Comment hidden (obsolete)
Comment 69 Martin Renvoize (ashimema) 2023-05-09 14:46:29 UTC Comment hidden (obsolete)
Comment 70 Martin Renvoize (ashimema) 2023-05-09 14:52:06 UTC Comment hidden (obsolete)
Comment 71 Martin Renvoize (ashimema) 2023-05-09 14:52:09 UTC Comment hidden (obsolete)
Comment 72 Martin Renvoize (ashimema) 2023-05-09 14:52:13 UTC Comment hidden (obsolete)
Comment 73 Martin Renvoize (ashimema) 2023-05-09 14:52:16 UTC Comment hidden (obsolete)
Comment 74 Martin Renvoize (ashimema) 2023-05-09 14:52:19 UTC Comment hidden (obsolete)
Comment 75 Martin Renvoize (ashimema) 2023-05-09 14:52:23 UTC Comment hidden (obsolete)
Comment 76 Martin Renvoize (ashimema) 2023-05-09 14:52:27 UTC Comment hidden (obsolete)
Comment 77 Martin Renvoize (ashimema) 2023-05-09 14:52:30 UTC Comment hidden (obsolete)
Comment 78 Martin Renvoize (ashimema) 2023-05-09 14:52:34 UTC Comment hidden (obsolete)
Comment 79 Martin Renvoize (ashimema) 2023-05-09 14:52:37 UTC Comment hidden (obsolete)
Comment 80 Martin Renvoize (ashimema) 2023-05-10 11:15:05 UTC Comment hidden (obsolete)
Comment 81 Martin Renvoize (ashimema) 2023-05-10 11:15:08 UTC Comment hidden (obsolete)
Comment 82 Martin Renvoize (ashimema) 2023-05-10 11:15:11 UTC Comment hidden (obsolete)
Comment 83 Martin Renvoize (ashimema) 2023-05-10 11:15:15 UTC Comment hidden (obsolete)
Comment 84 Martin Renvoize (ashimema) 2023-05-10 11:15:18 UTC Comment hidden (obsolete)
Comment 85 Martin Renvoize (ashimema) 2023-05-10 11:15:22 UTC Comment hidden (obsolete)
Comment 86 Martin Renvoize (ashimema) 2023-05-10 11:15:26 UTC Comment hidden (obsolete)
Comment 87 Martin Renvoize (ashimema) 2023-05-10 11:15:29 UTC Comment hidden (obsolete)
Comment 88 Martin Renvoize (ashimema) 2023-05-16 09:55:23 UTC Comment hidden (obsolete)
Comment 89 Martin Renvoize (ashimema) 2023-05-16 09:55:26 UTC Comment hidden (obsolete)
Comment 90 Martin Renvoize (ashimema) 2023-05-16 09:55:30 UTC Comment hidden (obsolete)
Comment 91 Martin Renvoize (ashimema) 2023-05-16 09:55:33 UTC Comment hidden (obsolete)
Comment 92 Martin Renvoize (ashimema) 2023-05-16 09:55:37 UTC Comment hidden (obsolete)
Comment 93 Martin Renvoize (ashimema) 2023-05-16 09:55:41 UTC Comment hidden (obsolete)
Comment 94 Martin Renvoize (ashimema) 2023-05-16 09:55:44 UTC Comment hidden (obsolete)
Comment 95 Martin Renvoize (ashimema) 2023-05-16 09:55:48 UTC Comment hidden (obsolete)
Comment 96 Martin Renvoize (ashimema) 2023-05-17 17:12:07 UTC Comment hidden (obsolete)
Comment 97 Martin Renvoize (ashimema) 2023-05-17 17:12:11 UTC Comment hidden (obsolete)
Comment 98 Martin Renvoize (ashimema) 2023-05-17 17:12:14 UTC Comment hidden (obsolete)
Comment 99 Martin Renvoize (ashimema) 2023-05-17 17:12:18 UTC Comment hidden (obsolete)
Comment 100 Martin Renvoize (ashimema) 2023-05-17 17:12:22 UTC Comment hidden (obsolete)
Comment 101 Martin Renvoize (ashimema) 2023-05-17 17:12:26 UTC Comment hidden (obsolete)
Comment 102 Martin Renvoize (ashimema) 2023-05-17 17:12:30 UTC Comment hidden (obsolete)
Comment 103 Martin Renvoize (ashimema) 2023-05-17 17:12:33 UTC Comment hidden (obsolete)
Comment 104 Martin Renvoize (ashimema) 2023-05-17 17:20:23 UTC
Hmm.. the rebase on 23336 broke something here.. working on a fresh rebase
Comment 105 Martin Renvoize (ashimema) 2023-05-17 19:00:00 UTC Comment hidden (obsolete)
Comment 106 Martin Renvoize (ashimema) 2023-05-17 19:00:46 UTC Comment hidden (obsolete)
Comment 107 Martin Renvoize (ashimema) 2023-05-17 19:01:26 UTC Comment hidden (obsolete)
Comment 108 Martin Renvoize (ashimema) 2023-05-17 19:01:58 UTC Comment hidden (obsolete)
Comment 109 Martin Renvoize (ashimema) 2023-05-17 19:02:36 UTC Comment hidden (obsolete)
Comment 110 Martin Renvoize (ashimema) 2023-05-17 19:03:05 UTC Comment hidden (obsolete)
Comment 111 Martin Renvoize (ashimema) 2023-05-17 19:03:28 UTC Comment hidden (obsolete)
Comment 112 Martin Renvoize (ashimema) 2023-05-17 19:03:49 UTC Comment hidden (obsolete)
Comment 113 Martin Renvoize (ashimema) 2023-05-17 19:04:11 UTC Comment hidden (obsolete)
Comment 114 Martin Renvoize (ashimema) 2023-06-28 12:41:57 UTC Comment hidden (obsolete)
Comment 115 Martin Renvoize (ashimema) 2023-06-28 12:42:01 UTC Comment hidden (obsolete)
Comment 116 Martin Renvoize (ashimema) 2023-06-28 12:42:05 UTC Comment hidden (obsolete)
Comment 117 Martin Renvoize (ashimema) 2023-06-28 12:42:09 UTC Comment hidden (obsolete)
Comment 118 Martin Renvoize (ashimema) 2023-06-28 12:42:13 UTC Comment hidden (obsolete)
Comment 119 Martin Renvoize (ashimema) 2023-06-28 12:42:17 UTC Comment hidden (obsolete)
Comment 120 Martin Renvoize (ashimema) 2023-06-28 12:42:21 UTC Comment hidden (obsolete)
Comment 121 Martin Renvoize (ashimema) 2023-06-28 12:42:25 UTC Comment hidden (obsolete)
Comment 122 Martin Renvoize (ashimema) 2023-06-28 12:42:29 UTC Comment hidden (obsolete)
Comment 123 Martin Renvoize (ashimema) 2023-07-14 11:29:04 UTC Comment hidden (obsolete)
Comment 124 Martin Renvoize (ashimema) 2023-07-14 11:29:08 UTC Comment hidden (obsolete)
Comment 125 Martin Renvoize (ashimema) 2023-07-14 11:29:12 UTC Comment hidden (obsolete)
Comment 126 Martin Renvoize (ashimema) 2023-07-14 11:29:15 UTC Comment hidden (obsolete)
Comment 127 Martin Renvoize (ashimema) 2023-07-14 11:29:19 UTC Comment hidden (obsolete)
Comment 128 Martin Renvoize (ashimema) 2023-07-14 11:29:22 UTC Comment hidden (obsolete)
Comment 129 Martin Renvoize (ashimema) 2023-07-14 11:29:26 UTC Comment hidden (obsolete)
Comment 130 Martin Renvoize (ashimema) 2023-07-14 11:29:29 UTC Comment hidden (obsolete)
Comment 131 Martin Renvoize (ashimema) 2023-07-14 11:29:33 UTC Comment hidden (obsolete)
Comment 132 Martin Renvoize (ashimema) 2023-07-14 11:30:33 UTC
Just another rebase to make sure it still applies clean.
Comment 133 Tomás Cohen Arazi (tcohen) 2023-07-14 15:13:46 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 134 Tomás Cohen Arazi (tcohen) 2023-07-14 19:32:54 UTC
Created attachment 153500 [details] [review]
Bug 30979: (QA follow-up) Add missing docs on error codes

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 135 Tomás Cohen Arazi (tcohen) 2023-07-14 19:33:14 UTC
Created attachment 153501 [details] [review]
Bug 30979: (QA follow-up) Tidy things

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 136 Tomás Cohen Arazi (tcohen) 2023-07-14 19:33:40 UTC
Created attachment 153502 [details] [review]
Bug 30979: Fix regression

This patch fixes a regression introduced by the 'Fix public availability
500' follow-up.

To test:
1. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/checkouts.t
=> FAIL: Tests fail!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass! Tests are useful!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 137 Tomás Cohen Arazi (tcohen) 2023-07-14 19:36:35 UTC
Created attachment 153503 [details] [review]
Bug 30979: Fix xt/api.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 138 Martin Renvoize (ashimema) 2023-07-18 11:41:13 UTC
New feature, no backport for 23.05.x series.