cog
cog copied to clipboard
Audit resource user presentation
Currently models are encoded to json via either a Poison.Encoder implementation or a phoenix view. This leads to inconsistent output of data for users dependent on where they access the data.
For example the group model. If a user retrieves a group via the REST api they are presented with the following structure:
{"name": <group name>,
"id": <group id>,
"members": {"roles": [<roles>],
"users": [<users>]}}
But when retrieving a group the the group chat command the structure returned looks like this:
{"name": <group name>,
"id": <group id>,
"role": [<roles>],
"members": [<users>]}
This can not only cause confusion for the end user, but also makes it difficult to maintain the application. We should audit and consolidate how resources are presented to the user to provide more consistency.