{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/opencrvs-org/json-schema/opencrvs-org-event-index-schema.json",
  "title": "EventIndex",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/events-openapi.yml#/components/schemas/EventIndex",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "type": {
      "type": "string",
      "description": "The type of event, such as birth, death, or marriage."
    },
    "status": {
      "type": "string",
      "enum": [
        "CREATED",
        "NOTIFIED",
        "DECLARED",
        "REGISTERED",
        "ARCHIVED"
      ]
    },
    "legalStatuses": {
      "type": "object",
      "properties": {
        "DECLARED": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "createdAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
                  "description": "The timestamp when the action request was created."
                },
                "createdBy": {
                  "type": "string",
                  "description": "ID of the user who created the action request."
                },
                "createdAtLocation": {
                  "description": "Location of the user who created the action request.",
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "createdByUserType": {
                  "description": "Whether the user is a normal user or a system.",
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "user",
                        "system"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "acceptedAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
                  "description": "Timestamp when the action request was accepted."
                },
                "createdByRole": {
                  "description": "Role of the user at the time of action request creation.",
                  "type": "string"
                }
              },
              "required": [
                "createdAt",
                "createdBy",
                "acceptedAt"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "REGISTERED": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "createdAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
                  "description": "The timestamp when the action request was created."
                },
                "createdBy": {
                  "type": "string",
                  "description": "ID of the user who created the action request."
                },
                "createdAtLocation": {
                  "description": "Location of the user who created the action request.",
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "createdByUserType": {
                  "description": "Whether the user is a normal user or a system.",
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "user",
                        "system"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "acceptedAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
                  "description": "Timestamp when the action request was accepted."
                },
                "createdByRole": {
                  "description": "Role of the user at the time of action request creation.",
                  "type": "string"
                },
                "registrationNumber": {
                  "type": "string",
                  "description": "Registration number of the event. Always present for accepted registrations."
                }
              },
              "required": [
                "createdAt",
                "createdBy",
                "acceptedAt",
                "registrationNumber"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false,
      "description": "Metadata related to the legal registration of the event, such as who registered it and when."
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
      "description": "The timestamp when the event was first created and saved."
    },
    "dateOfEvent": {
      "anyOf": [
        {
          "type": "string",
          "format": "date",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
        },
        {
          "type": "null"
        }
      ]
    },
    "placeOfEvent": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        {
          "type": "null"
        }
      ]
    },
    "createdBy": {
      "type": "string",
      "description": "ID of the user who created the event."
    },
    "createdByUserType": {
      "description": "Whether the user is a normal user or a system.",
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "user",
            "system"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "updatedByUserRole": {
      "description": "Role of the user who last changed the status.",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "createdAtLocation": {
      "description": "Location of the user who created the event.",
      "anyOf": [
        {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        {
          "type": "null"
        }
      ]
    },
    "updatedAtLocation": {
      "description": "Location of the user who last changed the status.",
      "anyOf": [
        {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        {
          "type": "null"
        }
      ]
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
      "description": "Timestamp of the most recent *accepted* status change. Possibly 3rd party update, if action is validation asynchronously."
    },
    "assignedTo": {
      "description": "ID of the user currently assigned to the event.",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "updatedBy": {
      "description": "ID of the user who last changed the status.",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "trackingId": {
      "type": "string",
      "description": "System-generated tracking ID used by informants or registrars to look up the event."
    },
    "potentialDuplicates": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "trackingId": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "trackingId"
        ],
        "additionalProperties": false
      },
      "description": "List of event IDs and their tracking IDs that this event could be a duplicate of."
    },
    "flags": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(delete|create|notify|declare|register|edit|duplicate_detected|reject|mark_as_duplicate|mark_as_not_duplicate|archive|print_certificate|request_correction|reject_correction|approve_correction|read|assign|unassign|custom):(requested|accepted|rejected)$"
              },
              {
                "type": "string",
                "enum": [
                  "incomplete",
                  "rejected",
                  "correction-requested",
                  "potential-duplicate",
                  "edit-in-progress"
                ]
              }
            ]
          },
          {
            "type": "string",
            "description": "Custom flag identifier defined by the country config."
          }
        ]
      }
    },
    "declaration": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "anyOf": [
          {
            "anyOf": [
              {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "country": {
                        "type": "string"
                      },
                      "streetLevelDetails": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {
                          "type": "string"
                        }
                      },
                      "addressType": {
                        "type": "string",
                        "const": "DOMESTIC"
                      },
                      "administrativeArea": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      }
                    },
                    "required": [
                      "country",
                      "addressType",
                      "administrativeArea"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "country": {
                        "type": "string"
                      },
                      "streetLevelDetails": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {
                          "type": "string"
                        }
                      },
                      "addressType": {
                        "type": "string",
                        "const": "INTERNATIONAL"
                      }
                    },
                    "required": [
                      "country",
                      "addressType"
                    ],
                    "additionalProperties": false
                  }
                ],
                "type": "object"
              },
              {
                "type": "string"
              },
              {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                "description": "Date in the format YYYY-MM-DD"
              },
              {
                "type": "object",
                "properties": {
                  "age": {
                    "type": "number"
                  },
                  "asOfDateRef": {
                    "type": "string"
                  }
                },
                "required": [
                  "age",
                  "asOfDateRef"
                ],
                "additionalProperties": false
              },
              {
                "type": "string",
                "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
              },
              {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "start": {
                        "type": "string",
                        "format": "date",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                        "description": "Date in the format YYYY-MM-DD"
                      },
                      "end": {
                        "type": "string",
                        "format": "date",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                        "description": "Date in the format YYYY-MM-DD"
                      }
                    },
                    "required": [
                      "start",
                      "end"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "string",
                    "format": "date",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                    "description": "Date in the format YYYY-MM-DD"
                  }
                ],
                "description": "Date range with start and end dates in the format YYYY-MM-DD. Inclusive start, exclusive end."
              },
              {
                "type": "string",
                "enum": [
                  "last7Days",
                  "last30Days",
                  "last90Days",
                  "last365Days"
                ]
              },
              {
                "type": "boolean"
              },
              {
                "type": "number"
              },
              {
                "type": "object",
                "properties": {
                  "path": {
                    "type": "string",
                    "description": "A relative path within the S3 bucket, never starting with /. e.g. document-id.jpg or directory/document-id.jpg. The document service constructs the full /bucket/path internally."
                  },
                  "originalFilename": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  }
                },
                "required": [
                  "path",
                  "originalFilename",
                  "type"
                ],
                "additionalProperties": false
              },
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "path": {
                      "type": "string",
                      "description": "A relative path within the S3 bucket, never starting with /. e.g. document-id.jpg or directory/document-id.jpg. The document service constructs the full /bucket/path internally."
                    },
                    "originalFilename": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "option": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "path",
                    "originalFilename",
                    "type",
                    "option"
                  ],
                  "additionalProperties": false
                }
              },
              {
                "type": "object",
                "properties": {
                  "firstname": {
                    "type": "string"
                  },
                  "surname": {
                    "type": "string"
                  },
                  "middlename": {
                    "type": "string"
                  }
                },
                "required": [
                  "firstname",
                  "surname"
                ],
                "additionalProperties": false
              },
              {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "firstname": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "surname": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "middlename": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  {
                    "not": {}
                  }
                ]
              },
              {
                "type": "number"
              },
              {
                "type": "object",
                "properties": {
                  "loading": {
                    "type": "boolean"
                  },
                  "error": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "statusCode": {
                            "type": "number"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "statusCode",
                          "message"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "data": {}
                },
                "required": [
                  "loading",
                  "data"
                ],
                "additionalProperties": false
              },
              {
                "type": "string",
                "enum": [
                  "verified",
                  "authenticated",
                  "failed",
                  "pending"
                ]
              },
              {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "data": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {
                          "type": "string"
                        }
                      },
                      "updatedAt": {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                      }
                    },
                    "required": [
                      "data",
                      "updatedAt"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "object",
                "properties": {
                  "data": {}
                },
                "required": [
                  "data"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "data": {}
                },
                "required": [
                  "data"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "numericValue": {
                    "type": "number"
                  },
                  "unit": {
                    "type": "string"
                  }
                },
                "required": [
                  "numericValue",
                  "unit"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "numericValue": {
                    "type": "number"
                  },
                  "unit": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              },
              {},
              {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "value": {
                    "type": "string"
                  }
                },
                "required": [
                  "label",
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "label": {
                        "type": "string"
                      },
                      "value": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "label",
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            ]
          },
          {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "country": {
                                  "type": "string"
                                },
                                "streetLevelDetails": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                },
                                "addressType": {
                                  "type": "string",
                                  "const": "DOMESTIC"
                                },
                                "administrativeArea": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                                }
                              },
                              "required": [
                                "country",
                                "addressType",
                                "administrativeArea"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "country": {
                                  "type": "string"
                                },
                                "streetLevelDetails": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                },
                                "addressType": {
                                  "type": "string",
                                  "const": "INTERNATIONAL"
                                }
                              },
                              "required": [
                                "country",
                                "addressType"
                              ],
                              "additionalProperties": false
                            }
                          ],
                          "type": "object"
                        },
                        {
                          "type": "string"
                        },
                        {
                          "type": "string",
                          "format": "date",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                          "description": "Date in the format YYYY-MM-DD"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "age": {
                              "type": "number"
                            },
                            "asOfDateRef": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "age",
                            "asOfDateRef"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "string",
                          "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
                        },
                        {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "start": {
                                  "type": "string",
                                  "format": "date",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                                  "description": "Date in the format YYYY-MM-DD"
                                },
                                "end": {
                                  "type": "string",
                                  "format": "date",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                                  "description": "Date in the format YYYY-MM-DD"
                                }
                              },
                              "required": [
                                "start",
                                "end"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "string",
                              "format": "date",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                              "description": "Date in the format YYYY-MM-DD"
                            }
                          ],
                          "description": "Date range with start and end dates in the format YYYY-MM-DD. Inclusive start, exclusive end."
                        },
                        {
                          "type": "string",
                          "enum": [
                            "last7Days",
                            "last30Days",
                            "last90Days",
                            "last365Days"
                          ]
                        },
                        {
                          "type": "boolean"
                        },
                        {
                          "type": "number"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "path": {
                              "type": "string",
                              "description": "A relative path within the S3 bucket, never starting with /. e.g. document-id.jpg or directory/document-id.jpg. The document service constructs the full /bucket/path internally."
                            },
                            "originalFilename": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "path",
                            "originalFilename",
                            "type"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string",
                                "description": "A relative path within the S3 bucket, never starting with /. e.g. document-id.jpg or directory/document-id.jpg. The document service constructs the full /bucket/path internally."
                              },
                              "originalFilename": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string"
                              },
                              "option": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "originalFilename",
                              "type",
                              "option"
                            ],
                            "additionalProperties": false
                          }
                        },
                        {
                          "type": "object",
                          "properties": {
                            "firstname": {
                              "type": "string"
                            },
                            "surname": {
                              "type": "string"
                            },
                            "middlename": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "firstname",
                            "surname"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "anyOf": [
                            {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "firstname": {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "surname": {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "middlename": {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            {
                              "not": {}
                            }
                          ]
                        },
                        {
                          "type": "number"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "loading": {
                              "type": "boolean"
                            },
                            "error": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "statusCode": {
                                      "type": "number"
                                    },
                                    "message": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "statusCode",
                                    "message"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "data": {}
                          },
                          "required": [
                            "loading",
                            "data"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "string",
                          "enum": [
                            "verified",
                            "authenticated",
                            "failed",
                            "pending"
                          ]
                        },
                        {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "data": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                }
                              },
                              "required": [
                                "data",
                                "updatedAt"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "data": {}
                          },
                          "required": [
                            "data"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "data": {}
                          },
                          "required": [
                            "data"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "numericValue": {
                              "type": "number"
                            },
                            "unit": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "numericValue",
                            "unit"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "numericValue": {
                              "type": "number"
                            },
                            "unit": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": false
                        },
                        {},
                        {
                          "type": "object",
                          "properties": {
                            "label": {
                              "type": "string"
                            },
                            "value": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "label",
                            "value"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "label": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "label",
                                "value"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      ]
                    }
                  }
                },
                "required": [
                  "data"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "anyOf": [
                {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "country": {
                          "type": "string"
                        },
                        "streetLevelDetails": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {
                            "type": "string"
                          }
                        },
                        "addressType": {
                          "type": "string",
                          "const": "DOMESTIC"
                        },
                        "administrativeArea": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        }
                      },
                      "required": [
                        "country",
                        "addressType",
                        "administrativeArea"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "country": {
                          "type": "string"
                        },
                        "streetLevelDetails": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {
                            "type": "string"
                          }
                        },
                        "addressType": {
                          "type": "string",
                          "const": "INTERNATIONAL"
                        }
                      },
                      "required": [
                        "country",
                        "addressType"
                      ],
                      "additionalProperties": false
                    }
                  ],
                  "type": "object"
                },
                {
                  "type": "string"
                },
                {
                  "type": "string",
                  "format": "date",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                  "description": "Date in the format YYYY-MM-DD"
                },
                {
                  "type": "object",
                  "properties": {
                    "age": {
                      "type": "number"
                    },
                    "asOfDateRef": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "age",
                    "asOfDateRef"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "string",
                  "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
                },
                {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "start": {
                          "type": "string",
                          "format": "date",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                          "description": "Date in the format YYYY-MM-DD"
                        },
                        "end": {
                          "type": "string",
                          "format": "date",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                          "description": "Date in the format YYYY-MM-DD"
                        }
                      },
                      "required": [
                        "start",
                        "end"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "string",
                      "format": "date",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                      "description": "Date in the format YYYY-MM-DD"
                    }
                  ],
                  "description": "Date range with start and end dates in the format YYYY-MM-DD. Inclusive start, exclusive end."
                },
                {
                  "type": "string",
                  "enum": [
                    "last7Days",
                    "last30Days",
                    "last90Days",
                    "last365Days"
                  ]
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "number"
                },
                {
                  "type": "object",
                  "properties": {
                    "path": {
                      "type": "string",
                      "description": "A relative path within the S3 bucket, never starting with /. e.g. document-id.jpg or directory/document-id.jpg. The document service constructs the full /bucket/path internally."
                    },
                    "originalFilename": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "path",
                    "originalFilename",
                    "type"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "path": {
                        "type": "string",
                        "description": "A relative path within the S3 bucket, never starting with /. e.g. document-id.jpg or directory/document-id.jpg. The document service constructs the full /bucket/path internally."
                      },
                      "originalFilename": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string"
                      },
                      "option": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "path",
                      "originalFilename",
                      "type",
                      "option"
                    ],
                    "additionalProperties": false
                  }
                },
                {
                  "type": "object",
                  "properties": {
                    "firstname": {
                      "type": "string"
                    },
                    "surname": {
                      "type": "string"
                    },
                    "middlename": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "firstname",
                    "surname"
                  ],
                  "additionalProperties": false
                },
                {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "firstname": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "surname": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "middlename": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    {
                      "not": {}
                    }
                  ]
                },
                {
                  "type": "number"
                },
                {
                  "type": "object",
                  "properties": {
                    "loading": {
                      "type": "boolean"
                    },
                    "error": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "statusCode": {
                              "type": "number"
                            },
                            "message": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "statusCode",
                            "message"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "data": {}
                  },
                  "required": [
                    "loading",
                    "data"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "string",
                  "enum": [
                    "verified",
                    "authenticated",
                    "failed",
                    "pending"
                  ]
                },
                {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {
                            "type": "string"
                          }
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        }
                      },
                      "required": [
                        "data",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "data": {}
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "data": {}
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "numericValue": {
                      "type": "number"
                    },
                    "unit": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "numericValue",
                    "unit"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "numericValue": {
                      "type": "number"
                    },
                    "unit": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                },
                {},
                {
                  "type": "object",
                  "properties": {
                    "label": {
                      "type": "string"
                    },
                    "value": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "label",
                    "value"
                  ],
                  "additionalProperties": false
                },
                {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "label": {
                          "type": "string"
                        },
                        "value": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "label",
                        "value"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              ]
            }
          }
        ]
      },
      "description": "Aggregate representation of event data after all actions have been applied, with all updates consolidated and null values removed."
    }
  },
  "required": [
    "id",
    "type",
    "status",
    "legalStatuses",
    "createdAt",
    "createdBy",
    "updatedAt",
    "trackingId",
    "potentialDuplicates",
    "flags",
    "declaration"
  ],
  "additionalProperties": false
}