Add basic REST API operations for Notices. This way we can easily allow staff with correct permissions to resend/create manually new notices via REST API and accept third party delivery notes.
Created attachment 42645 [details] [review] Bug 14843: Notifications and messages via REST API This patch adds notifications/messages to REST API. The purpose is to let user with permissions get/create/update/delete/resend messages in message_queue. For the operations we have to introduce new functionalities to C4::Letters. Currently it is not possible to delete/update notifications or get message by id. With this patch we are able to do these operations. Two new subroutines are: C4::Letters::DequeueLetter and C4::Letters::UpdateQueuedMessage There are specific permissions for each operation. Under pemission module 'messages', the following permissions can be found: - get_message - create_message - update_message (also allows resend via status change) - delete_message - resend_message Endpoints that this patch adds are: GET /api/v1/messages (GETs all messages) POST /api/v1/messages (creates new message) GET /api/v1/messages/{messagenumber} (GETs specific message) PUT /api/v1/messages/{messagenumber} (modifies specific message) DELETE /api/v1/messages/{messagenumber} (deletes specific message) POST /api/v1/messages/{messagenumber}/resend (makes new resend for a message) See Swagger definitions for more precise descriptions. Includes REST tests and unit tests for new subroutines in C4::Letters.
Created attachment 42693 [details] [review] Bug 14843: Notifications and messages via REST API
Created attachment 42694 [details] [review] Bug 14843: Notifications and messages via REST API
Created attachment 42719 [details] [review] Bug 14843: Notifications and messages via REST API
fatal: sha1 information is lacking or useless (Koha/AuthUtils.pm). error: could not build fake ancestor at ./getter.pl line 196.
This bug depends on bug7174 which is in status Needs Signoff but the patches for it do not apply cleanly
This bug depends on 14723 which is in status Patch doesn't apply
Created attachment 62791 [details] [review] Bug 14843: REST API for message queue - /api/v1/notices GET /api/v1/notices POST /api/v1/notices GET /api/v1/notices/{message_id} PUT /api/v1/notices/{message_id} PATCH /api/v1/notices/{message_id} DELETE /api/v1/notices/{message_id} POST /api/v1/notices/{message_id}/resend New permissions: - Module * messages - Sub-permissions * get_message * create_message * update_message * delete_message * resend_message To test: 1. prove t/db_dependent/api/v1/notices.t
Still BLOCKED by Bug 7174 but I wanted to attach this heavily rewritten patch if anyone is interested to work with it. It is now dependent on Bug 18137. This patch can work without dependency to Bug 7174, but at least the following steps are required: 1. The atomicupdate script needs to be rewritten to community standards. Get rid of AtomicUpdater and PermissionManager, and those permissions have to be added the way it currently happens in Koha 2. Fix permission adding mechanism in the test file 3. There are probably some conflicts in definitions.json, paths.json and parameters.json, but they should be trivial to fix. I may return later to fix those steps, but if you really want to test this now, feel free to provide a follow-up :)
Needs to be added to https://wiki.koha-community.org/wiki/REST_api_RFCs In my opinion we could use : GET /api/v1/messages Since we have message_transport, message_queue, ... Note that table 'messages' is something else why may have to rename.