thtsystems / open-visit

Open-source application for visiting scheduling.
MIT License
9 stars 6 forks source link

[Question] Types of users and company user #56

Open JoaoAlem opened 11 months ago

JoaoAlem commented 11 months ago

Hello everyone.

Context When creating a condominium, it also creates the condominium user, the same happens for employees. But while working in companies route, i cannot find a user_type company. I cannot find any clues in code to answer this, so i am opening this issue.

Question Who's gonna add employees for a company? After talking with Tomazella, we found three possibilities.

Solution

  1. Creating a flag in employees and this flag will indicate if the employee can manage the company;
  2. Creating a another user_type of Company;
  3. The condominium user is gonna add every employee of a company.

Conclusions In terms of work load, we agreed that using the first method would be more beneficial. The third solution, wouldn't fit well in our scenario, because the responsibility of the employees should be of the company.

ernestoresende commented 11 months ago

The condominium is the "master user" in our scenario. The flow goes as follows:

I agree that we should figure out how to handle the employee having administrative actions. As I see, it could be a simple boolean column in the employee table, but you might have a better idea.

JoaoAlem commented 11 months ago

From the point of view of our database schema, the most logical way to do this will be creating a new user type like: adminEmployee or company.

Because we already have the field user_type, and i think that doing this instead using a boolean will be more benefical for the future of the application than using a simple boolean.