{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "urn:sbv:iso20022:camt.054.001.10",
  "title": "BankToCustomerDebitCreditNotification — camt.054.001.10 (SBV profile)",
  "description": "ISO 20022 camt.054.001.10: Thông báo ghi nợ/có tài khoản",
  "type": "object",
  "required": ["Document"],
  "properties": {
    "Document": {
      "type": "object",
      "required": ["BkToCstmrDbtCdtNtfctn"],
      "properties": {
        "BkToCstmrDbtCdtNtfctn": {
          "type": "object",
          "required": ["GrpHdr", "Ntfctn"],
          "properties": {
            "GrpHdr": {
              "type": "object",
              "required": ["MsgId", "CreDtTm"],
              "properties": {
                "MsgId":   { "type": "string", "maxLength": 35 },
                "CreDtTm": { "type": "string", "format": "date-time" }
              }
            },
            "Ntfctn": {
              "type": "array",
              "minItems": 1,
              "items": {
                "type": "object",
                "required": ["Id", "Acct"],
                "properties": {
                  "Id":   { "type": "string", "maxLength": 35 },
                  "Acct": { "type": "object", "required": ["Id"], "properties": { "Id": { "type": "object" } } },
                  "Ntry": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": ["Amt", "CdtDbtInd", "Sts"],
                      "properties": {
                        "Amt":       { "type": "object", "required": ["_","$"], "properties": { "_": { "type": "string" }, "$": { "type": "object", "properties": { "Ccy": { "type": "string" } } } } },
                        "CdtDbtInd": { "type": "string", "enum": ["CRDT","DBIT"] },
                        "Sts":       { "type": "object", "properties": { "Cd": { "type": "string", "enum": ["BOOK","PDNG","INFO"] } } },
                        "BookgDt":   { "type": "object", "properties": { "Dt": { "type": "string", "format": "date" } } }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
