[Design Management] When a design is deleted, remove Todos for that design
This issue was created out of this discussion #207200 (comment 290710243).
When a design is deleted we should remove the Todos for that design.
Note that "deleted" is referring to the future feature of design "hard" deletion, which doesn't exist at time of writing and will be implemented in #38048.
UPDATE: Todos should be deleted also for designs which were soft-deleted (archived).
Technical Solution (starting point)
We could look further into the TodosDestroyer
workers, and service classes under Todos::Destroy
as it's possible we could follow similar patterns.
The solution might be:
- add a new
Todos::Destroy::ArchiveDesign
(or something similar) service, similar to e.g.Todos::Destroy::ConfidentialIssueService
- when a design is soft-deleted, schedule an async job which runs the
Todos::Destroy::ArchiveDesign
- depending whether a design can be un-archived again, we may want to schedule this with a delay or not
Edited by Jan Provaznik