{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/api-evangelist/jack-henry/json-schema/jxchange-customer-schema.json",
  "title": "jXchange Customer",
  "type": "object",
  "required": ["customerId", "firstName", "lastName"],
  "properties": {
    "customerId": { "type": "string" },
    "firstName": { "type": "string" },
    "lastName": { "type": "string" },
    "ssnLast4": { "type": "string", "pattern": "^[0-9]{4}$" },
    "dateOfBirth": { "type": "string", "format": "date" },
    "primaryAddress": {
      "type": "object",
      "properties": {
        "line1": { "type": "string" },
        "line2": { "type": "string" },
        "city": { "type": "string" },
        "state": { "type": "string", "pattern": "^[A-Z]{2}$" },
        "postalCode": { "type": "string" }
      }
    },
    "primaryPhone": { "type": "string" },
    "primaryEmail": { "type": "string", "format": "email" },
    "relationshipOpenDate": { "type": "string", "format": "date" }
  }
}
