Deleting a tenant must delete 9 most important resources

Description

9 resources to delete when a tenant is deleted:

  1. Users

  2. Allowed peripherials

  3. Ring groups

  4. Voicemail

  5. Incoming routes

  6. Outgoing routes

  7. Trunks

  8. Conference rooms

  9. Contexts (Settings > Dialplan > Contextes)

 

  • Write the code deleting the 9 resources (managed by wazo-confd). The delete can be completed by calling the DAOs delete(…). We may not need to call all the DAOs as there are some foreign keys with a delete on cascade. Code must be written in sync_db.py

  • Improve the bus consumer (wazo_confd/plugins/event_handlers/) for the tenant_deleted event by calling the code deleting the resources (see above)

  • Improve sync_db.py by calling the code deleting the resources in the “main”

  • NOTE: the steps above will create a new technical debt for us (the developers) https://wazo-dev.atlassian.net/browse/WAZO-3290 . When we will put in place foreign keys in all the resources tables, we will need to rework on this deletion process


DISCLAIMER:

voicemails and devices deletions will be done in other tasks (check the epic for more details about these tasks)

Zendesk Ticket IDs

None

Activity

Show:

Nabil Ben Youssef July 27, 2023 at 12:56 PM

After tests execution, I found some tables that are not properly deleted:

'agentqueueskill','extensions','dialaction','queue','queuemember','pickupmember','queueskillcat','func_key','func_key_dest_custom',

Nabil Ben Youssef July 27, 2023 at 12:55 PM

tests added for tenant deletion by :

  • event

  • sync_db

Nabil Ben Youssef July 26, 2023 at 12:50 PM
Edited

Pascal Crausaz July 24, 2023 at 1:45 PM

Can you link the voicemail leftover ticket and the device ticket to this ticket.

Nabil Ben Youssef July 24, 2023 at 12:31 PM
Edited

working on test for sync_db

Done

Details

Priority

Assignee

Reporter

Approvers

Pascal Cadotte

Fix versions

Sprint

Zendesk Support

Created June 20, 2023 at 6:08 PM
Updated September 26, 2024 at 6:24 PM
Resolved August 2, 2023 at 8:09 PM

Flag notifications