Skip to content

Account Lifecycle

This page documents Coldtivate's current account and cooling user profile lifecycle behavior, with a focus on the distinction between archival and anonymization.

It is intended as a policy and implementation reference for product, support, QA, frontend, and backend teams.

Note: The frontend does not currently expose archival flows in the UI. Archival is a supported backend capability but not yet a fully exposed end-user feature.


Lifecycle Options

1. Archive

Temporarily removes a cooling user profile from active operational use while preserving the record for possible restoration. Prefer this when removal should be reversible.

  • the person is temporarily inactive or should be suspended from daily operations
  • the company wants to remove the profile without losing its state
  • historical traceability should be preserved

For cooling user profiles, archival is modeled through is_archived, archived_at, and archived_by.

2. Anonymize

Permanently removes personally identifying information from a profile or user account. The record stays in the database but is no longer attributable to the original person. Prefer this when retaining identifiable data would be inappropriate.

  • the user requests account deletion
  • compliance or retention rules require personal data removal
  • restoration is not the expected outcome

The backend does not hard-delete records. Instead, it relies on anonymization to preserve historical operational relationships while removing PII.


Current Backend Support

The backend supports the following lifecycle operations:

  • user account anonymization (User records; sets is_active=False and clears PII)
  • cooling user profile archival
  • cooling user profile restoration
  • cooling user profile anonymization
  • dependency checks that may block archival, restoration, or deletion

Relevant backend areas:

  • services/user.py - delete_user_account, archive_farmer_profile, restore_farmer_profile, anonymize_farmer_profile
  • farmer views - archive, restore, and operator-proxy-delete actions
  • dependency validation before destructive lifecycle actions proceed

Data Retention And Side Effects

Archival

  • profile remains in the database
  • profile is excluded from normal active listings/queries
  • restoration remains possible
  • historical relationships remain intact

Anonymization

  • identifying fields are cleared or replaced with anonymous placeholders
  • the record becomes non-attributable but remains in the database
  • company and cooling unit associations are removed
  • related operational history is preserved in anonymized form

Fields affected: first/last name, phone, email, gender, language, cooling user identifier, company association, linked cooling units.

Anonymization can also trigger organization-level side effects. For example, when the last active employee of a company is removed, the company's own data and associated cooling units are also anonymized.


Operational Guidance

Archive Procedure

  1. Check whether unresolved operational dependencies block archival.
  2. Archive the profile through the supported backend/API flow.
  3. Confirm the profile no longer appears in active operational queries.

Restore Procedure

  1. Confirm the profile is currently archived.
  2. Restore the profile through the supported backend/API flow.
  3. Verify the profile is visible again in active workflows.

Anonymize Procedure

  1. Confirm anonymization is the correct action rather than archival.
  2. Check for blocking dependencies.
  3. Review expected downstream side effects.
  4. Execute the supported anonymization flow.
  5. Verify identifying data is no longer exposed.

Troubleshooting

Profile cannot be archived

  • the requester is not authorized
  • unresolved dependencies are blocking archival
  • the profile is already archived

Profile cannot be restored

  • the requester is not authorized
  • the target profile is not archived

Profile cannot be deleted

  • unresolved produce or check-out dependencies exist
  • consider archival instead

UI does not show the expected lifecycle action

The backend may support the action, but frontend support is incomplete or not yet exposed. Confirm whether the action is available only through the backend/API.