{
  "id": "LC-FRESH-ORG-OPP",
  "name": "Fresh-org Lead Convert creates Opportunity with schema StageName + seeded CloseDate",
  "description": "Phase-1-Part-A regression: the default-application pipeline (stages 2/3/5) must produce a valid Opportunity on a fresh greenfield org with no user-supplied StageName or CloseDate. Before the fix, the Std_ConvertLead flow wrote StageName=nil (unresolved _defaults ref), which blocked schema-DefaultValue from filling it at applyDefaults (!exists gate). CloseDate was never injected at all, and Opportunity.CloseDate is required in standard metadata. Result: doNotCreateOpportunity=false 400-ed on a fresh org. This case proves the new pipeline: layer 5 schema DefaultValue fills StageName='Prospecting'; layer 3 _System_ActionFieldDefault row fills CloseDate='TODAY()+30'. The flow JSON references neither — both are engine-applied.",
  "object": "LeadConvert",
  "method": "POST",
  "endpoint": "/services/data/v63.0/actions/standard/convertLead",
  "payload": {
    "inputs": [
      {
        "leadId": "{seed_Lead_0}",
        "convertedStatus": "Converted",
        "opportunityName": "Fresh-Org Opportunity"
      }
    ]
  },
  "expects": {
    "status_code": 200
  },
  "extract": {
    "opportunity_id": "0.outputValues.opportunityId"
  },
  "query_after": {
    "object": "Opportunity",
    "record_id": "{opportunity_id}",
    "assertions": [
      {"field": "Name", "operator": "eq", "value": "Fresh-Org Opportunity"},
      {"field": "StageName", "operator": "eq", "value": "Prospecting"},
      {"field": "CloseDate", "operator": "is_not_null"}
    ]
  },
  "priority": "P0",
  "scene": "lead_convert"
}
