code4romania / sunrise

Mozilla Public License 2.0
0 stars 0 forks source link

[Super Admin/Nomenclator] implement CRUD servicii #156

Open teodoranegru opened 1 month ago

teodoranegru commented 1 month ago

User story

As a Super Admin, I need to be able to create and manage the services available on the platform. The services I configure in the Super Admin interface will populate the selection list for NGO Admins in the "Nomenclator servicii" section when they set up the platform.

Flows

Add service

  1. Super Admin user navigates to "Nomenclator" page, "Servicii" tab
  2. User clicks on "Adauga serviciu" button
  3. The system retrieves the "Adauga serviciu" page
  4. The user fills in the name of the service and chooses the associated file (optional)
  5. The user defines the interventions from that service (fills in the name of the interventions and chooses if it is available or not)
  6. The user clicks on "Salveaza modificarile" button
  7. The system retrieves the page of that service in view mode (see design in Figma)

Edit service

  1. Super Admin user navigates to "Nomenclator" page, "Servicii" tab
  2. The user clicks on the "Vezi detalii" button
  3. The system retrieves the service page (link)
  4. The user clicks on the "Modifică serviciu" button
  5. The system retrieves the service page in edit mode
  6. The user edits the service and clicks on "Salvează modificările" button
  7. The system retrieves the service page in view mode and displays the success message

Delete service

  1. Super Admin user navigates to "Nomenclator" page, "Servicii" tab
  2. The user clicks on the "Vezi detalii" button
  3. The system retrieves the service page
  4. The user clicks on the "Modifică serviciu" button
  5. The system retrieves the service page in edit mode
  6. The user clicks on the "Sterge serviciu" button (the button is clickable ONLY if the service has not been used)
  7. The system displays a confirmation message
  8. The user clicks on the "Sterge serviciu" button
  9. The service is deleted from the db, the user is redirected to the "Nomenclator" page, "Servicii" tab, and a success message is displayed

Download list

  1. Super Admin user navigates to "Nomenclator" page, "Servicii" tab
  2. The user clicks on the "Vezi detalii" button
  3. The system retrieves the service page (link)
  4. The user clicks on "Descarcă lista" button
  5. The system downloads the list of interventions from that Service (to determine which format is the most suitable)

Business rules

  1. If there are no services added on the platform, display the empty state (link to design)
  2. When a new service is created, the default status of that service is Active
  3. When a new intervention is added, the default status of it is Active
  4. The default state of the "Intervenții asociate serviciului" table has 1 empty row displayed
  5. A service that was used can not be deleted, only deactivated
  6. An intervention that was used can not be deleted, only deactivated
  7. At hover on the "Sterge serviciu" button (disabled) from a service that can not be deleted, display the following tooltip (link)
  8. At hover on the delete icon (disabled) from an intervention that can not be deleted, display the following tooltip (link)
  9. Display in the "Toate serviciile" table the following information:
    • Nume serviciu;
    • Institutii (total nr of Organizations that have selected that service. If the service is selected in more than one tenant, count the organization once)
    • Centre (total nr of tenants that have selected that service)
    • Status
  10. Implement filter by Status on the "Toate serviciile" table