{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "urn:sbv:iso20022:auth.002.001.02",
  "title": "InformationRequestResponse — auth.002.001.02 (SBV profile)",
  "description": "ISO 20022 auth.002.001.02: Phản hồi yêu cầu thông tin AML/CFT từ NHNN",
  "type": "object",
  "required": ["Document"],
  "properties": {
    "Document": {
      "type": "object",
      "required": ["InfReqRspn"],
      "properties": {
        "InfReqRspn": {
          "type": "object",
          "required": ["RspnId", "Rspn"],
          "properties": {
            "RspnId": { "type": "string", "maxLength": 35 },
            "OrgnlBizInqry": {
              "type": "object",
              "properties": {
                "InqryId": { "type": "string", "maxLength": 35 },
                "ReqdAsSpr":  { "type": "boolean" }
              }
            },
            "Rspn": {
              "type": "object",
              "required": ["Dt", "Rspndr"],
              "properties": {
                "Dt":       { "type": "string", "format": "date" },
                "Rspndr":   { "type": "object", "properties": { "FinInstnId": { "type": "object", "properties": { "BICFI": { "type": "string" } } } } },
                "Tp":       { "type": "object", "properties": { "Cd": { "type": "string" } } },
                "RspnRsn":  { "type": "object", "properties": { "Cd": { "type": "string", "maxLength": 4 } } }
              }
            },
            "ReqdData": {
              "type": "object",
              "properties": {
                "TxRpt": {
                  "type": "object",
                  "properties": {
                    "Tx": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "CdtDbtInd":  { "type": "string", "enum": ["CRDT","DBIT"] },
                          "TxId":       { "type": "string", "maxLength": 35 },
                          "UETR":       { "type": "string", "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" },
                          "SttlmDt":    { "type": "string", "format": "date" },
                          "Amt":        { "type": "object", "required": ["_","$"], "properties": { "_": { "type": "string" }, "$": { "type": "object", "properties": { "Ccy": { "type": "string" } } } } }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
