{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "urn:sbv:iso20022:camt.057.001.08",
  "title": "NotificationToReceive — camt.057.001.08 (SBV profile)",
  "description": "ISO 20022 camt.057.001.08: Thông báo nhận tiền sắp đến",
  "type": "object",
  "required": ["Document"],
  "properties": {
    "Document": {
      "type": "object",
      "required": ["NtfctnToRcv"],
      "properties": {
        "NtfctnToRcv": {
          "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": "object",
              "required": ["Id", "Acct", "Itm"],
              "properties": {
                "Id":   { "type": "string", "maxLength": 35 },
                "Acct": { "type": "object", "required": ["Id"], "properties": { "Id": { "type": "object" } } },
                "Itm": {
                  "type": "array",
                  "minItems": 1,
                  "items": {
                    "type": "object",
                    "required": ["Id", "EndToEndId", "Amt", "XpctdValDt"],
                    "properties": {
                      "Id":           { "type": "string", "maxLength": 35 },
                      "EndToEndId":   { "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}$" },
                      "Amt":          { "type": "object", "required": ["_","$"], "properties": { "_": { "type": "string" }, "$": { "type": "object", "properties": { "Ccy": { "type": "string", "pattern": "^[A-Z]{3}$" } } } } },
                      "XpctdValDt":   { "type": "string", "format": "date" },
                      "Dbtr":         { "type": "object", "properties": { "Pty": { "type": "object", "properties": { "Nm": { "type": "string", "maxLength": 140 } } } } },
                      "DbtrAgt":      { "type": "object", "properties": { "FinInstnId": { "type": "object", "properties": { "BICFI": { "type": "string" } } } } },
                      "RmtInf":       { "type": "object", "properties": { "Ustrd": { "type": "array", "items": { "type": "string", "maxLength": 140 } } } }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
