{
  "apiVersion": 56,
  "label": "Credits — Stamp Completed_Date on Lifecycle Flip",
  "description": "When Sales Ops flips Credit_Lifecycle__c to 'Completed', this before-save Flow stamps Completed_Date__c = TODAY(). Sales Ops can still override via Edit if they need to back-fill a historical completion date — Flow only fires when lifecycle changes to Completed, so a later Completed_Date edit does not re-trigger. Phase 2 candidate: when a scheduled Flow auto-flips records past Expiration_Date to Completed, this Flow stamps the same way. Zero external calls; pure local field update. See docs/object-proposals/poc-credits-refactor.md §6.",
  "processType": "AutoLaunchedFlow",
  "status": "Active",
  "start": {
    "object": "Credits__c",
    "triggerType": "RecordBeforeSave",
    "recordTriggerType": "Update",
    "filterLogic": "and",
    "filters": [
      {"field": "Credit_Lifecycle__c", "operator": "IsChanged", "value": {"booleanValue": true}},
      {"field": "Credit_Lifecycle__c", "operator": "EqualTo", "value": {"stringValue": "Completed"}}
    ],
    "connector": {"targetReference": "Stamp_Completed_Date"}
  },
  "assignments": [
    {
      "name": "Stamp_Completed_Date",
      "label": "Set Completed_Date = TODAY()",
      "locationX": 200,
      "locationY": 100,
      "assignmentItems": [
        {"assignToReference": "$Record.Completed_Date__c", "operator": "Assign", "value": {"elementReference": "$Flow.CurrentDate"}}
      ]
    }
  ]
}
