{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/memo-bank/main/json-schema/memo-bank-create-account-assessment-schema.json",
  "title": "CreateAccountAssessment",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/memo-bank-account-assessments-api-openapi.yml#/components/schemas/CreateAccountAssessment",
  "required": [
    "iban"
  ],
  "type": "object",
  "properties": {
    "iban": {
      "pattern": "^[A-Z]{2}[0-9]{2}[a-zA-Z0-9]{1,30}$",
      "type": "string",
      "description": "IBAN of the account to assess."
    },
    "identifications": {
      "type": "array",
      "description": "List of identifications to match against the account.",
      "items": {
        "$ref": "#/$defs/Identification"
      },
      "default": []
    }
  },
  "$defs": {
    "Identification": {
      "type": "object",
      "oneOf": [
        {
          "$ref": "#/$defs/NameIdentification"
        },
        {
          "$ref": "#/$defs/SirenIdentification"
        },
        {
          "$ref": "#/$defs/LeiIdentification"
        }
      ]
    },
    "IdentificationDiscriminator": {
      "required": [
        "type"
      ],
      "type": "object",
      "properties": {
        "value": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "description": "Type of identification to match.",
          "enum": [
            "name",
            "siren",
            "lei"
          ]
        }
      }
    },
    "LeiIdentification": {
      "required": [
        "type",
        "value"
      ],
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/IdentificationDiscriminator"
        },
        {
          "type": "object",
          "properties": {
            "value": {
              "pattern": "^[0-9A-Z]{18}[0-9]{2}$",
              "type": "string",
              "description": "LEI to match."
            }
          }
        }
      ]
    },
    "NameIdentification": {
      "required": [
        "type",
        "value"
      ],
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/IdentificationDiscriminator"
        },
        {
          "type": "object",
          "properties": {
            "value": {
              "maxLength": 140,
              "minLength": 1,
              "type": "string",
              "description": "Name to match."
            }
          }
        }
      ]
    },
    "SirenIdentification": {
      "required": [
        "type",
        "value"
      ],
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/IdentificationDiscriminator"
        },
        {
          "type": "object",
          "properties": {
            "value": {
              "pattern": "^\\d{9}$",
              "type": "string",
              "description": "SIREN to match."
            }
          }
        }
      ]
    }
  }
}