{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://kartsell.taxbaik.com/contracts/data/source-approval.v1.proposed.json",
  "title": "Governed Data Source Approval Contract",
  "description": "Proposal only. This contract does not authorize ingestion until a human approval record exists.",
  "contractVersion": "source-approval.v1-proposed",
  "status": "DESIGN_PROPOSAL",
  "automationBoundary": {
    "allowedModes": ["EVALUATION_ONLY", "PROPOSAL_ONLY", "DRILL_ONLY"],
    "forbiddenEffects": [
      "AUTO_MODEL_ACTIVATION",
      "AUTO_MODEL_PROMOTION",
      "AUTO_PARAMETER_CHANGE",
      "AUTO_ORDER",
      "KIS_SUBMISSION",
      "CLIENT_PUBLICATION"
    ]
  },
  "type": "object",
  "additionalProperties": false,
  "required": [
    "sourceId",
    "sourceVersion",
    "domain",
    "owner",
    "steward",
    "licenseReference",
    "availabilitySla",
    "freshnessSla",
    "timezone",
    "calendarId",
    "unitContract",
    "schemaContractVersion",
    "status",
    "contentHash",
    "approvedBy",
    "approvedAt"
  ],
  "properties": {
    "sourceId": {"type": "string", "minLength": 1},
    "sourceVersion": {"type": "string", "minLength": 1},
    "domain": {"type": "string", "minLength": 1},
    "owner": {"type": "string", "minLength": 1},
    "steward": {"type": "string", "minLength": 1},
    "licenseReference": {"type": "string", "minLength": 1},
    "availabilitySla": {"type": "string", "minLength": 1},
    "freshnessSla": {"type": "string", "minLength": 1},
    "timezone": {"type": "string", "minLength": 1},
    "calendarId": {"type": "string", "minLength": 1},
    "unitContract": {"type": "string", "minLength": 1},
    "schemaContractVersion": {"type": "string", "minLength": 1},
    "status": {"enum": ["CANDIDATE", "APPROVED", "SUSPENDED", "RETIRED", "QUARANTINED"]},
    "contentHash": {"type": "string", "pattern": "^[A-Fa-f0-9]{64}$"},
    "approvedBy": {"type": "string", "minLength": 1},
    "approvedAt": {"type": "string", "format": "date-time"},
    "publishedAt": {"type": "string", "format": "date-time"},
    "revision": {"type": "integer", "minimum": 1}
  },
  "allOf": [
    {
      "if": {"properties": {"status": {"const": "APPROVED"}}},
      "then": {"required": ["publishedAt", "revision"]}
    }
  ]
}
