Patrons messaging preferences endpoint RFC

From Koha Wiki

Jump to: navigation, search

This RFC should be the basis for bug 17505 and related bug reports that could need to be filed.

Contents

Actions and routes

The following table presents the current implementation, and the proposed changes.

Description Action Current path Proposed path
List preferences for patron
 GET
/patrons/{patron_id}/messaging_preferences
Overwrite prefernces
 PUT
/patrons/{patron_id}/messaging_preferences

Patron object definition

DB schema Josef Moravec
borrowernumberpatron_id
message_attribute_idmessage_type [1]
days_in_advancedays_in_advance
digestdigest
borrower_message_preferences_idpatron_message_preferences_id
message_transport_typetransport_type [2]
system_preferencesmessaging_preferences_status [3]

Notes

[1] Should by some kind of string identifier - maybe value from message_attributes.message_name
[2] list of defined transports from borrower_message_transport_preferences
[3] if don't enabled by syspref, get error 405 Method Not Allowed

Comments

Some thoughts:

  • If we only support GET and PUT here, how will you deactivate message preferences? With an empty list of message types?
  • What if there don't exist any entries for the patron in the tables yet - How will we receive the correct list of message types to update?

--Kfischer 08:12, 30 March 2018 (EDT)