{
  "version": "1.0.0",
  "generatedFrom": "docs/setup/csv-template-spec.md",
  "dataset": {
    "organizationCode": "ALLA",
    "branchCode": "head_office",
    "productTypeCode": "crane",
    "currency": "THB",
    "administratorEmail": "admin@example.com",
    "marketingEmail": "mk.uat@example.com",
    "salesEmail": "sales.uat@example.com",
    "managerEmail": "manager.uat@example.com",
    "ceoEmail": "ceo.uat@example.com"
  },
  "templates": [
    {
      "file": "users.csv",
      "seedType": "organization",
      "importOrder": 1,
      "supported": true,
      "requiredColumns": ["email", "name", "system_role"],
      "description": "Setup-managed users."
    },
    {
      "file": "organizations.csv",
      "seedType": "organization",
      "importOrder": 2,
      "supported": true,
      "requiredColumns": ["organization_code", "organization_name", "slug", "created_by_email"],
      "description": "Tenant organizations."
    },
    {
      "file": "memberships.csv",
      "seedType": "organization",
      "importOrder": 3,
      "supported": true,
      "requiredColumns": ["organization_code", "user_email", "membership_role", "business_role"],
      "description": "App-level organization memberships."
    },
    {
      "file": "crm-role-assignments.csv",
      "seedType": "organization",
      "importOrder": 5,
      "supported": true,
      "requiredColumns": [
        "organization_code",
        "user_email",
        "crm_role_code",
        "is_primary",
        "branch_scope_mode",
        "product_type_scope_mode"
      ],
      "description": "CRM role assignments and scopes."
    },
    {
      "file": "master-options.csv",
      "seedType": "foundation",
      "importOrder": 6,
      "supported": true,
      "requiredColumns": ["organization_code", "category", "code", "label"],
      "description": "Generic governed master options."
    },
    {
      "file": "branches.csv",
      "seedType": "organization",
      "importOrder": 7,
      "supported": true,
      "requiredColumns": ["organization_code", "branch_code", "branch_name"],
      "description": "Branch options mapped to ms_options category crm_branch."
    },
    {
      "file": "product-types.csv",
      "seedType": "organization",
      "importOrder": 8,
      "supported": true,
      "requiredColumns": ["organization_code", "product_type_code", "product_type_name"],
      "description": "Product type options mapped to ms_options category crm_product_type."
    },
    {
      "file": "document-sequences.csv",
      "seedType": "foundation",
      "importOrder": 14,
      "supported": true,
      "requiredColumns": ["organization_code", "document_type", "prefix", "period"],
      "description": "Document numbering configuration."
    },
    {
      "file": "approval-workflows.csv",
      "seedType": "foundation",
      "importOrder": 15,
      "supported": true,
      "requiredColumns": ["organization_code", "workflow_code", "workflow_name", "entity_type"],
      "description": "Approval workflow headers."
    },
    {
      "file": "approval-steps.csv",
      "seedType": "foundation",
      "importOrder": 16,
      "supported": true,
      "requiredColumns": ["organization_code", "workflow_code", "step_number", "role_code", "role_name"],
      "description": "Approval workflow steps."
    },
    {
      "file": "approval-matrix.csv",
      "seedType": "foundation",
      "importOrder": 17,
      "supported": true,
      "requiredColumns": ["organization_code", "entity_type", "workflow_code", "priority", "is_default"],
      "description": "Approval workflow routing matrix."
    },
    {
      "file": "customers.csv",
      "seedType": "business",
      "importOrder": 30,
      "supported": true,
      "requiredColumns": [
        "organization_code",
        "customer_code",
        "customer_name",
        "customer_type",
        "customer_status",
        "created_by_email"
      ],
      "description": "CRM customers."
    },
    {
      "file": "contacts.csv",
      "seedType": "business",
      "importOrder": 32,
      "supported": true,
      "requiredColumns": ["organization_code", "customer_code", "contact_name", "created_by_email"],
      "description": "Customer contacts."
    },
    {
      "file": "contact-shares.csv",
      "seedType": "business",
      "importOrder": 33,
      "supported": true,
      "requiredColumns": [
        "organization_code",
        "customer_code",
        "contact_email",
        "shared_to_user_email",
        "shared_by_user_email"
      ],
      "description": "Contact sharing grants."
    },
    {
      "file": "leads.csv",
      "seedType": "business",
      "importOrder": 34,
      "supported": true,
      "requiredColumns": ["organization_code", "lead_code", "status", "created_by_email"],
      "description": "Marketing-owned leads."
    },
    {
      "file": "opportunities.csv",
      "seedType": "business",
      "importOrder": 36,
      "supported": true,
      "requiredColumns": [
        "organization_code",
        "opportunity_code",
        "customer_code",
        "title",
        "product_type_code",
        "status",
        "priority",
        "created_by_email",
        "updated_by_email"
      ],
      "description": "Sales opportunities."
    },
    {
      "file": "opportunity-parties.csv",
      "seedType": "business",
      "importOrder": 37,
      "supported": true,
      "requiredColumns": ["organization_code", "opportunity_code", "customer_code", "role_code"],
      "description": "Opportunity project parties."
    },
    {
      "file": "quotations.csv",
      "seedType": "business",
      "importOrder": 40,
      "supported": true,
      "requiredColumns": [
        "organization_code",
        "quotation_code",
        "customer_code",
        "quotation_date",
        "quotation_type",
        "status",
        "currency",
        "subtotal",
        "total_amount",
        "created_by_email",
        "updated_by_email"
      ],
      "description": "Quotation headers."
    },
    {
      "file": "quotation-items.csv",
      "seedType": "business",
      "importOrder": 41,
      "supported": true,
      "requiredColumns": [
        "organization_code",
        "quotation_code",
        "item_number",
        "product_type_code",
        "description",
        "quantity",
        "unit_price",
        "total_price"
      ],
      "description": "Quotation line items."
    },
    {
      "file": "quotation-parties.csv",
      "seedType": "business",
      "importOrder": 42,
      "supported": true,
      "requiredColumns": ["organization_code", "quotation_code", "customer_code", "role_code"],
      "description": "Quotation project parties."
    },
    {
      "file": "quotation-topics.csv",
      "seedType": "business",
      "importOrder": 43,
      "supported": true,
      "requiredColumns": ["organization_code", "quotation_code", "topic_key", "topic_type", "title"],
      "description": "Quotation topic headers."
    },
    {
      "file": "quotation-topic-items.csv",
      "seedType": "business",
      "importOrder": 44,
      "supported": true,
      "requiredColumns": ["organization_code", "quotation_code", "topic_key", "content"],
      "description": "Quotation topic rows."
    }
  ],
  "unsupportedTemplates": [
    "departments.csv",
    "teams.csv",
    "warehouses.csv",
    "sites.csv",
    "services.csv",
    "price-books.csv",
    "tax-rates.csv",
    "attachments.csv",
    "email-settings.csv"
  ]
}
