[Koha-bugs] [Bug 17505] REST API: Add route for messaging preferences

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Sun Jul 30 16:30:01 CEST 2017


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

Jiri Kozlovsky <mail at jkozlovsky.cz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #64796|0                           |1
        is obsolete|                            |

--- Comment #13 from Jiri Kozlovsky <mail at jkozlovsky.cz> ---
Created attachment 65326
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=65326&action=edit
Bug 17505: REST API route for messaging preferences

Get patron's / category's messaging preferences:
    GET /messaging_preferences?borrowernumber=123
        - allowed if getting own preferences
        - otherwise borrowers flag required
    GET /messaging_preferences?categorycode=K
        - borrowers flag required

Modify patron's / category's messaging preferences:
    PUT /messaging_preferences?borrowernumber=123
        - allowed if modifying own preferences
        - otherwise borrowers flag required

    PUT /messaging_preferences?categorycode=K
        - borrowers flag required

Returns the following JSON object (same for PUT except for readOnly values):
{
  "Advanced_Notice": {
    "days_in_advance": {
      "configurable": true,
      "value": 20
    },
    "digest": {
      "configurable": true,
      "value": true
    },
    "transport_types": {
      "email": true,
      "sms": false
    }
  },
  "Another_Message_Name": {
    "days_in_advance": {
      "configurable": false,
      "value": null
    },
    "digest": { ...
  },
  ...
}

To test:
1. prove t/db_dependent/api/v1/messagingpreferences.t
2. Send GET and PUT requests to /api/v1/messaging_preferences

Signed-off-by: Jiri Kozlovsky <mail at jkozlovsky.cz>

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


More information about the Koha-bugs mailing list