{
  "jira_key": "AN-49",
  "summary": "Opportunity Closed Won Validation",
  "approach": "Implement a validation rule on Opportunity to enforce Close Date and Amount requirements when Stage is 'Closed Won'. Ensure required fields are present and visible on the Opportunity object. Use allowlisted metadata only (CustomField, ValidationRule, PermissionSet). No Apex, Flow, or Lightning Components are required for this requirement. Security and access are handled via PermissionSet for Opportunity create/edit.",
  "metadata_plan": [
    {
      "metadata_type": "CustomField",
      "api_name": "CloseDate",
      "action": "update",
      "object": "Opportunity",
      "notes": "Data type: Date; Field label: Close Date; Required-at-definition: false (enforced via validation rule); Standard field, ensure present and visible on layout."
    },
    {
      "metadata_type": "CustomField",
      "api_name": "Amount",
      "action": "update",
      "object": "Opportunity",
      "notes": "Data type: Currency; Field label: Amount; Required-at-definition: false (enforced via validation rule); Standard field, ensure present and visible on layout."
    },
    {
      "metadata_type": "CustomField",
      "api_name": "StageName",
      "action": "update",
      "object": "Opportunity",
      "notes": "Data type: Picklist; Field label: Stage; Picklist values: includes 'Closed Won'; Standard field, ensure present and visible on layout."
    },
    {
      "metadata_type": "CustomField",
      "api_name": "Name",
      "action": "update",
      "object": "Opportunity",
      "notes": "Data type: Text; Field label: Opportunity Name; Standard field, ensure present and visible on layout."
    },
    {
      "metadata_type": "CustomField",
      "api_name": "AccountId",
      "action": "update",
      "object": "Opportunity",
      "notes": "Data type: Lookup(Account); Field label: Account; Standard field, ensure present and visible on layout."
    },
    {
      "metadata_type": "ValidationRule",
      "api_name": "Closed_Won_Requires_CloseDate_And_Amount",
      "action": "create",
      "object": "Opportunity",
      "notes": "Purpose: Prevent saving Opportunity as Closed Won unless Close Date is populated and Amount > 0. Formula: AND(ISPICKVAL(StageName, 'Closed Won'), OR(ISBLANK(CloseDate), Amount <= 0)). Error message: 'For a Closed Won Opportunity, Close Date is required and Amount must be greater than $0.' Error location: Amount field."
    },
    {
      "metadata_type": "PermissionSet",
      "api_name": "Opportunity_Create_Edit_Access",
      "action": "create",
      "object": null,
      "notes": "Grants create and edit access to Opportunity object for users. Assign to relevant users/groups."
    }
  ],
  "dependencies": [
    "Opportunity object standard fields must be present and visible on page layout.",
    "PermissionSet assignment to users."
  ],
  "risks_or_escalations": [
    "No escalation required. All requirements are within v1 allowlist."
  ],
  "out_of_allowlist": false,
  "confidence": 1.0,
  "notes": "No custom Apex, Flow, or Lightning Components are required. All changes are to standard fields, validation rule, and permission set. No out-of-scope items identified."
}