{
  "jira_key": "AN-39",
  "summary": "Account Customer Tier Classification",
  "approach": "Implement automatic classification of Accounts into Customer Tiers based on Annual Revenue using a custom picklist field and a record-triggered Flow. The Customer Tier field will be read-only for users, visible on the Account Lightning Record Page, and populated for both new and existing Accounts. Validation Rule will prevent manual edits. Backfill will be handled via Flow. All metadata is within the v1 allowlist.",
  "metadata_plan": [
    {
      "metadata_type": "CustomField",
      "api_name": "Customer_Tier__c",
      "action": "create",
      "object": "Account",
      "notes": "Data type: Picklist. Field label: Customer Tier. Picklist values: Platinum, Gold, Silver, Bronze. Default value: (none). Required-at-definition: false."
    },
    {
      "metadata_type": "ValidationRule",
      "api_name": "Prevent_Manual_Customer_Tier_Edit",
      "action": "create",
      "object": "Account",
      "notes": "Purpose: Prevent users from manually editing the Customer Tier field. Formula: ISCHANGED(Customer_Tier__c) && NOT(ISCHANGED(AnnualRevenue)) && $Profile.Name <> 'System Administrator'. Error message: Customer Tier is set automatically and cannot be edited. Error location: Field (Customer Tier)."
    },
    {
      "metadata_type": "Flow",
      "api_name": "Account_Customer_Tier_Auto_Assign",
      "action": "create",
      "object": "Account",
      "notes": "Record-triggered Flow on Account. Trigger: When record is created or when AnnualRevenue changes. Logic: Set Customer_Tier__c based on AnnualRevenue value using revenue-to-tier mapping. Also includes a batchable subflow for backfilling existing Accounts."
    },
    {
      "metadata_type": "PermissionSet",
      "api_name": "Account_Customer_Tier_Visibility",
      "action": "create",
      "object": null,
      "notes": "Grants read access to Customer_Tier__c for relevant users. Does not grant edit access."
    },
    {
      "metadata_type": "LightningComponentBundle",
      "api_name": "accountSummary",
      "action": "update",
      "object": null,
      "notes": "Update Account Lightning Record Page to ensure Customer Tier field is visible in the summary component."
    }
  ],
  "dependencies": [
    "force-app/main/default/classes/AccountService.cls (for domain logic pattern)",
    "force-app/main/default/lwc/accountSummary/accountSummary.js (for UI display pattern)"
  ],
  "risks_or_escalations": [
    "No escalations. All required metadata is within v1 allowlist."
  ],
  "out_of_allowlist": false,
  "confidence": 1.0,
  "notes": "All requirements are addressed using allowlisted metadata types. No blockers or ambiguities remain. Backfill is handled via Flow, not requiring batch Apex."
}