[Bug 44349] New: Mark patron self-renewal availability read-only in the REST API
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44349 Bug ID: 44349 Summary: Mark patron self-renewal availability read-only in the REST API Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: REST API Assignee: nugged@gmail.com Reporter: nugged@gmail.com QA Contact: tomascohen@gmail.com CC: tomascohen@gmail.com Depends on: 26355 Target Milestone: --- Bug 26355 added self_renewal_available as a computed property in patron responses. The shared patron schema accepts it in create and update requests. Including it in an otherwise valid request can produce HTTP 500 because the property has no backing column. Mark the property read-only in the patron schema, as with expired and restricted. POST and PUT should return HTTP 400 identifying the read-only field, with no patron record created or changed. Patron responses should continue to include the computed value. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26355 [Bug 26355] Allow patron account renewals through the OPAC -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44349 --- Comment #1 from Andrii Nugged <nugged@gmail.com> --- Created attachment 212864 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212864&action=edit Bug 44349: Mark patron self-renewal availability read-only Koha derives self_renewal_available when serializing a patron. The property has no backing column. Mark it read-only in OpenAPI so that patron create and update requests containing it are rejected before persistence, while responses still include the derived value. Test plan: 1. Run prove t/db_dependent/api/v1/patrons.t on a Koha test database. 2. Without the schema change, both regression cases fail: the REST requests reach persistence and do not return a field-specific 400. 3. Apply the schema change and repeat the same test. Verify that POST and PUT report the field as read-only, leave records unchanged, and that the existing valid patron create and update cases still pass. Co-Authored-By: Loontik <loontik@nugged.team> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44349 Andrii Nugged <nugged@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org