CDF COACHACCOUNTABLE MIGRATION PACKAGE
======================================

Purpose
-------
Import the historical CoachAccountable account into CDF without automatically
placing all historical coaching clients into the active CRM pipeline.

Import policy
-------------
- Source system: CoachAccountable
- Historical records should remain historical.
- clients.csv sets activate_in_crm=0 by default.
- Preserve source dates, privacy/visibility fields, statuses, and source content.
- Keep HTML note/template content intact during migration.
- Keep the original source exports in /source for audit/recovery.
- Do not delete the CoachAccountable account until CDF import is validated.

Inventory
---------
{
  "clients": 95,
  "templates": 31,
  "notes": 578,
  "file_metadata_records": 83,
  "physical_attachment_files": 84,
  "appointments": 63,
  "actions": 178,
  "metrics": 42,
  "metric_data_points": 178,
  "messages": 15,
  "invoices": 1,
  "payments": 1
}

Recommended import order
------------------------
1. clients.csv -> CDF contact/client staging table
2. templates.csv
3. notes.csv
4. appointments.csv
5. actions.csv
6. metrics.csv
7. metric_data.csv
8. messages.csv
9. invoices.csv
10. payments.csv
11. files_metadata.csv + attachment_inventory.csv + /attachments

Important
---------
legacy_key is a migration-only relationship key because the main CoachAccountable
JSON export does not expose a ClientID field on each client object.
The original attachment ZIP uses CoachAccountable client-number/name folders, so
attachment_inventory.csv preserves those folder IDs and names for reconciliation.

Before production import, map these staging columns to the exact current CDF
database columns and run a dry-run with counts and duplicate checks.
