{
    "$schema": "http://json-schema.org/draft-07/schema",
    "type": "object",
    "title": "CommandReceived schema",
    "description": "The commandreceived schema comprises the command received event related information",
    "required": [
        "specversion",
        "type",
        "source",
        "subject",
        "id",
        "data"
    ],
    "properties": {
        "specversion": {
            "type": "string"
        },
        "type": {
            "type": "string"
        },
        "subject": {
            "type": "string"
        },
        "source": {
            "type": "string"
        },
        "id": {
            "type": "string"
        },
        "time": {
            "type": "string",
       		"format": "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
        },
        "correlationid": {
            "type": "string"
        },
        "serviceid": {
            "type": "string"
        },
        "channelid": {
            "type": "string"
        },
        "organizationid": {
            "type": "string"
        },
        "tenantid": {
            "type": "string"
        },
        "businesskey": {
            "type": "string"
        },
        "sequenceno": {
            "type": "integer"
        },        
        "extension-mscontext": {
            "type": "object",
            "properties": {
                "authorization": {
                    "type": "string"
                },
                "customfilterid": {
                    "type": "string"
                },
                "operationinstanceid": {
                    "type": "string"
                },
                "sequenceinstanceid": {
                    "type": "string"
                },
                "priority": {
                    "type": "integer"
                }
            }
        },
        "datacontenttype": {
            "type": "string"
        },
        "data": {
    "$schema": "http://json-schema.org/draft-07/schema",
    "type": "object",
    "title": "Command schema",
    "description": "The command schema comprises the command related information",
    "required": [
        "specversion",
        "type",
        "source",
        "subject",
        "id",
        "data"
    ],
    "properties": {
        "specversion": {
            "type": "string"
        },
        "type": {
            "type": "string"
        },
        "subject": {
            "type": "string"
        },
        "source": {
            "type": "string"
        },
        "id": {
            "type": "string"
        },
        "time": {
            "type": "string",
       		"format": "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
        },
        "correlationid": {
            "type": "string"
        },
        "serviceid": {
            "type": "string"
        },
        "channelid": {
            "type": "string"
        },
        "organizationid": {
            "type": "string"
        },
        "tenantid": {
            "type": "string"
        },
        "businesskey": {
            "type": "string"
        },
        "sequenceno": {
            "type": "integer"
        },
        "extension-mscontext": {
            "type": "object",
            "properties": {
                "authorization": {
                    "type": "string"
                },
                "customfilterid": {
                    "type": "string"
                },
                "operationinstanceid": {
                    "type": "string"
                },
                "sequenceinstanceid": {
                    "type": "string"
                },
                "priority": {
                    "type": "integer"
                }
            }
        },
        "datacontenttype": {
            "type": "string"
        },
        "data": {
  "type" : "object",
  "id" : "urn:jsonschema:com:temenos:microservice:payments:function:CreateNewPaymentOrderInput",
  "properties" : {
    "body" : {
      "type" : "object",
      "id" : "urn:jsonschema:com:temenos:microservice:payments:view:PaymentOrder",
      "properties" : {
        "fromAccount" : {
          "type" : "string"
        },
        "toAccount" : {
          "type" : "string"
        },
        "paymentReference" : {
          "type" : "string"
        },
        "paymentDetails" : {
          "type" : "string"
        },
        "currency" : {
          "type" : "string",
          "enum" : [ "USD", "INR" ]
        },
        "amount" : {
          "type" : "number"
        },
        "expires" : {
          "type" : "integer"
        },
        "fileContent" : {
          "type" : "array",
          "items" : {
            "type" : "integer"
          }
        },
        "fileReadWrite" : {
          "type" : "array",
          "items" : {
            "type" : "integer"
          }
        },
        "fileOverWrite" : {
          "type" : "boolean"
        },
        "paymentDate" : {
          "type" : "string"
        },
        "paymentMethod" : {
          "type" : "object",
          "id" : "urn:jsonschema:com:temenos:microservice:payments:view:PaymentMethod",
          "properties" : {
            "id" : {
              "type" : "integer"
            },
            "name" : {
              "type" : "string"
            },
            "extensionData" : {
              "type" : "any"
            },
            "card" : {
              "type" : "object",
              "id" : "urn:jsonschema:com:temenos:microservice:payments:view:Card",
              "properties" : {
                "cardid" : {
                  "type" : "integer"
                },
                "cardname" : {
                  "type" : "string"
                },
                "cardlimit" : {
                  "type" : "number"
                }
              }
            }
          }
        },
        "exchangeRates" : {
          "type" : "array",
          "items" : {
            "type" : "object",
            "id" : "urn:jsonschema:com:temenos:microservice:payments:view:ExchangeRate",
            "properties" : {
              "id" : {
                "type" : "integer"
              },
              "name" : {
                "type" : "string"
              },
              "value" : {
                "type" : "number"
              }
            }
          }
        },
        "payeeDetails" : {
          "type" : "object",
          "id" : "urn:jsonschema:com:temenos:microservice:payments:view:PayeeDetails",
          "properties" : {
            "payeeName" : {
              "type" : "string"
            },
            "payeeType" : {
              "type" : "string"
            }
          }
        },
        "extensionData" : {
          "type" : "any"
        },
        "descriptions" : {
          "type" : "array",
          "items" : {
            "type" : "string"
          }
        }
      }
    }
  }
}
    }
}

    }
}
