{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://finance.entelekron.org/schemas/bank-payment-control-profile.schema.json",
  "title": "Verified bank payment control profile",
  "type": "object",
  "additionalProperties": false,
  "required": ["$schema", "schemaVersion", "controlPlaneId", "canonicalAssetId", "profileId", "status", "effectiveAt", "acceptedEnvironments", "productionInstructionEndpoint", "productionProviderCallbackEndpoint", "approvedBankingProviders", "supportedRails", "supportedCurrencies", "activeBeneficiaryCount", "activePaymentInstructionCount", "scopeBoundary", "requiredBindings", "beneficiarySafety", "preflightDecision", "transactionControls", "stateMachine", "privacy", "exceptions", "authority", "notice"],
  "properties": {
    "$schema": {"const": "https://finance.entelekron.org/schemas/bank-payment-control-profile.schema.json"},
    "schemaVersion": {"type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"},
    "controlPlaneId": {"const": "tvk-group:entelekron-financial-infrastructure"},
    "canonicalAssetId": {"const": "tvk-group:tvkusd"},
    "profileId": {"type": "string", "minLength": 1},
    "status": {"const": "prelaunch-locked"},
    "effectiveAt": {"type": "string", "format": "date-time"},
    "acceptedEnvironments": {"type": "array", "maxItems": 0},
    "productionInstructionEndpoint": {"type": "null"},
    "productionProviderCallbackEndpoint": {"type": "null"},
    "approvedBankingProviders": {"type": "array", "maxItems": 0},
    "supportedRails": {"type": "array", "maxItems": 0},
    "supportedCurrencies": {"type": "array", "maxItems": 0},
    "activeBeneficiaryCount": {"const": 0},
    "activePaymentInstructionCount": {"const": 0},
    "scopeBoundary": {"$ref": "#/$defs/falseControls"},
    "requiredBindings": {"type": "array", "minItems": 26, "maxItems": 26, "uniqueItems": true, "items": {"type": "string", "minLength": 1}},
    "beneficiarySafety": {
      "type": "object", "additionalProperties": false,
      "required": ["verifiedOwnershipEvidenceRequired", "accountNameMatchRequired", "closeMatchRequiresManualReview", "noMatchDenied", "unavailableMatchDenied", "beneficiaryChangeCoolingOffRequired", "minimumCoolingOffSeconds", "independentOutOfBandConfirmationRequired", "recycledAccountRiskCheckRequired", "trustedBeneficiaryMayBypassCurrentChecks"],
      "properties": {
        "verifiedOwnershipEvidenceRequired": {"const": true}, "accountNameMatchRequired": {"const": true}, "closeMatchRequiresManualReview": {"const": true}, "noMatchDenied": {"const": true}, "unavailableMatchDenied": {"const": true}, "beneficiaryChangeCoolingOffRequired": {"const": true}, "minimumCoolingOffSeconds": {"type": "integer", "minimum": 86400}, "independentOutOfBandConfirmationRequired": {"const": true}, "recycledAccountRiskCheckRequired": {"const": true}, "trustedBeneficiaryMayBypassCurrentChecks": {"const": false}
      }
    },
    "preflightDecision": {"$ref": "#/$defs/booleanControls"},
    "transactionControls": {
      "type": "object", "additionalProperties": false,
      "required": ["screeningAtInstructionCreationRequired", "screeningRefreshBeforeReleaseRequired", "fraudRiskDecisionRequired", "deviceAndSessionRiskRequired", "stepUpAuthenticationRequired", "independentApprovalRequired", "amountLimitDecisionRequired", "velocityLimitDecisionRequired", "sourceOfFundsDecisionRequired", "purposeCodeRequired", "idempotencyRequired", "singleUseNonceRequired", "maximumAuthorizationLifetimeSeconds", "amountCurrencyAndBeneficiaryImmutableAfterApproval", "providerFinalityBeforeLedgerCompletion", "reconciliationBeforeSuccess", "automaticRetryMayDuplicateValueMovement"],
      "properties": {
        "screeningAtInstructionCreationRequired": {"const": true}, "screeningRefreshBeforeReleaseRequired": {"const": true}, "fraudRiskDecisionRequired": {"const": true}, "deviceAndSessionRiskRequired": {"const": true}, "stepUpAuthenticationRequired": {"const": true}, "independentApprovalRequired": {"const": true}, "amountLimitDecisionRequired": {"const": true}, "velocityLimitDecisionRequired": {"const": true}, "sourceOfFundsDecisionRequired": {"const": true}, "purposeCodeRequired": {"const": true}, "idempotencyRequired": {"const": true}, "singleUseNonceRequired": {"const": true}, "maximumAuthorizationLifetimeSeconds": {"type": "integer", "minimum": 1, "maximum": 300}, "amountCurrencyAndBeneficiaryImmutableAfterApproval": {"const": true}, "providerFinalityBeforeLedgerCompletion": {"const": true}, "reconciliationBeforeSuccess": {"const": true}, "automaticRetryMayDuplicateValueMovement": {"const": false}
      }
    },
    "stateMachine": {
      "type": "object", "additionalProperties": false,
      "required": ["currentOperationalState", "definedStates", "terminalSuccessState", "exceptionStates"],
      "properties": {
        "currentOperationalState": {"const": "disabled"}, "definedStates": {"type": "array", "minItems": 13, "uniqueItems": true, "items": {"type": "string"}}, "terminalSuccessState": {"const": "reconciled"}, "exceptionStates": {"type": "array", "minItems": 4, "uniqueItems": true, "items": {"type": "string"}}
      }
    },
    "privacy": {"$ref": "#/$defs/booleanControls"},
    "exceptions": {"$ref": "#/$defs/booleanControls"},
    "authority": {"$ref": "#/$defs/falseControls"},
    "notice": {"type": "string", "minLength": 1}
  },
  "$defs": {
    "booleanControls": {"type": "object", "minProperties": 1, "additionalProperties": {"type": "boolean"}},
    "falseControls": {"type": "object", "minProperties": 1, "additionalProperties": {"const": false}}
  }
}
