{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "urn:sbv:iso20022:camt.052.001.10",
  "title": "BankToCustomerAccountReport — camt.052.001.10 (SBV profile)",
  "description": "ISO 20022 camt.052.001.10: Báo cáo tài khoản tức thời (intraday statement)",
  "type": "object",
  "required": ["Document"],
  "properties": {
    "Document": {
      "type": "object",
      "required": ["BkToCstmrAcctRpt"],
      "properties": {
        "BkToCstmrAcctRpt": {
          "type": "object",
          "required": ["GrpHdr", "Rpt"],
          "properties": {

            "GrpHdr": {
              "type": "object",
              "required": ["MsgId", "CreDtTm"],
              "properties": {
                "MsgId":    { "type": "string", "maxLength": 35 },
                "CreDtTm":  { "type": "string", "format": "date-time" },
                "MsgPgntn": {
                  "type": "object",
                  "properties": {
                    "PgNb":   { "type": "string", "pattern": "^[0-9]{1,5}$" },
                    "LastPgInd": { "type": "boolean" }
                  }
                }
              }
            },

            "Rpt": {
              "type": "array",
              "minItems": 1,
              "items": {
                "type": "object",
                "required": ["Id", "Acct"],
                "properties": {
                  "Id":       { "type": "string", "maxLength": 35, "description": "Report ID" },
                  "CreDtTm":  { "type": "string", "format": "date-time" },
                  "FrToDt": {
                    "type": "object",
                    "properties": {
                      "FrDtTm": { "type": "string", "format": "date-time" },
                      "ToDtTm": { "type": "string", "format": "date-time" }
                    }
                  },
                  "Acct": {
                    "type": "object",
                    "required": ["Id"],
                    "properties": {
                      "Id":   { "type": "object", "properties": { "Othr": { "type": "object", "properties": { "Id": { "type": "string" } } } } },
                      "Ccy":  { "type": "string", "pattern": "^[A-Z]{3}$" },
                      "Nm":   { "type": "string", "maxLength": 70 },
                      "Svcr": { "type": "object", "properties": { "FinInstnId": { "type": "object", "properties": { "BICFI": { "type": "string" } } } } }
                    }
                  },
                  "Bal": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": ["Tp", "Amt", "CdtDbtInd"],
                      "properties": {
                        "Tp":       { "type": "object", "properties": { "CdOrPrtry": { "type": "object", "properties": { "Cd": { "type": "string", "enum": ["OPBD","CLBD","ITBD","PRCD","FWAV"] } } } } },
                        "Amt":      { "type": "object", "properties": { "_": { "type": "string" }, "$": { "type": "object", "properties": { "Ccy": { "type": "string" } } } } },
                        "CdtDbtInd":{ "type": "string", "enum": ["CRDT","DBIT"] },
                        "Dt":       { "type": "object", "properties": { "DtTm": { "type": "string", "format": "date-time" } } }
                      }
                    }
                  },
                  "TxsSummry": {
                    "type": "object",
                    "properties": {
                      "TtlNtries":   { "type": "object", "properties": { "NbOfNtries": { "type": "string" }, "Sum": { "type": "number" } } },
                      "TtlCdtNtries":{ "type": "object", "properties": { "NbOfNtries": { "type": "string" }, "Sum": { "type": "number" } } },
                      "TtlDbtNtries":{ "type": "object", "properties": { "NbOfNtries": { "type": "string" }, "Sum": { "type": "number" } } }
                    }
                  },
                  "Ntry": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": ["Amt", "CdtDbtInd", "Sts", "BookgDt"],
                      "properties": {
                        "NtryRef":   { "type": "string", "maxLength": 35 },
                        "Amt":       { "type": "object", "properties": { "_": { "type": "string" }, "$": { "type": "object", "properties": { "Ccy": { "type": "string" } } } } },
                        "CdtDbtInd": { "type": "string", "enum": ["CRDT","DBIT"] },
                        "Sts":       { "type": "object", "properties": { "Cd": { "type": "string", "enum": ["BOOK","INFO","PDNG"] } } },
                        "BookgDt":   { "type": "object", "properties": { "DtTm": { "type": "string", "format": "date-time" } } },
                        "ValDt":     { "type": "object", "properties": { "Dt": { "type": "string", "format": "date" } } },
                        "NtryDtls":  { "type": "object", "properties": { "TxDtls": { "type": "object", "properties": { "Refs": { "type": "object", "properties": { "UETR": { "type": "string" }, "EndToEndId": { "type": "string" } } } } } } }
                      }
                    }
                  }
                }
              }
            }

          }
        }
      }
    }
  }
}
