Provide a `Settings` entity with key, value pairs
A new database entity for storing configuration data.
Motivation
This can be used for many different scenarios. Just two name two of them:
Storing possible link types
With the new Link
model we are missing a way how different link types are identified. This is the main reason from which this ticket emerges. While doing the migration from the o94 legacy backend data, it's not clear how to pass e.g. CBA, Website or any other type of links.
For example previously a timeslot.note
did have a specific field for the CBA Link. Since this is now generalized, any API consumers do not know how to store Links to the CBA. A Link
entity has the properties description
and url
. To create a new CBA Link record, a client will e.g. populate the property description with link_type_cba
and the property url
with the actual URL.
Now, how does an API client know, which identify it should provide for the link type? Where does it retrieve the information from, that CBA Links are identified by link_type_cba
?. How does it even know all the link types which are allowed within a radios infrastructure.
This case would be solved by such a Settings key/value store.
A place to store global Web Application configuration
The Dashboard can store an radio-specific settings, which require a more dynamic approach than static config files.
Thoughts on implementation
- It might me wise to not only provide
key
andvalue
pairs, but also anamespace
field. The enables grouped queries of e.g. all config records of the typelink_type
. - A way to define some pre-defined set of mandatory settings (like Fixtures)
- Think about not using the Link field
description
but defining link types, but adding a specific fieldtype
. This is because "description" indicates a human-use perspective, while the "type" is meant for pure machine-use. We also want to avoid that Use Case appear that people mix and match the same field for machine- and human-use. - Provide API endpoints to deal with the Settings entity