Details
-
Type: Sub-task
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 4.3.0-b1
-
Component/s: Staff Interface
-
Labels:None
Description
When deleting a client (Clients::delete), this action should occur within a database transaction via listeners to the Clients.delete event and delete all stored records related to the client, including:
- clients (done in the Clients model, which triggers the rest of these to be called)
- client_account (done in the ClientAccount handler)
- accounts_cc (remove from offsite if necessary) (done in the AccountsCc handler)
- accounts_ach (remove from offsite if necessary) (done in the AccountsAch handler)
- client_notes (done in the ClientNotes handler)
- client_packages (done in the ClientPackages handler)
- client_settings (done in the ClientSettings handler)
- client_values (done in the ClientValues handler)
- contacts (done in the Contacts handler)
- contact_numbers (done in the Contacts handler)
- contact_permissions (done in the Contacts handler)
- invoices (done in the Invoices handler)
- invoices_recur (done in the InvoicesRecur handler)
- invoices_recur_created (done in the InvoicesRecur handler)
- invoice_delivery (done in the Invoices handler)
- invoice_lines (done in the Invoices handler)
- invoice_line_taxes (done in the Invoices handler)
- invoice_meta (done in the Invoices handler)
- invoice_recur_delivery (done in the InvoicesRecur handler)
- invoice_recur_lines (done in the InvoicesRecur handler)
- invoice_recur_values (done in the InvoicesRecur handler)
- invoice_values (done in the Invoices handler)
- log_client_settings (requires
CORE-2679/CORE-2692) (done in the LogClientSettings handler) - log_contacts (done in the LogContacts handler)
- log_emails (done in the LogEmails handler)
- log_services (done in the Services handler)
- log_transactions (done in the Transactions handler)
- log_users (done in the LogUsers handler)
- services (done in the Services handler)
- service_changes (done in the Services handler)
- service_fields (done in the Services handler)
- service_invoices (done in the Services handler)
- service_options (done in the Services handler)
- transactions (done in the Transactions handler)
- transactions_applied (done in the Transactions handler)
- users (done in the Clients and Contacts handlers)
- user_otps (done in the Clients and Contacts handlers)
- Add a new event "Users.delete" to perform user deletion dependencies
Note:
- The log_* tables may be ignored in favor of normal log rotation policies
- The data should be deleted by calling the appropriate delete actions of existing models. This will ensure all of the appropriate referenced data is deleted without knowledge of their existing data stores. It will also invoke any appropriate event handlers for those particular actions.
Issue Links
- is blocked by
-
CORE-2701 Add observer event for the core
- Closed