https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42311 --- Comment #8 from David Nind <david@davidnind.com> --- Created attachment 197130 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197130&action=edit Bug 42311: REST API CRUD endpoints for library calendar With the Koha::Calendar::* classes and the normalized schema from bug 42310 in place, this patch adds the REST API layer for managing library calendar closures. Each closure type gets its own controller and spec file, following the established Koha::REST::V1::Cities pattern: GET /libraries/{id}/calendar Returns all closure definitions grouped by type. POST /libraries/{id}/calendar/weekly_closures GET /libraries/{id}/calendar/weekly_closures/{weekly_closure_id} PUT /libraries/{id}/calendar/weekly_closures/{weekly_closure_id} DELETE /libraries/{id}/calendar/weekly_closures/{weekly_closure_id} POST /libraries/{id}/calendar/repeating_closures GET /libraries/{id}/calendar/repeating_closures/{repeating_closure_id} PUT /libraries/{id}/calendar/repeating_closures/{repeating_closure_id} DELETE /libraries/{id}/calendar/repeating_closures/{repeating_closure_id} POST /libraries/{id}/calendar/single_closures GET /libraries/{id}/calendar/single_closures/{single_closure_id} PUT /libraries/{id}/calendar/single_closures/{single_closure_id} DELETE /libraries/{id}/calendar/single_closures/{single_closure_id} POST /libraries/{id}/calendar/closure_exceptions GET /libraries/{id}/calendar/closure_exceptions/{closure_exception_id} PUT /libraries/{id}/calendar/closure_exceptions/{closure_exception_id} DELETE /libraries/{id}/calendar/closure_exceptions/{closure_exception_id} POST /libraries/{id}/calendar/copy Copies all closure rules from another library. Permissions: catalogue:1 for reads, tools:edit_calendar for writes. To test: 1. Apply the patches from bug 42310, then this one 2. Run: $ ktd --shell k$ yarn api:bundle k$ prove t/db_dependent/api/v1/libraries_calendar.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.