code4romania / sunrise

Mozilla Public License 2.0
0 stars 0 forks source link

[Super Admin/Nomenclator] implement CRUD roluri specialiști #157

Open teodoranegru opened 2 months ago

teodoranegru commented 2 months ago

User story

As a Super Admin, I need to be able to define the list of roles the NGO Specialist users can have. The roles I configure in the Super Admin interface will populate the "Rol" dropdown from the Staff section.

Implement in the "Nomenclator servicii și specialiști section" the "Specialiști" tab. In the "Specialiști" tab, implement the "Toate rolurile de specialiști" table (link to design in Figma)

Flows

Add specialist role

  1. Super Admin user navigates to "Nomenclator servicii și specialiști" page, "Specialisti" tab
  2. User clicks on "Adauga rol speiclist" button
  3. The system retrieves the "Adauga rol specialist" page
  4. The user fills in the name of the role and chooses the default permissions of that role
  5. The user clicks on "Salveaza modificarile" button
  6. The system retrieves the page of that role in view mode

Edit specialist role

  1. Super Admin user navigates to "Nomenclator servicii și specialiști" page, "Specialisti" tab
  2. The user clicks on the "Modifica" button
  3. The system retrieves the specialist role page in edit mode (see design in Figma)
  4. The user edits the service and clicks on "Salvează modificările" button
  5. The system retrieves the "Specialisti" tab and displays the success message

Delete specialist role

  1. Super Admin user navigates to "Nomenclator servicii și specialiști" page, "Specialisti" tab
  2. The user clicks on the "Modifica" button
  3. The system retrieves the specialist role page in edit mode (see design in Figma)
  4. The user clicks on the "Sterge rol" button (the button is clickable ONLY if the role has not been used)
  5. The system displays a confirmation message
  6. The user clicks on the "Sterge rol" button
  7. The role is deleted from the db, the user is redirected to the "Nomenclator servicii și specialiști" page, "Specialisti" tab, and a success message is displayed

Business rules

  1. If there are no role added on the platform, display the empty state (link to design)
  2. When a new role is created, the default status of that role is Active
  3. A role that was used can not be deleted, only deactivated
  4. At hover on the "Sterge rol" button (disabled) from a role that can not be deleted, display the following tooltip (link)
  5. Display in the "Toate rolurile de specialiști" table the following information:Rol specialist; Institutii (total nr of Organizations that have users with that role) Centre (total nr of tenants that have users with that role) Status
  6. Implement filter by Status on the "Toate rolurile de specialiști" table
teodoranegru commented 1 month ago

Additional business rules: