{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://fingertrackid.dev/schemas/customer-action-receipt.v1.schema.json",
  "title": "CustomerActionReceiptV1",
  "$comment": "Generated from existing feedback OpenAPI components. Do not edit; regenerate locally. Generation does not establish validator parity, publication readiness, authentication or runtime availability.",
  "x-implementation-status": "generated-not-parity-validated",
  "x-ftid-generation": {
    "generator": "../../tools/generate-feedback-schemas.ts",
    "source_document": "../openapi/feedback.v1.yaml",
    "source_component": "#/components/schemas/CustomerActionReceiptV1",
    "source_openapi_version": "3.1.0",
    "source_info_version": "1.0.0",
    "source_sha256": "a1ade5a3364cd6b940eee85f84e5426eac702c47b461118ee449735320ac0789"
  },
  "$ref": "#/$defs/CustomerActionReceiptV1",
  "$defs": {
    "CustomerActionReceiptV1": {
      "additionalProperties": false,
      "allOf": [
        {
          "else": {
            "properties": {
              "recommendation_alignment": {
                "enum": ["ALIGNED", "NOT_ALIGNED"]
              }
            }
          },
          "if": {
            "properties": {
              "action": {
                "const": "CANCELLED"
              }
            }
          },
          "then": {
            "properties": {
              "recommendation_alignment": {
                "const": "NOT_COMPARABLE"
              }
            }
          }
        }
      ],
      "properties": {
        "action": {
          "enum": ["ALLOWED", "CHALLENGED", "HELD", "REVIEWED", "BLOCKED", "CANCELLED"]
        },
        "assessment_id": {
          "$ref": "#/$defs/UuidV7"
        },
        "business_event_id": {
          "$ref": "#/$defs/UuidV7"
        },
        "customer_action_id": {
          "$ref": "#/$defs/UuidV7"
        },
        "external_action_id": {
          "$ref": "#/$defs/ExternalId"
        },
        "receipt_id": {
          "$ref": "#/$defs/UuidV7"
        },
        "received_at": {
          "$ref": "#/$defs/ServerInstant"
        },
        "recommendation_alignment": {
          "enum": ["ALIGNED", "NOT_ALIGNED", "NOT_COMPARABLE"]
        },
        "retryable": {
          "const": false
        },
        "schema_version": {
          "const": "customer-action-receipt.v1"
        }
      },
      "required": [
        "schema_version",
        "receipt_id",
        "assessment_id",
        "business_event_id",
        "received_at",
        "retryable",
        "customer_action_id",
        "external_action_id",
        "action",
        "recommendation_alignment"
      ],
      "type": "object"
    },
    "ExternalId": {
      "description": "Opaque 1..255 UTF-16 code units, NOT Unicode code points. Supplementary\nscalars count as two units. Preserve whitespace and exact spelling; reject\nNUL and unpaired surrogates. maxLength alone is insufficient for this bound.\n",
      "maxLength": 255,
      "minLength": 1,
      "type": "string",
      "x-ftid-max-utf16-code-units": 255
    },
    "ServerInstant": {
      "allOf": [
        {
          "$ref": "#/$defs/SourceInstant"
        },
        {
          "pattern": "T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\\.[0-9]{1,3})?(?:Z|[+-][0-9]{2}:[0-9]{2})$"
        }
      ]
    },
    "SourceInstant": {
      "description": "Lossless existing Instante grammar; do not normalize, truncate or add a stricter RFC date-time format",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
      "type": "string"
    },
    "UuidV7": {
      "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
      "type": "string"
    }
  }
}
