[Koha-bugs] [Bug 17314] REST API: Add API route to create, list and delete a purchase suggestion

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Jun 10 17:45:59 CEST 2019


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17314

Tomás Cohen Arazi <tomascohen at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Needs Signoff               |Failed QA
                 CC|                            |tomascohen at gmail.com

--- Comment #28 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
I have a few remarks:
- The method you are adding to Koha::Patron (->suggestions) needs tests, and it
should be actually relying on a relationship, and thus using _new_from_dbic so
it is prefetchable. This has been discussed recently so you couldn't know
beforehand.
- There's now a clear distinction between endpoints that target unprivileged
users (OPAC) and administrative ones (e.g. staff interface). If this bug only
targets the 'privileged' one, maybe make it explicit and make sure the
permissions are correct.
- The attribute names seem to come straight from the DB structure. This should
be fixed. Look at the RFCs page [1] and please follow naming conventions
discussed and voted there. For example, borrowernumber is not used on the API,
use patron_id instead.
- POD is missing on the controller
- Take a look at Koha::REST::V1::Cities and how it uses ->objects_search. It
will automagically add pagination to the list method, which is desierd on busy
sites (i.e. make the list manageable).
- objects_search requires you to pass the _to_api and _to_model methods you
will need to write to comply with the currently voted RFCs regarding
terminology.
- If you want the end user (session) to create purchase suggestions, then you
need an endpoint in /public. And if you need to list them on the patron's page,
maybe worth generating /public/patron/{patron_id}/purchase_suggestions (this is
very arguable, just a thought).

[1] https://wiki.koha-community.org/wiki/REST_api_RFCs

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list