{
  "openapi": "3.1.0",
  "info": {
    "title": "Drometra Core API",
    "version": "0.4.0"
  },
  "components": {
    "securitySchemes": {
      "accessToken": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "OIDC access token"
      }
    },
    "responses": {
      "error": {
        "description": "Response",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/errorSchema"
            }
          }
        }
      }
    },
    "schemas": {
      "approvalInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version"
        ],
        "properties": {
          "version": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "assignmentInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "routePlanId",
          "vehicleRouteId",
          "workerId",
          "serviceDate",
          "depotName",
          "vehicle"
        ],
        "properties": {
          "routePlanId": {
            "type": "string",
            "format": "uuid"
          },
          "vehicleRouteId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "workerId": {
            "type": "string",
            "format": "uuid"
          },
          "serviceDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "depotName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "vehicle": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "plate",
              "label"
            ],
            "properties": {
              "plate": {
                "type": "string",
                "minLength": 1,
                "maxLength": 12
              },
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              }
            }
          },
          "verification": {
            "$ref": "#/components/schemas/verificationPolicySchema"
          }
        }
      },
      "auditSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "tenantId",
          "actorId",
          "requestId",
          "action",
          "resourceId",
          "outcome",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "actorId": {
            "type": "string",
            "format": "uuid"
          },
          "requestId": {
            "type": "string",
            "format": "uuid"
          },
          "resourceId": {
            "type": "string",
            "format": "uuid"
          },
          "action": {
            "type": "string"
          },
          "outcome": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "bsaleAuthorizationCompleteSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "bindingSecret"
        ],
        "properties": {
          "code": {
            "type": "string",
            "pattern": "^[A-Za-z0-9._~-]{8,512}$"
          },
          "bindingSecret": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        }
      },
      "bsaleAuthorizationInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "clientCode",
          "name"
        ],
        "properties": {
          "clientCode": {
            "type": "string",
            "minLength": 3,
            "maxLength": 16
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          }
        }
      },
      "bsaleAuthorizationSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "clientCode",
          "name",
          "expiresAt",
          "bindingSecret",
          "authorizeUrl"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "clientCode": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,8}-[0-9K]$"
          },
          "name": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          },
          "bindingSecret": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "authorizeUrl": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "bsaleIssueOptionsSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "offices",
          "taxes",
          "documentTypes",
          "current"
        ],
        "properties": {
          "offices": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "name"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[1-9][0-9]{0,9}$"
                },
                "name": {
                  "type": "string",
                  "maxLength": 120
                }
              }
            }
          },
          "taxes": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "name",
                "percentage",
                "code"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[1-9][0-9]{0,9}$"
                },
                "name": {
                  "type": "string",
                  "maxLength": 120
                },
                "percentage": {
                  "type": "number"
                },
                "code": {
                  "type": "string",
                  "maxLength": 20
                }
              }
            }
          },
          "documentTypes": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "name",
                "codeSii"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[1-9][0-9]{0,9}$"
                },
                "name": {
                  "type": "string",
                  "maxLength": 120
                },
                "codeSii": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 10
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          },
          "current": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "officeId",
                  "vatTaxId",
                  "documentTypeIds"
                ],
                "properties": {
                  "officeId": {
                    "type": "string",
                    "pattern": "^[1-9][0-9]{0,9}$"
                  },
                  "vatTaxId": {
                    "type": "string",
                    "pattern": "^[1-9][0-9]{0,9}$"
                  },
                  "documentTypeIds": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "receipt",
                      "invoice",
                      "creditNote"
                    ],
                    "properties": {
                      "receipt": {
                        "type": "string",
                        "pattern": "^[1-9][0-9]{0,9}$"
                      },
                      "invoice": {
                        "type": "string",
                        "pattern": "^[1-9][0-9]{0,9}$"
                      },
                      "creditNote": {
                        "type": "string",
                        "pattern": "^[1-9][0-9]{0,9}$"
                      }
                    }
                  },
                  "dispatchStock": {
                    "type": "boolean"
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "bsaleIssueSettingsInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version",
          "officeId",
          "vatTaxId",
          "documentTypeIds"
        ],
        "properties": {
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "officeId": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,9}$"
          },
          "vatTaxId": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,9}$"
          },
          "documentTypeIds": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "receipt",
              "invoice",
              "creditNote"
            ],
            "properties": {
              "receipt": {
                "type": "string",
                "pattern": "^[1-9][0-9]{0,9}$"
              },
              "invoice": {
                "type": "string",
                "pattern": "^[1-9][0-9]{0,9}$"
              },
              "creditNote": {
                "type": "string",
                "pattern": "^[1-9][0-9]{0,9}$"
              }
            }
          },
          "dispatchStock": {
            "type": "boolean"
          }
        }
      },
      "cancelInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version"
        ],
        "properties": {
          "version": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "canonicalPageSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "nextCursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/canonicalRecordSchema"
            }
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "canonicalRecordSchema": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "connectionId",
              "externalId",
              "observationVersion",
              "mappingVersion",
              "origin",
              "causationId",
              "importedAt",
              "sku",
              "name",
              "unit",
              "parentExternalId",
              "barCode",
              "active",
              "externalVersion",
              "versionKind"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "connectionId": {
                "type": "string",
                "format": "uuid"
              },
              "externalId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 180
              },
              "observationVersion": {
                "type": "integer",
                "minimum": 1
              },
              "mappingVersion": {
                "type": "integer",
                "minimum": 1
              },
              "origin": {
                "type": "string",
                "enum": [
                  "sandbox-v1",
                  "bsale-chile-v1"
                ]
              },
              "causationId": {
                "type": "string",
                "format": "uuid"
              },
              "importedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "sku": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "unit": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 32
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "parentExternalId": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 180
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "barCode": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "active": {
                "type": "boolean"
              },
              "externalVersion": {
                "type": "string",
                "pattern": "^[1-9][0-9]{0,29}$"
              },
              "versionKind": {
                "type": "string",
                "const": "provider_monotonic"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "connectionId",
              "externalId",
              "observationVersion",
              "mappingVersion",
              "origin",
              "causationId",
              "importedAt",
              "sku",
              "name",
              "unit",
              "parentExternalId",
              "barCode",
              "active",
              "externalVersion",
              "versionKind"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "connectionId": {
                "type": "string",
                "format": "uuid"
              },
              "externalId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 180
              },
              "observationVersion": {
                "type": "integer",
                "minimum": 1
              },
              "mappingVersion": {
                "type": "integer",
                "minimum": 1
              },
              "origin": {
                "type": "string",
                "enum": [
                  "sandbox-v1",
                  "bsale-chile-v1"
                ]
              },
              "causationId": {
                "type": "string",
                "format": "uuid"
              },
              "importedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "sku": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "unit": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 32
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "parentExternalId": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 180
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "barCode": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "active": {
                "type": "boolean"
              },
              "externalVersion": {
                "type": "null"
              },
              "versionKind": {
                "type": "string",
                "const": "local_observation"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "connectionId",
              "externalId",
              "observationVersion",
              "mappingVersion",
              "origin",
              "causationId",
              "importedAt",
              "variantExternalId",
              "officeExternalId",
              "quantityPhysical",
              "quantityReserved",
              "quantityAvailable",
              "externalVersion",
              "versionKind"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "connectionId": {
                "type": "string",
                "format": "uuid"
              },
              "externalId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 180
              },
              "observationVersion": {
                "type": "integer",
                "minimum": 1
              },
              "mappingVersion": {
                "type": "integer",
                "minimum": 1
              },
              "origin": {
                "type": "string",
                "enum": [
                  "sandbox-v1",
                  "bsale-chile-v1"
                ]
              },
              "causationId": {
                "type": "string",
                "format": "uuid"
              },
              "importedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "variantExternalId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 180
              },
              "officeExternalId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 180
              },
              "quantityPhysical": {
                "type": "string",
                "pattern": "^-?(0|[1-9][0-9]{0,23})(\\.[0-9]{1,6})?$"
              },
              "quantityReserved": {
                "type": "string",
                "pattern": "^-?(0|[1-9][0-9]{0,23})(\\.[0-9]{1,6})?$"
              },
              "quantityAvailable": {
                "type": "string",
                "pattern": "^-?(0|[1-9][0-9]{0,23})(\\.[0-9]{1,6})?$"
              },
              "externalVersion": {
                "type": "string",
                "pattern": "^[1-9][0-9]{0,29}$"
              },
              "versionKind": {
                "type": "string",
                "const": "provider_monotonic"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "connectionId",
              "externalId",
              "observationVersion",
              "mappingVersion",
              "origin",
              "causationId",
              "importedAt",
              "variantExternalId",
              "officeExternalId",
              "quantityPhysical",
              "quantityReserved",
              "quantityAvailable",
              "externalVersion",
              "versionKind"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "connectionId": {
                "type": "string",
                "format": "uuid"
              },
              "externalId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 180
              },
              "observationVersion": {
                "type": "integer",
                "minimum": 1
              },
              "mappingVersion": {
                "type": "integer",
                "minimum": 1
              },
              "origin": {
                "type": "string",
                "enum": [
                  "sandbox-v1",
                  "bsale-chile-v1"
                ]
              },
              "causationId": {
                "type": "string",
                "format": "uuid"
              },
              "importedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "variantExternalId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 180
              },
              "officeExternalId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 180
              },
              "quantityPhysical": {
                "type": "string",
                "pattern": "^-?(0|[1-9][0-9]{0,23})(\\.[0-9]{1,6})?$"
              },
              "quantityReserved": {
                "type": "string",
                "pattern": "^-?(0|[1-9][0-9]{0,23})(\\.[0-9]{1,6})?$"
              },
              "quantityAvailable": {
                "type": "string",
                "pattern": "^-?(0|[1-9][0-9]{0,23})(\\.[0-9]{1,6})?$"
              },
              "externalVersion": {
                "type": "null"
              },
              "versionKind": {
                "type": "string",
                "const": "local_observation"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "connectionId",
              "externalId",
              "observationVersion",
              "mappingVersion",
              "origin",
              "causationId",
              "importedAt",
              "name",
              "taxId",
              "active",
              "contacts",
              "externalVersion",
              "versionKind"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "connectionId": {
                "type": "string",
                "format": "uuid"
              },
              "externalId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 180
              },
              "observationVersion": {
                "type": "integer",
                "minimum": 1
              },
              "mappingVersion": {
                "type": "integer",
                "minimum": 1
              },
              "origin": {
                "type": "string",
                "enum": [
                  "sandbox-v1",
                  "bsale-chile-v1"
                ]
              },
              "causationId": {
                "type": "string",
                "format": "uuid"
              },
              "importedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "taxId": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 32
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "active": {
                "type": "boolean"
              },
              "contacts": {
                "type": "array",
                "maxItems": 100,
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "externalId",
                        "name",
                        "email",
                        "phone",
                        "externalVersion",
                        "versionKind"
                      ],
                      "properties": {
                        "externalId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 180
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 120
                        },
                        "email": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 254
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "phone": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 64
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "externalVersion": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]{0,29}$"
                        },
                        "versionKind": {
                          "type": "string",
                          "const": "provider_monotonic"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "externalId",
                        "name",
                        "email",
                        "phone",
                        "externalVersion",
                        "versionKind"
                      ],
                      "properties": {
                        "externalId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 180
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 120
                        },
                        "email": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 254
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "phone": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 64
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "externalVersion": {
                          "type": "null"
                        },
                        "versionKind": {
                          "type": "string",
                          "const": "local_observation"
                        }
                      }
                    }
                  ]
                }
              },
              "externalVersion": {
                "type": "string",
                "pattern": "^[1-9][0-9]{0,29}$"
              },
              "versionKind": {
                "type": "string",
                "const": "provider_monotonic"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "connectionId",
              "externalId",
              "observationVersion",
              "mappingVersion",
              "origin",
              "causationId",
              "importedAt",
              "name",
              "taxId",
              "active",
              "contacts",
              "externalVersion",
              "versionKind"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "connectionId": {
                "type": "string",
                "format": "uuid"
              },
              "externalId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 180
              },
              "observationVersion": {
                "type": "integer",
                "minimum": 1
              },
              "mappingVersion": {
                "type": "integer",
                "minimum": 1
              },
              "origin": {
                "type": "string",
                "enum": [
                  "sandbox-v1",
                  "bsale-chile-v1"
                ]
              },
              "causationId": {
                "type": "string",
                "format": "uuid"
              },
              "importedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "taxId": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 32
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "active": {
                "type": "boolean"
              },
              "contacts": {
                "type": "array",
                "maxItems": 100,
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "externalId",
                        "name",
                        "email",
                        "phone",
                        "externalVersion",
                        "versionKind"
                      ],
                      "properties": {
                        "externalId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 180
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 120
                        },
                        "email": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 254
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "phone": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 64
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "externalVersion": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]{0,29}$"
                        },
                        "versionKind": {
                          "type": "string",
                          "const": "provider_monotonic"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "externalId",
                        "name",
                        "email",
                        "phone",
                        "externalVersion",
                        "versionKind"
                      ],
                      "properties": {
                        "externalId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 180
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 120
                        },
                        "email": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 254
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "phone": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 64
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "externalVersion": {
                          "type": "null"
                        },
                        "versionKind": {
                          "type": "string",
                          "const": "local_observation"
                        }
                      }
                    }
                  ]
                }
              },
              "externalVersion": {
                "type": "null"
              },
              "versionKind": {
                "type": "string",
                "const": "local_observation"
              }
            }
          }
        ]
      },
      "careDueSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "vehicleId",
          "label",
          "item",
          "date",
          "daysLeft",
          "status",
          "km",
          "text",
          "attention"
        ],
        "properties": {
          "vehicleId": {
            "type": "string",
            "format": "uuid"
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "item": {
            "type": "string",
            "enum": [
              "technical_review",
              "circulation_permit",
              "soap",
              "service",
              "service_km"
            ]
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "daysLeft": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "expired",
              "today",
              "soon"
            ]
          },
          "km": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "dueKm",
                  "estimatedKm",
                  "leftKm"
                ],
                "properties": {
                  "dueKm": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 2999999
                  },
                  "estimatedKm": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "leftKm": {
                    "type": "integer"
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 400
          },
          "attention": {
            "type": "boolean"
          }
        }
      },
      "careListSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "today",
          "vehicles",
          "due",
          "kmLimited",
          "rules",
          "odometerRules"
        ],
        "properties": {
          "today": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "vehicles": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/careListVehicleSchema"
            }
          },
          "due": {
            "type": "array",
            "maxItems": 5000,
            "items": {
              "$ref": "#/components/schemas/careDueSchema"
            }
          },
          "kmLimited": {
            "type": "boolean"
          },
          "rules": {
            "$ref": "#/components/schemas/careRulesSchema"
          },
          "odometerRules": {
            "$ref": "#/components/schemas/odometerRulesSchema"
          }
        }
      },
      "careListVehicleSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "vehicleId",
          "label",
          "active",
          "care",
          "version",
          "updatedAt",
          "odometer"
        ],
        "properties": {
          "vehicleId": {
            "type": "string",
            "format": "uuid"
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "active": {
            "type": "boolean"
          },
          "care": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/vehicleCareFieldsSchema"
              },
              {
                "type": "null"
              }
            ]
          },
          "version": {
            "type": "integer",
            "minimum": 0
          },
          "updatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              {
                "type": "null"
              }
            ]
          },
          "odometer": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/odometerViewSchema"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "careRulesSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version",
          "items",
          "soon",
          "today"
        ],
        "properties": {
          "version": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40
          },
          "items": {
            "type": "string"
          },
          "soon": {
            "type": "string"
          },
          "today": {
            "type": "string"
          }
        }
      },
      "conflictPageSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "nextCursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/conflictSchema"
            }
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "conflictSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "connectionId",
          "stream",
          "externalId",
          "currentVersion",
          "incomingVersion",
          "currentVersionKind",
          "incomingVersionKind",
          "currentSha256",
          "incomingSha256",
          "kind",
          "origin",
          "causationId",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "connectionId": {
            "type": "string",
            "format": "uuid"
          },
          "stream": {
            "$ref": "#/components/schemas/integrationStreamSchema"
          },
          "externalId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 180
          },
          "currentVersion": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[1-9][0-9]{0,29}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "incomingVersion": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[1-9][0-9]{0,29}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "currentVersionKind": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "provider_monotonic",
                  "local_observation"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "incomingVersionKind": {
            "type": "string",
            "enum": [
              "provider_monotonic",
              "local_observation"
            ]
          },
          "currentSha256": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "incomingSha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "same_version_different_payload",
              "stale_version",
              "canonical_key_collision"
            ]
          },
          "origin": {
            "type": "string",
            "enum": [
              "sandbox-v1",
              "bsale-chile-v1"
            ]
          },
          "causationId": {
            "type": "string",
            "format": "uuid"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          }
        }
      },
      "connectionChangeSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version",
          "active"
        ],
        "properties": {
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "active": {
            "type": "boolean"
          }
        }
      },
      "connectionInputSchema": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "name",
              "environment",
              "providerKind"
            ],
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "environment": {
                "type": "string",
                "const": "sandbox"
              },
              "providerKind": {
                "type": "string",
                "const": "sandbox-v1"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "name",
              "environment",
              "providerKind",
              "instanceKey"
            ],
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "environment": {
                "type": "string",
                "enum": [
                  "sandbox",
                  "production"
                ]
              },
              "providerKind": {
                "type": "string",
                "const": "bsale-chile-v1"
              },
              "instanceKey": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              }
            }
          }
        ]
      },
      "connectionSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "tenantId",
          "name",
          "environment",
          "providerKind",
          "instanceKey",
          "capabilities",
          "active",
          "version",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "environment": {
            "type": "string",
            "enum": [
              "sandbox",
              "production"
            ]
          },
          "providerKind": {
            "type": "string",
            "enum": [
              "sandbox-v1",
              "bsale-chile-v1"
            ]
          },
          "instanceKey": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ]
          },
          "capabilities": {
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "catalog.import",
                "stock.import",
                "crm.customers.import",
                "invoices.issue",
                "invoices.query_by_correlation",
                "invoices.idempotent_issue"
              ]
            }
          },
          "active": {
            "type": "boolean"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          },
          "needsReconnect": {
            "type": "boolean"
          }
        }
      },
      "contextSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "actorId",
          "tenantId",
          "role"
        ],
        "properties": {
          "actorId": {
            "type": "string",
            "format": "uuid"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "role": {
            "type": "string",
            "enum": [
              "viewer",
              "operator",
              "admin",
              "driver"
            ]
          }
        }
      },
      "coordinateSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "latitude",
          "longitude"
        ],
        "properties": {
          "latitude": {
            "type": "number",
            "minimum": -90,
            "maximum": 90
          },
          "longitude": {
            "type": "number",
            "minimum": -180,
            "maximum": 180
          }
        }
      },
      "customerCodeInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "type": "string",
            "pattern": "^\\d{6}$"
          }
        }
      },
      "customerCodeResultSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "valid",
          "attemptsRemaining"
        ],
        "properties": {
          "valid": {
            "type": "boolean"
          },
          "attemptsRemaining": {
            "type": "integer",
            "minimum": 0,
            "maximum": 5
          }
        }
      },
      "deliveryRegisterItemSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "stopId",
          "routeId",
          "orderId",
          "serviceDate",
          "sequence",
          "reference",
          "recipientName",
          "address",
          "workerName",
          "vehicleLabel",
          "vehiclePlate",
          "plannedArrivalAt",
          "arrivedAt",
          "outcomeAt",
          "outcome",
          "failureReason",
          "receiverName",
          "flags",
          "summary",
          "parcels",
          "assets",
          "manifestSha256"
        ],
        "properties": {
          "stopId": {
            "type": "string",
            "format": "uuid"
          },
          "routeId": {
            "type": "string",
            "format": "uuid"
          },
          "orderId": {
            "type": "string",
            "format": "uuid"
          },
          "serviceDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "sequence": {
            "type": "integer",
            "minimum": 1,
            "maximum": 50
          },
          "reference": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "recipientName": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 160
              },
              {
                "type": "null"
              }
            ]
          },
          "address": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300
          },
          "workerName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "vehicleLabel": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "vehiclePlate": {
            "type": "string",
            "minLength": 1,
            "maxLength": 12
          },
          "plannedArrivalAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              {
                "type": "null"
              }
            ]
          },
          "arrivedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              {
                "type": "null"
              }
            ]
          },
          "outcomeAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          },
          "outcome": {
            "type": "string",
            "enum": [
              "delivered",
              "failed"
            ]
          },
          "failureReason": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 60
              },
              {
                "type": "null"
              }
            ]
          },
          "receiverName": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ]
          },
          "flags": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 60
            }
          },
          "summary": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "methods",
              "closeDistanceMeters",
              "positionAccuracyMeters",
              "code",
              "note",
              "appVersion"
            ],
            "properties": {
              "methods": {
                "type": "array",
                "maxItems": 7,
                "items": {
                  "type": "string",
                  "enum": [
                    "package_scan",
                    "geofence",
                    "photo",
                    "signature",
                    "receiver_id",
                    "otp",
                    "customer_qr"
                  ]
                }
              },
              "closeDistanceMeters": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "positionAccuracyMeters": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "code": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "online",
                      "offline"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "note": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 300
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "appVersion": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          },
          "parcels": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "total",
              "delivered"
            ],
            "properties": {
              "total": {
                "type": "integer",
                "minimum": 0
              },
              "delivered": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "assets": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "assetId",
                "kind",
                "sha256",
                "capturedAt",
                "sizeBytes"
              ],
              "properties": {
                "assetId": {
                  "type": "string",
                  "format": "uuid"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "DELIVERY_PHOTO",
                    "FAILURE_PHOTO",
                    "SIGNATURE"
                  ]
                },
                "sha256": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                },
                "capturedAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "Z$"
                },
                "sizeBytes": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 8388608
                }
              }
            }
          },
          "manifestSha256": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "deliveryRegisterSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "from",
          "to",
          "rules",
          "counts",
          "items",
          "nextCursor"
        ],
        "properties": {
          "from": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "to": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "rules": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "version",
              "distance",
              "code",
              "window"
            ],
            "properties": {
              "version": {
                "type": "string",
                "minLength": 1,
                "maxLength": 40
              },
              "distance": {
                "type": "string"
              },
              "code": {
                "type": "string"
              },
              "window": {
                "type": "string"
              }
            }
          },
          "counts": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "delivered",
              "failed",
              "partial"
            ],
            "properties": {
              "delivered": {
                "type": "integer",
                "minimum": 0
              },
              "failed": {
                "type": "integer",
                "minimum": 0
              },
              "partial": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/deliveryRegisterItemSchema"
            }
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "deliverySummarySchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "period",
          "totals",
          "punctuality",
          "serviceSeconds",
          "failures",
          "days",
          "workers",
          "places",
          "rules"
        ],
        "properties": {
          "period": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "from",
              "to"
            ],
            "properties": {
              "from": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "to": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              }
            }
          },
          "totals": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "stops",
              "delivered",
              "failed",
              "pending"
            ],
            "properties": {
              "stops": {
                "type": "integer",
                "minimum": 0
              },
              "delivered": {
                "type": "integer",
                "minimum": 0
              },
              "failed": {
                "type": "integer",
                "minimum": 0
              },
              "pending": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "punctuality": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "evaluated",
              "onTime",
              "late",
              "onTimeRate"
            ],
            "properties": {
              "evaluated": {
                "type": "integer",
                "minimum": 0
              },
              "onTime": {
                "type": "integer",
                "minimum": 0
              },
              "late": {
                "type": "integer",
                "minimum": 0
              },
              "onTimeRate": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          },
          "serviceSeconds": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "measured",
              "median",
              "p90"
            ],
            "properties": {
              "measured": {
                "type": "integer",
                "minimum": 0
              },
              "median": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "p90": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          },
          "failures": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "reason",
                "count"
              ],
              "properties": {
                "reason": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 60
                },
                "count": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "days": {
            "type": "array",
            "maxItems": 62,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "date",
                "stops",
                "delivered",
                "failed",
                "pending",
                "late"
              ],
              "properties": {
                "date": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "stops": {
                  "type": "integer",
                  "minimum": 0
                },
                "delivered": {
                  "type": "integer",
                  "minimum": 0
                },
                "failed": {
                  "type": "integer",
                  "minimum": 0
                },
                "pending": {
                  "type": "integer",
                  "minimum": 0
                },
                "late": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "workers": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "workerId",
                "name",
                "stops",
                "delivered",
                "failed",
                "late"
              ],
              "properties": {
                "workerId": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "stops": {
                  "type": "integer",
                  "minimum": 0
                },
                "delivered": {
                  "type": "integer",
                  "minimum": 0
                },
                "failed": {
                  "type": "integer",
                  "minimum": 0
                },
                "late": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "places": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "locationId",
                "name",
                "lastDeliveredAt",
                "deliveries",
                "daysSinceLast",
                "usualIntervalDays",
                "overdue"
              ],
              "properties": {
                "locationId": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 160
                },
                "lastDeliveredAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "Z$"
                },
                "deliveries": {
                  "type": "integer",
                  "minimum": 0
                },
                "daysSinceLast": {
                  "type": "integer",
                  "minimum": 0
                },
                "usualIntervalDays": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "overdue": {
                  "type": "boolean"
                }
              }
            }
          },
          "rules": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "version",
              "onTime",
              "serviceTime",
              "places",
              "overdue"
            ],
            "properties": {
              "version": {
                "type": "string",
                "minLength": 1,
                "maxLength": 40
              },
              "onTime": {
                "type": "string"
              },
              "serviceTime": {
                "type": "string"
              },
              "places": {
                "type": "string"
              },
              "overdue": {
                "type": "string"
              }
            }
          }
        }
      },
      "documentChangeSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "number",
          "issuedOn",
          "expiresOn",
          "notes",
          "version"
        ],
        "properties": {
          "number": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 60
              },
              {
                "type": "null"
              }
            ]
          },
          "issuedOn": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "expiresOn": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 400
              },
              {
                "type": "null"
              }
            ]
          },
          "version": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "documentFileSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "mimeType",
          "sizeBytes",
          "sha256",
          "uploadedAt"
        ],
        "properties": {
          "mimeType": {
            "type": "string",
            "enum": [
              "application/pdf",
              "image/jpeg",
              "image/png"
            ]
          },
          "sizeBytes": {
            "type": "integer",
            "minimum": 8,
            "maximum": 10485760
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "uploadedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          }
        }
      },
      "documentHistorySchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "minItems": 1,
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/documentSchema"
            }
          }
        }
      },
      "documentInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "typeKey",
          "vehicleId",
          "workerId",
          "number",
          "issuedOn",
          "expiresOn",
          "notes",
          "replaces"
        ],
        "properties": {
          "typeKey": {
            "type": "string",
            "pattern": "^(technical_review|circulation_permit|soap|insurance|registration|driver_license|custom-[0-9a-f]{12})$"
          },
          "vehicleId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "workerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "number": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 60
              },
              {
                "type": "null"
              }
            ]
          },
          "issuedOn": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "expiresOn": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 400
              },
              {
                "type": "null"
              }
            ]
          },
          "replaces": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "documentListSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "today",
          "rules",
          "types",
          "vehicles",
          "drivers",
          "documents",
          "slots",
          "due",
          "missing",
          "blocked",
          "counts",
          "storage"
        ],
        "properties": {
          "today": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "rules": {
            "$ref": "#/components/schemas/documentRulesSchema"
          },
          "types": {
            "type": "array",
            "maxItems": 46,
            "items": {
              "$ref": "#/components/schemas/documentTypeSchema"
            }
          },
          "vehicles": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "label",
                "active"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "active": {
                  "type": "boolean"
                }
              }
            }
          },
          "drivers": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "label",
                "active"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "active": {
                  "type": "boolean"
                }
              }
            }
          },
          "documents": {
            "type": "array",
            "maxItems": 92000,
            "items": {
              "$ref": "#/components/schemas/documentSchema"
            }
          },
          "slots": {
            "type": "array",
            "maxItems": 92000,
            "items": {
              "$ref": "#/components/schemas/documentSlotSchema"
            }
          },
          "due": {
            "type": "array",
            "maxItems": 92000,
            "items": {
              "$ref": "#/components/schemas/documentSlotSchema"
            }
          },
          "missing": {
            "type": "array",
            "maxItems": 92000,
            "items": {
              "$ref": "#/components/schemas/documentSlotSchema"
            }
          },
          "blocked": {
            "type": "array",
            "maxItems": 2000,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "subject",
                "subjectId",
                "label",
                "typeKeys"
              ],
              "properties": {
                "subject": {
                  "type": "string",
                  "enum": [
                    "vehicle",
                    "driver"
                  ]
                },
                "subjectId": {
                  "type": "string",
                  "format": "uuid"
                },
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "typeKeys": {
                  "type": "array",
                  "minItems": 1,
                  "maxItems": 46,
                  "items": {
                    "type": "string",
                    "pattern": "^(technical_review|circulation_permit|soap|insurance|registration|driver_license|custom-[0-9a-f]{12})$"
                  }
                }
              }
            }
          },
          "counts": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "expired",
              "soon",
              "missing",
              "valid"
            ],
            "properties": {
              "expired": {
                "type": "integer",
                "minimum": 0
              },
              "soon": {
                "type": "integer",
                "minimum": 0
              },
              "missing": {
                "type": "integer",
                "minimum": 0
              },
              "valid": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "storage": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "usedBytes",
              "quotaBytes"
            ],
            "properties": {
              "usedBytes": {
                "type": "integer",
                "minimum": 0
              },
              "quotaBytes": {
                "type": "integer",
                "minimum": 1
              }
            }
          }
        }
      },
      "documentRemovalSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version"
        ],
        "properties": {
          "version": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "documentRulesSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version",
          "items",
          "soon",
          "missing",
          "care",
          "today"
        ],
        "properties": {
          "version": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40
          },
          "items": {
            "type": "string"
          },
          "soon": {
            "type": "string"
          },
          "missing": {
            "type": "string"
          },
          "care": {
            "type": "string"
          },
          "today": {
            "type": "string"
          }
        }
      },
      "documentSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "typeKey",
          "subject",
          "vehicleId",
          "workerId",
          "number",
          "issuedOn",
          "expiresOn",
          "notes",
          "file",
          "replacesId",
          "replacedAt",
          "removedAt",
          "version",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "typeKey": {
            "type": "string",
            "pattern": "^(technical_review|circulation_permit|soap|insurance|registration|driver_license|custom-[0-9a-f]{12})$"
          },
          "subject": {
            "type": "string",
            "enum": [
              "vehicle",
              "driver"
            ]
          },
          "vehicleId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "workerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "number": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 60
              },
              {
                "type": "null"
              }
            ]
          },
          "issuedOn": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "expiresOn": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 400
              },
              {
                "type": "null"
              }
            ]
          },
          "file": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/documentFileSchema"
              },
              {
                "type": "null"
              }
            ]
          },
          "replacesId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "replacedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              {
                "type": "null"
              }
            ]
          },
          "removedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              {
                "type": "null"
              }
            ]
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          }
        }
      },
      "documentSlotSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "subject",
          "subjectId",
          "label",
          "typeKey",
          "typeName",
          "documentId",
          "expiresOn",
          "status",
          "daysLeft",
          "hasFile",
          "blocksDispatch",
          "text"
        ],
        "properties": {
          "subject": {
            "type": "string",
            "enum": [
              "vehicle",
              "driver"
            ]
          },
          "subjectId": {
            "type": "string",
            "format": "uuid"
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "typeKey": {
            "type": "string",
            "pattern": "^(technical_review|circulation_permit|soap|insurance|registration|driver_license|custom-[0-9a-f]{12})$"
          },
          "typeName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "documentId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "expiresOn": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "expired",
              "today",
              "soon",
              "valid",
              "no_expiry",
              "no_date"
            ]
          },
          "daysLeft": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "hasFile": {
            "type": "boolean"
          },
          "blocksDispatch": {
            "type": "boolean"
          },
          "text": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 400
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "documentTypeChangeSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "blocksDispatch",
          "noticeDays",
          "renewerActorId",
          "active",
          "version"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "blocksDispatch": {
            "type": "boolean"
          },
          "noticeDays": {
            "type": "integer",
            "minimum": 1,
            "maximum": 180
          },
          "renewerActorId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "active": {
            "type": "boolean"
          },
          "version": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "documentTypeInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "subject",
          "name",
          "expires",
          "blocksDispatch",
          "noticeDays",
          "renewerActorId",
          "active"
        ],
        "properties": {
          "subject": {
            "type": "string",
            "enum": [
              "vehicle",
              "driver"
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "expires": {
            "type": "boolean"
          },
          "blocksDispatch": {
            "type": "boolean"
          },
          "noticeDays": {
            "type": "integer",
            "minimum": 1,
            "maximum": 180
          },
          "renewerActorId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "active": {
            "type": "boolean"
          }
        }
      },
      "documentTypeSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "subject",
          "name",
          "expires",
          "blocksDispatch",
          "noticeDays",
          "renewerActorId",
          "active",
          "builtin",
          "version"
        ],
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^(technical_review|circulation_permit|soap|insurance|registration|driver_license|custom-[0-9a-f]{12})$"
          },
          "subject": {
            "type": "string",
            "enum": [
              "vehicle",
              "driver"
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "expires": {
            "type": "boolean"
          },
          "blocksDispatch": {
            "type": "boolean"
          },
          "noticeDays": {
            "type": "integer",
            "minimum": 1,
            "maximum": 180
          },
          "renewerActorId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "active": {
            "type": "boolean"
          },
          "builtin": {
            "type": "boolean"
          },
          "version": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "emailForReaderSchema": {
        "type": "string",
        "minLength": 6,
        "maxLength": 254,
        "pattern": "^[a-z0-9.!#$%&'*+/=?^_`{|}~-]{1,64}@([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$",
        "description": "Completo (en minúsculas) para operator y admin; enmascarado para los demás roles: primer carácter, tres asteriscos fijos y el dominio entero, p. ej. j***@dominio.cl."
      },
      "emailMessageListSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/emailMessageSchema"
            }
          }
        }
      },
      "emailMessageSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "kind",
          "state",
          "attempts",
          "lastError",
          "createdAt",
          "sentAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "type": "string",
            "enum": [
              "recipient_verification",
              "delivery_receipt",
              "webhook_failing",
              "weekly_report",
              "after_hours_alert"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "sending",
              "sent",
              "failed",
              "suppressed",
              "expired"
            ]
          },
          "attempts": {
            "type": "integer",
            "minimum": 0
          },
          "lastError": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[a-z_]{1,60}$"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "sentAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "emptyInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {}
      },
      "enrollmentInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "device"
        ],
        "properties": {
          "code": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{16,128}$"
          },
          "device": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "namespace",
              "publicKeySpki",
              "model",
              "osVersion",
              "appVersion"
            ],
            "properties": {
              "namespace": {
                "type": "string",
                "format": "uuid"
              },
              "publicKeySpki": {
                "type": "string",
                "minLength": 120,
                "maxLength": 130
              },
              "model": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "osVersion": {
                "type": "string",
                "minLength": 1,
                "maxLength": 60
              },
              "appVersion": {
                "type": "string",
                "minLength": 1,
                "maxLength": 60
              }
            }
          }
        }
      },
      "enrollmentSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "deviceId",
          "tenant"
        ],
        "properties": {
          "deviceId": {
            "type": "string",
            "format": "uuid"
          },
          "tenant": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              }
            }
          }
        }
      },
      "errorSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "error",
          "requestId"
        ],
        "properties": {
          "error": {
            "type": "string",
            "enum": [
              "invalid_request",
              "unauthorized",
              "forbidden",
              "not_found",
              "conflict",
              "cursor_expired",
              "snapshot_quota",
              "storage_quota",
              "rate_limit",
              "unavailable",
              "routing_coverage_unavailable",
              "routing_no_route",
              "routing_capability_unsupported",
              "routing_concurrency_limit",
              "routing_provider_unavailable",
              "optimization_quota",
              "optimization_concurrency_limit",
              "optimization_solver_unavailable",
              "integration_provider_authentication_failed",
              "integration_provider_instance_blocked",
              "integration_provider_permission_denied",
              "integration_provider_rate_limited",
              "integration_provider_budget_exhausted",
              "integration_provider_concurrency_limited",
              "distribution_quota",
              "geocoding_concurrency_limit",
              "geocoding_provider_unavailable",
              "field_quota",
              "capability_unavailable",
              "evidence_rejected",
              "import_rejected",
              "export_rejected",
              "vehicle_unlinked",
              "route_closed",
              "webhook_quota",
              "verification_failed",
              "notification_quota",
              "report_too_large",
              "place_quota",
              "michiva_quota",
              "michiva_unavailable"
            ]
          },
          "requestId": {
            "type": "string",
            "format": "uuid"
          },
          "reason": {
            "type": "string",
            "pattern": "^[a-z_]{1,60}$"
          }
        }
      },
      "eventAckSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "eventId",
          "duplicate"
        ],
        "properties": {
          "eventId": {
            "type": "string"
          },
          "duplicate": {
            "type": "boolean"
          }
        }
      },
      "eventEnvelopeSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "eventId",
          "occurredAt",
          "event"
        ],
        "properties": {
          "eventId": {
            "type": "string",
            "minLength": 5,
            "maxLength": 80
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          },
          "event": {
            "type": "object",
            "required": [
              "type",
              "eventId",
              "routeId",
              "occurredAtMs"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "vehicle_confirmed",
                  "load_confirmed",
                  "stop_arrived",
                  "delivery_completed",
                  "delivery_failed",
                  "parcels_returned",
                  "shift_finished"
                ]
              },
              "eventId": {
                "type": "string"
              },
              "routeId": {
                "type": "string"
              },
              "occurredAtMs": {
                "type": "integer"
              }
            }
          }
        }
      },
      "fieldRouteListSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/fieldRouteSchema"
            }
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 60
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "fieldRouteProgressListSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "serviceDate",
          "items"
        ],
        "properties": {
          "serviceDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/fieldRouteProgressSchema"
            }
          }
        }
      },
      "fieldRouteProgressSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "routeId",
          "fleetVehicleId",
          "state",
          "total",
          "delivered",
          "failed",
          "pending",
          "next"
        ],
        "properties": {
          "routeId": {
            "type": "string",
            "format": "uuid"
          },
          "fleetVehicleId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "assigned",
              "in_progress",
              "finished",
              "cancelled"
            ]
          },
          "total": {
            "type": "integer",
            "minimum": 0,
            "maximum": 50
          },
          "delivered": {
            "type": "integer",
            "minimum": 0,
            "maximum": 50
          },
          "failed": {
            "type": "integer",
            "minimum": 0,
            "maximum": 50
          },
          "pending": {
            "type": "integer",
            "minimum": 0,
            "maximum": 50
          },
          "next": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "sequence",
                  "name"
                ],
                "properties": {
                  "sequence": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 50
                  },
                  "name": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 160
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "fieldRouteSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "tenantId",
          "workerId",
          "workerName",
          "routePlanId",
          "vehicleRouteId",
          "serviceDate",
          "depotName",
          "vehicle",
          "verification",
          "state",
          "version",
          "createdAt",
          "vehicleConfirmedAt",
          "finishedAt",
          "progress",
          "stops"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "workerId": {
            "type": "string",
            "format": "uuid"
          },
          "workerName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "routePlanId": {
            "type": "string",
            "format": "uuid"
          },
          "vehicleRouteId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "serviceDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "depotName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "vehicle": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "plate",
              "label",
              "fleetVehicleId"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "plate": {
                "type": "string",
                "minLength": 1,
                "maxLength": 12
              },
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "fleetVehicleId": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          },
          "verification": {
            "$ref": "#/components/schemas/verificationPolicySchema"
          },
          "state": {
            "type": "string",
            "enum": [
              "assigned",
              "in_progress",
              "finished",
              "cancelled"
            ]
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          },
          "vehicleConfirmedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              {
                "type": "null"
              }
            ]
          },
          "finishedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              {
                "type": "null"
              }
            ]
          },
          "progress": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "total",
              "delivered",
              "failed",
              "pending"
            ],
            "properties": {
              "total": {
                "type": "integer"
              },
              "delivered": {
                "type": "integer"
              },
              "failed": {
                "type": "integer"
              },
              "pending": {
                "type": "integer"
              }
            }
          },
          "stops": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "sequence",
                "orderId",
                "reference",
                "recipientName",
                "address",
                "coordinate",
                "window",
                "state",
                "arrivedAt",
                "outcomeAt",
                "failureReason",
                "receiverName",
                "flags",
                "evidence",
                "manifestSha256",
                "parcels",
                "plannedArrivalAt",
                "plannedDepartureAt",
                "codeVerifiedAt"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "sequence": {
                  "type": "integer",
                  "minimum": 1
                },
                "orderId": {
                  "type": "string",
                  "format": "uuid"
                },
                "reference": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "recipientName": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 160
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "address": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 300
                },
                "coordinate": {
                  "$ref": "#/components/schemas/coordinateSchema"
                },
                "window": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "startsAt",
                    "endsAt"
                  ],
                  "properties": {
                    "startsAt": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    "endsAt": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    }
                  }
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "arrived",
                    "delivered",
                    "failed"
                  ]
                },
                "arrivedAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "outcomeAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "failureReason": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 60
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "receiverName": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 120
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "flags": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 60
                  }
                },
                "manifestSha256": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^[a-f0-9]{64}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "evidence": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "assetId",
                      "kind",
                      "sha256",
                      "capturedAt",
                      "sizeBytes"
                    ],
                    "properties": {
                      "assetId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "kind": {
                        "type": "string",
                        "enum": [
                          "DELIVERY_PHOTO",
                          "FAILURE_PHOTO",
                          "SIGNATURE"
                        ]
                      },
                      "sha256": {
                        "type": "string",
                        "pattern": "^[a-f0-9]{64}$"
                      },
                      "capturedAt": {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "Z$"
                      },
                      "sizeBytes": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 8388608
                      }
                    }
                  }
                },
                "parcels": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "id",
                      "code",
                      "description",
                      "loadStatus",
                      "deliveredAt",
                      "returnedAt"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "code": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 64
                      },
                      "description": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 160
                      },
                      "loadStatus": {
                        "type": "string",
                        "enum": [
                          "PENDING",
                          "LOADED",
                          "MISSING",
                          "DAMAGED"
                        ]
                      },
                      "deliveredAt": {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "Z$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "returnedAt": {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "Z$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    }
                  }
                },
                "plannedArrivalAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "plannedDepartureAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "codeVerifiedAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "fieldSettingsInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "verification",
          "version"
        ],
        "properties": {
          "displayName": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ]
          },
          "verification": {
            "$ref": "#/components/schemas/verificationPolicySchema"
          },
          "version": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "fieldSettingsSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "tenantId",
          "displayName",
          "verification",
          "version"
        ],
        "properties": {
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "displayName": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ]
          },
          "verification": {
            "$ref": "#/components/schemas/verificationPolicySchema"
          },
          "version": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "fleetLatestPositionSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "sourceId",
          "eventId",
          "vehicleId",
          "actorId",
          "sequence",
          "observedAt",
          "receivedAt",
          "latitude",
          "longitude",
          "accuracyMeters",
          "speedMetersPerSecond",
          "headingDegrees",
          "ageSeconds",
          "quality"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "sourceId": {
            "type": "string",
            "format": "uuid"
          },
          "eventId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "vehicleId": {
            "type": "string",
            "format": "uuid"
          },
          "actorId": {
            "type": "string",
            "format": "uuid"
          },
          "sequence": {
            "type": "integer",
            "minimum": 1
          },
          "observedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          },
          "receivedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          },
          "latitude": {
            "type": "number",
            "minimum": -90,
            "maximum": 90
          },
          "longitude": {
            "type": "number",
            "minimum": -180,
            "maximum": 180
          },
          "accuracyMeters": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0,
                "maximum": 100000
              },
              {
                "type": "null"
              }
            ]
          },
          "speedMetersPerSecond": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0,
                "maximum": 1000
              },
              {
                "type": "null"
              }
            ]
          },
          "headingDegrees": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0,
                "exclusiveMaximum": 360
              },
              {
                "type": "null"
              }
            ]
          },
          "ageSeconds": {
            "type": "integer",
            "minimum": 0
          },
          "quality": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "reportedAccuracyMeters"
            ],
            "properties": {
              "reportedAccuracyMeters": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 100000
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          }
        }
      },
      "fleetLiveTrackPageSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "nextAfter"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "vehicleId",
                "matched"
              ],
              "properties": {
                "vehicleId": {
                  "type": "string",
                  "format": "uuid"
                },
                "matched": {
                  "anyOf": [
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "fromPositionId",
                        "toPositionId",
                        "geometry",
                        "confidence",
                        "provenance"
                      ],
                      "properties": {
                        "fromPositionId": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "toPositionId": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "geometry": {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "type",
                            "coordinates"
                          ],
                          "properties": {
                            "type": {
                              "type": "string",
                              "const": "LineString"
                            },
                            "coordinates": {
                              "type": "array",
                              "minItems": 2,
                              "items": {
                                "type": "array",
                                "prefixItems": [
                                  {
                                    "type": "number",
                                    "minimum": -180,
                                    "maximum": 180
                                  },
                                  {
                                    "type": "number",
                                    "minimum": -90,
                                    "maximum": 90
                                  }
                                ],
                                "minItems": 2,
                                "maxItems": 2
                              },
                              "maxItems": 60
                            }
                          }
                        },
                        "confidence": {
                          "anyOf": [
                            {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "provenance": {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "kind",
                            "engine",
                            "engineVersion",
                            "graphVersion",
                            "coverage",
                            "roadNetwork",
                            "method"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "enum": [
                                "valhalla",
                                "osrm",
                                "synthetic_non_road"
                              ]
                            },
                            "engine": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 80
                            },
                            "engineVersion": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 120
                            },
                            "graphVersion": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 160
                            },
                            "coverage": {
                              "type": "object",
                              "additionalProperties": false,
                              "required": [
                                "id",
                                "status"
                              ],
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 160
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "covered",
                                    "synthetic"
                                  ]
                                }
                              }
                            },
                            "roadNetwork": {
                              "type": "boolean"
                            },
                            "method": {
                              "type": "string",
                              "enum": [
                                "match",
                                "route"
                              ]
                            }
                          }
                        }
                      }
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          },
          "nextAfter": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "fleetPositionInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "sourceId",
          "eventId",
          "vehicleId",
          "observedAt",
          "latitude",
          "longitude"
        ],
        "properties": {
          "sourceId": {
            "type": "string",
            "format": "uuid"
          },
          "eventId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "vehicleId": {
            "type": "string",
            "format": "uuid"
          },
          "observedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          },
          "latitude": {
            "type": "number",
            "minimum": -90,
            "maximum": 90
          },
          "longitude": {
            "type": "number",
            "minimum": -180,
            "maximum": 180
          },
          "accuracyMeters": {
            "type": "number",
            "minimum": 0,
            "maximum": 100000
          },
          "speedMetersPerSecond": {
            "type": "number",
            "minimum": 0,
            "maximum": 1000
          },
          "headingDegrees": {
            "type": "number",
            "minimum": 0,
            "exclusiveMaximum": 360
          }
        }
      },
      "fleetPositionPageSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "watermark",
          "nextCursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/fleetPositionSchema"
            }
          },
          "watermark": {
            "type": "integer",
            "minimum": 0
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "fleetPositionSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "sourceId",
          "eventId",
          "vehicleId",
          "actorId",
          "sequence",
          "observedAt",
          "receivedAt",
          "latitude",
          "longitude",
          "accuracyMeters",
          "speedMetersPerSecond",
          "headingDegrees"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "sourceId": {
            "type": "string",
            "format": "uuid"
          },
          "eventId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "vehicleId": {
            "type": "string",
            "format": "uuid"
          },
          "actorId": {
            "type": "string",
            "format": "uuid"
          },
          "sequence": {
            "type": "integer",
            "minimum": 1
          },
          "observedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          },
          "receivedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          },
          "latitude": {
            "type": "number",
            "minimum": -90,
            "maximum": 90
          },
          "longitude": {
            "type": "number",
            "minimum": -180,
            "maximum": 180
          },
          "accuracyMeters": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0,
                "maximum": 100000
              },
              {
                "type": "null"
              }
            ]
          },
          "speedMetersPerSecond": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0,
                "maximum": 1000
              },
              {
                "type": "null"
              }
            ]
          },
          "headingDegrees": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0,
                "exclusiveMaximum": 360
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "fleetSourceChangeSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version"
        ],
        "anyOf": [
          {
            "required": [
              "name"
            ]
          },
          {
            "required": [
              "active"
            ]
          }
        ],
        "properties": {
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "active": {
            "type": "boolean"
          }
        }
      },
      "fleetSourceInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          }
        }
      },
      "fleetSourceSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "tenantId",
          "name",
          "kind",
          "active",
          "version",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "kind": {
            "type": "string",
            "enum": [
              "synthetic",
              "phone"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          }
        }
      },
      "fleetVehicleChangeSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version"
        ],
        "anyOf": [
          {
            "required": [
              "label"
            ]
          },
          {
            "required": [
              "externalReference"
            ]
          },
          {
            "required": [
              "active"
            ]
          }
        ],
        "properties": {
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "externalReference": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ]
          },
          "active": {
            "type": "boolean"
          }
        }
      },
      "fleetVehicleInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "label"
        ],
        "properties": {
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "externalReference": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "fleetVehiclePageSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "watermark",
          "nextCursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/fleetVehicleSchema"
            }
          },
          "watermark": {
            "type": "integer",
            "minimum": 0
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "fleetVehicleSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "tenantId",
          "label",
          "externalReference",
          "active",
          "version",
          "createdAt",
          "updatedAt",
          "latestPosition"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "externalReference": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ]
          },
          "active": {
            "type": "boolean"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          },
          "latestPosition": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/fleetLatestPositionSchema"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "fuelInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kmPerLiter",
          "pricePerLiter"
        ],
        "properties": {
          "kmPerLiter": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 1,
                "maximum": 50
              },
              {
                "type": "null"
              }
            ]
          },
          "pricePerLiter": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 100,
                "maximum": 5000
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "geocodeInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "text"
        ],
        "properties": {
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5,
            "default": 5
          }
        }
      },
      "geocodeResultSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "results",
          "provenance"
        ],
        "properties": {
          "results": {
            "type": "array",
            "maxItems": 5,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "label",
                "coordinate",
                "precision",
                "address"
              ],
              "properties": {
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 300
                },
                "coordinate": {
                  "$ref": "#/components/schemas/coordinateSchema"
                },
                "precision": {
                  "type": "string",
                  "enum": [
                    "address",
                    "street",
                    "area"
                  ]
                },
                "address": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "road": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 200
                    },
                    "houseNumber": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 40
                    },
                    "locality": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 120
                    },
                    "region": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 120
                    },
                    "postcode": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 20
                    }
                  }
                }
              }
            }
          },
          "provenance": {
            "$ref": "#/components/schemas/geocodingProvenanceSchema"
          }
        }
      },
      "geocodingProvenanceSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "engine",
          "engineVersion",
          "dataVersion",
          "coverage"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "const": "nominatim"
          },
          "engine": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "engineVersion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "dataVersion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "coverage": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "status"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160
              },
              "status": {
                "type": "string",
                "const": "covered"
              }
            }
          }
        }
      },
      "healthSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "ready"
            ]
          }
        }
      },
      "importBatchListSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/importBatchSummarySchema"
            }
          }
        }
      },
      "importBatchSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "tenantId",
          "kind",
          "fileName",
          "fileSha256",
          "encoding",
          "delimiter",
          "state",
          "warnings",
          "counts",
          "createdBy",
          "createdAt",
          "committedBy",
          "committedAt",
          "discardedBy",
          "discardedAt",
          "expiresAt",
          "version",
          "rows",
          "nextRow"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "type": "string",
            "const": "orders"
          },
          "fileName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "fileSha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "encoding": {
            "type": "string",
            "enum": [
              "utf-8",
              "windows-1252"
            ]
          },
          "delimiter": {
            "type": "string",
            "enum": [
              ",",
              ";"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "validated",
              "committed",
              "discarded"
            ]
          },
          "warnings": {
            "type": "array",
            "maxItems": 40,
            "items": {
              "$ref": "#/components/schemas/importIssueSchema"
            }
          },
          "counts": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "total",
              "valid",
              "needsGeocoding",
              "needsReview",
              "error",
              "duplicate",
              "excluded",
              "created",
              "skippedDuplicate"
            ],
            "properties": {
              "total": {
                "type": "integer",
                "minimum": 0,
                "maximum": 500
              },
              "valid": {
                "type": "integer",
                "minimum": 0,
                "maximum": 500
              },
              "needsGeocoding": {
                "type": "integer",
                "minimum": 0,
                "maximum": 500
              },
              "needsReview": {
                "type": "integer",
                "minimum": 0,
                "maximum": 500
              },
              "error": {
                "type": "integer",
                "minimum": 0,
                "maximum": 500
              },
              "duplicate": {
                "type": "integer",
                "minimum": 0,
                "maximum": 500
              },
              "excluded": {
                "type": "integer",
                "minimum": 0,
                "maximum": 500
              },
              "created": {
                "type": "integer",
                "minimum": 0,
                "maximum": 500
              },
              "skippedDuplicate": {
                "type": "integer",
                "minimum": 0,
                "maximum": 500
              }
            }
          },
          "createdBy": {
            "type": "string",
            "format": "uuid"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          },
          "committedBy": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "committedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              {
                "type": "null"
              }
            ]
          },
          "discardedBy": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "discardedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              {
                "type": "null"
              }
            ]
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "rows": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/importRowSchema"
            }
          },
          "nextRow": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 2,
                "maximum": 100000
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "importBatchSummarySchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "tenantId",
          "kind",
          "fileName",
          "fileSha256",
          "encoding",
          "delimiter",
          "state",
          "warnings",
          "counts",
          "createdBy",
          "createdAt",
          "committedBy",
          "committedAt",
          "discardedBy",
          "discardedAt",
          "expiresAt",
          "version"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "type": "string",
            "const": "orders"
          },
          "fileName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "fileSha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "encoding": {
            "type": "string",
            "enum": [
              "utf-8",
              "windows-1252"
            ]
          },
          "delimiter": {
            "type": "string",
            "enum": [
              ",",
              ";"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "validated",
              "committed",
              "discarded"
            ]
          },
          "warnings": {
            "type": "array",
            "maxItems": 40,
            "items": {
              "$ref": "#/components/schemas/importIssueSchema"
            }
          },
          "counts": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "total",
              "valid",
              "needsGeocoding",
              "needsReview",
              "error",
              "duplicate",
              "excluded",
              "created",
              "skippedDuplicate"
            ],
            "properties": {
              "total": {
                "type": "integer",
                "minimum": 0,
                "maximum": 500
              },
              "valid": {
                "type": "integer",
                "minimum": 0,
                "maximum": 500
              },
              "needsGeocoding": {
                "type": "integer",
                "minimum": 0,
                "maximum": 500
              },
              "needsReview": {
                "type": "integer",
                "minimum": 0,
                "maximum": 500
              },
              "error": {
                "type": "integer",
                "minimum": 0,
                "maximum": 500
              },
              "duplicate": {
                "type": "integer",
                "minimum": 0,
                "maximum": 500
              },
              "excluded": {
                "type": "integer",
                "minimum": 0,
                "maximum": 500
              },
              "created": {
                "type": "integer",
                "minimum": 0,
                "maximum": 500
              },
              "skippedDuplicate": {
                "type": "integer",
                "minimum": 0,
                "maximum": 500
              }
            }
          },
          "createdBy": {
            "type": "string",
            "format": "uuid"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          },
          "committedBy": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "committedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              {
                "type": "null"
              }
            ]
          },
          "discardedBy": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "discardedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              {
                "type": "null"
              }
            ]
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "importGeocodeInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {}
      },
      "importInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "fileName",
          "contentBase64"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "const": "orders"
          },
          "fileName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "pattern": "^[^\\u0000-\\u001f\\u007f/\\\\]+$"
          },
          "contentBase64": {
            "type": "string",
            "minLength": 4,
            "maxLength": 699052,
            "pattern": "^[A-Za-z0-9+/]*={0,2}$"
          }
        }
      },
      "importIssueSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "column",
          "severity"
        ],
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "missing_value",
              "too_long",
              "control_characters",
              "duplicate_reference_in_file",
              "reference_exists",
              "invalid_date",
              "invalid_time",
              "window_not_increasing",
              "window_time_nonexistent",
              "window_time_ambiguous",
              "invalid_integer",
              "coordinate_pair_incomplete",
              "invalid_coordinate",
              "coordinate_out_of_coverage",
              "phone_requires_recipient",
              "invalid_phone",
              "invalid_parcel_code",
              "too_many_parcels",
              "duplicate_parcel_code",
              "invalid_value",
              "geocoding_text_too_long",
              "geocoding_no_result",
              "geocoding_low_precision",
              "geocoding_ambiguous",
              "geocoding_unavailable",
              "decoded_as_windows_1252",
              "unknown_column",
              "file_already_imported"
            ]
          },
          "column": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              },
              {
                "type": "null"
              }
            ]
          },
          "severity": {
            "type": "string",
            "enum": [
              "error",
              "warning"
            ]
          }
        }
      },
      "importResolutionInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version",
          "action"
        ],
        "properties": {
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "action": {
            "type": "string",
            "enum": [
              "candidate",
              "coordinate",
              "exclude",
              "include"
            ]
          },
          "candidateIndex": {
            "type": "integer",
            "minimum": 0,
            "maximum": 4
          },
          "coordinate": {
            "$ref": "#/components/schemas/coordinateSchema"
          }
        }
      },
      "importResultSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "attemptId",
          "connectionId",
          "stream",
          "previousCursor",
          "nextCursor",
          "inserted",
          "updated",
          "duplicates",
          "conflicts",
          "completedAt"
        ],
        "properties": {
          "attemptId": {
            "type": "string",
            "format": "uuid"
          },
          "connectionId": {
            "type": "string",
            "format": "uuid"
          },
          "stream": {
            "$ref": "#/components/schemas/integrationStreamSchema"
          },
          "previousCursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "inserted": {
            "type": "integer",
            "minimum": 0
          },
          "updated": {
            "type": "integer",
            "minimum": 0
          },
          "duplicates": {
            "type": "integer",
            "minimum": 0
          },
          "conflicts": {
            "type": "integer",
            "minimum": 0
          },
          "completedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          }
        }
      },
      "importRowSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "rowNumber",
          "reference",
          "status",
          "issues",
          "location",
          "candidates",
          "existingOrderId",
          "orderId",
          "version",
          "summary"
        ],
        "properties": {
          "rowNumber": {
            "type": "integer",
            "minimum": 2,
            "maximum": 100000
          },
          "reference": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "valid",
              "needs_geocoding",
              "needs_review",
              "error",
              "duplicate",
              "excluded",
              "created",
              "skipped_duplicate"
            ]
          },
          "issues": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "$ref": "#/components/schemas/importIssueSchema"
            }
          },
          "location": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "coordinate",
                  "precision",
                  "geocoding"
                ],
                "properties": {
                  "coordinate": {
                    "$ref": "#/components/schemas/coordinateSchema"
                  },
                  "precision": {
                    "type": "string",
                    "enum": [
                      "address",
                      "street",
                      "area",
                      "manual"
                    ]
                  },
                  "geocoding": {
                    "anyOf": [
                      {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "provenance",
                          "label"
                        ],
                        "properties": {
                          "provenance": {
                            "$ref": "#/components/schemas/geocodingProvenanceSchema"
                          },
                          "label": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 300
                          }
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "candidates": {
            "anyOf": [
              {
                "type": "array",
                "maxItems": 5,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "label",
                    "coordinate",
                    "precision",
                    "address"
                  ],
                  "properties": {
                    "label": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 300
                    },
                    "coordinate": {
                      "$ref": "#/components/schemas/coordinateSchema"
                    },
                    "precision": {
                      "type": "string",
                      "enum": [
                        "address",
                        "street",
                        "area"
                      ]
                    },
                    "address": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "road": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 200
                        },
                        "houseNumber": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 40
                        },
                        "locality": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 120
                        },
                        "region": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 120
                        },
                        "postcode": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 20
                        }
                      }
                    }
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "existingOrderId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "orderId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "summary": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "locationName",
                  "address",
                  "date",
                  "window"
                ],
                "properties": {
                  "locationName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "address": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 300
                  },
                  "date": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "window": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "startsAt",
                      "endsAt"
                    ],
                    "properties": {
                      "startsAt": {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "Z$"
                      },
                      "endsAt": {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "Z$"
                      }
                    }
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "integrationStreamSchema": {
        "type": "string",
        "enum": [
          "catalog",
          "stock",
          "customers"
        ]
      },
      "invitationSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "workerId",
          "expiresAt",
          "code",
          "enrollmentUri"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "workerId": {
            "type": "string",
            "format": "uuid"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          },
          "code": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{16,128}$"
          },
          "enrollmentUri": {
            "type": "string",
            "maxLength": 2048,
            "pattern": "^dromivia://enroll\\?"
          }
        }
      },
      "invoiceIntentInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "connectionId",
          "documentKind",
          "customerId",
          "currency",
          "minorUnitScale",
          "totalMinor",
          "lines"
        ],
        "properties": {
          "connectionId": {
            "type": "string",
            "format": "uuid"
          },
          "documentKind": {
            "type": "string",
            "enum": [
              "receipt",
              "invoice",
              "credit_note"
            ]
          },
          "customerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "creditedInvoiceId": {
            "type": "string",
            "format": "uuid"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "minorUnitScale": {
            "type": "integer",
            "minimum": 0,
            "maximum": 6
          },
          "totalMinor": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]{0,18})$"
          },
          "lines": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/invoiceLineInputSchema"
            }
          }
        }
      },
      "invoiceIntentPageSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "nextCursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/invoiceIntentSchema"
            }
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "invoiceIntentSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "tenantId",
          "connectionId",
          "documentKind",
          "customerId",
          "creditedInvoiceId",
          "correlationId",
          "currency",
          "minorUnitScale",
          "totalMinor",
          "localState",
          "providerState",
          "taxState",
          "externalDocumentId",
          "providerVersion",
          "version",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "connectionId": {
            "type": "string",
            "format": "uuid"
          },
          "documentKind": {
            "type": "string",
            "enum": [
              "receipt",
              "invoice",
              "credit_note"
            ]
          },
          "customerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "creditedInvoiceId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "correlationId": {
            "type": "string",
            "format": "uuid"
          },
          "currency": {
            "type": "string"
          },
          "minorUnitScale": {
            "type": "integer"
          },
          "totalMinor": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]{0,18})$"
          },
          "localState": {
            "type": "string",
            "enum": [
              "draft",
              "reviewed",
              "approved",
              "submitting",
              "unknown",
              "provider_recorded",
              "blocked"
            ]
          },
          "providerState": {
            "type": "string",
            "enum": [
              "not_sent",
              "unknown",
              "received",
              "processing",
              "accepted",
              "rejected"
            ]
          },
          "taxState": {
            "type": "string",
            "enum": [
              "not_submitted",
              "unknown",
              "pending",
              "authorized",
              "rejected"
            ]
          },
          "externalDocumentId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "providerVersion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          }
        }
      },
      "invoiceLineInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "conceptKey",
          "description",
          "quantity",
          "unitPriceMinor",
          "lineTotalMinor"
        ],
        "properties": {
          "conceptKey": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 240
          },
          "quantity": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]{0,23})(\\.[0-9]{1,6})?$"
          },
          "unitPriceMinor": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]{0,18})$"
          },
          "lineTotalMinor": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]{0,18})$"
          },
          "catalogItemId": {
            "type": "string",
            "format": "uuid"
          },
          "creditedPosition": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          }
        }
      },
      "invoiceLinesSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "position",
                "conceptKey",
                "description",
                "quantity",
                "unitPriceMinor",
                "lineTotalMinor",
                "catalogItemId",
                "creditedPosition"
              ],
              "properties": {
                "position": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 100
                },
                "conceptKey": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "quantity": {
                  "type": "string"
                },
                "unitPriceMinor": {
                  "type": "string",
                  "pattern": "^(0|[1-9][0-9]{0,18})$"
                },
                "lineTotalMinor": {
                  "type": "string",
                  "pattern": "^(0|[1-9][0-9]{0,18})$"
                },
                "catalogItemId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "creditedPosition": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "locationInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "address",
          "coordinate",
          "precision"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "address": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300
          },
          "coordinate": {
            "$ref": "#/components/schemas/coordinateSchema"
          },
          "precision": {
            "type": "string",
            "enum": [
              "address",
              "street",
              "area",
              "manual"
            ]
          },
          "geocoding": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "provenance",
              "label"
            ],
            "properties": {
              "provenance": {
                "$ref": "#/components/schemas/geocodingProvenanceSchema"
              },
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 300
              }
            }
          }
        }
      },
      "locationListSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/locationSchema"
            }
          }
        }
      },
      "locationSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "tenantId",
          "name",
          "address",
          "coordinate",
          "precision",
          "geocoding",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "address": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300
          },
          "coordinate": {
            "$ref": "#/components/schemas/coordinateSchema"
          },
          "precision": {
            "type": "string",
            "enum": [
              "address",
              "street",
              "area",
              "manual"
            ]
          },
          "geocoding": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "provenance",
                  "label"
                ],
                "properties": {
                  "provenance": {
                    "$ref": "#/components/schemas/geocodingProvenanceSchema"
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 300
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          }
        }
      },
      "mappingInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "domain",
          "version",
          "profile",
          "rules"
        ],
        "properties": {
          "domain": {
            "$ref": "#/components/schemas/integrationStreamSchema"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "profile": {
            "type": "string",
            "enum": [
              "sandbox-v1",
              "bsale-chile-v1"
            ]
          },
          "rules": {
            "type": "object",
            "minProperties": 5,
            "maxProperties": 8,
            "additionalProperties": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          }
        }
      },
      "mappingSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "tenantId",
          "connectionId",
          "domain",
          "version",
          "profile",
          "rules",
          "active",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "connectionId": {
            "type": "string",
            "format": "uuid"
          },
          "domain": {
            "$ref": "#/components/schemas/integrationStreamSchema"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "profile": {
            "type": "string",
            "enum": [
              "sandbox-v1",
              "bsale-chile-v1"
            ]
          },
          "rules": {
            "type": "object",
            "minProperties": 5,
            "maxProperties": 8,
            "additionalProperties": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          "active": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          }
        }
      },
      "maskedPhoneSchema": {
        "type": "string",
        "minLength": 4,
        "maxLength": 16,
        "pattern": "^(?:\\+(?:[1-9][0-9]{0,2})?\\*{4,8}[0-9]{4}|\\*{4})$",
        "description": "Teléfono enmascarado: prefijo y cuatro últimos dígitos, p. ej. +569****5678; oculta al menos cuatro dígitos (+****5678 en un número de ocho) o **** si el valor guardado no es E.164."
      },
      "matrixResultSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "profile",
          "pointCount",
          "distancesMeters",
          "durationsSeconds",
          "estimated",
          "trafficIncluded",
          "provenance"
        ],
        "properties": {
          "profile": {
            "$ref": "#/components/schemas/routingProfileSchema"
          },
          "pointCount": {
            "type": "integer",
            "minimum": 2,
            "maximum": 52
          },
          "distancesMeters": {
            "type": "array",
            "minItems": 2,
            "maxItems": 52,
            "items": {
              "type": "array",
              "minItems": 2,
              "maxItems": 52,
              "items": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          },
          "durationsSeconds": {
            "type": "array",
            "minItems": 2,
            "maxItems": 52,
            "items": {
              "type": "array",
              "minItems": 2,
              "maxItems": 52,
              "items": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          },
          "estimated": {
            "type": "boolean",
            "const": true
          },
          "trafficIncluded": {
            "type": "boolean",
            "const": false
          },
          "provenance": {
            "$ref": "#/components/schemas/provenanceSchema"
          }
        }
      },
      "memberInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "role",
          "active"
        ],
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "viewer",
              "operator",
              "admin",
              "driver"
            ]
          },
          "active": {
            "type": "boolean"
          }
        }
      },
      "memberSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "actorId",
          "role",
          "active"
        ],
        "properties": {
          "actorId": {
            "type": "string",
            "format": "uuid"
          },
          "role": {
            "type": "string",
            "enum": [
              "viewer",
              "operator",
              "admin",
              "driver"
            ]
          },
          "active": {
            "type": "boolean"
          }
        }
      },
      "meSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "worker",
          "tenant"
        ],
        "properties": {
          "worker": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "displayName"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "displayName": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              }
            }
          },
          "tenant": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              }
            }
          }
        }
      },
      "michivaAskedInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "question"
        ],
        "properties": {
          "question": {
            "type": "string",
            "enum": [
              "week",
              "month",
              "fuel",
              "where",
              "outside",
              "speed",
              "base",
              "overdue",
              "ordersLess",
              "busiest",
              "papers",
              "history"
            ]
          }
        }
      },
      "michivaInterpretationSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "question",
          "vehicleId",
          "date"
        ],
        "properties": {
          "question": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "week",
                  "month",
                  "fuel",
                  "where",
                  "outside",
                  "speed",
                  "base",
                  "overdue",
                  "ordersLess",
                  "busiest",
                  "papers",
                  "history"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "vehicleId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "date": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "michivaPopularSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "question",
                "source"
              ],
              "properties": {
                "question": {
                  "type": "string",
                  "enum": [
                    "week",
                    "month",
                    "fuel",
                    "where",
                    "outside",
                    "speed",
                    "base",
                    "overdue",
                    "ordersLess",
                    "busiest",
                    "papers",
                    "history"
                  ]
                },
                "source": {
                  "type": "string",
                  "enum": [
                    "tenant",
                    "all"
                  ]
                }
              }
            }
          }
        }
      },
      "michivaQuestionInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "text"
        ],
        "properties": {
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300
          }
        }
      },
      "monthlyReportSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "month",
          "rules",
          "narrative",
          "totals",
          "previousTotals",
          "analyzed",
          "truncatedDays",
          "days",
          "vehicles",
          "projection",
          "busiest",
          "deliveries",
          "fuel"
        ],
        "properties": {
          "month": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "month",
              "from",
              "to",
              "through",
              "partial",
              "timeZone"
            ],
            "properties": {
              "month": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}$"
              },
              "from": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "to": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "through": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "partial": {
                "type": "boolean"
              },
              "timeZone": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              }
            }
          },
          "rules": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "monthly",
              "trips",
              "deliveries",
              "fuel"
            ],
            "properties": {
              "monthly": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "version",
                  "month",
                  "projection",
                  "minimumHistory",
                  "busiest"
                ],
                "properties": {
                  "version": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "month": {
                    "type": "string"
                  },
                  "projection": {
                    "type": "string"
                  },
                  "minimumHistory": {
                    "type": "string"
                  },
                  "busiest": {
                    "type": "string"
                  }
                }
              },
              "trips": {
                "$ref": "#/components/schemas/tripRulesSchema"
              },
              "deliveries": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "version",
                  "onTime",
                  "serviceTime",
                  "places",
                  "overdue"
                ],
                "properties": {
                  "version": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "onTime": {
                    "type": "string"
                  },
                  "serviceTime": {
                    "type": "string"
                  },
                  "places": {
                    "type": "string"
                  },
                  "overdue": {
                    "type": "string"
                  }
                }
              },
              "fuel": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "version",
                  "inputs",
                  "cost",
                  "projection"
                ],
                "properties": {
                  "version": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "inputs": {
                    "type": "string"
                  },
                  "cost": {
                    "type": "string"
                  },
                  "projection": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "narrative": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "text",
              "evidence",
              "source"
            ],
            "properties": {
              "text": {
                "type": "string",
                "minLength": 1,
                "maxLength": 600
              },
              "evidence": {
                "type": "string",
                "minLength": 1,
                "maxLength": 600
              },
              "source": {
                "type": "string",
                "const": "template"
              }
            }
          },
          "totals": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "distanceMeters",
              "movingSeconds",
              "trips",
              "stops",
              "activeVehicles",
              "activeDays"
            ],
            "properties": {
              "distanceMeters": {
                "type": "integer",
                "minimum": 0
              },
              "movingSeconds": {
                "type": "integer",
                "minimum": 0
              },
              "trips": {
                "type": "integer",
                "minimum": 0
              },
              "stops": {
                "type": "integer",
                "minimum": 0
              },
              "activeVehicles": {
                "type": "integer",
                "minimum": 0
              },
              "activeDays": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "previousTotals": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "distanceMeters",
                  "movingSeconds",
                  "trips",
                  "stops",
                  "activeVehicles",
                  "activeDays"
                ],
                "properties": {
                  "distanceMeters": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "movingSeconds": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "trips": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "stops": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "activeVehicles": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "activeDays": {
                    "type": "integer",
                    "minimum": 0
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "analyzed": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "positions",
              "trips",
              "stops",
              "vehicles"
            ],
            "properties": {
              "positions": {
                "type": "integer",
                "minimum": 0
              },
              "trips": {
                "type": "integer",
                "minimum": 0
              },
              "stops": {
                "type": "integer",
                "minimum": 0
              },
              "vehicles": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "truncatedDays": {
            "type": "integer",
            "minimum": 0
          },
          "days": {
            "type": "array",
            "minItems": 28,
            "maxItems": 31,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "date",
                "distanceMeters",
                "movingSeconds",
                "trips",
                "vehicles"
              ],
              "properties": {
                "date": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "distanceMeters": {
                  "type": "integer",
                  "minimum": 0
                },
                "movingSeconds": {
                  "type": "integer",
                  "minimum": 0
                },
                "trips": {
                  "type": "integer",
                  "minimum": 0
                },
                "vehicles": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "vehicles": {
            "type": "array",
            "maxItems": 25,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "vehicleId",
                "label",
                "distanceMeters",
                "movingSeconds",
                "trips",
                "activeDays"
              ],
              "properties": {
                "vehicleId": {
                  "type": "string",
                  "format": "uuid"
                },
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "distanceMeters": {
                  "type": "integer",
                  "minimum": 0
                },
                "movingSeconds": {
                  "type": "integer",
                  "minimum": 0
                },
                "trips": {
                  "type": "integer",
                  "minimum": 0
                },
                "activeDays": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "projection": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "expectedMeters",
                  "lowMeters",
                  "highMeters",
                  "remainingDays",
                  "weeks"
                ],
                "properties": {
                  "expectedMeters": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "lowMeters": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "highMeters": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "remainingDays": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "weeks": {
                    "type": "array",
                    "minItems": 4,
                    "maxItems": 4,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "from",
                        "distanceMeters"
                      ],
                      "properties": {
                        "from": {
                          "type": "string",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                        },
                        "distanceMeters": {
                          "type": "integer",
                          "minimum": 0
                        }
                      }
                    }
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "busiest": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "weekday",
                  "averageMeters",
                  "othersAverageMeters"
                ],
                "properties": {
                  "weekday": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 7
                  },
                  "averageMeters": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "othersAverageMeters": {
                    "type": "integer",
                    "minimum": 0
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "deliveries": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "stops",
              "delivered",
              "failed",
              "evaluated",
              "onTime",
              "onTimeRate"
            ],
            "properties": {
              "stops": {
                "type": "integer",
                "minimum": 0
              },
              "delivered": {
                "type": "integer",
                "minimum": 0
              },
              "failed": {
                "type": "integer",
                "minimum": 0
              },
              "evaluated": {
                "type": "integer",
                "minimum": 0
              },
              "onTime": {
                "type": "integer",
                "minimum": 0
              },
              "onTimeRate": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          },
          "fuel": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "cost",
                  "liters",
                  "vehicles",
                  "missing",
                  "projectedCost"
                ],
                "properties": {
                  "cost": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "liters": {
                    "type": "number",
                    "minimum": 0
                  },
                  "vehicles": {
                    "type": "array",
                    "maxItems": 25,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "vehicleId",
                        "label",
                        "liters",
                        "cost"
                      ],
                      "properties": {
                        "vehicleId": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 120
                        },
                        "liters": {
                          "type": "number",
                          "minimum": 0
                        },
                        "cost": {
                          "type": "integer",
                          "minimum": 0
                        }
                      }
                    }
                  },
                  "missing": {
                    "type": "array",
                    "maxItems": 25,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "vehicleId",
                        "label"
                      ],
                      "properties": {
                        "vehicleId": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 120
                        }
                      }
                    }
                  },
                  "projectedCost": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "notificationRecipientListSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 5,
            "items": {
              "$ref": "#/components/schemas/notificationRecipientSchema"
            }
          }
        }
      },
      "notificationRecipientSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "address",
          "state",
          "verifiedAt",
          "version"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "address": {
            "type": "string",
            "maxLength": 254
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "verified",
              "removed"
            ]
          },
          "verifiedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "notificationSettingsInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "deliveryReceipts",
          "webhookAlerts",
          "version"
        ],
        "properties": {
          "deliveryReceipts": {
            "type": "boolean"
          },
          "webhookAlerts": {
            "type": "boolean"
          },
          "weeklyReport": {
            "type": "boolean"
          },
          "afterHoursAlert": {
            "type": "boolean"
          },
          "version": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "notificationSettingsSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "deliveryReceipts",
          "webhookAlerts",
          "weeklyReport",
          "afterHoursAlert",
          "version",
          "emailDelivery"
        ],
        "properties": {
          "deliveryReceipts": {
            "type": "boolean"
          },
          "webhookAlerts": {
            "type": "boolean"
          },
          "weeklyReport": {
            "type": "boolean"
          },
          "afterHoursAlert": {
            "type": "boolean"
          },
          "version": {
            "type": "integer",
            "minimum": 0
          },
          "emailDelivery": {
            "type": "string",
            "enum": [
              "enabled",
              "disabled"
            ]
          }
        }
      },
      "objectInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "title",
          "text"
        ],
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "text": {
            "type": "string",
            "maxLength": 65536
          }
        }
      },
      "objectSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "tenantId",
          "ownerId",
          "title",
          "state",
          "sha256",
          "bytes",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "ownerId": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string",
            "maxLength": 100
          },
          "state": {
            "type": "string",
            "enum": [
              "quarantined",
              "ready",
              "rejected",
              "deleted"
            ]
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "bytes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 65536
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "odometerInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "km"
        ],
        "properties": {
          "km": {
            "type": "integer",
            "minimum": 0,
            "maximum": 2999999
          }
        }
      },
      "odometerRulesSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version",
          "reading",
          "estimate",
          "pace",
          "soon"
        ],
        "properties": {
          "version": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40
          },
          "reading": {
            "type": "string"
          },
          "estimate": {
            "type": "string"
          },
          "pace": {
            "type": "string"
          },
          "soon": {
            "type": "string"
          }
        }
      },
      "odometerViewSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "estimatedKm",
          "sinceKm",
          "paceKmPerDay",
          "leftKm",
          "daysLeft",
          "text",
          "serviceText",
          "reminder"
        ],
        "properties": {
          "estimatedKm": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "sinceKm": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "paceKmPerDay": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "leftKm": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "daysLeft": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "text": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 400
              },
              {
                "type": "null"
              }
            ]
          },
          "serviceText": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 400
              },
              {
                "type": "null"
              }
            ]
          },
          "reminder": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 400
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "optimizationInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "profile",
          "depot",
          "vehicles",
          "stops"
        ],
        "properties": {
          "profile": {
            "$ref": "#/components/schemas/routingProfileSchema"
          },
          "depot": {
            "$ref": "#/components/schemas/coordinateSchema"
          },
          "vehicles": {
            "type": "array",
            "minItems": 1,
            "maxItems": 8,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "capacity",
                "shift"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "fleetVehicleId": {
                  "type": "string",
                  "format": "uuid"
                },
                "capacity": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 1000000
                },
                "shift": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "startsAt",
                    "endsAt"
                  ],
                  "properties": {
                    "startsAt": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    "endsAt": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    }
                  }
                }
              }
            }
          },
          "stops": {
            "type": "array",
            "minItems": 1,
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/optimizationStopSchema"
            }
          },
          "maxComputationMs": {
            "type": "integer",
            "minimum": 1,
            "maximum": 2000,
            "default": 500
          },
          "vehicle": {
            "$ref": "#/components/schemas/vehicleRestrictionsSchema"
          }
        }
      },
      "optimizationPreviewSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "tenantId",
          "state",
          "version",
          "profile",
          "solution",
          "roadRoutes",
          "matrixProvenance",
          "solver",
          "createdAt",
          "approvedAt",
          "routePlanId"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "state": {
            "type": "string",
            "enum": [
              "ready",
              "approved"
            ]
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "profile": {
            "$ref": "#/components/schemas/routingProfileSchema"
          },
          "solution": {
            "$ref": "#/components/schemas/solutionSchema"
          },
          "roadRoutes": {
            "type": "array",
            "maxItems": 8,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "vehicleId",
                "route"
              ],
              "properties": {
                "vehicleId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "fleetVehicleId": {
                  "type": "string",
                  "format": "uuid"
                },
                "route": {
                  "$ref": "#/components/schemas/routeResultSchema"
                }
              }
            }
          },
          "matrixProvenance": {
            "$ref": "#/components/schemas/provenanceSchema"
          },
          "solver": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "name",
              "maxComputationMs",
              "optimal"
            ],
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "maxComputationMs": {
                "type": "integer",
                "minimum": 1,
                "maximum": 2000
              },
              "optimal": {
                "type": "boolean",
                "const": false
              }
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          },
          "approvedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              {
                "type": "null"
              }
            ]
          },
          "routePlanId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "optimizationStopSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "coordinate",
          "demand",
          "serviceSeconds",
          "window"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "coordinate": {
            "$ref": "#/components/schemas/coordinateSchema"
          },
          "demand": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000
          },
          "serviceSeconds": {
            "type": "integer",
            "minimum": 0,
            "maximum": 86400
          },
          "window": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "startsAt",
              "endsAt"
            ],
            "properties": {
              "startsAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "endsAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              }
            }
          }
        }
      },
      "orderDeliveryCodeSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "orderId",
          "reference",
          "code"
        ],
        "properties": {
          "orderId": {
            "type": "string",
            "format": "uuid"
          },
          "reference": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "code": {
            "type": "string",
            "pattern": "^\\d{6}$"
          }
        }
      },
      "orderEventListSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "orderId",
          "items",
          "truncated"
        ],
        "properties": {
          "orderId": {
            "type": "string",
            "format": "uuid"
          },
          "truncated": {
            "type": "boolean"
          },
          "items": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "type",
                "occurredAt",
                "receivedAt",
                "routeId",
                "stopId",
                "serviceDate",
                "author"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "route_assigned",
                    "route_cancelled",
                    "vehicle_confirmed",
                    "load_confirmed",
                    "stop_arrived",
                    "delivery_completed",
                    "delivery_failed",
                    "parcels_returned",
                    "shift_finished"
                  ]
                },
                "occurredAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "Z$"
                },
                "receivedAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "Z$"
                },
                "routeId": {
                  "type": "string",
                  "format": "uuid"
                },
                "stopId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "serviceDate": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "author": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "kind",
                    "name"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "company",
                        "worker"
                      ]
                    },
                    "name": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 120
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      },
      "orderInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "reference",
          "locationId",
          "demand",
          "serviceSeconds",
          "window"
        ],
        "properties": {
          "reference": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "locationId": {
            "type": "string",
            "format": "uuid"
          },
          "demand": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000
          },
          "serviceSeconds": {
            "type": "integer",
            "minimum": 0,
            "maximum": 86400
          },
          "window": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "startsAt",
              "endsAt"
            ],
            "properties": {
              "startsAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "endsAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              }
            }
          },
          "notes": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "recipient": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "name"
            ],
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "phone": {
                "type": "string",
                "minLength": 8,
                "maxLength": 24
              },
              "email": {
                "type": "string",
                "minLength": 6,
                "maxLength": 254
              }
            }
          },
          "parcels": {
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "code"
              ],
              "properties": {
                "code": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,63}$"
                },
                "description": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 160
                }
              }
            }
          },
          "lines": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "catalogItemId",
                "description",
                "quantity",
                "unitPriceMinor"
              ],
              "properties": {
                "catalogItemId": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 240
                },
                "quantity": {
                  "type": "string",
                  "pattern": "^(0|[1-9][0-9]{0,23})(\\.[0-9]{1,6})?$"
                },
                "unitPriceMinor": {
                  "type": "string",
                  "pattern": "^(0|[1-9][0-9]{0,17})$"
                }
              }
            }
          },
          "customerId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "orderListSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/orderSchema"
            }
          }
        }
      },
      "orderOutcomeListSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "orderId",
                "outcome",
                "at",
                "serviceDate",
                "routeId",
                "stopId",
                "routeState"
              ],
              "properties": {
                "orderId": {
                  "type": "string",
                  "format": "uuid"
                },
                "outcome": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "arrived",
                    "delivered",
                    "partial",
                    "failed"
                  ]
                },
                "at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "serviceDate": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "routeId": {
                  "type": "string",
                  "format": "uuid"
                },
                "stopId": {
                  "type": "string",
                  "format": "uuid"
                },
                "routeState": {
                  "type": "string",
                  "enum": [
                    "assigned",
                    "in_progress",
                    "finished",
                    "cancelled"
                  ]
                }
              }
            }
          }
        }
      },
      "orderSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "tenantId",
          "reference",
          "location",
          "demand",
          "serviceSeconds",
          "window",
          "notes",
          "recipient",
          "parcels",
          "state",
          "planning",
          "lines",
          "customerId",
          "invoiceIntentId",
          "version",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "reference": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "location": {
            "$ref": "#/components/schemas/locationSchema"
          },
          "demand": {
            "type": "integer",
            "minimum": 0
          },
          "serviceSeconds": {
            "type": "integer",
            "minimum": 0
          },
          "window": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "startsAt",
              "endsAt"
            ],
            "properties": {
              "startsAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "endsAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              }
            }
          },
          "notes": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "recipient": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "phone": {
                    "$ref": "#/components/schemas/phoneForReaderSchema"
                  },
                  "email": {
                    "$ref": "#/components/schemas/emailForReaderSchema"
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "parcels": {
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "code"
              ],
              "properties": {
                "code": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,63}$"
                },
                "description": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 160
                }
              }
            }
          },
          "state": {
            "type": "string",
            "enum": [
              "open",
              "cancelled"
            ]
          },
          "planning": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "status",
              "routePlanId",
              "vehicleId"
            ],
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "unplanned",
                  "planned"
                ]
              },
              "routePlanId": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "vehicleId": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          },
          "lines": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "position",
                "catalogItemId",
                "description",
                "quantity",
                "unitPriceMinor"
              ],
              "properties": {
                "position": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 100
                },
                "catalogItemId": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 240
                },
                "quantity": {
                  "type": "string",
                  "pattern": "^(0|[1-9][0-9]{0,23})(\\.[0-9]{1,6})?$"
                },
                "unitPriceMinor": {
                  "type": "string",
                  "pattern": "^(0|[1-9][0-9]{0,17})$"
                }
              }
            }
          },
          "customerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "invoiceIntentId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          }
        }
      },
      "phoneForReaderSchema": {
        "type": "string",
        "minLength": 4,
        "maxLength": 16,
        "pattern": "^(?:\\+[1-9][0-9]{7,14}|\\+(?:[1-9][0-9]{0,2})?\\*{4,8}[0-9]{4}|\\*{4})$",
        "description": "E.164 completo para operator y admin; enmascarado para los demás roles: prefijo y cuatro últimos dígitos, p. ej. +569****5678; oculta al menos cuatro dígitos (+****5678 en un número de ocho) o **** si el valor guardado no es E.164."
      },
      "placeChangeSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version"
        ],
        "minProperties": 2,
        "properties": {
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "kind": {
            "type": "string",
            "enum": [
              "base",
              "customer",
              "supplier",
              "fuel",
              "other"
            ]
          },
          "radiusMeters": {
            "type": "integer",
            "minimum": 50,
            "maximum": 500
          },
          "active": {
            "type": "boolean"
          }
        }
      },
      "placeInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "kind",
          "coordinate"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "kind": {
            "type": "string",
            "enum": [
              "base",
              "customer",
              "supplier",
              "fuel",
              "other"
            ]
          },
          "coordinate": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "latitude",
              "longitude"
            ],
            "properties": {
              "latitude": {
                "type": "number",
                "minimum": -90,
                "maximum": 90
              },
              "longitude": {
                "type": "number",
                "minimum": -180,
                "maximum": 180
              }
            }
          },
          "radiusMeters": {
            "type": "integer",
            "minimum": 50,
            "maximum": 500
          }
        }
      },
      "placeListSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/placeSchema"
            }
          }
        }
      },
      "placeSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "kind",
          "coordinate",
          "radiusMeters",
          "active",
          "version",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "kind": {
            "type": "string",
            "enum": [
              "base",
              "customer",
              "supplier",
              "fuel",
              "other"
            ]
          },
          "coordinate": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "latitude",
              "longitude"
            ],
            "properties": {
              "latitude": {
                "type": "number",
                "minimum": -90,
                "maximum": 90
              },
              "longitude": {
                "type": "number",
                "minimum": -180,
                "maximum": 180
              }
            }
          },
          "radiusMeters": {
            "type": "integer",
            "minimum": 50,
            "maximum": 500
          },
          "active": {
            "type": "boolean"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          }
        }
      },
      "placeSuggestionsSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "window",
          "rules",
          "analyzed",
          "items",
          "heat"
        ],
        "properties": {
          "window": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "from",
              "to",
              "days",
              "timeZone"
            ],
            "properties": {
              "from": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "to": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "days": {
                "type": "integer",
                "minimum": 0
              },
              "timeZone": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              }
            }
          },
          "rules": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "places",
              "trips"
            ],
            "properties": {
              "places": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "version",
                  "cluster",
                  "frequent",
                  "known"
                ],
                "properties": {
                  "version": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "cluster": {
                    "type": "string"
                  },
                  "frequent": {
                    "type": "string"
                  },
                  "known": {
                    "type": "string"
                  }
                }
              },
              "trips": {
                "$ref": "#/components/schemas/tripRulesSchema"
              }
            }
          },
          "analyzed": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "vehicles",
              "days",
              "stops"
            ],
            "properties": {
              "vehicles": {
                "type": "integer",
                "minimum": 0
              },
              "days": {
                "type": "integer",
                "minimum": 0
              },
              "stops": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "items": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "center",
                "spreadMeters",
                "visits",
                "days",
                "vehicles",
                "dwellSeconds",
                "usualArrival",
                "weekdays",
                "known"
              ],
              "properties": {
                "center": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "latitude",
                    "longitude"
                  ],
                  "properties": {
                    "latitude": {
                      "type": "number",
                      "minimum": -90,
                      "maximum": 90
                    },
                    "longitude": {
                      "type": "number",
                      "minimum": -180,
                      "maximum": 180
                    }
                  }
                },
                "spreadMeters": {
                  "type": "integer",
                  "minimum": 0
                },
                "visits": {
                  "type": "integer",
                  "minimum": 0
                },
                "days": {
                  "type": "integer",
                  "minimum": 0
                },
                "vehicles": {
                  "type": "integer",
                  "minimum": 0
                },
                "dwellSeconds": {
                  "type": "integer",
                  "minimum": 0
                },
                "usualArrival": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^\\d{2}:\\d{2}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "weekdays": {
                  "type": "array",
                  "maxItems": 7,
                  "items": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 7
                  }
                },
                "known": {
                  "anyOf": [
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "id",
                        "name"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 160
                        }
                      }
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          },
          "heat": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "rules",
              "totalMinutes",
              "cells",
              "top"
            ],
            "properties": {
              "rules": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "version",
                  "stops",
                  "cells",
                  "top"
                ],
                "properties": {
                  "version": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "stops": {
                    "type": "string"
                  },
                  "cells": {
                    "type": "string"
                  },
                  "top": {
                    "type": "string"
                  }
                }
              },
              "totalMinutes": {
                "type": "integer",
                "minimum": 0
              },
              "cells": {
                "type": "array",
                "maxItems": 400,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "latitude",
                    "longitude",
                    "minutes",
                    "stops",
                    "days"
                  ],
                  "properties": {
                    "latitude": {
                      "type": "number",
                      "minimum": -90,
                      "maximum": 90
                    },
                    "longitude": {
                      "type": "number",
                      "minimum": -180,
                      "maximum": 180
                    },
                    "minutes": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "stops": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "days": {
                      "type": "integer",
                      "minimum": 0
                    }
                  }
                }
              },
              "top": {
                "type": "array",
                "maxItems": 5,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "latitude",
                    "longitude",
                    "minutes",
                    "stops",
                    "days",
                    "share",
                    "name"
                  ],
                  "properties": {
                    "latitude": {
                      "type": "number",
                      "minimum": -90,
                      "maximum": 90
                    },
                    "longitude": {
                      "type": "number",
                      "minimum": -180,
                      "maximum": 180
                    },
                    "minutes": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "stops": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "days": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "share": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    },
                    "name": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 160
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      },
      "planPreviewInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "profile",
          "depot",
          "vehicles",
          "orderIds"
        ],
        "properties": {
          "profile": {
            "$ref": "#/components/schemas/routingProfileSchema"
          },
          "depot": {
            "$ref": "#/components/schemas/coordinateSchema"
          },
          "vehicles": {
            "type": "array",
            "minItems": 1,
            "maxItems": 8,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "capacity",
                "shift"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "fleetVehicleId": {
                  "type": "string",
                  "format": "uuid"
                },
                "capacity": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 1000000
                },
                "shift": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "startsAt",
                    "endsAt"
                  ],
                  "properties": {
                    "startsAt": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    "endsAt": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    }
                  }
                }
              }
            }
          },
          "maxComputationMs": {
            "type": "integer",
            "minimum": 1,
            "maximum": 2000,
            "default": 500
          },
          "vehicle": {
            "$ref": "#/components/schemas/vehicleRestrictionsSchema"
          },
          "orderIds": {
            "type": "array",
            "minItems": 1,
            "maxItems": 50,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        }
      },
      "positionBatchSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "positions"
        ],
        "properties": {
          "positions": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "observedAt",
                "lat",
                "lon"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "observedAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "Z$"
                },
                "lat": {
                  "type": "number",
                  "minimum": -90,
                  "maximum": 90
                },
                "lon": {
                  "type": "number",
                  "minimum": -180,
                  "maximum": 180
                },
                "accuracyMeters": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 100000
                },
                "speedMetersPerSecond": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1000
                },
                "headingDegrees": {
                  "type": "number",
                  "minimum": 0,
                  "exclusiveMaximum": 360
                }
              }
            }
          }
        }
      },
      "positionsAckSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "accepted",
          "duplicates",
          "rejected"
        ],
        "properties": {
          "accepted": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "duplicates": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "rejected": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "reason"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "reason": {
                  "type": "string",
                  "enum": [
                    "stale",
                    "future",
                    "conflict",
                    "out_of_route"
                  ]
                }
              }
            }
          }
        }
      },
      "provenanceSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "engine",
          "engineVersion",
          "graphVersion",
          "coverage",
          "roadNetwork"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "valhalla",
              "osrm",
              "synthetic_non_road"
            ]
          },
          "engine": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "engineVersion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "graphVersion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "coverage": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "status"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160
              },
              "status": {
                "type": "string",
                "enum": [
                  "covered",
                  "synthetic"
                ]
              }
            }
          },
          "roadNetwork": {
            "type": "boolean"
          }
        }
      },
      "recipientInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "address"
        ],
        "properties": {
          "address": {
            "type": "string",
            "minLength": 6,
            "maxLength": 254
          }
        }
      },
      "recipientRemoveInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version"
        ],
        "properties": {
          "version": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "recipientVerifyInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "type": "string",
            "pattern": "^[0-9]{6}$"
          }
        }
      },
      "reverseGeocodeInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "coordinates"
        ],
        "properties": {
          "coordinates": {
            "type": "array",
            "minItems": 1,
            "maxItems": 25,
            "items": {
              "$ref": "#/components/schemas/coordinateSchema"
            }
          }
        }
      },
      "reverseGeocodeResultSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 25,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "address"
              ],
              "properties": {
                "address": {
                  "anyOf": [
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "label",
                        "locality"
                      ],
                      "properties": {
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 300
                        },
                        "locality": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 120
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      }
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "routeInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "profile",
          "coordinates"
        ],
        "properties": {
          "profile": {
            "$ref": "#/components/schemas/routingProfileSchema"
          },
          "coordinates": {
            "type": "array",
            "minItems": 2,
            "maxItems": 52,
            "items": {
              "$ref": "#/components/schemas/coordinateSchema"
            }
          },
          "vehicle": {
            "$ref": "#/components/schemas/vehicleRestrictionsSchema"
          }
        }
      },
      "routeManifestSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "date",
          "version",
          "depot",
          "vehicle",
          "stops"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "depot": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "name"
            ],
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              }
            }
          },
          "vehicle": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "plate",
              "label"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "plate": {
                "type": "string",
                "minLength": 1,
                "maxLength": 12
              },
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              }
            }
          },
          "stops": {
            "type": "array",
            "minItems": 1,
            "maxItems": 50,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "sequence",
                "orderReference",
                "customer",
                "address",
                "coordinate",
                "window",
                "verification",
                "secrets",
                "parcels"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "sequence": {
                  "type": "integer",
                  "minimum": 1
                },
                "orderReference": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "customer": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "name",
                    "canCall"
                  ],
                  "properties": {
                    "name": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 160
                    },
                    "phoneMasked": {
                      "$ref": "#/components/schemas/maskedPhoneSchema"
                    },
                    "canCall": {
                      "type": "boolean"
                    }
                  }
                },
                "address": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 300
                },
                "addressDetail": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 300
                },
                "coordinate": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "lat",
                    "lon"
                  ],
                  "properties": {
                    "lat": {
                      "type": "number",
                      "minimum": -90,
                      "maximum": 90
                    },
                    "lon": {
                      "type": "number",
                      "minimum": -180,
                      "maximum": 180
                    }
                  }
                },
                "window": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "startsAt",
                    "endsAt"
                  ],
                  "properties": {
                    "startsAt": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    "endsAt": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    }
                  }
                },
                "notes": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 500
                },
                "verification": {
                  "$ref": "#/components/schemas/verificationPolicySchema"
                },
                "lines": {
                  "type": "array",
                  "maxItems": 100,
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "position",
                      "description",
                      "quantity"
                    ],
                    "properties": {
                      "position": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100
                      },
                      "description": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 240
                      },
                      "quantity": {
                        "type": "string",
                        "pattern": "^(0|[1-9][0-9]{0,23})(\\.[0-9]{1,6})?$"
                      }
                    }
                  }
                },
                "secrets": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "otp": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "saltHex",
                        "iterations",
                        "hashHex"
                      ],
                      "properties": {
                        "saltHex": {
                          "type": "string",
                          "pattern": "^[0-9a-f]{32}$"
                        },
                        "iterations": {
                          "type": "integer",
                          "minimum": 1000,
                          "maximum": 600000
                        },
                        "hashHex": {
                          "type": "string",
                          "pattern": "^[0-9a-f]{64}$"
                        }
                      }
                    }
                  }
                },
                "parcels": {
                  "type": "array",
                  "minItems": 1,
                  "maxItems": 20,
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "id",
                      "code",
                      "description"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "code": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 64
                      },
                      "description": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 160
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "routePlanSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "tenantId",
          "previewId",
          "version",
          "profile",
          "routes",
          "unassigned",
          "roadRoutes",
          "matrixProvenance",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "previewId": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "profile": {
            "$ref": "#/components/schemas/routingProfileSchema"
          },
          "routes": {
            "type": "array",
            "minItems": 1,
            "maxItems": 8,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "vehicleId",
                "orderedStops",
                "distanceMeters",
                "durationSeconds"
              ],
              "properties": {
                "vehicleId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "fleetVehicleId": {
                  "type": "string",
                  "format": "uuid"
                },
                "orderedStops": {
                  "type": "array",
                  "maxItems": 50,
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "id",
                      "arrivalAt",
                      "serviceStartsAt",
                      "departureAt",
                      "loadAfter"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128
                      },
                      "arrivalAt": {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "Z$"
                      },
                      "serviceStartsAt": {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "Z$"
                      },
                      "departureAt": {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "Z$"
                      },
                      "loadAfter": {
                        "type": "integer",
                        "minimum": 0
                      }
                    }
                  }
                },
                "distanceMeters": {
                  "type": "integer",
                  "minimum": 0
                },
                "durationSeconds": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "unassigned": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "reason"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "reason": {
                  "type": "string",
                  "enum": [
                    "capacity_exceeded",
                    "window_incompatible",
                    "shift_exceeded",
                    "unreachable",
                    "solver_timeout",
                    "solver_incomplete"
                  ]
                }
              }
            }
          },
          "roadRoutes": {
            "type": "array",
            "maxItems": 8,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "vehicleId",
                "route"
              ],
              "properties": {
                "vehicleId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "fleetVehicleId": {
                  "type": "string",
                  "format": "uuid"
                },
                "route": {
                  "$ref": "#/components/schemas/routeResultSchema"
                }
              }
            }
          },
          "matrixProvenance": {
            "$ref": "#/components/schemas/provenanceSchema"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          }
        }
      },
      "routeResultSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "profile",
          "waypoints",
          "geometry",
          "distanceMeters",
          "durationSeconds",
          "estimated",
          "trafficIncluded",
          "provenance"
        ],
        "properties": {
          "profile": {
            "$ref": "#/components/schemas/routingProfileSchema"
          },
          "waypoints": {
            "type": "array",
            "minItems": 2,
            "maxItems": 52,
            "items": {
              "$ref": "#/components/schemas/coordinateSchema"
            }
          },
          "geometry": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "type",
              "coordinates"
            ],
            "properties": {
              "type": {
                "type": "string",
                "const": "LineString"
              },
              "coordinates": {
                "type": "array",
                "minItems": 2,
                "items": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number",
                      "minimum": -180,
                      "maximum": 180
                    },
                    {
                      "type": "number",
                      "minimum": -90,
                      "maximum": 90
                    }
                  ],
                  "minItems": 2,
                  "maxItems": 2
                }
              }
            }
          },
          "distanceMeters": {
            "type": "integer",
            "minimum": 0
          },
          "durationSeconds": {
            "type": "integer",
            "minimum": 0
          },
          "estimated": {
            "type": "boolean",
            "const": true
          },
          "trafficIncluded": {
            "type": "boolean",
            "const": false
          },
          "provenance": {
            "$ref": "#/components/schemas/provenanceSchema"
          },
          "ferryMeters": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "routingProfileSchema": {
        "type": "string",
        "enum": [
          "car",
          "truck",
          "bicycle",
          "pedestrian"
        ]
      },
      "scheduleInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "days",
          "version"
        ],
        "properties": {
          "days": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/workWeekSchema"
              },
              {
                "type": "null"
              }
            ]
          },
          "version": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "scheduleRulesSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version",
          "outside",
          "suggestion"
        ],
        "properties": {
          "version": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40
          },
          "outside": {
            "type": "string"
          },
          "suggestion": {
            "type": "string"
          }
        }
      },
      "scheduleSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "days",
          "version",
          "updatedAt",
          "rules"
        ],
        "properties": {
          "days": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/workWeekSchema"
              },
              {
                "type": "null"
              }
            ]
          },
          "version": {
            "type": "integer",
            "minimum": 0
          },
          "updatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              {
                "type": "null"
              }
            ]
          },
          "rules": {
            "$ref": "#/components/schemas/scheduleRulesSchema"
          }
        }
      },
      "scheduleSuggestionSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "window",
          "rules",
          "analyzed",
          "days",
          "basis"
        ],
        "properties": {
          "window": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "from",
              "to",
              "weeks",
              "timeZone"
            ],
            "properties": {
              "from": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "to": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "weeks": {
                "type": "integer",
                "minimum": 0
              },
              "timeZone": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              }
            }
          },
          "rules": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "schedule",
              "trips"
            ],
            "properties": {
              "schedule": {
                "$ref": "#/components/schemas/scheduleRulesSchema"
              },
              "trips": {
                "$ref": "#/components/schemas/tripRulesSchema"
              }
            }
          },
          "analyzed": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "vehicles",
              "days",
              "trips"
            ],
            "properties": {
              "vehicles": {
                "type": "integer",
                "minimum": 0
              },
              "days": {
                "type": "integer",
                "minimum": 0
              },
              "trips": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "days": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/workWeekSchema"
              },
              {
                "type": "null"
              }
            ]
          },
          "basis": {
            "type": "array",
            "minItems": 7,
            "maxItems": 7,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "weekday",
                "weeks",
                "earliestDeparture",
                "latestArrival"
              ],
              "properties": {
                "weekday": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 7
                },
                "weeks": {
                  "type": "integer",
                  "minimum": 0
                },
                "earliestDeparture": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "latestArrival": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "solutionSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "feasible",
          "timedOut",
          "optimal",
          "routes",
          "unassigned",
          "totalDistanceMeters",
          "totalDurationSeconds",
          "baselineDistanceMeters",
          "improvementMeters"
        ],
        "properties": {
          "feasible": {
            "type": "boolean"
          },
          "timedOut": {
            "type": "boolean"
          },
          "optimal": {
            "type": "boolean",
            "const": false
          },
          "routes": {
            "type": "array",
            "minItems": 1,
            "maxItems": 8,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "vehicleId",
                "orderedStops",
                "distanceMeters",
                "durationSeconds"
              ],
              "properties": {
                "vehicleId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "fleetVehicleId": {
                  "type": "string",
                  "format": "uuid"
                },
                "orderedStops": {
                  "type": "array",
                  "maxItems": 50,
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "id",
                      "arrivalAt",
                      "serviceStartsAt",
                      "departureAt",
                      "loadAfter"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128
                      },
                      "arrivalAt": {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "Z$"
                      },
                      "serviceStartsAt": {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "Z$"
                      },
                      "departureAt": {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "Z$"
                      },
                      "loadAfter": {
                        "type": "integer",
                        "minimum": 0
                      }
                    }
                  }
                },
                "distanceMeters": {
                  "type": "integer",
                  "minimum": 0
                },
                "durationSeconds": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "unassigned": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "reason"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "reason": {
                  "type": "string",
                  "enum": [
                    "capacity_exceeded",
                    "window_incompatible",
                    "shift_exceeded",
                    "unreachable",
                    "solver_timeout",
                    "solver_incomplete"
                  ]
                }
              }
            }
          },
          "totalDistanceMeters": {
            "type": "integer",
            "minimum": 0
          },
          "totalDurationSeconds": {
            "type": "integer",
            "minimum": 0
          },
          "baselineDistanceMeters": {
            "type": "integer",
            "minimum": 0
          },
          "improvementMeters": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "speedingReportSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "period",
          "limitKmh",
          "episodes",
          "rules"
        ],
        "properties": {
          "period": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "from",
              "to",
              "through",
              "partial",
              "timeZone"
            ],
            "properties": {
              "from": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "to": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "through": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "partial": {
                "type": "boolean"
              },
              "timeZone": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              }
            }
          },
          "limitKmh": {
            "type": "integer",
            "minimum": 1
          },
          "episodes": {
            "type": "array",
            "maxItems": 2000,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "vehicleId",
                "vehicleLabel",
                "date",
                "sourceId",
                "startedAt",
                "endedAt",
                "seconds",
                "distanceMeters",
                "maxSpeedMetersPerSecond",
                "driver"
              ],
              "properties": {
                "vehicleId": {
                  "type": "string",
                  "format": "uuid"
                },
                "vehicleLabel": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "date": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "sourceId": {
                  "type": "string",
                  "format": "uuid"
                },
                "startedAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "Z$"
                },
                "endedAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "Z$"
                },
                "seconds": {
                  "type": "integer",
                  "minimum": 0
                },
                "distanceMeters": {
                  "type": "integer",
                  "minimum": 0
                },
                "maxSpeedMetersPerSecond": {
                  "type": "number",
                  "minimum": 0
                },
                "driver": {
                  "anyOf": [
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "workerId",
                        "name"
                      ],
                      "properties": {
                        "workerId": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 120
                        }
                      }
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          },
          "rules": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "speed",
              "trips",
              "driver"
            ],
            "properties": {
              "speed": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "version",
                  "limit"
                ],
                "properties": {
                  "version": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "limit": {
                    "type": "string"
                  }
                }
              },
              "trips": {
                "$ref": "#/components/schemas/tripRulesSchema"
              },
              "driver": {
                "type": "string"
              }
            }
          }
        }
      },
      "statsReportSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "period",
          "comparedWith",
          "totals",
          "daily",
          "customers",
          "vehicles",
          "drivers",
          "trends",
          "notes",
          "rules"
        ],
        "properties": {
          "period": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "from",
              "to",
              "through",
              "partial",
              "comparedThrough",
              "days",
              "businessDays",
              "scheduled",
              "timeZone"
            ],
            "properties": {
              "from": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "to": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "through": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "partial": {
                "type": "boolean"
              },
              "comparedThrough": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "days": {
                "type": "integer",
                "minimum": 1,
                "maximum": 31
              },
              "businessDays": {
                "type": "integer",
                "minimum": 0,
                "maximum": 31
              },
              "scheduled": {
                "type": "boolean"
              },
              "timeZone": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              }
            }
          },
          "comparedWith": {
            "type": "array",
            "minItems": 0,
            "maxItems": 4,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "from",
                "to"
              ],
              "properties": {
                "from": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "to": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                }
              }
            }
          },
          "totals": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "stops",
              "delivered",
              "failed",
              "pending",
              "onTime",
              "deliveredWithProof",
              "distanceMeters",
              "movingSeconds",
              "stopsWithoutVehicle"
            ],
            "properties": {
              "stops": {
                "type": "integer",
                "minimum": 0
              },
              "delivered": {
                "type": "integer",
                "minimum": 0
              },
              "failed": {
                "type": "integer",
                "minimum": 0
              },
              "pending": {
                "type": "integer",
                "minimum": 0
              },
              "onTime": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "evaluated",
                  "onTime",
                  "rate"
                ],
                "properties": {
                  "evaluated": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "onTime": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "rate": {
                    "anyOf": [
                      {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              },
              "deliveredWithProof": {
                "type": "integer",
                "minimum": 0
              },
              "distanceMeters": {
                "type": "integer",
                "minimum": 0
              },
              "movingSeconds": {
                "type": "integer",
                "minimum": 0
              },
              "stopsWithoutVehicle": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "daily": {
            "type": "array",
            "maxItems": 31,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "date",
                "distanceMeters",
                "vehiclesUsed",
                "delivered",
                "failed",
                "pending",
                "onTime"
              ],
              "properties": {
                "date": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "distanceMeters": {
                  "type": "integer",
                  "minimum": 0
                },
                "vehiclesUsed": {
                  "type": "integer",
                  "minimum": 0
                },
                "delivered": {
                  "type": "integer",
                  "minimum": 0
                },
                "failed": {
                  "type": "integer",
                  "minimum": 0
                },
                "pending": {
                  "type": "integer",
                  "minimum": 0
                },
                "onTime": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "evaluated",
                    "onTime",
                    "rate"
                  ],
                  "properties": {
                    "evaluated": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "onTime": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "rate": {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "customers": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "locationId",
                "name",
                "stops",
                "delivered",
                "failed",
                "pending",
                "failures",
                "onTime",
                "onSite",
                "frequency",
                "orders",
                "unavailable"
              ],
              "properties": {
                "locationId": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 160
                },
                "stops": {
                  "type": "integer",
                  "minimum": 0
                },
                "delivered": {
                  "type": "integer",
                  "minimum": 0
                },
                "failed": {
                  "type": "integer",
                  "minimum": 0
                },
                "pending": {
                  "type": "integer",
                  "minimum": 0
                },
                "failures": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "reason",
                      "count"
                    ],
                    "properties": {
                      "reason": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 60
                      },
                      "count": {
                        "type": "integer",
                        "minimum": 0
                      }
                    }
                  }
                },
                "onTime": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "evaluated",
                    "onTime",
                    "rate"
                  ],
                  "properties": {
                    "evaluated": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "onTime": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "rate": {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                },
                "onSite": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "measured",
                    "averageMinutes"
                  ],
                  "properties": {
                    "measured": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "averageMinutes": {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                },
                "frequency": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "deliveryDays",
                    "medianDaysBetween"
                  ],
                  "properties": {
                    "deliveryDays": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "medianDaysBetween": {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                },
                "orders": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "period",
                    "previous",
                    "previousAverage",
                    "lessThanBefore"
                  ],
                  "properties": {
                    "period": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "previous": {
                      "type": "array",
                      "minItems": 4,
                      "maxItems": 4,
                      "items": {
                        "type": "integer",
                        "minimum": 0
                      }
                    },
                    "previousAverage": {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "lessThanBefore": {
                      "type": "boolean"
                    }
                  }
                },
                "unavailable": {
                  "type": "array",
                  "maxItems": 20,
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "metric",
                      "reason"
                    ],
                    "properties": {
                      "metric": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 40
                      },
                      "reason": {
                        "type": "string",
                        "enum": [
                          "no_deliveries",
                          "no_arrival_marked",
                          "too_few_delivery_days",
                          "no_history",
                          "history_too_large",
                          "no_business_days",
                          "no_distance",
                          "no_fuel_data",
                          "no_gps_on_delivery_days",
                          "no_finished_routes",
                          "too_few_evaluated",
                          "no_gps",
                          "period_in_progress"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "vehicles": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "vehicleId",
                "label",
                "active",
                "distanceMeters",
                "movingSeconds",
                "workSeconds",
                "daysUsed",
                "businessDays",
                "businessDaysUsed",
                "utilization",
                "lowUse",
                "delivered",
                "failed",
                "metersPerDelivery",
                "stopsPerHour",
                "fuelCostPerDelivery",
                "unavailable"
              ],
              "properties": {
                "vehicleId": {
                  "type": "string",
                  "format": "uuid"
                },
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "active": {
                  "type": "boolean"
                },
                "distanceMeters": {
                  "type": "integer",
                  "minimum": 0
                },
                "movingSeconds": {
                  "type": "integer",
                  "minimum": 0
                },
                "workSeconds": {
                  "type": "integer",
                  "minimum": 0
                },
                "daysUsed": {
                  "type": "integer",
                  "minimum": 0
                },
                "businessDays": {
                  "type": "integer",
                  "minimum": 0
                },
                "businessDaysUsed": {
                  "type": "integer",
                  "minimum": 0
                },
                "utilization": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "lowUse": {
                  "type": "boolean"
                },
                "delivered": {
                  "type": "integer",
                  "minimum": 0
                },
                "failed": {
                  "type": "integer",
                  "minimum": 0
                },
                "metersPerDelivery": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "stopsPerHour": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "fuelCostPerDelivery": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "unavailable": {
                  "type": "array",
                  "maxItems": 20,
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "metric",
                      "reason"
                    ],
                    "properties": {
                      "metric": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 40
                      },
                      "reason": {
                        "type": "string",
                        "enum": [
                          "no_deliveries",
                          "no_arrival_marked",
                          "too_few_delivery_days",
                          "no_history",
                          "history_too_large",
                          "no_business_days",
                          "no_distance",
                          "no_fuel_data",
                          "no_gps_on_delivery_days",
                          "no_finished_routes",
                          "too_few_evaluated",
                          "no_gps",
                          "period_in_progress"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "drivers": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "workerId",
                "name",
                "stops",
                "delivered",
                "failed",
                "onTime",
                "finishedRoutes",
                "minutesPerStop",
                "unavailable"
              ],
              "properties": {
                "workerId": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "stops": {
                  "type": "integer",
                  "minimum": 0
                },
                "delivered": {
                  "type": "integer",
                  "minimum": 0
                },
                "failed": {
                  "type": "integer",
                  "minimum": 0
                },
                "onTime": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "evaluated",
                    "onTime",
                    "rate"
                  ],
                  "properties": {
                    "evaluated": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "onTime": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "rate": {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                },
                "finishedRoutes": {
                  "type": "integer",
                  "minimum": 0
                },
                "minutesPerStop": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "unavailable": {
                  "type": "array",
                  "maxItems": 20,
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "metric",
                      "reason"
                    ],
                    "properties": {
                      "metric": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 40
                      },
                      "reason": {
                        "type": "string",
                        "enum": [
                          "no_deliveries",
                          "no_arrival_marked",
                          "too_few_delivery_days",
                          "no_history",
                          "history_too_large",
                          "no_business_days",
                          "no_distance",
                          "no_fuel_data",
                          "no_gps_on_delivery_days",
                          "no_finished_routes",
                          "too_few_evaluated",
                          "no_gps",
                          "period_in_progress"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "trends": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "distanceMeters",
              "delivered",
              "onTimeRate",
              "unavailable"
            ],
            "properties": {
              "distanceMeters": {
                "anyOf": [
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "current",
                      "previous",
                      "previousAverage",
                      "change"
                    ],
                    "properties": {
                      "current": {
                        "type": "number",
                        "minimum": 0
                      },
                      "previous": {
                        "type": "array",
                        "minItems": 4,
                        "maxItems": 4,
                        "items": {
                          "anyOf": [
                            {
                              "type": "number",
                              "minimum": 0
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "previousAverage": {
                        "type": "number",
                        "minimum": 0
                      },
                      "change": {
                        "type": "number"
                      }
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "delivered": {
                "anyOf": [
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "current",
                      "previous",
                      "previousAverage",
                      "change"
                    ],
                    "properties": {
                      "current": {
                        "type": "number",
                        "minimum": 0
                      },
                      "previous": {
                        "type": "array",
                        "minItems": 4,
                        "maxItems": 4,
                        "items": {
                          "anyOf": [
                            {
                              "type": "number",
                              "minimum": 0
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "previousAverage": {
                        "type": "number",
                        "minimum": 0
                      },
                      "change": {
                        "type": "number"
                      }
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "onTimeRate": {
                "anyOf": [
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "current",
                      "previous",
                      "previousAverage",
                      "change"
                    ],
                    "properties": {
                      "current": {
                        "type": "number",
                        "minimum": 0
                      },
                      "previous": {
                        "type": "array",
                        "minItems": 4,
                        "maxItems": 4,
                        "items": {
                          "anyOf": [
                            {
                              "type": "number",
                              "minimum": 0
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "previousAverage": {
                        "type": "number",
                        "minimum": 0
                      },
                      "change": {
                        "type": "number"
                      }
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "unavailable": {
                "type": "array",
                "maxItems": 20,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "metric",
                    "reason"
                  ],
                  "properties": {
                    "metric": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 40
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "no_deliveries",
                        "no_arrival_marked",
                        "too_few_delivery_days",
                        "no_history",
                        "history_too_large",
                        "no_business_days",
                        "no_distance",
                        "no_fuel_data",
                        "no_gps_on_delivery_days",
                        "no_finished_routes",
                        "too_few_evaluated",
                        "no_gps",
                        "period_in_progress"
                      ]
                    }
                  }
                }
              }
            }
          },
          "notes": {
            "type": "array",
            "maxItems": 8,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "kind",
                "text",
                "vehicleId",
                "locationId"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "distance_trend",
                    "deliveries_trend",
                    "punctuality_trend",
                    "low_use",
                    "orders_less",
                    "failures"
                  ]
                },
                "text": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 600
                },
                "vehicleId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "locationId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          },
          "rules": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "stats",
              "trips",
              "deliveries",
              "fuel"
            ],
            "properties": {
              "stats": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "version",
                  "period",
                  "customers",
                  "onSite",
                  "frequency",
                  "lessThanBefore",
                  "vehicles",
                  "utilization",
                  "lowUse",
                  "vehicleDeliveries",
                  "perDelivery",
                  "fuel",
                  "drivers",
                  "trends",
                  "notes",
                  "daily",
                  "unavailable"
                ],
                "properties": {
                  "version": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "period": {
                    "type": "string"
                  },
                  "customers": {
                    "type": "string"
                  },
                  "onSite": {
                    "type": "string"
                  },
                  "frequency": {
                    "type": "string"
                  },
                  "lessThanBefore": {
                    "type": "string"
                  },
                  "vehicles": {
                    "type": "string"
                  },
                  "utilization": {
                    "type": "string"
                  },
                  "lowUse": {
                    "type": "string"
                  },
                  "vehicleDeliveries": {
                    "type": "string"
                  },
                  "perDelivery": {
                    "type": "string"
                  },
                  "fuel": {
                    "type": "string"
                  },
                  "drivers": {
                    "type": "string"
                  },
                  "trends": {
                    "type": "string"
                  },
                  "notes": {
                    "type": "string"
                  },
                  "daily": {
                    "type": "string"
                  },
                  "unavailable": {
                    "type": "string"
                  }
                }
              },
              "trips": {
                "$ref": "#/components/schemas/tripRulesSchema"
              },
              "deliveries": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "version",
                  "onTime",
                  "serviceTime",
                  "places",
                  "overdue"
                ],
                "properties": {
                  "version": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "onTime": {
                    "type": "string"
                  },
                  "serviceTime": {
                    "type": "string"
                  },
                  "places": {
                    "type": "string"
                  },
                  "overdue": {
                    "type": "string"
                  }
                }
              },
              "fuel": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "version",
                  "inputs",
                  "cost",
                  "projection"
                ],
                "properties": {
                  "version": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "inputs": {
                    "type": "string"
                  },
                  "cost": {
                    "type": "string"
                  },
                  "projection": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "suppressionInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "address"
        ],
        "properties": {
          "address": {
            "type": "string",
            "minLength": 6,
            "maxLength": 254
          }
        }
      },
      "suppressionListSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/suppressionSchema"
            }
          }
        }
      },
      "suppressionSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "reason",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "reason": {
            "type": "string",
            "enum": [
              "hard_bounce",
              "recipient_request",
              "admin"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "tenantDirectorySchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "tenantId",
                "name",
                "role"
              ],
              "properties": {
                "tenantId": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 120
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "viewer",
                    "operator",
                    "admin",
                    "driver"
                  ]
                }
              }
            }
          }
        }
      },
      "trackingLinkIssuedSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "orderId",
          "reference",
          "active",
          "createdAt",
          "expiresAt",
          "revokedAt",
          "lastOpenedAt",
          "openCount",
          "previewCount",
          "url",
          "message",
          "whatsappUrl"
        ],
        "properties": {
          "orderId": {
            "type": "string",
            "format": "uuid"
          },
          "reference": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "active": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          },
          "revokedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastOpenedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              {
                "type": "null"
              }
            ]
          },
          "openCount": {
            "type": "integer",
            "minimum": 0
          },
          "previewCount": {
            "type": "integer",
            "minimum": 0
          },
          "url": {
            "type": "string",
            "format": "uri",
            "maxLength": 300
          },
          "message": {
            "type": "string",
            "minLength": 1,
            "maxLength": 600
          },
          "whatsappUrl": {
            "type": "string",
            "format": "uri",
            "maxLength": 2000
          }
        }
      },
      "trackingLinkStatusSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "orderId",
          "reference",
          "active",
          "createdAt",
          "expiresAt",
          "revokedAt",
          "lastOpenedAt",
          "openCount",
          "previewCount"
        ],
        "properties": {
          "orderId": {
            "type": "string",
            "format": "uuid"
          },
          "reference": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "active": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          },
          "revokedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastOpenedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              {
                "type": "null"
              }
            ]
          },
          "openCount": {
            "type": "integer",
            "minimum": 0
          },
          "previewCount": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "trackingViewSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "company",
          "order",
          "state",
          "eta",
          "etaNote",
          "stopsBefore",
          "driver",
          "approximatePosition",
          "closedAt",
          "refreshSeconds"
        ],
        "properties": {
          "company": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "name"
            ],
            "properties": {
              "name": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          },
          "order": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "reference"
            ],
            "properties": {
              "reference": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              }
            }
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "on_the_way",
              "arriving",
              "delivered",
              "failed"
            ]
          },
          "eta": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "from",
                  "to",
                  "label"
                ],
                "properties": {
                  "from": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "Z$"
                  },
                  "to": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "Z$"
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "etaNote": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ]
          },
          "stopsBefore": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 50
              },
              {
                "type": "null"
              }
            ]
          },
          "driver": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "firstName"
                ],
                "properties": {
                  "firstName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "approximatePosition": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "latitude",
                  "longitude",
                  "updatedAt"
                ],
                "properties": {
                  "latitude": {
                    "type": "number",
                    "minimum": -90,
                    "maximum": 90
                  },
                  "longitude": {
                    "type": "number",
                    "minimum": -180,
                    "maximum": 180
                  },
                  "updatedAt": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "Z$"
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "closedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              {
                "type": "null"
              }
            ]
          },
          "refreshSeconds": {
            "type": "integer",
            "minimum": 30,
            "maximum": 300
          }
        }
      },
      "tripRulesSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version",
          "maxAccuracyMeters",
          "maxJumpMetersPerSecond",
          "stopRadiusMeters",
          "minStopSeconds",
          "minTripMeters",
          "maxGapSeconds",
          "stillMetersPerSecond",
          "movingMetersPerSecond"
        ],
        "properties": {
          "version": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40
          },
          "maxAccuracyMeters": {
            "type": "number",
            "minimum": 0
          },
          "maxJumpMetersPerSecond": {
            "type": "number",
            "minimum": 0
          },
          "stopRadiusMeters": {
            "type": "number",
            "minimum": 0
          },
          "minStopSeconds": {
            "type": "integer",
            "minimum": 0
          },
          "minTripMeters": {
            "type": "number",
            "minimum": 0
          },
          "maxGapSeconds": {
            "type": "integer",
            "minimum": 0
          },
          "stillMetersPerSecond": {
            "type": "number",
            "minimum": 0
          },
          "movingMetersPerSecond": {
            "type": "number",
            "minimum": 0
          }
        }
      },
      "uploadRequestSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "kind",
          "mimeType",
          "sizeBytes",
          "sha256",
          "capturedAtMs"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,128}$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "DELIVERY_PHOTO",
              "FAILURE_PHOTO",
              "SIGNATURE"
            ]
          },
          "mimeType": {
            "type": "string",
            "enum": [
              "image/jpeg",
              "image/svg+xml"
            ]
          },
          "sizeBytes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 8388608
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "capturedAtMs": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "uploadTicketSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "assetId",
          "uploadUrl",
          "method",
          "headers",
          "expiresAt",
          "alreadyUploaded"
        ],
        "properties": {
          "assetId": {
            "type": "string",
            "format": "uuid"
          },
          "uploadUrl": {
            "type": "string",
            "maxLength": 2048
          },
          "method": {
            "type": "string",
            "const": "PUT"
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          },
          "alreadyUploaded": {
            "type": "boolean"
          }
        }
      },
      "vehicleCareFieldsSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "technicalReviewUntil",
          "circulationPermitUntil",
          "soapUntil",
          "nextServiceOn",
          "serviceDueKm",
          "odometerKm",
          "odometerAt",
          "fuelKmPerLiter",
          "fuelPricePerLiter",
          "fuelPriceOn"
        ],
        "properties": {
          "technicalReviewUntil": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "circulationPermitUntil": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "soapUntil": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "nextServiceOn": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "serviceDueKm": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 2999999
              },
              {
                "type": "null"
              }
            ]
          },
          "odometerKm": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 2999999
              },
              {
                "type": "null"
              }
            ]
          },
          "odometerAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              {
                "type": "null"
              }
            ]
          },
          "fuelKmPerLiter": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 1,
                "maximum": 50
              },
              {
                "type": "null"
              }
            ]
          },
          "fuelPricePerLiter": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 100,
                "maximum": 5000
              },
              {
                "type": "null"
              }
            ]
          },
          "fuelPriceOn": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "vehicleCareInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "technicalReviewUntil",
          "circulationPermitUntil",
          "soapUntil",
          "nextServiceOn",
          "version"
        ],
        "properties": {
          "technicalReviewUntil": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "circulationPermitUntil": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "soapUntil": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "nextServiceOn": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "serviceDueKm": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 2999999
              },
              {
                "type": "null"
              }
            ]
          },
          "version": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "vehicleCareSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "vehicleId",
          "label",
          "active",
          "care",
          "version",
          "updatedAt"
        ],
        "properties": {
          "vehicleId": {
            "type": "string",
            "format": "uuid"
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "active": {
            "type": "boolean"
          },
          "care": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/vehicleCareFieldsSchema"
              },
              {
                "type": "null"
              }
            ]
          },
          "version": {
            "type": "integer",
            "minimum": 0
          },
          "updatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "vehicleDaySchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "vehicleId",
          "vehicleLabel",
          "date",
          "timeZone",
          "window",
          "rules",
          "source",
          "totals",
          "deliveries",
          "schedule",
          "speeding",
          "timeline"
        ],
        "properties": {
          "vehicleId": {
            "type": "string",
            "format": "uuid"
          },
          "vehicleLabel": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "timeZone": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "window": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "from",
              "to"
            ],
            "properties": {
              "from": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "to": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              }
            }
          },
          "rules": {
            "$ref": "#/components/schemas/tripRulesSchema"
          },
          "source": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "sourceId",
              "positions",
              "otherSourcesPositions",
              "truncated",
              "discarded"
            ],
            "properties": {
              "sourceId": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "positions": {
                "type": "integer",
                "minimum": 0
              },
              "otherSourcesPositions": {
                "type": "integer",
                "minimum": 0
              },
              "truncated": {
                "type": "boolean"
              },
              "discarded": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "accuracy",
                  "jump",
                  "duplicate"
                ],
                "properties": {
                  "accuracy": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "jump": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "duplicate": {
                    "type": "integer",
                    "minimum": 0
                  }
                }
              }
            }
          },
          "totals": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "distanceMeters",
              "movingSeconds",
              "stoppedSeconds",
              "trips",
              "stops",
              "firstDepartureAt",
              "lastArrivalAt",
              "maxSpeedMetersPerSecond"
            ],
            "properties": {
              "distanceMeters": {
                "type": "integer",
                "minimum": 0
              },
              "movingSeconds": {
                "type": "integer",
                "minimum": 0
              },
              "stoppedSeconds": {
                "type": "integer",
                "minimum": 0
              },
              "trips": {
                "type": "integer",
                "minimum": 0
              },
              "stops": {
                "type": "integer",
                "minimum": 0
              },
              "firstDepartureAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "Z$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "lastArrivalAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "Z$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "maxSpeedMetersPerSecond": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          },
          "deliveries": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "total",
              "delivered",
              "failed",
              "pending"
            ],
            "properties": {
              "total": {
                "type": "integer",
                "minimum": 0
              },
              "delivered": {
                "type": "integer",
                "minimum": 0
              },
              "failed": {
                "type": "integer",
                "minimum": 0
              },
              "pending": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "schedule": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "hours",
                  "rules"
                ],
                "properties": {
                  "hours": {
                    "anyOf": [
                      {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "start",
                          "end"
                        ],
                        "properties": {
                          "start": {
                            "type": "string",
                            "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
                          },
                          "end": {
                            "type": "string",
                            "pattern": "^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"
                          }
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "rules": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "version",
                      "outside",
                      "suggestion"
                    ],
                    "properties": {
                      "version": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 40
                      },
                      "outside": {
                        "type": "string"
                      },
                      "suggestion": {
                        "type": "string"
                      }
                    }
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "speeding": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "limitKmh",
              "episodes",
              "rules"
            ],
            "properties": {
              "limitKmh": {
                "type": "integer",
                "minimum": 1
              },
              "episodes": {
                "type": "array",
                "maxItems": 500,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "startedAt",
                    "endedAt",
                    "seconds",
                    "maxSpeedMetersPerSecond"
                  ],
                  "properties": {
                    "startedAt": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    "endedAt": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    "seconds": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "maxSpeedMetersPerSecond": {
                      "type": "number",
                      "minimum": 0
                    }
                  }
                }
              },
              "rules": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "version",
                  "limit"
                ],
                "properties": {
                  "version": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "limit": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "timeline": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "kind",
                    "startedAt",
                    "endedAt",
                    "durationSeconds",
                    "center",
                    "points",
                    "place",
                    "deliveries"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "stop"
                    },
                    "startedAt": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    "endedAt": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    "durationSeconds": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "center": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "latitude",
                        "longitude"
                      ],
                      "properties": {
                        "latitude": {
                          "type": "number",
                          "minimum": -90,
                          "maximum": 90
                        },
                        "longitude": {
                          "type": "number",
                          "minimum": -180,
                          "maximum": 180
                        }
                      }
                    },
                    "points": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "place": {
                      "anyOf": [
                        {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "id",
                            "name",
                            "distanceMeters"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "name": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 160
                            },
                            "distanceMeters": {
                              "type": "integer",
                              "minimum": 0
                            }
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "deliveries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "routeId",
                          "stopId",
                          "reference",
                          "state",
                          "arrivedAt",
                          "outcomeAt",
                          "failureReason",
                          "evidence"
                        ],
                        "properties": {
                          "routeId": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "stopId": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "reference": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 80
                          },
                          "state": {
                            "type": "string",
                            "enum": [
                              "pending",
                              "arrived",
                              "delivered",
                              "failed"
                            ]
                          },
                          "arrivedAt": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "Z$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "outcomeAt": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "Z$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "failureReason": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 60
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "evidence": {
                            "type": "array",
                            "maxItems": 50,
                            "items": {
                              "type": "object",
                              "additionalProperties": false,
                              "required": [
                                "id",
                                "kind",
                                "capturedAt"
                              ],
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "DELIVERY_PHOTO",
                                    "FAILURE_PHOTO",
                                    "SIGNATURE"
                                  ]
                                },
                                "capturedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "Z$"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "kind",
                    "startedAt",
                    "endedAt",
                    "durationSeconds",
                    "distanceMeters",
                    "maxSpeedMetersPerSecond",
                    "path",
                    "outsideHours"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "trip"
                    },
                    "startedAt": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    "endedAt": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    "durationSeconds": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "distanceMeters": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "maxSpeedMetersPerSecond": {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "path": {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "minItems": 3,
                        "maxItems": 3,
                        "items": {
                          "type": "number"
                        }
                      }
                    },
                    "outsideHours": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "day_off",
                            "early",
                            "late"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                },
                {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "kind",
                    "startedAt",
                    "endedAt",
                    "durationSeconds",
                    "straightLineMeters"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "gap"
                    },
                    "startedAt": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    "endedAt": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    "durationSeconds": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "straightLineMeters": {
                      "type": "integer",
                      "minimum": 0
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "vehicleMonthSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "vehicleId",
          "vehicleLabel",
          "month",
          "days",
          "totals",
          "longest",
          "analyzed",
          "truncatedDays",
          "scheduled",
          "narrative",
          "rules"
        ],
        "properties": {
          "vehicleId": {
            "type": "string",
            "format": "uuid"
          },
          "vehicleLabel": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "month": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "month",
              "from",
              "to",
              "through",
              "partial",
              "timeZone"
            ],
            "properties": {
              "month": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}$"
              },
              "from": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "to": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "through": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "partial": {
                "type": "boolean"
              },
              "timeZone": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              }
            }
          },
          "days": {
            "type": "array",
            "minItems": 28,
            "maxItems": 31,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "date",
                "distanceMeters",
                "movingSeconds",
                "trips",
                "stops",
                "firstDepartureAt",
                "lastArrivalAt",
                "positions",
                "truncated",
                "outsideHours",
                "speeding"
              ],
              "properties": {
                "date": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "distanceMeters": {
                  "type": "number",
                  "minimum": 0
                },
                "movingSeconds": {
                  "type": "integer",
                  "minimum": 0
                },
                "trips": {
                  "type": "integer",
                  "minimum": 0
                },
                "stops": {
                  "type": "integer",
                  "minimum": 0
                },
                "firstDepartureAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "lastArrivalAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "positions": {
                  "type": "integer",
                  "minimum": 0
                },
                "truncated": {
                  "type": "boolean"
                },
                "outsideHours": {
                  "type": "integer",
                  "minimum": 0
                },
                "speeding": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "totals": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "distanceMeters",
              "movingSeconds",
              "trips",
              "activeDays",
              "elapsedDays",
              "outsideHours",
              "speeding"
            ],
            "properties": {
              "distanceMeters": {
                "type": "number",
                "minimum": 0
              },
              "movingSeconds": {
                "type": "integer",
                "minimum": 0
              },
              "trips": {
                "type": "integer",
                "minimum": 0
              },
              "activeDays": {
                "type": "integer",
                "minimum": 0
              },
              "elapsedDays": {
                "type": "integer",
                "minimum": 0
              },
              "outsideHours": {
                "type": "integer",
                "minimum": 0
              },
              "speeding": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "longest": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "date",
                  "distanceMeters"
                ],
                "properties": {
                  "date": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "distanceMeters": {
                    "type": "number",
                    "minimum": 0
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "analyzed": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "positions",
              "trips",
              "stops",
              "vehicles"
            ],
            "properties": {
              "positions": {
                "type": "integer",
                "minimum": 0
              },
              "trips": {
                "type": "integer",
                "minimum": 0
              },
              "stops": {
                "type": "integer",
                "minimum": 0
              },
              "vehicles": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "truncatedDays": {
            "type": "integer",
            "minimum": 0
          },
          "scheduled": {
            "type": "boolean"
          },
          "narrative": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "text",
              "evidence",
              "source"
            ],
            "properties": {
              "text": {
                "type": "string",
                "minLength": 1,
                "maxLength": 600
              },
              "evidence": {
                "type": "string",
                "minLength": 1,
                "maxLength": 600
              },
              "source": {
                "type": "string",
                "const": "template"
              }
            }
          },
          "rules": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "calendar",
              "trips",
              "schedule",
              "speed"
            ],
            "properties": {
              "calendar": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "version",
                  "days",
                  "marks",
                  "longest"
                ],
                "properties": {
                  "version": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "days": {
                    "type": "string"
                  },
                  "marks": {
                    "type": "string"
                  },
                  "longest": {
                    "type": "string"
                  }
                }
              },
              "trips": {
                "$ref": "#/components/schemas/tripRulesSchema"
              },
              "schedule": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "version",
                  "outside",
                  "suggestion"
                ],
                "properties": {
                  "version": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "outside": {
                    "type": "string"
                  },
                  "suggestion": {
                    "type": "string"
                  }
                }
              },
              "speed": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "version",
                  "limit"
                ],
                "properties": {
                  "version": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "limit": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "vehicleRestrictionsSchema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "heightMeters": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 10
          },
          "widthMeters": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 10
          },
          "lengthMeters": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 50
          },
          "weightKilograms": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 200000
          }
        }
      },
      "verificationPolicySchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "workerRequired",
          "customerAllowed",
          "customerMinimum",
          "geofenceRadiusMeters",
          "allowGeofenceOverride"
        ],
        "properties": {
          "workerRequired": {
            "type": "array",
            "maxItems": 3,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "package_scan",
                "geofence",
                "photo"
              ]
            }
          },
          "customerAllowed": {
            "type": "array",
            "maxItems": 4,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "otp",
                "customer_qr",
                "signature",
                "receiver_id"
              ]
            }
          },
          "customerMinimum": {
            "type": "integer",
            "minimum": 0,
            "maximum": 4
          },
          "geofenceRadiusMeters": {
            "type": "integer",
            "minimum": 25,
            "maximum": 2000
          },
          "allowGeofenceOverride": {
            "type": "boolean"
          }
        }
      },
      "versionInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version"
        ],
        "properties": {
          "version": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "webhookAttemptSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "attemptNo",
          "trigger",
          "startedAt",
          "durationMs",
          "outcome",
          "statusCode"
        ],
        "properties": {
          "attemptNo": {
            "type": "integer",
            "minimum": 1,
            "maximum": 30
          },
          "trigger": {
            "type": "string",
            "enum": [
              "auto",
              "manual"
            ]
          },
          "startedAt": {
            "type": "string",
            "format": "date-time"
          },
          "durationMs": {
            "type": "integer",
            "minimum": 0,
            "maximum": 60000
          },
          "outcome": {
            "type": "string",
            "enum": [
              "success",
              "http_status",
              "timeout",
              "dns_failure",
              "destination_blocked",
              "tls_failure",
              "connection_failure"
            ]
          },
          "statusCode": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 100,
            "maximum": 599
          }
        }
      },
      "webhookDeliveryDetailSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "endpointId",
          "eventId",
          "eventType",
          "state",
          "mode",
          "attempts",
          "maxAttempts",
          "manualRetries",
          "nextAttemptAt",
          "lastAttemptAt",
          "lastStatus",
          "lastOutcome",
          "succeededAt",
          "deadAt",
          "createdAt",
          "event",
          "attemptLog"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "endpointId": {
            "type": "string",
            "format": "uuid"
          },
          "eventId": {
            "type": "string",
            "format": "uuid"
          },
          "eventType": {
            "type": "string",
            "enum": [
              "distribution.order.created",
              "distribution.order.cancelled",
              "routing.plan.approved",
              "field.route.assigned",
              "field.route.cancelled",
              "field.route.started",
              "field.stop.delivered",
              "field.stop.failed",
              "field.route.finished",
              "webhook.test"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "delivering",
              "succeeded",
              "dead"
            ]
          },
          "mode": {
            "type": "string",
            "enum": [
              "auto",
              "manual"
            ]
          },
          "attempts": {
            "type": "integer",
            "minimum": 0,
            "maximum": 30
          },
          "maxAttempts": {
            "type": "integer",
            "minimum": 1,
            "maximum": 30
          },
          "manualRetries": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10
          },
          "nextAttemptAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "lastAttemptAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "lastStatus": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 100,
            "maximum": 599
          },
          "lastOutcome": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "success",
              "http_status",
              "timeout",
              "dns_failure",
              "destination_blocked",
              "tls_failure",
              "connection_failure",
              "endpoint_disabled",
              null
            ]
          },
          "succeededAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "deadAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "event": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "type",
              "occurredAt",
              "data"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "type": {
                "type": "string",
                "enum": [
                  "distribution.order.created",
                  "distribution.order.cancelled",
                  "routing.plan.approved",
                  "field.route.assigned",
                  "field.route.cancelled",
                  "field.route.started",
                  "field.stop.delivered",
                  "field.stop.failed",
                  "field.route.finished",
                  "webhook.test"
                ]
              },
              "occurredAt": {
                "type": "string",
                "format": "date-time"
              },
              "data": {
                "type": "object",
                "additionalProperties": true
              }
            }
          },
          "attemptLog": {
            "type": "array",
            "maxItems": 30,
            "items": {
              "$ref": "#/components/schemas/webhookAttemptSchema"
            }
          }
        }
      },
      "webhookDeliveryPageSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "nextCursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/webhookDeliverySchema"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        }
      },
      "webhookDeliverySchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "endpointId",
          "eventId",
          "eventType",
          "state",
          "mode",
          "attempts",
          "maxAttempts",
          "manualRetries",
          "nextAttemptAt",
          "lastAttemptAt",
          "lastStatus",
          "lastOutcome",
          "succeededAt",
          "deadAt",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "endpointId": {
            "type": "string",
            "format": "uuid"
          },
          "eventId": {
            "type": "string",
            "format": "uuid"
          },
          "eventType": {
            "type": "string",
            "enum": [
              "distribution.order.created",
              "distribution.order.cancelled",
              "routing.plan.approved",
              "field.route.assigned",
              "field.route.cancelled",
              "field.route.started",
              "field.stop.delivered",
              "field.stop.failed",
              "field.route.finished",
              "webhook.test"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "delivering",
              "succeeded",
              "dead"
            ]
          },
          "mode": {
            "type": "string",
            "enum": [
              "auto",
              "manual"
            ]
          },
          "attempts": {
            "type": "integer",
            "minimum": 0,
            "maximum": 30
          },
          "maxAttempts": {
            "type": "integer",
            "minimum": 1,
            "maximum": 30
          },
          "manualRetries": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10
          },
          "nextAttemptAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "lastAttemptAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "lastStatus": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 100,
            "maximum": 599
          },
          "lastOutcome": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "success",
              "http_status",
              "timeout",
              "dns_failure",
              "destination_blocked",
              "tls_failure",
              "connection_failure",
              "endpoint_disabled",
              null
            ]
          },
          "succeededAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "deadAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "webhookEndpointChangeSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version"
        ],
        "minProperties": 2,
        "properties": {
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 120
          },
          "eventTypes": {
            "type": "array",
            "minItems": 1,
            "maxItems": 9,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/webhookEventTypeSchema"
            }
          },
          "active": {
            "type": "boolean"
          }
        }
      },
      "webhookEndpointCreatedSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "endpoint"
        ],
        "properties": {
          "endpoint": {
            "$ref": "#/components/schemas/webhookEndpointSchema"
          },
          "secret": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "value",
              "createdAt"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "value": {
                "type": "string",
                "pattern": "^whsec_[A-Za-z0-9+/]{43}=$"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              }
            }
          }
        }
      },
      "webhookEndpointInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "url",
          "eventTypes"
        ],
        "properties": {
          "url": {
            "type": "string",
            "minLength": 12,
            "maxLength": 2048,
            "pattern": "^https://"
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "eventTypes": {
            "type": "array",
            "minItems": 1,
            "maxItems": 9,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/webhookEventTypeSchema"
            }
          }
        }
      },
      "webhookEndpointListSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/webhookEndpointSchema"
            }
          }
        }
      },
      "webhookEndpointSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "url",
          "description",
          "eventTypes",
          "state",
          "disabledReason",
          "consecutiveFailures",
          "version",
          "createdAt",
          "updatedAt",
          "secrets"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "url": {
            "type": "string",
            "maxLength": 2048
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 120
          },
          "eventTypes": {
            "type": "array",
            "minItems": 1,
            "maxItems": 9,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/webhookEventTypeSchema"
            }
          },
          "state": {
            "type": "string",
            "enum": [
              "active",
              "disabled"
            ]
          },
          "disabledReason": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "manual",
              "failures",
              null
            ]
          },
          "consecutiveFailures": {
            "type": "integer",
            "minimum": 0
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "secrets": {
            "type": "array",
            "maxItems": 2,
            "items": {
              "$ref": "#/components/schemas/webhookSecretMetaSchema"
            }
          }
        }
      },
      "webhookEventTypeSchema": {
        "type": "string",
        "enum": [
          "distribution.order.created",
          "distribution.order.cancelled",
          "routing.plan.approved",
          "field.route.assigned",
          "field.route.cancelled",
          "field.route.started",
          "field.stop.delivered",
          "field.stop.failed",
          "field.route.finished"
        ]
      },
      "webhookRotationInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version",
          "graceSeconds"
        ],
        "properties": {
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "graceSeconds": {
            "type": "integer",
            "minimum": 0,
            "maximum": 604800
          }
        }
      },
      "webhookSecretMetaSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "createdAt",
          "expiresAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "weeklyReportSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "week",
          "comparedWith",
          "rules",
          "narrative",
          "findings",
          "totals",
          "previousTotals",
          "analyzed",
          "truncatedDays",
          "days",
          "vehicles",
          "idleVehicles",
          "deliveries",
          "previousDeliveries"
        ],
        "properties": {
          "week": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "from",
              "to",
              "through",
              "partial",
              "timeZone"
            ],
            "properties": {
              "from": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "to": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "through": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "partial": {
                "type": "boolean"
              },
              "timeZone": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              }
            }
          },
          "comparedWith": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "from",
              "to"
            ],
            "properties": {
              "from": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "to": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              }
            }
          },
          "rules": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "weekly",
              "trips",
              "deliveries",
              "schedule",
              "speed"
            ],
            "properties": {
              "weekly": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "version",
                  "week",
                  "comparison",
                  "overdue",
                  "distanceChange",
                  "punctualityChange",
                  "dataGap",
                  "idle",
                  "outsideHours",
                  "awayOvernight",
                  "speeding"
                ],
                "properties": {
                  "version": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "week": {
                    "type": "string"
                  },
                  "comparison": {
                    "type": "string"
                  },
                  "overdue": {
                    "type": "string"
                  },
                  "distanceChange": {
                    "type": "string"
                  },
                  "punctualityChange": {
                    "type": "string"
                  },
                  "dataGap": {
                    "type": "string"
                  },
                  "idle": {
                    "type": "string"
                  },
                  "outsideHours": {
                    "type": "string"
                  },
                  "awayOvernight": {
                    "type": "string"
                  },
                  "speeding": {
                    "type": "string"
                  }
                }
              },
              "trips": {
                "$ref": "#/components/schemas/tripRulesSchema"
              },
              "deliveries": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "version",
                  "onTime",
                  "serviceTime",
                  "places",
                  "overdue"
                ],
                "properties": {
                  "version": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "onTime": {
                    "type": "string"
                  },
                  "serviceTime": {
                    "type": "string"
                  },
                  "places": {
                    "type": "string"
                  },
                  "overdue": {
                    "type": "string"
                  }
                }
              },
              "schedule": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "version",
                  "outside",
                  "suggestion"
                ],
                "properties": {
                  "version": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "outside": {
                    "type": "string"
                  },
                  "suggestion": {
                    "type": "string"
                  }
                }
              },
              "speed": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "version",
                  "limit"
                ],
                "properties": {
                  "version": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "limit": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "narrative": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "text",
              "evidence",
              "source"
            ],
            "properties": {
              "text": {
                "type": "string",
                "minLength": 1,
                "maxLength": 600
              },
              "evidence": {
                "type": "string",
                "minLength": 1,
                "maxLength": 600
              },
              "source": {
                "type": "string",
                "const": "template"
              }
            }
          },
          "findings": {
            "type": "array",
            "maxItems": 5,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "kind",
                "attention",
                "text",
                "vehicleId",
                "locationId",
                "date"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "outside_hours",
                    "speeding",
                    "away_overnight",
                    "overdue_place",
                    "failures",
                    "data_gap",
                    "idle_vehicles",
                    "distance_change",
                    "punctuality_change",
                    "longest_day"
                  ]
                },
                "attention": {
                  "type": "boolean"
                },
                "text": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 600
                },
                "vehicleId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "locationId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "date": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          },
          "totals": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "distanceMeters",
              "movingSeconds",
              "trips",
              "stops",
              "activeVehicles",
              "activeDays"
            ],
            "properties": {
              "distanceMeters": {
                "type": "integer",
                "minimum": 0
              },
              "movingSeconds": {
                "type": "integer",
                "minimum": 0
              },
              "trips": {
                "type": "integer",
                "minimum": 0
              },
              "stops": {
                "type": "integer",
                "minimum": 0
              },
              "activeVehicles": {
                "type": "integer",
                "minimum": 0
              },
              "activeDays": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "previousTotals": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "distanceMeters",
                  "movingSeconds",
                  "trips",
                  "stops",
                  "activeVehicles",
                  "activeDays"
                ],
                "properties": {
                  "distanceMeters": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "movingSeconds": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "trips": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "stops": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "activeVehicles": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "activeDays": {
                    "type": "integer",
                    "minimum": 0
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "analyzed": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "positions",
              "trips",
              "stops",
              "vehicles"
            ],
            "properties": {
              "positions": {
                "type": "integer",
                "minimum": 0
              },
              "trips": {
                "type": "integer",
                "minimum": 0
              },
              "stops": {
                "type": "integer",
                "minimum": 0
              },
              "vehicles": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "truncatedDays": {
            "type": "integer",
            "minimum": 0
          },
          "days": {
            "type": "array",
            "minItems": 7,
            "maxItems": 7,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "date",
                "distanceMeters",
                "movingSeconds",
                "trips",
                "stops",
                "vehicles"
              ],
              "properties": {
                "date": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "distanceMeters": {
                  "type": "integer",
                  "minimum": 0
                },
                "movingSeconds": {
                  "type": "integer",
                  "minimum": 0
                },
                "trips": {
                  "type": "integer",
                  "minimum": 0
                },
                "stops": {
                  "type": "integer",
                  "minimum": 0
                },
                "vehicles": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "vehicles": {
            "type": "array",
            "maxItems": 25,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "vehicleId",
                "label",
                "distanceMeters",
                "movingSeconds",
                "trips",
                "stops",
                "activeDays",
                "gapSeconds",
                "previousDistanceMeters",
                "longestDay"
              ],
              "properties": {
                "vehicleId": {
                  "type": "string",
                  "format": "uuid"
                },
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "distanceMeters": {
                  "type": "integer",
                  "minimum": 0
                },
                "movingSeconds": {
                  "type": "integer",
                  "minimum": 0
                },
                "trips": {
                  "type": "integer",
                  "minimum": 0
                },
                "stops": {
                  "type": "integer",
                  "minimum": 0
                },
                "activeDays": {
                  "type": "integer",
                  "minimum": 0
                },
                "gapSeconds": {
                  "type": "integer",
                  "minimum": 0
                },
                "previousDistanceMeters": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "longestDay": {
                  "anyOf": [
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "date",
                        "distanceMeters"
                      ],
                      "properties": {
                        "date": {
                          "type": "string",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                        },
                        "distanceMeters": {
                          "type": "integer",
                          "minimum": 0
                        }
                      }
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          },
          "idleVehicles": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "vehicleId",
                "label"
              ],
              "properties": {
                "vehicleId": {
                  "type": "string",
                  "format": "uuid"
                },
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                }
              }
            }
          },
          "deliveries": {
            "$ref": "#/components/schemas/deliverySummarySchema"
          },
          "previousDeliveries": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "stops",
                  "delivered",
                  "failed",
                  "onTimeRate"
                ],
                "properties": {
                  "stops": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "delivered": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "failed": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "onTimeRate": {
                    "anyOf": [
                      {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "workerChangeSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version"
        ],
        "properties": {
          "displayName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "phone": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 8,
                "maxLength": 24
              },
              {
                "type": "null"
              }
            ]
          },
          "active": {
            "type": "boolean"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "workerInputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "displayName"
        ],
        "properties": {
          "displayName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "phone": {
            "type": "string",
            "minLength": 8,
            "maxLength": 24
          }
        }
      },
      "workerListSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/workerSchema"
            }
          }
        }
      },
      "workerSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "tenantId",
          "displayName",
          "phone",
          "linked",
          "active",
          "version",
          "devices",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "displayName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "phone": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/phoneForReaderSchema"
              },
              {
                "type": "null"
              }
            ]
          },
          "linked": {
            "type": "boolean"
          },
          "active": {
            "type": "boolean"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "devices": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "model",
                "appVersion",
                "enrolledAt",
                "activatedAt",
                "revokedAt"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "model": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "appVersion": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 60
                },
                "enrolledAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "Z$"
                },
                "activatedAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "revokedAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          }
        }
      },
      "workHoursSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "start",
          "end"
        ],
        "properties": {
          "start": {
            "type": "string",
            "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
          },
          "end": {
            "type": "string",
            "pattern": "^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"
          }
        }
      },
      "workWeekSchema": {
        "type": "array",
        "minItems": 7,
        "maxItems": 7,
        "items": {
          "anyOf": [
            {
              "$ref": "#/components/schemas/workHoursSchema"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    }
  },
  "paths": {
    "/health/live": {
      "get": {
        "security": [],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/healthSchema"
                }
              }
            }
          }
        }
      }
    },
    "/health/ready": {
      "get": {
        "security": [],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/healthSchema"
                }
              }
            }
          },
          "503": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorSchema"
                }
              }
            }
          }
        }
      }
    },
    "/v1/context": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/contextSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/me/tenants": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/tenantDirectorySchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/objects": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/objectInputSchema"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/objectSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      },
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "after",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/objectSchema"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/objects/{id}": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/objectSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      },
      "delete": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Object suppressed"
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/objects/{id}/content": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validated UTF-8 attachment; never public/cacheable",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/members": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/memberSchema"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/members/{id}": {
      "patch": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/memberInputSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/memberSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/audit": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "after",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/auditSchema"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/fleet/vehicles": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/fleetVehicleInputSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/fleetVehicleSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      },
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/fleetVehiclePageSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/fleet/live-tracks": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "after",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/fleetLiveTrackPageSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/fleet/vehicles/{id}": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/fleetVehicleSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      },
      "patch": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/fleetVehicleChangeSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/fleetVehicleSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/fleet/vehicles/{id}/positions": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "sourceId",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "from",
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "in": "query",
            "name": "to",
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/fleetPositionPageSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/fleet/vehicles/{id}/days/{date}": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "date",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/vehicleDaySchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/fleet/vehicles/{id}/months/{month}": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "month",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/vehicleMonthSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/fleet/sources": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/fleetSourceInputSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/fleetSourceSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      },
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/fleetSourceSchema"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/fleet/sources/{id}": {
      "patch": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/fleetSourceChangeSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/fleetSourceSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/fleet/positions": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/fleetPositionInputSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/fleetPositionSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/routing/routes": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/routeInputSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/routeResultSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/routing/matrices": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/routeInputSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/matrixResultSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/routing/optimization-previews": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/optimizationInputSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/optimizationPreviewSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/routing/optimization-previews/{id}": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/optimizationPreviewSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/routing/optimization-previews/{id}/approve": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/approvalInputSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/routePlanSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/routing/route-plans/{id}": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/routePlanSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/geocoding/searches": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/geocodeInputSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/geocodeResultSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/geocoding/reverse": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/reverseGeocodeInputSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/reverseGeocodeResultSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/distribution/locations": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/locationInputSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/locationSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      },
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/locationListSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/distribution/orders": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/orderInputSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/orderSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      },
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/orderListSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/distribution/orders/{id}/cancel": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/cancelInputSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/orderSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/distribution/plan-previews": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/planPreviewInputSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/optimizationPreviewSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/distribution/imports": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/importInputSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/importBatchSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      },
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/importBatchListSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/distribution/imports/{id}": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "afterRow",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100000,
              "default": 1
            }
          },
          {
            "in": "query",
            "name": "rowLimit",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/importBatchSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/distribution/imports/{id}/geocode": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/importGeocodeInputSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/importBatchSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/distribution/imports/{id}/rows/{rowNumber}/resolution": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "rowNumber",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 2,
              "maximum": 100000
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/importResolutionInputSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/importBatchSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/distribution/imports/{id}/commit": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/cancelInputSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/importBatchSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/distribution/imports/{id}/discard": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/cancelInputSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/importBatchSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/distribution/exports/orders": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "from",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "in": "query",
            "name": "to",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "in": "query",
            "name": "state",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "cancelled",
                "all"
              ],
              "default": "all"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Orders CSV attachment for Excel es-CL; audited, never cacheable",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/field/exports/deliveries": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "from",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "in": "query",
            "name": "to",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deliveries CSV attachment (one row per stop, sealed evidence counts); audited, never cacheable",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/integrations/connections": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/connectionInputSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/connectionSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      },
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/connectionSchema"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/integrations/connections/{id}": {
      "patch": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/connectionChangeSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/connectionSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/integrations/connections/{id}/bsale/issue-options": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/bsaleIssueOptionsSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/integrations/connections/{id}/bsale/issue-settings": {
      "put": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/bsaleIssueSettingsInputSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/connectionSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/integrations/connections/{id}/disconnect": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/versionInputSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/connectionSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/integrations/bsale/authorizations": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/bsaleAuthorizationInputSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/bsaleAuthorizationSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/integrations/bsale/authorizations/{id}/complete": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/bsaleAuthorizationCompleteSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/connectionSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/integrations/connections/{id}/mappings/{stream}": {
      "put": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "stream",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/integrationStreamSchema"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/mappingInputSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/mappingSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/integrations/connections/{id}/imports/{stream}": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "stream",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/integrationStreamSchema"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/importResultSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/integrations/canonical/{stream}": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "stream",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/integrationStreamSchema"
            }
          },
          {
            "in": "query",
            "name": "after",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "in": "query",
            "name": "connectionId",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/canonicalPageSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/integrations/connections/{id}/conflicts": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "after",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/conflictPageSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/customer-finance/invoice-intents": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/invoiceIntentInputSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/invoiceIntentSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      },
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "after",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/invoiceIntentPageSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/customer-finance/invoice-intents/{id}": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/invoiceIntentSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/customer-finance/invoice-intents/{id}/lines": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/invoiceLinesSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/customer-finance/invoice-intents/{id}/review": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/versionInputSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/invoiceIntentSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/customer-finance/invoice-intents/{id}/approve": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/versionInputSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/invoiceIntentSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/customer-finance/invoice-intents/{id}/issue": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/invoiceIntentSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/customer-finance/invoice-intents/{id}/reconcile": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/invoiceIntentSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/field/settings": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/fieldSettingsSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      },
      "put": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/fieldSettingsInputSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/fieldSettingsSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/field/workers": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/workerListSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      },
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/workerInputSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/workerSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/field/workers/{id}": {
      "patch": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/workerChangeSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/workerSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/field/workers/{id}/invitations": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/invitationSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/field/devices/{id}/revoke": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/workerSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/field/routes": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/assignmentInputSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/fieldRouteSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      },
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "serviceDate",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "in": "query",
            "name": "from",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "in": "query",
            "name": "to",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 60
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/fieldRouteListSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/field/routes/progress": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "serviceDate",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/fieldRouteProgressListSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/field/routes/{id}": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/fieldRouteSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/field/deliveries/summary": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "from",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "to",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/deliverySummarySchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/reports/weekly": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "week",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/weeklyReportSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/reports/monthly": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "month",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}$"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/monthlyReportSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/reports/stats": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "from",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "to",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/statsReportSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/reports/speeding": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "from",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "to",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/speedingReportSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/fleet/places": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/placeListSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      },
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/placeInputSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/placeSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/fleet/places/{id}": {
      "patch": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/placeChangeSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/placeSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/fleet/places/suggestions": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "days",
            "schema": {
              "type": "integer",
              "minimum": 7,
              "maximum": 31,
              "default": 30
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/placeSuggestionsSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/fleet/schedule": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/scheduleSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      },
      "put": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/scheduleInputSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/scheduleSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/fleet/schedule/suggestion": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/scheduleSuggestionSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/fleet/care": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/careListSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/fleet/vehicles/{id}/care": {
      "put": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/vehicleCareInputSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/vehicleCareSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/fleet/vehicles/{id}/odometer": {
      "put": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/odometerInputSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/vehicleCareSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/fleet/vehicles/{id}/fuel": {
      "put": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/fuelInputSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/vehicleCareSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/fleet/documents": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/documentListSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      },
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/documentInputSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/documentSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/fleet/documents/{id}": {
      "patch": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/documentChangeSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/documentSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/fleet/documents/{id}/remove": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/documentRemovalSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/documentSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/fleet/documents/{id}/history": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/documentHistorySchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/fleet/documents/{id}/file": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "La copia como adjunto, aislada; nunca en caché",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      },
      "put": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/documentSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/pdf": {
              "schema": {
                "type": "string",
                "format": "binary",
                "maxLength": 10485760
              }
            },
            "image/jpeg": {
              "schema": {
                "type": "string",
                "format": "binary",
                "maxLength": 10485760
              }
            },
            "image/png": {
              "schema": {
                "type": "string",
                "format": "binary",
                "maxLength": 10485760
              }
            }
          }
        }
      }
    },
    "/v1/fleet/document-types": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/documentTypeInputSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/documentTypeSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/fleet/document-types/{key}": {
      "put": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^(technical_review|circulation_permit|soap|insurance|registration|driver_license|custom-[0-9a-f]{12})$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/documentTypeChangeSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/documentTypeSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/michiva/questions": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/michivaQuestionInputSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/michivaInterpretationSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/michiva/asked": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/michivaAskedInputSchema"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Counted"
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/michiva/popular": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/michivaPopularSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/field/routes/{id}/cancel": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/versionInputSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/fieldRouteSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/field/assets/{id}/content": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sealed evidence as an attachment, sandboxed; never cacheable",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/svg+xml": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/field/devices/enrollments": {
      "post": {
        "security": [],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/enrollmentInputSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/enrollmentSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        },
        "tags": [
          "field-device"
        ]
      }
    },
    "/v1/field/devices/{id}/activation": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/meSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        },
        "tags": [
          "field-device"
        ]
      }
    },
    "/v1/field/me": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "x-device-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/meSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        },
        "tags": [
          "field-device"
        ]
      }
    },
    "/v1/field/routes/current": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "x-device-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/routeManifestSchema"
                }
              }
            }
          },
          "204": {
            "description": "No open route for this worker"
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        },
        "tags": [
          "field-device"
        ]
      }
    },
    "/v1/field/routes/{id}/events": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "x-device-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/eventEnvelopeSchema"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/eventAckSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        },
        "tags": [
          "field-device"
        ]
      }
    },
    "/v1/field/routes/{id}/positions": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "x-device-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/positionBatchSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/positionsAckSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        },
        "tags": [
          "field-device"
        ]
      }
    },
    "/v1/field/evidence/uploads": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "x-device-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/uploadRequestSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/uploadTicketSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        },
        "tags": [
          "field-device"
        ]
      }
    },
    "/v1/field/evidence/uploads/{id}/content": {
      "put": {
        "security": [],
        "tags": [
          "field-device"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{43}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "image/jpeg": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "image/svg+xml": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Stored and sealed"
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/field/routes/{routeId}/stops/{stopId}/customer-code/dispatch": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "x-device-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "routeId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "stopId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        },
        "tags": [
          "field-device"
        ]
      }
    },
    "/v1/field/routes/{routeId}/stops/{stopId}/customer-code/verify": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "x-device-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "routeId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "stopId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/customerCodeInputSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/customerCodeResultSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        },
        "tags": [
          "field-device"
        ]
      }
    },
    "/v1/field/deliveries": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "from",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "in": "query",
            "name": "to",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "in": "query",
            "name": "outcome",
            "schema": {
              "type": "string",
              "enum": [
                "delivered",
                "failed"
              ]
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/deliveryRegisterSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/distribution/orders/{id}/delivery-code": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/orderDeliveryCodeSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/distribution/orders/deliveries": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/orderOutcomeListSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/distribution/orders/{id}/events": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/orderEventListSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/distribution/orders/{id}/tracking-link": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/trackingLinkStatusSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      },
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/trackingLinkIssuedSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/distribution/orders/{id}/tracking-link/revoke": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/trackingLinkStatusSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/track/{token}": {
      "get": {
        "security": [],
        "tags": [
          "tracking-public"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{22}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/trackingViewSchema"
                }
              }
            }
          },
          "404": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorSchema"
                }
              }
            }
          },
          "429": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorSchema"
                }
              }
            }
          },
          "503": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorSchema"
                }
              }
            }
          }
        }
      }
    },
    "/t/{token}": {
      "get": {
        "security": [],
        "tags": [
          "tracking-public"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{22}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Self-contained tracking page (strict CSP, no third parties); polls /v1/track/{token}",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Same page; it shows that the link is not available",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorSchema"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhooks/endpoints": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/webhookEndpointInputSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookEndpointCreatedSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      },
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookEndpointListSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/webhooks/endpoints/{id}": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookEndpointSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      },
      "patch": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/webhookEndpointChangeSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookEndpointSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/webhooks/endpoints/{id}/secrets": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/webhookRotationInputSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookEndpointCreatedSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/webhooks/endpoints/{id}/test": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDeliverySchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/webhooks/endpoints/{id}/deliveries": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "state",
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "delivering",
                "succeeded",
                "dead"
              ]
            }
          },
          {
            "in": "query",
            "name": "before",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDeliveryPageSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/webhooks/deliveries": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "state",
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "delivering",
                "succeeded",
                "dead"
              ]
            }
          },
          {
            "in": "query",
            "name": "before",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "in": "query",
            "name": "endpointId",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDeliveryPageSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/webhooks/deliveries/{id}": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDeliveryDetailSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/webhooks/deliveries/{id}/retry": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDeliverySchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/notifications/email/settings": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/notificationSettingsSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      },
      "put": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/notificationSettingsInputSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/notificationSettingsSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/notifications/email/recipients": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/notificationRecipientListSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      },
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/recipientInputSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/notificationRecipientSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/notifications/email/recipients/{id}/verify": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/recipientVerifyInputSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/notificationRecipientSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/notifications/email/recipients/{id}/resend": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/emptyInputSchema"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/notificationRecipientSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/notifications/email/recipients/{id}/remove": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/recipientRemoveInputSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/notificationRecipientSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/notifications/email/suppressions": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/suppressionListSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      },
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/suppressionInputSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/suppressionSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/notifications/email/suppressions/{id}/remove": {
      "post": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/emptyInputSchema"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Suppression removed"
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/v1/notifications/email/messages": {
      "get": {
        "security": [
          {
            "accessToken": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/emailMessageListSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/error"
          },
          "401": {
            "$ref": "#/components/responses/error"
          },
          "403": {
            "$ref": "#/components/responses/error"
          },
          "404": {
            "$ref": "#/components/responses/error"
          },
          "409": {
            "$ref": "#/components/responses/error"
          },
          "410": {
            "$ref": "#/components/responses/error"
          },
          "413": {
            "$ref": "#/components/responses/error"
          },
          "415": {
            "$ref": "#/components/responses/error"
          },
          "422": {
            "$ref": "#/components/responses/error"
          },
          "429": {
            "$ref": "#/components/responses/error"
          },
          "503": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    }
  },
  "webhooks": {
    "distribution.order.cancelled": {
      "post": {
        "summary": "distribution.order.cancelled",
        "parameters": [
          {
            "in": "header",
            "name": "webhook-id",
            "required": true,
            "description": "Id estable del evento (igual a `id` del cuerpo); deduplicar por él.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "webhook-timestamp",
            "required": true,
            "description": "Segundos Unix; rechazar si difiere más de 5 minutos.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{1,12}$"
            }
          },
          {
            "in": "header",
            "name": "webhook-signature",
            "required": true,
            "description": "Una o dos firmas `v1,<base64(HMAC-SHA256(secreto,\"{id}.{timestamp}.{cuerpo}\"))>` separadas por espacio.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "tenantId",
                  "version",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Id estable del evento; igual a la cabecera webhook-id. Sirve para deduplicar."
                  },
                  "type": {
                    "type": "string",
                    "const": "distribution.order.cancelled"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "tenantId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "version": {
                    "type": "integer",
                    "const": 1
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "orderId",
                      "reference",
                      "state"
                    ],
                    "properties": {
                      "orderId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "reference": {
                        "type": "string",
                        "maxLength": 80
                      },
                      "state": {
                        "type": "string",
                        "enum": [
                          "open",
                          "cancelled"
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Recibido; cualquier otra respuesta se reintenta"
          }
        }
      }
    },
    "distribution.order.created": {
      "post": {
        "summary": "distribution.order.created",
        "parameters": [
          {
            "in": "header",
            "name": "webhook-id",
            "required": true,
            "description": "Id estable del evento (igual a `id` del cuerpo); deduplicar por él.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "webhook-timestamp",
            "required": true,
            "description": "Segundos Unix; rechazar si difiere más de 5 minutos.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{1,12}$"
            }
          },
          {
            "in": "header",
            "name": "webhook-signature",
            "required": true,
            "description": "Una o dos firmas `v1,<base64(HMAC-SHA256(secreto,\"{id}.{timestamp}.{cuerpo}\"))>` separadas por espacio.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "tenantId",
                  "version",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Id estable del evento; igual a la cabecera webhook-id. Sirve para deduplicar."
                  },
                  "type": {
                    "type": "string",
                    "const": "distribution.order.created"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "tenantId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "version": {
                    "type": "integer",
                    "const": 1
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "orderId",
                      "reference",
                      "state"
                    ],
                    "properties": {
                      "orderId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "reference": {
                        "type": "string",
                        "maxLength": 80
                      },
                      "state": {
                        "type": "string",
                        "enum": [
                          "open",
                          "cancelled"
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Recibido; cualquier otra respuesta se reintenta"
          }
        }
      }
    },
    "field.route.assigned": {
      "post": {
        "summary": "field.route.assigned",
        "parameters": [
          {
            "in": "header",
            "name": "webhook-id",
            "required": true,
            "description": "Id estable del evento (igual a `id` del cuerpo); deduplicar por él.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "webhook-timestamp",
            "required": true,
            "description": "Segundos Unix; rechazar si difiere más de 5 minutos.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{1,12}$"
            }
          },
          {
            "in": "header",
            "name": "webhook-signature",
            "required": true,
            "description": "Una o dos firmas `v1,<base64(HMAC-SHA256(secreto,\"{id}.{timestamp}.{cuerpo}\"))>` separadas por espacio.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "tenantId",
                  "version",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Id estable del evento; igual a la cabecera webhook-id. Sirve para deduplicar."
                  },
                  "type": {
                    "type": "string",
                    "const": "field.route.assigned"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "tenantId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "version": {
                    "type": "integer",
                    "const": 1
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "routeId",
                      "routePlanId",
                      "vehicleRouteId",
                      "serviceDate",
                      "fleetVehicleId",
                      "stopCount",
                      "orderIds"
                    ],
                    "properties": {
                      "routeId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "routePlanId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "vehicleRouteId": {
                        "type": "string",
                        "maxLength": 128
                      },
                      "serviceDate": {
                        "type": "string",
                        "format": "date"
                      },
                      "fleetVehicleId": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "uuid"
                      },
                      "stopCount": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50
                      },
                      "orderIds": {
                        "type": "array",
                        "maxItems": 50,
                        "items": {
                          "type": "string",
                          "format": "uuid"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Recibido; cualquier otra respuesta se reintenta"
          }
        }
      }
    },
    "field.route.cancelled": {
      "post": {
        "summary": "field.route.cancelled",
        "parameters": [
          {
            "in": "header",
            "name": "webhook-id",
            "required": true,
            "description": "Id estable del evento (igual a `id` del cuerpo); deduplicar por él.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "webhook-timestamp",
            "required": true,
            "description": "Segundos Unix; rechazar si difiere más de 5 minutos.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{1,12}$"
            }
          },
          {
            "in": "header",
            "name": "webhook-signature",
            "required": true,
            "description": "Una o dos firmas `v1,<base64(HMAC-SHA256(secreto,\"{id}.{timestamp}.{cuerpo}\"))>` separadas por espacio.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "tenantId",
                  "version",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Id estable del evento; igual a la cabecera webhook-id. Sirve para deduplicar."
                  },
                  "type": {
                    "type": "string",
                    "const": "field.route.cancelled"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "tenantId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "version": {
                    "type": "integer",
                    "const": 1
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "routeId",
                      "serviceDate"
                    ],
                    "properties": {
                      "routeId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "serviceDate": {
                        "type": "string",
                        "format": "date"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Recibido; cualquier otra respuesta se reintenta"
          }
        }
      }
    },
    "field.route.finished": {
      "post": {
        "summary": "field.route.finished",
        "parameters": [
          {
            "in": "header",
            "name": "webhook-id",
            "required": true,
            "description": "Id estable del evento (igual a `id` del cuerpo); deduplicar por él.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "webhook-timestamp",
            "required": true,
            "description": "Segundos Unix; rechazar si difiere más de 5 minutos.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{1,12}$"
            }
          },
          {
            "in": "header",
            "name": "webhook-signature",
            "required": true,
            "description": "Una o dos firmas `v1,<base64(HMAC-SHA256(secreto,\"{id}.{timestamp}.{cuerpo}\"))>` separadas por espacio.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "tenantId",
                  "version",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Id estable del evento; igual a la cabecera webhook-id. Sirve para deduplicar."
                  },
                  "type": {
                    "type": "string",
                    "const": "field.route.finished"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "tenantId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "version": {
                    "type": "integer",
                    "const": 1
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "routeId",
                      "finishedAt",
                      "summary"
                    ],
                    "properties": {
                      "routeId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "finishedAt": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "summary": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "delivered",
                          "failed",
                          "skipped"
                        ],
                        "properties": {
                          "delivered": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "failed": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "skipped": {
                            "type": "integer",
                            "minimum": 0
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Recibido; cualquier otra respuesta se reintenta"
          }
        }
      }
    },
    "field.route.started": {
      "post": {
        "summary": "field.route.started",
        "parameters": [
          {
            "in": "header",
            "name": "webhook-id",
            "required": true,
            "description": "Id estable del evento (igual a `id` del cuerpo); deduplicar por él.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "webhook-timestamp",
            "required": true,
            "description": "Segundos Unix; rechazar si difiere más de 5 minutos.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{1,12}$"
            }
          },
          {
            "in": "header",
            "name": "webhook-signature",
            "required": true,
            "description": "Una o dos firmas `v1,<base64(HMAC-SHA256(secreto,\"{id}.{timestamp}.{cuerpo}\"))>` separadas por espacio.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "tenantId",
                  "version",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Id estable del evento; igual a la cabecera webhook-id. Sirve para deduplicar."
                  },
                  "type": {
                    "type": "string",
                    "const": "field.route.started"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "tenantId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "version": {
                    "type": "integer",
                    "const": 1
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "routeId"
                    ],
                    "properties": {
                      "routeId": {
                        "type": "string",
                        "format": "uuid"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Recibido; cualquier otra respuesta se reintenta"
          }
        }
      }
    },
    "field.stop.delivered": {
      "post": {
        "summary": "field.stop.delivered",
        "parameters": [
          {
            "in": "header",
            "name": "webhook-id",
            "required": true,
            "description": "Id estable del evento (igual a `id` del cuerpo); deduplicar por él.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "webhook-timestamp",
            "required": true,
            "description": "Segundos Unix; rechazar si difiere más de 5 minutos.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{1,12}$"
            }
          },
          {
            "in": "header",
            "name": "webhook-signature",
            "required": true,
            "description": "Una o dos firmas `v1,<base64(HMAC-SHA256(secreto,\"{id}.{timestamp}.{cuerpo}\"))>` separadas por espacio.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "tenantId",
                  "version",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Id estable del evento; igual a la cabecera webhook-id. Sirve para deduplicar."
                  },
                  "type": {
                    "type": "string",
                    "const": "field.stop.delivered"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "tenantId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "version": {
                    "type": "integer",
                    "const": 1
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "routeId",
                      "stopId",
                      "orderId",
                      "reference",
                      "outcomeAt",
                      "evidenceCount"
                    ],
                    "properties": {
                      "routeId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "stopId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "orderId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "reference": {
                        "type": "string",
                        "maxLength": 80
                      },
                      "outcomeAt": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "evidenceCount": {
                        "type": "integer",
                        "minimum": 0
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Recibido; cualquier otra respuesta se reintenta"
          }
        }
      }
    },
    "field.stop.failed": {
      "post": {
        "summary": "field.stop.failed",
        "parameters": [
          {
            "in": "header",
            "name": "webhook-id",
            "required": true,
            "description": "Id estable del evento (igual a `id` del cuerpo); deduplicar por él.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "webhook-timestamp",
            "required": true,
            "description": "Segundos Unix; rechazar si difiere más de 5 minutos.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{1,12}$"
            }
          },
          {
            "in": "header",
            "name": "webhook-signature",
            "required": true,
            "description": "Una o dos firmas `v1,<base64(HMAC-SHA256(secreto,\"{id}.{timestamp}.{cuerpo}\"))>` separadas por espacio.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "tenantId",
                  "version",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Id estable del evento; igual a la cabecera webhook-id. Sirve para deduplicar."
                  },
                  "type": {
                    "type": "string",
                    "const": "field.stop.failed"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "tenantId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "version": {
                    "type": "integer",
                    "const": 1
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "routeId",
                      "stopId",
                      "orderId",
                      "reference",
                      "outcomeAt",
                      "evidenceCount"
                    ],
                    "properties": {
                      "routeId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "stopId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "orderId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "reference": {
                        "type": "string",
                        "maxLength": 80
                      },
                      "outcomeAt": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "evidenceCount": {
                        "type": "integer",
                        "minimum": 0
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Recibido; cualquier otra respuesta se reintenta"
          }
        }
      }
    },
    "routing.plan.approved": {
      "post": {
        "summary": "routing.plan.approved",
        "parameters": [
          {
            "in": "header",
            "name": "webhook-id",
            "required": true,
            "description": "Id estable del evento (igual a `id` del cuerpo); deduplicar por él.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "webhook-timestamp",
            "required": true,
            "description": "Segundos Unix; rechazar si difiere más de 5 minutos.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{1,12}$"
            }
          },
          {
            "in": "header",
            "name": "webhook-signature",
            "required": true,
            "description": "Una o dos firmas `v1,<base64(HMAC-SHA256(secreto,\"{id}.{timestamp}.{cuerpo}\"))>` separadas por espacio.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "tenantId",
                  "version",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Id estable del evento; igual a la cabecera webhook-id. Sirve para deduplicar."
                  },
                  "type": {
                    "type": "string",
                    "const": "routing.plan.approved"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "tenantId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "version": {
                    "type": "integer",
                    "const": 1
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "routePlanId",
                      "previewId",
                      "routeCount",
                      "unassignedCount"
                    ],
                    "properties": {
                      "routePlanId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "previewId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "routeCount": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "unassignedCount": {
                        "type": "integer",
                        "minimum": 0
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Recibido; cualquier otra respuesta se reintenta"
          }
        }
      }
    },
    "webhook.test": {
      "post": {
        "summary": "webhook.test",
        "parameters": [
          {
            "in": "header",
            "name": "webhook-id",
            "required": true,
            "description": "Id estable del evento (igual a `id` del cuerpo); deduplicar por él.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "webhook-timestamp",
            "required": true,
            "description": "Segundos Unix; rechazar si difiere más de 5 minutos.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{1,12}$"
            }
          },
          {
            "in": "header",
            "name": "webhook-signature",
            "required": true,
            "description": "Una o dos firmas `v1,<base64(HMAC-SHA256(secreto,\"{id}.{timestamp}.{cuerpo}\"))>` separadas por espacio.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "tenantId",
                  "version",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Id estable del evento; igual a la cabecera webhook-id. Sirve para deduplicar."
                  },
                  "type": {
                    "type": "string",
                    "const": "webhook.test"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "tenantId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "version": {
                    "type": "integer",
                    "const": 1
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "endpointId"
                    ],
                    "properties": {
                      "endpointId": {
                        "type": "string",
                        "format": "uuid"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Recibido; cualquier otra respuesta se reintenta"
          }
        }
      }
    }
  }
}
