Consider the following database scheme :
- User (id, username, firstname, lastname, .....)
- Group (id, name) // 3 entries administrator, approver or issuer
- Project(id, name, launchdate, ....)
with a ternary association relating the three previous entities:
- Membership(user_id, group_id, project_id)
I need to create a route to change the group for a specific user in a specific project.
What is the best RESTful Architecture to design this route?
First draft : PUT : api/membership/user_id/project_id/group_id
This route associate group with group_id to user if it doesn't exist and remove it if it's associated