vendredi 2 juillet 2021

What is the best design pattern for users groups [closed]

I'm new in my current company and they handled me an existed HR project that have multiple users group on it, I have a problem with maintain it because lets say we have a vacation request page . and we have three groups of users:

  1. employee
  2. supervisor
  3. manager

an employee create a request for vacation, his supervisor replay to it and also the manager.

the problem is the supervisor and the manger have the same view with different employees requests list depending on is the logged user is a (supervisor or manager), there are alot of IF statements in there and is hard to maintain or handling adding a new user group like a Department manger for example

I want to refactor the project to make it more expandable and maintainable without creating more pages for each group user, but I don't know which design pattern that can help me in the case

Please help me I'm having a hard time maintaining this project since there are 12 types of requests that employee could ask for.

Aucun commentaire:

Enregistrer un commentaire