{
  "jira_key": "AN-49",
  "passed": false,
  "cycle": 0,
  "findings": [
    {
      "severity": "critical",
      "category": "Field Definition",
      "file": "force-app/main/default/objects/Opportunity/fields/AccountId.field-meta.xml",
      "line": 1,
      "message": "AccountId is a standard lookup field to Account on Opportunity and should not be defined as a custom picklist. Remove this custom field definition and ensure the standard AccountId field is present and visible on the layout.",
      "fixable": true
    },
    {
      "severity": "critical",
      "category": "Field Definition",
      "file": "force-app/main/default/objects/Opportunity/fields/Amount.field-meta.xml",
      "line": 1,
      "message": "Amount is a standard currency field on Opportunity and should not be defined as a custom picklist. Remove this custom field definition and ensure the standard Amount field is present and visible on the layout.",
      "fixable": true
    },
    {
      "severity": "critical",
      "category": "Field Definition",
      "file": "force-app/main/default/objects/Opportunity/fields/CloseDate.field-meta.xml",
      "line": 1,
      "message": "CloseDate is a standard date field on Opportunity and should not be defined as a custom picklist. Remove this custom field definition and ensure the standard CloseDate field is present and visible on the layout.",
      "fixable": true
    },
    {
      "severity": "critical",
      "category": "Field Definition",
      "file": "force-app/main/default/objects/Opportunity/fields/Name.field-meta.xml",
      "line": 1,
      "message": "Name is a standard text field on Opportunity and should not be defined as a custom picklist. Remove this custom field definition and ensure the standard Name field is present and visible on the layout.",
      "fixable": true
    },
    {
      "severity": "critical",
      "category": "Field Definition",
      "file": "force-app/main/default/objects/Opportunity/fields/StageName.field-meta.xml",
      "line": 1,
      "message": "StageName is a standard picklist field on Opportunity and should not be defined as a custom picklist. Remove this custom field definition and ensure the standard StageName field is present and visible on the layout.",
      "fixable": true
    },
    {
      "severity": "critical",
      "category": "Validation Rule",
      "file": "force-app/main/default/objects/Opportunity/validationRules/Closed_Won_Requires_CloseDate_And_Amount.validationRule-meta.xml",
      "line": 1,
      "message": "Validation rule formula and error message do not match requirements. The formula references unrelated fields (Customer_Tier__c, AnnualRevenue) and does not enforce the requirement for CloseDate and Amount when StageName is 'Closed Won'. Update the formula to: AND(ISPICKVAL(StageName, 'Closed Won'), OR(ISBLANK(CloseDate), Amount <= 0)). Update the error message to: 'For a Closed Won Opportunity, Close Date is required and Amount must be greater than $0.'",
      "fixable": true
    },
    {
      "severity": "medium",
      "category": "Permission Set",
      "file": "force-app/main/default/permissionsets/Opportunity_Create_Edit_Access.permissionset-meta.xml",
      "line": 1,
      "message": "Permission set does not specify object or field-level permissions. Add explicit create and edit permissions for the Opportunity object and ensure required fields are visible and editable.",
      "fixable": true
    }
  ],
  "summary": "The generated metadata incorrectly defines standard Opportunity fields (AccountId, Amount, CloseDate, Name, StageName) as custom picklists instead of referencing the standard fields. The validation rule does not implement the required logic or error message. The permission set lacks explicit object and field permissions. These issues must be addressed to meet requirements and Salesforce best practices.",
  "static_analysis_status": "passed",
  "notes": "Standard fields on Opportunity (Name, AccountId, StageName, CloseDate, Amount) should not be redefined as custom fields. Validation rule must match the business logic. Permission set should grant explicit access."
}