aau-giraf / web-api

The backend API for GIRAF — a .NET-core project written in C#.
GNU General Public License v3.0
2 stars 5 forks source link

Trustee should only be assigned to their correct Citizen #254

Open ChrisBuchardt opened 2 years ago

ChrisBuchardt commented 2 years ago

This issue is when the register endpoint in the REST-API creates a user, after the Trustee user is added to the database a relation between the Trustee and the Citizen is created. Currently as it is implemented in the REST-API a Trustee is added to all Citizens with the method AddTrusteeToCitizens and all Trustees are added to the one Citizen in this method AddCitizensToTrustee.

Both methods get called in the register endpoint under the \lstinline{AccountController}. To solve this issues one or two new methods should be created which adds the created Citizen to the created Trustee when they are created. These methods should be added to if-else statement in the register endpoint.