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

--- Comment #20 from Tomás Cohen Arazi (tcohen) <[email protected]> ---
Created attachment 203318
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203318&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 <[email protected]>
Signed-off-by: David Nind <[email protected]>
Signed-off-by: Martin Renvoize <[email protected]>
Signed-off-by: Tomás Cohen Arazi <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to