{
  "openapi": "3.0.0",
  "paths": {
    "/v1/tenants/create": {
      "post": {
        "description": "Create a new tenant with the provided data.",
        "operationId": "TenantsController_create_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTenantDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the created tenant ID and prefix.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/CreatedTenantDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "summary": "Create a tenant",
        "tags": [
          "tenants"
        ]
      }
    },
    "/v1/storage/files/upload/sign": {
      "post": {
        "description": "Sign a file upload to allow the client to upload a file.",
        "operationId": "StorageController_signUpload_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignUploadDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns signed upload URL and file metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/SignedUploadPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Sign a file upload",
        "tags": [
          "storage"
        ]
      }
    },
    "/v1/storage/files": {
      "get": {
        "description": "Get a list of all files based on the provided query parameters.",
        "operationId": "StorageController_findAllFiles_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of files.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "files": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/FilePayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "storage:view:all"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all files",
        "tags": [
          "storage"
        ]
      }
    },
    "/v1/storage/files/{fileId}": {
      "get": {
        "description": "Get a file by its ID. Only metadata will be retrieved, to open the file use the /files/:fileId/open endpoint.",
        "operationId": "StorageController_findOneFile_v1",
        "parameters": [
          {
            "name": "fileId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the file.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/FilePayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "storage:view:all"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Retrieve a file metadata",
        "tags": [
          "storage"
        ]
      }
    },
    "/v1/storage/files/{fileId}/open": {
      "get": {
        "description": "Generate a secure URL to open a file.",
        "operationId": "StorageController_openFile_v1",
        "parameters": [
          {
            "name": "fileId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a temporary signed URL for file access.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/FileOpenPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "storage:view:all"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Open a file",
        "tags": [
          "storage"
        ]
      }
    },
    "/v1/storage/files/{fileId}/update": {
      "post": {
        "description": "Update the metadata of a file.",
        "operationId": "StorageController_updateFile_v1",
        "parameters": [
          {
            "name": "fileId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateFileDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the updated file.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/FilePayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "storage:edit:all"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Update a file metadata",
        "tags": [
          "storage"
        ]
      }
    },
    "/v1/storage/files/{fileId}/delete": {
      "post": {
        "description": "Remove a file from the storage. This action is irreversible.",
        "operationId": "StorageController_removeFile_v1",
        "parameters": [
          {
            "name": "fileId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "storage:delete:all"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Delete a file",
        "tags": [
          "storage"
        ]
      }
    },
    "/v1/storage/folders/create": {
      "post": {
        "description": "Create a new folder.",
        "operationId": "StorageController_createFolder_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFolderDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the created folder.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/FolderPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "storage:edit:all"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Create a folder",
        "tags": [
          "storage"
        ]
      }
    },
    "/v1/storage/folders": {
      "get": {
        "description": "Get a list of all folders based on the provided query parameters.",
        "operationId": "StorageController_findAllFolders_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of folders.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "folders": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/FolderPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "storage:view:all"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all folders",
        "tags": [
          "storage"
        ]
      }
    },
    "/v1/storage/folders/{folderId}/update": {
      "post": {
        "description": "Update a folder.",
        "operationId": "StorageController_updateFolder_v1",
        "parameters": [
          {
            "name": "folderId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateFolderDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the updated folder.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/FolderPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "storage:edit:all"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Update a folder",
        "tags": [
          "storage"
        ]
      }
    },
    "/v1/storage/folders/{folderId}/delete": {
      "post": {
        "description": "Remove a folder from the storage. This action is irreversible. All files and folders inside will be removed as well.",
        "operationId": "StorageController_removeFolder_v1",
        "parameters": [
          {
            "name": "folderId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "storage:delete:all"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Delete a folder",
        "tags": [
          "storage"
        ]
      }
    },
    "/v1/settings": {
      "get": {
        "description": "Retrieve the settings object for this tenant.",
        "operationId": "SettingsController_findOne_v1",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Return the settings object for this tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/SettingPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Retrieve all settings",
        "tags": [
          "settings"
        ]
      }
    },
    "/v1/settings/portal": {
      "get": {
        "description": "Retrieve the portal settings object for this tenant.",
        "operationId": "SettingsController_portal_v1",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Returns the portal settings for this tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/PortalPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "summary": "Retrieve portal settings",
        "tags": [
          "settings"
        ]
      }
    },
    "/v1/settings/nickname/check": {
      "get": {
        "description": "Check if a nickname is available for use as a custom subdomain. Returns the sanitized version and availability status.",
        "operationId": "SettingsController_checkNickname_v1",
        "parameters": [
          {
            "name": "value",
            "required": true,
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super",
                            "admin"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Check nickname availability",
        "tags": [
          "settings"
        ]
      }
    },
    "/v1/settings/update": {
      "post": {
        "description": "Update the settings object for this tenant.",
        "operationId": "SettingsController_update_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSettingDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return a limited settings object for this tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/SettingPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super",
                            "admin"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Update the settings",
        "tags": [
          "settings"
        ]
      }
    },
    "/v1/settings/domains/create": {
      "post": {
        "description": "Create a custom domain for this tenant.",
        "operationId": "SettingsController_createDomain_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDomainDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the updated settings object after domain creation.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/SettingPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super",
                            "admin"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Create a custom domain",
        "tags": [
          "settings"
        ]
      }
    },
    "/v1/settings/domains/{domainId}/delete": {
      "post": {
        "description": "Remove a custom domain for this tenant.",
        "operationId": "SettingsController_removeDomain_v1",
        "parameters": [
          {
            "name": "domainId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super",
                            "admin"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Delete a custom domain",
        "tags": [
          "settings"
        ]
      }
    },
    "/v1/settings/senders-identity/details": {
      "get": {
        "description": "Retrieve detailed sender identities for this tenant.",
        "operationId": "SettingsController_getSenderIdentitiesDetails_v1",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Returns a list of sender identities with DNS verification details.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "senderIdentities": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/SenderIdentityPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super",
                            "admin"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Retrieve all sender identities",
        "tags": [
          "settings"
        ]
      }
    },
    "/v1/settings/senders-identity/create": {
      "post": {
        "description": "Create a new email sender indentity for this tenant.",
        "operationId": "SettingsController_createSenderIdentity_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSenderIdentityDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the created sender identity.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/SenderIdentityPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super",
                            "admin"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Create a new email sender indentity.",
        "tags": [
          "settings"
        ]
      }
    },
    "/v1/settings/senders-identity/{senderIdentityId}/delete": {
      "post": {
        "description": "Remove a sender identity for this tenant.",
        "operationId": "SettingsController_removeSenderIdentity_v1",
        "parameters": [
          {
            "name": "senderIdentityId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super",
                            "admin"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Delete a sender identity",
        "tags": [
          "settings"
        ]
      }
    },
    "/v1/billing/invoices": {
      "get": {
        "description": "Get a list of all invoices based on the provided query parameters.",
        "operationId": "BillingController_findAllInvoices_v1",
        "parameters": [
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 100,
              "type": "number"
            }
          },
          {
            "name": "status",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "draft",
                "open",
                "paid",
                "uncollectible",
                "void"
              ]
            }
          },
          {
            "name": "dueDate",
            "required": false,
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/QueryInvoiceDueDateDto"
            }
          },
          {
            "name": "startingAfter",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endingBefore",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 100,
              "type": "number"
            }
          },
          {
            "required": false,
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dueDate",
            "required": false,
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/QueryInvoiceDueDateDto"
            }
          },
          {
            "required": false,
            "name": "startingAfter",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "endingBefore",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns paginated invoice list.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/InvoicesDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all invoices",
        "tags": [
          "billing"
        ]
      }
    },
    "/v1/billing/products": {
      "get": {
        "description": "Get a list of all available products.",
        "operationId": "BillingController_findAllProducts_v1",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Returns list of available products.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/ProductsDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all products",
        "tags": [
          "billing"
        ]
      }
    },
    "/v1/billing/sources": {
      "get": {
        "description": "Get a list of all active payment sources.",
        "operationId": "BillingController_findAllSources_v1",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Returns a list of current active sources.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "sources": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/PaymentMethodDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all sources",
        "tags": [
          "billing"
        ]
      }
    },
    "/v1/billing/sources/create": {
      "post": {
        "description": "Currently only cards are supported. Sources will be used to charge for Qualy services.",
        "operationId": "BillingController_createSource_v1",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique key for idempotent request processing. If the same key is sent again, the cached response is returned.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttachPaymentMethodDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns a list of current active sources.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "sources": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/PaymentMethodDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Create a new source",
        "tags": [
          "billing"
        ]
      }
    },
    "/v1/billing/sources/{sourceId}/default": {
      "post": {
        "description": "The default source will be the first to be charged. If it fails, and other sources are available, other sources may be attempted.",
        "operationId": "BillingController_updateSource_v1",
        "parameters": [
          {
            "name": "sourceId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "sources": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/PaymentMethodDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Set source as default",
        "tags": [
          "billing"
        ]
      }
    },
    "/v1/billing/sources/{sourceId}/delete": {
      "post": {
        "description": "Delete a source, rendering it impossible to be charged.",
        "operationId": "BillingController_deleteSource_v1",
        "parameters": [
          {
            "name": "sourceId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of current active sources.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "sources": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/PaymentMethodDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Delete source",
        "tags": [
          "billing"
        ]
      }
    },
    "/v1/billing/subscriptions": {
      "get": {
        "description": "Get information about all subscriptions, including their status and products.",
        "operationId": "BillingController_findAllSubscriptions_v1",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Returns subscription status and active subscription list.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/ActiveSubscriptionsDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all subscriptions",
        "tags": [
          "billing"
        ]
      }
    },
    "/v1/billing/subscriptions/add-ons/{productId}/{priceId}/buy": {
      "post": {
        "description": "Purchase an addon. After purchase it may need to be manually set up.",
        "operationId": "BillingController_buyAddon_v1",
        "parameters": [
          {
            "name": "productId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "priceId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the updated subscription."
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Buy and activate addon",
        "tags": [
          "billing"
        ]
      }
    },
    "/v1/billing/subscriptions/{priceId}/restart": {
      "post": {
        "description": "Restart a subscription with the specified price ID. Use this endpoint when a subscription was cancelled.",
        "operationId": "BillingController_restartSubscription_v1",
        "parameters": [
          {
            "name": "priceId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the restarted subscription."
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Restart specified subscription",
        "tags": [
          "billing"
        ]
      }
    },
    "/v1/billing/subscriptions/{subscriptionId}/renew": {
      "post": {
        "description": "Renew a subscription with the specified subscription ID. Use this endpoint when a subscription was set to cancel by the end of the billing cycle.",
        "operationId": "BillingController_renewSubscription_v1",
        "parameters": [
          {
            "name": "subscriptionId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the renewed subscription."
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Renew a subscription",
        "tags": [
          "billing"
        ]
      }
    },
    "/v1/billing/subscriptions/{subscriptionId}/cancel": {
      "post": {
        "description": "Cancel a subscription with the specified subscription ID.",
        "operationId": "BillingController_cancelSubscription_v1",
        "parameters": [
          {
            "name": "subscriptionId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the cancelled subscription."
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Cancel a subscription",
        "tags": [
          "billing"
        ]
      }
    },
    "/v1/billing/subscriptions/{currentSubscriptionId}/change/{newSubscriptionId}": {
      "post": {
        "description": "Change the subscription plan from the current subscription to a new subscription.",
        "operationId": "BillingController_changePlans_v1",
        "parameters": [
          {
            "name": "currentSubscriptionId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "newSubscriptionId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the updated subscription."
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Change subscription plan",
        "tags": [
          "billing"
        ]
      }
    },
    "/v1/billing/stats": {
      "get": {
        "description": "Get billing statistics for the current tenant.",
        "operationId": "BillingController_getStats_v1",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Returns billing statistics for the tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/StatsDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Get billing statistics",
        "tags": [
          "billing"
        ]
      }
    },
    "/v1/auth/login": {
      "post": {
        "description": "Login via password, magic link, or 2FA code. Password and 2FA logins return a JWT token and user information. Magic link login sends the token via email and returns only the tenant ID.",
        "operationId": "AuthController_login_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthUserDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns authentication credentials on successful login.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/AuthSignInDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "summary": "Authenticate user",
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/reset-password": {
      "post": {
        "description": "Send a password reset email to the specified email address. Returns 204 No Content.",
        "operationId": "AuthController_resetPassword_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResetPasswordDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": ""
          }
        },
        "summary": "Request password reset",
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/process-reset-password": {
      "post": {
        "description": "Validate the password reset token and set the new password. Returns the user ID and email of the user whose password was reset.",
        "operationId": "AuthController_processResetPassword_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProcessResetPasswordDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the user ID and email after successful password reset.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/ProcessResultPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "summary": "Process password reset",
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/process-invite": {
      "post": {
        "description": "Accept an invitation, set the user password, and activate the account. Returns the user ID and email of the invited user.",
        "operationId": "AuthController_processInvite_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProcessInviteDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the user ID and email after successful invite processing.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/ProcessResultPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "summary": "Process user invitation",
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/oauth/google": {
      "get": {
        "description": "Redirects the user to Google for OAuth authentication. This endpoint does not return a JSON response.",
        "operationId": "AuthController_googleAuth_v1",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Initiate Google OAuth login",
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/oauth/google/callback": {
      "get": {
        "description": "Handles the Google OAuth callback and redirects the user to the client application with authentication credentials.",
        "operationId": "AuthController_googleAuthCallback_v1",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Google OAuth callback",
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/logout": {
      "post": {
        "description": "Invalidate the current session by blacklisting the token. Returns 204 No Content.",
        "operationId": "AuthController_logout_v1",
        "parameters": [],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Logout user",
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/logout-all": {
      "post": {
        "description": "Invalidate all sessions for the current user. Any JWT issued before this point will be rejected. Returns 204 No Content.",
        "operationId": "AuthController_logoutAll_v1",
        "parameters": [],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Logout all sessions",
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/validate-magic-link": {
      "post": {
        "description": "Validates a one-time magic link token and returns a new session JWT. The magic link token is consumed and cannot be reused.",
        "operationId": "AuthController_validateMagicLink_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ValidateMagicLinkDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns a new session token after consuming the magic link.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/AuthSignInDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "summary": "Validate and consume a magic link token",
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/users/create": {
      "post": {
        "operationId": "UsersController_create_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUserDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the created user object.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/UserDetailedPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "tags": [
          "users"
        ]
      }
    },
    "/v1/users/invite": {
      "post": {
        "operationId": "UsersController_invite_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InviteUserDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the invited user object.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/UserDetailedPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "users"
        ]
      }
    },
    "/v1/users": {
      "get": {
        "operationId": "UsersController_findAll_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of users based on the filter specified.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "users": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/UserBasicPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "users"
        ]
      }
    },
    "/v1/users/user": {
      "get": {
        "operationId": "UsersController_findMy_v1",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Returns the user object of the current user.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/UserDetailedPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "users"
        ]
      }
    },
    "/v1/users/{userId}": {
      "get": {
        "operationId": "UsersController_findOne_v1",
        "parameters": [
          {
            "name": "userId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the user object.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/UserDetailedPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "users"
        ]
      }
    },
    "/v1/users/{userId}/update": {
      "post": {
        "operationId": "UsersController_update_v1",
        "parameters": [
          {
            "name": "userId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the updated user object.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/UserDetailedPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "users"
        ]
      }
    },
    "/v1/users/{userId}/state/ui": {
      "post": {
        "operationId": "UsersController_updateUiState_v1",
        "parameters": [
          {
            "name": "userId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserUiStateDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the updated user object.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/UserDetailedPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "204": {
            "description": ""
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "users"
        ]
      }
    },
    "/v1/users/{userId}/change-password": {
      "post": {
        "operationId": "UsersController_changePassword_v1",
        "parameters": [
          {
            "name": "userId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePasswordDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "users"
        ]
      }
    },
    "/v1/users/{userIdToRemove}/delete": {
      "post": {
        "operationId": "UsersController_remove_v1",
        "parameters": [
          {
            "name": "userIdToRemove",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "users"
        ]
      }
    },
    "/v1/notifications/preferences": {
      "get": {
        "operationId": "NotificationsController_findAllPreferences_v1",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Returns notification preferences for the current user."
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "notifications"
        ]
      }
    },
    "/v1/notifications/preferences/update": {
      "post": {
        "operationId": "NotificationsController_updatePreferences_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePreferencesDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "notifications"
        ]
      }
    },
    "/v1/notifications/preferences/contacts/{contactId}": {
      "get": {
        "operationId": "NotificationsController_findAllPreferencesForContact_v1",
        "parameters": [
          {
            "name": "contactId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns notification preferences for a specific contact."
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "notifications"
        ]
      }
    },
    "/v1/notifications/preferences/contacts/{contactId}/update": {
      "post": {
        "operationId": "NotificationsController_updatePreferencesForContact_v1",
        "parameters": [
          {
            "name": "contactId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePreferencesDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "notifications"
        ]
      }
    },
    "/v1/notifications/send": {
      "post": {
        "operationId": "NotificationsController_send_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateNotificationDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sends a notification and returns the created notification."
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "notifications"
        ]
      }
    },
    "/v1/notifications/queue/create": {
      "post": {
        "operationId": "NotificationsController_queue_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateNotificationQueueItemDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the updated queue for the recipient.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "queue": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/NotificationQueuePayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "notifications"
        ]
      }
    },
    "/v1/notifications": {
      "get": {
        "operationId": "NotificationsController_findAll_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns notifications with unread count. Response includes nUnread (number) at the data level alongside the notifications array.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "notifications": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/NotificationListPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "notifications"
        ]
      }
    },
    "/v1/notifications/queue": {
      "get": {
        "operationId": "NotificationsController_findAllQueue_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of queued notifications.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "queue": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/NotificationQueuePayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "notifications"
        ]
      }
    },
    "/v1/notifications/config": {
      "post": {
        "operationId": "NotificationsController_updateConfig_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NotifcationConfigDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updates notification configuration."
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "notifications"
        ]
      }
    },
    "/v1/notifications/stats": {
      "get": {
        "description": "Get monthly notification statistics including counts by status and channel.",
        "operationId": "NotificationsController_stats_v1",
        "parameters": [
          {
            "name": "filter",
            "required": true,
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/NotificationStatsPayloadDto"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Get notification analytics",
        "tags": [
          "notifications"
        ]
      }
    },
    "/v1/notifications/{notificationId}": {
      "get": {
        "operationId": "NotificationsController_findOne_v1",
        "parameters": [
          {
            "name": "notificationId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the notification with populated references.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/NotificationDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "notifications"
        ]
      }
    },
    "/v1/notifications/{notificationId}/mark-as-read": {
      "post": {
        "operationId": "NotificationsController_markAsRead_v1",
        "parameters": [
          {
            "name": "notificationId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Marks a notification as read and returns the updated notification."
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "notifications"
        ]
      }
    },
    "/v1/notifications/mark-all-as-read": {
      "post": {
        "operationId": "NotificationsController_markAllAsRead_v1",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Marks all notifications as read for the current user."
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "notifications"
        ]
      }
    },
    "/v1/notifications/process/push": {
      "post": {
        "operationId": "NotificationsController_processPush_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PushNotificationDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "tags": [
          "notifications"
        ]
      }
    },
    "/v1/templates/create": {
      "post": {
        "description": "Create a new payment or email reminder template.",
        "operationId": "TemplatesController_create_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTemplateDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the created teamplate object.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/TemplatePayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super",
                            "admin"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Create a template",
        "tags": [
          "templates"
        ]
      }
    },
    "/v1/templates": {
      "get": {
        "description": "Retrieve all templates based on the filter specified.",
        "operationId": "TemplatesController_findAll_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of templates based on the filter specified.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "templates": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/TemplatePayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all templates",
        "tags": [
          "templates"
        ]
      }
    },
    "/v1/templates/{templateId}": {
      "get": {
        "description": "Retrieve a template based on the ID specified.",
        "operationId": "TemplatesController_findOne_v1",
        "parameters": [
          {
            "name": "templateId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the template.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/TemplatePayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Retrieve a template",
        "tags": [
          "templates"
        ]
      }
    },
    "/v1/templates/{templateId}/update": {
      "post": {
        "description": "Update a template based on the ID specified.",
        "operationId": "TemplatesController_update_v1",
        "parameters": [
          {
            "name": "templateId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTemplateDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the updated template object.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/TemplatePayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super",
                            "admin"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Update a template",
        "tags": [
          "templates"
        ]
      }
    },
    "/v1/templates/{templateId}/delete": {
      "post": {
        "description": "Remove a template based on the ID specified.",
        "operationId": "TemplatesController_remove_v1",
        "parameters": [
          {
            "name": "templateId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super",
                            "admin"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Delete a template",
        "tags": [
          "templates"
        ]
      }
    },
    "/v1/payment-intents/create": {
      "post": {
        "description": "A payment intent will generate a payment link and it's how Qualy collect payments.",
        "operationId": "PaymentIntentsController_create_v1",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique key for idempotent request processing. If the same key is sent again, the cached response is returned.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePaymentIntentDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the created payment intent object.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/PaymentIntentPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "string",
                      "example": "When payment intent type is \"step\" a stepId condition is required",
                      "description": "When payment intent type is \"step\" a stepId condition is required"
                    },
                    {
                      "type": "string",
                      "example": "This payment number has already been used",
                      "description": "This payment number has already been used"
                    },
                    {
                      "type": "string",
                      "example": "A new payment must have items",
                      "description": "A new payment must have items"
                    },
                    {
                      "type": "string",
                      "example": "When the intentType is \"portal\", the property \"services\" is required",
                      "description": "When the intentType is \"portal\", the property \"services\" is required"
                    },
                    {
                      "type": "string",
                      "example": "Unauthenticated requests can only create payment intents of type \"portal\" or \"ecommerce\"",
                      "description": "Returned when an unauthenticated caller submits an intentType other than \"portal\" or \"ecommerce\""
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Unauthenticated request was rejected because the Origin header is missing or does not match a registered tenant domain.\n\nThis action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "paymentIntents:edit:all",
                            "paymentIntents:edit:me",
                            "paymentIntents:edit:team"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "The service \"{service}\" can only be purchased once."
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Create a payment",
        "tags": [
          "payment intents"
        ]
      }
    },
    "/v1/payment-intents/early-payoff": {
      "post": {
        "description": "Consolidates a contact's pending installments into a single bundle so they can be cleared in one payment (ADR-030). Requires the tenant early-payoff feature to be enabled.",
        "operationId": "PaymentIntentsController_earlyPayoff_v1",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique key for idempotent request processing. If the same key is sent again, the cached response is returned.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEarlyPayoffDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the created early-payoff bundle intent.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/PaymentIntentPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "409": {
            "description": "A bundle is already in progress for this contact, or the resolved incentive is a surcharge (unsupported)."
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Create an early-payoff bundle",
        "tags": [
          "payment intents"
        ]
      }
    },
    "/v1/payment-intents/generate": {
      "post": {
        "description": "Provide a description of a business process to get AI-generated suggestions for payment items. Not available for API keys, contacts, or partners.",
        "operationId": "PaymentIntentsController_generate_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GeneratePaymentIntentDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns AI-generated payment item suggestions.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/GenerateSuggestionsPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "paymentIntents:edit:all",
                            "paymentIntents:edit:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "summary": "Generate payment items suggestions",
        "tags": [
          "payment intents"
        ]
      }
    },
    "/v1/payment-intents": {
      "get": {
        "description": "Find a list of payment intents based on a query provided.",
        "operationId": "PaymentIntentsController_findAll_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of payment intents.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "paymentIntents": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/PaymentIntentListPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "paymentIntents:view:all",
                            "paymentIntents:view:team",
                            "paymentIntents:view:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all payments",
        "tags": [
          "payment intents"
        ]
      }
    },
    "/v1/payment-intents/stats": {
      "get": {
        "description": "Get the number and amount of payments monthly or in a consolidated format.",
        "operationId": "PaymentIntentsController_stats_v1",
        "parameters": [
          {
            "name": "filter",
            "required": true,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "required": false,
            "in": "query",
            "schema": {
              "enum": [
                "stats",
                "month-by-month",
                "behavior",
                "by-partnership"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/StatsPayloadDto"
                    },
                    {
                      "$ref": "#/components/schemas/MonthlyStatsPayloadDto"
                    },
                    {
                      "$ref": "#/components/schemas/BehaviorStatsPayloadDto"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "paymentIntents:view:all",
                            "paymentIntents:view:team",
                            "paymentIntents:view:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Get payment analytics",
        "tags": [
          "payment intents"
        ]
      }
    },
    "/v1/payment-intents/statements/{contactId}": {
      "post": {
        "description": "Get an official statement of account for a specific contact.",
        "operationId": "PaymentIntentsController_statement_v1",
        "parameters": [
          {
            "name": "contactId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StatementDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the statement of account PDF URL.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/PdfUrlPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "paymentIntents:view:all",
                            "paymentIntents:view:team",
                            "paymentIntents:view:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Generate a statement in PDF",
        "tags": [
          "payment intents"
        ]
      }
    },
    "/v1/payment-intents/{paymentIntentId}": {
      "get": {
        "description": "Retrieve information about a particular payment intent. Masks email if not authenticated.",
        "operationId": "PaymentIntentsController_findOne_v1",
        "parameters": [
          {
            "name": "paymentIntentId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the payment intent object.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/PaymentIntentPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "paymentIntents:view:all",
                            "paymentIntents:view:me",
                            "paymentIntents:view:team"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Retrieve a payment",
        "tags": [
          "payment intents"
        ]
      }
    },
    "/v1/payment-intents/{paymentIntentId}/receipt": {
      "post": {
        "description": "Create a receipt for the specified payment intent. Returns the URL of the PDF file.",
        "operationId": "PaymentIntentsController_receipt_v1",
        "parameters": [
          {
            "name": "paymentIntentId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the receipt PDF URL.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/PdfUrlPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": ""
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "summary": "Generate a receipt in PDF",
        "tags": [
          "payment intents"
        ]
      }
    },
    "/v1/payment-intents/{paymentIntentId}/ti": {
      "post": {
        "description": "Create a tax invoice for the specified payment intent. Requires the tenant to have tax invoices enabled (settings.payment.ti). Returns the URL of the PDF file.",
        "operationId": "PaymentIntentsController_taxInvoice_v1",
        "parameters": [
          {
            "name": "paymentIntentId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the tax invoice PDF URL.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/PdfUrlPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": ""
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "summary": "Generate a tax invoice in PDF",
        "tags": [
          "payment intents"
        ]
      }
    },
    "/v1/payment-intents/{paymentIntentId}/items/create": {
      "post": {
        "description": "Add a new payment item to the specified payment intent.",
        "operationId": "PaymentIntentsController_createPaymentItem_v1",
        "parameters": [
          {
            "name": "paymentIntentId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePaymentItemDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the created payment intent object.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/PaymentIntentPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "paymentIntents:edit:all",
                            "paymentIntents:edit:me",
                            "paymentIntents:edit:team"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Create a payment item",
        "tags": [
          "payment intents"
        ]
      }
    },
    "/v1/payment-intents/{paymentIntentId}/items/{itemId}/update": {
      "post": {
        "description": "Modify details of a payment item associated with the specified payment intent.",
        "operationId": "PaymentIntentsController_updatePaymentItem_v1",
        "parameters": [
          {
            "name": "paymentIntentId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "itemId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePaymentItemDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the created payment intent object.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/PaymentIntentPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "paymentIntents:edit:all",
                            "paymentIntents:edit:me",
                            "paymentIntents:edit:team"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Update a payment item",
        "tags": [
          "payment intents"
        ]
      }
    },
    "/v1/payment-intents/{paymentIntentId}/items/{itemId}/delete": {
      "post": {
        "description": "Delete a payment item from the specified payment intent.",
        "operationId": "PaymentIntentsController_removePaymentItem_v1",
        "parameters": [
          {
            "name": "paymentIntentId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "itemId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the created payment intent object.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/PaymentIntentPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "paymentIntents:edit:all",
                            "paymentIntents:edit:me",
                            "paymentIntents:edit:team"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Delete a payment item",
        "tags": [
          "payment intents"
        ]
      }
    },
    "/v1/payment-intents/{paymentIntentId}/update": {
      "post": {
        "description": "Update the details of the specified payment intent.",
        "operationId": "PaymentIntentsController_update_v1",
        "parameters": [
          {
            "name": "paymentIntentId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePaymentIntentDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the created payment intent object.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/PaymentIntentPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "paymentIntents:edit:all",
                            "paymentIntents:edit:me",
                            "paymentIntents:edit:team"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Update a payment",
        "tags": [
          "payment intents"
        ]
      }
    },
    "/v1/payment-intents/{paymentIntentId}/cancel": {
      "post": {
        "description": "Cancel the specified payment intent. Payment link will still be available, but payment is no longer payable.",
        "operationId": "PaymentIntentsController_cancel_v1",
        "parameters": [
          {
            "name": "paymentIntentId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelPaymentIntentDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the created payment intent object.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/PaymentIntentPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "paymentIntents:edit:all",
                            "paymentIntents:edit:me",
                            "paymentIntents:edit:team"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": ""
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "string",
                      "example": "Payment status is canceled and cannot be canceled again",
                      "description": "Payment status is canceled and cannot be canceled again"
                    },
                    {
                      "type": "string",
                      "example": "Payment has been paid and cannot be canceled anymore",
                      "description": "Payment has been paid and cannot be canceled anymore"
                    },
                    {
                      "type": "string",
                      "example": "Payment has pending transactions and cannot be canceled at this moment",
                      "description": "Payment has pending transactions and cannot be canceled at this moment"
                    },
                    {
                      "type": "string",
                      "example": "Payment is being processed and cannot be canceled at this moment",
                      "description": "Payment is being processed and cannot be canceled at this moment"
                    },
                    {
                      "type": "string",
                      "example": "This payment has splits with pending review, failed or paid, and cannot be deleted",
                      "description": "This payment has splits with pending review, failed or paid, and cannot be deleted"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Cancel a payment",
        "tags": [
          "payment intents"
        ]
      }
    },
    "/v1/payment-intents/{paymentIntentId}/uncancel": {
      "post": {
        "description": "Reverse the cancellation of the specified payment intent. Returns it to due (if it has a due date) or added (if no due date). Also reverts associated canceled splits to pending.",
        "operationId": "PaymentIntentsController_uncancel_v1",
        "parameters": [
          {
            "name": "paymentIntentId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the uncanceled payment intent object.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/PaymentIntentPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "paymentIntents:edit:all",
                            "paymentIntents:edit:me",
                            "paymentIntents:edit:team"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": ""
          },
          "409": {
            "description": "Payment is not canceled and cannot be uncanceled"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Uncancel a payment",
        "tags": [
          "payment intents"
        ]
      }
    },
    "/v1/payment-intents/{paymentIntentId}/delete": {
      "post": {
        "description": "Remove the specified payment intent. Requires specific user roles for authorization.",
        "operationId": "PaymentIntentsController_remove_v1",
        "parameters": [
          {
            "name": "paymentIntentId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "paymentIntents:delete:all",
                            "paymentIntents:delete:me",
                            "paymentIntents:delete:team"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": ""
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "string",
                      "example": "Payment status is canceled and cannot be removed",
                      "description": "Payment status is canceled and cannot be removed"
                    },
                    {
                      "type": "string",
                      "example": "Payment has been paid and cannot be removed anymore",
                      "description": "Payment has been paid and cannot be removed anymore"
                    },
                    {
                      "type": "string",
                      "example": "Payment has pending transactions and cannot be removed at this moment",
                      "description": "Payment has pending transactions and cannot be removed at this moment"
                    },
                    {
                      "type": "string",
                      "example": "Payment is being processed and cannot be removed at this moment",
                      "description": "Payment is being processed and cannot be removed at this moment"
                    },
                    {
                      "type": "string",
                      "example": "This payment has splits with pending review, failed or paid, and cannot be deleted",
                      "description": "This payment has splits with pending review, failed or paid, and cannot be deleted"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Delete a payment",
        "tags": [
          "payment intents"
        ]
      }
    },
    "/v1/services/create": {
      "post": {
        "description": "Create a new service with the provided data.",
        "operationId": "ServicesController_create_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateServiceDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the created service with populated steps.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/ServiceDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "services:edit:all",
                            "paymentIntents:edit:all",
                            "paymentIntents:edit:me",
                            "paymentIntents:edit:team"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Create a service",
        "tags": [
          "services"
        ]
      }
    },
    "/v1/services/generate": {
      "post": {
        "description": "Generate a suggestion for a new service.",
        "operationId": "ServicesController_generate_v1",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "services:edit:all"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Generate a suggestion",
        "tags": [
          "services"
        ]
      }
    },
    "/v1/services": {
      "get": {
        "description": "List all services with the possibility to filter, sort and paginate the results.",
        "operationId": "ServicesController_findAll_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of services.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "services": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/ServiceListPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all services",
        "tags": [
          "services"
        ]
      }
    },
    "/v1/services/{serviceId}": {
      "get": {
        "description": "Retrieve a service by its ID.",
        "operationId": "ServicesController_findOne_v1",
        "parameters": [
          {
            "name": "serviceId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the service with populated steps.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/ServiceDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Retrieve a service",
        "tags": [
          "services"
        ]
      }
    },
    "/v1/services/{serviceId}/update": {
      "post": {
        "description": "Update an existing service with the provided data.",
        "operationId": "ServicesController_update_v1",
        "parameters": [
          {
            "name": "serviceId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateServiceDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the updated service with populated steps.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/ServiceDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "services:edit:all"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Update a service",
        "tags": [
          "services"
        ]
      }
    },
    "/v1/services/{serviceId}/steps/create": {
      "post": {
        "description": "Create a new step for a service with the provided data.",
        "operationId": "ServicesController_createStep_v1",
        "parameters": [
          {
            "name": "serviceId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateServiceStepDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the service with the new step added.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/ServiceDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "services:edit:all"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          },
          {
            "jwt": []
          }
        ],
        "summary": "Create a step for a service",
        "tags": [
          "services"
        ]
      }
    },
    "/v1/services/{serviceId}/steps/generate": {
      "post": {
        "description": "Generate a suggestion for a new step.",
        "operationId": "ServicesController_generateSteps_v1",
        "parameters": [
          {
            "name": "serviceId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateStepsDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "services:edit:all"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Generate a step suggestion",
        "tags": [
          "services"
        ]
      }
    },
    "/v1/services/{serviceId}/steps/{stepId}/update": {
      "post": {
        "description": "Update an existing step with the provided data.",
        "operationId": "ServicesController_updateStep_v1",
        "parameters": [
          {
            "name": "serviceId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "stepId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateStepDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the service with the updated step.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/ServiceDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "services:edit:all"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Update a step",
        "tags": [
          "services"
        ]
      }
    },
    "/v1/services/{serviceId}/steps/{stepId}/delete": {
      "post": {
        "description": "Remove a step from a service.",
        "operationId": "ServicesController_removeStep_v1",
        "parameters": [
          {
            "name": "serviceId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "stepId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the service after step removal.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/ServiceDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "services:edit:all"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Delete a step",
        "tags": [
          "services"
        ]
      }
    },
    "/v1/services/{serviceId}/delete": {
      "post": {
        "description": "Remove a service by its ID.",
        "operationId": "ServicesController_remove_v1",
        "parameters": [
          {
            "name": "serviceId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "services:delete:all"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Delete a service",
        "tags": [
          "services"
        ]
      }
    },
    "/v1/activities/create": {
      "post": {
        "description": "Create a new activity with the provided data.",
        "operationId": "ActivitiesController_create_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateActivityDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the created activity.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/ActivityDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Create an activity",
        "tags": [
          "activities"
        ]
      }
    },
    "/v1/activities": {
      "get": {
        "description": "Get a list of all activities based on the provided query parameters.",
        "operationId": "ActivitiesController_findAll_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of activities.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "activities": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/ActivityListPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all activities",
        "tags": [
          "activities"
        ]
      }
    },
    "/v1/activities/{activityId}": {
      "get": {
        "description": "Get an activity by its ID.",
        "operationId": "ActivitiesController_findOne_v1",
        "parameters": [
          {
            "name": "activityId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the activity.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/ActivityDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Retrieve an activity",
        "tags": [
          "activities"
        ]
      }
    },
    "/v1/activities/{activityId}/traces": {
      "get": {
        "description": "Get all traces (audit log entries) for a specific activity.",
        "operationId": "ActivitiesController_findAllTracesByActivity_v1",
        "parameters": [
          {
            "name": "activityId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of traces for the activity."
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List traces for an activity",
        "tags": [
          "activities"
        ]
      }
    },
    "/v1/activities/traces/{traceId}": {
      "get": {
        "description": "Get a specific trace (audit log entry) by its ID.",
        "operationId": "ActivitiesController_findOneTrace_v1",
        "parameters": [
          {
            "name": "traceId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a single trace by ID."
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Retrieve a trace",
        "tags": [
          "activities"
        ]
      }
    },
    "/v1/activities/traces/correlation/{activityId}": {
      "get": {
        "description": "Get all traces across activities that are correlated to the specified activity. Useful for tracing related operations.",
        "operationId": "ActivitiesController_findTracesCorrelatedToActivity_v1",
        "parameters": [
          {
            "name": "activityId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns traces correlated to the activity."
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Find traces correlated to an activity",
        "tags": [
          "activities"
        ]
      }
    },
    "/v1/activities/traces/correlation/{activityId}/{traceId}": {
      "get": {
        "description": "Get all traces that are correlated to a specific trace within an activity.",
        "operationId": "ActivitiesController_findTracesCorrelatedToTrace_v1",
        "parameters": [
          {
            "name": "activityId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "traceId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns traces correlated to a specific trace."
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Find traces correlated to a specific trace",
        "tags": [
          "activities"
        ]
      }
    },
    "/v1/orders/create": {
      "post": {
        "description": "Create an order with the given data.",
        "operationId": "OrdersController_create_v1",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique key for idempotent request processing. If the same key is sent again, the cached response is returned.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOrderDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/OrderDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Create an order",
        "tags": [
          "orders"
        ]
      }
    },
    "/v1/orders": {
      "get": {
        "description": "List all orders with the given filters.",
        "operationId": "OrdersController_findAll_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "orders": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/OrderListPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all orders",
        "tags": [
          "orders"
        ]
      }
    },
    "/v1/orders/items": {
      "get": {
        "description": "List all order items with the given filters.",
        "operationId": "OrdersController_findAllItems_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "items": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/OrderItemListPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all order items",
        "tags": [
          "orders"
        ]
      }
    },
    "/v1/orders/{orderId}": {
      "get": {
        "description": "Retrieve an order with the given id.",
        "operationId": "OrdersController_findOne_v1",
        "parameters": [
          {
            "name": "orderId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/OrderDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Retrieve an order",
        "tags": [
          "orders"
        ]
      }
    },
    "/v1/orders/{orderId}/items/create": {
      "post": {
        "description": "Create an order item with the given data.",
        "operationId": "OrdersController_createItem_v1",
        "parameters": [
          {
            "name": "orderId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOrderItemDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/OrderItemDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Create an order item",
        "tags": [
          "orders"
        ]
      }
    },
    "/v1/orders/{orderId}/items/{itemId}": {
      "get": {
        "description": "Retrieve an order item with the given id.",
        "operationId": "OrdersController_findOneItem_v1",
        "parameters": [
          {
            "name": "orderId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "itemId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/OrderItemDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Retrieve an order item",
        "tags": [
          "orders"
        ]
      }
    },
    "/v1/orders/{orderId}/items/{itemId}/update": {
      "post": {
        "description": "Update an order item with the given data.",
        "operationId": "OrdersController_updateItem_v1",
        "parameters": [
          {
            "name": "orderId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "itemId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrderItemDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/OrderItemDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Update an order item",
        "tags": [
          "orders"
        ]
      }
    },
    "/v1/orders/{orderId}/items/{itemId}/control": {
      "post": {
        "description": "Update position and current step of order item.",
        "operationId": "OrdersController_controlItem_v1",
        "parameters": [
          {
            "name": "orderId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "itemId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ControlOrderItemDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/OrderItemDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Update position and step of order item",
        "tags": [
          "orders"
        ]
      }
    },
    "/v1/search/{index}": {
      "post": {
        "description": "Perform a search with typo-tolerance within the specified index based on the provided search criteria.",
        "operationId": "SearchController_search_v1",
        "parameters": [
          {
            "name": "index",
            "required": true,
            "in": "path",
            "description": "The index to search",
            "schema": {
              "enum": [
                "contacts",
                "partnerships"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResultsDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Search an index",
        "tags": [
          "search"
        ]
      }
    },
    "/v1/search/{index}/click": {
      "post": {
        "description": "Report a clicked search result to Algolia for click analytics.",
        "operationId": "SearchController_sendClickEvent_v1",
        "parameters": [
          {
            "name": "index",
            "required": true,
            "in": "path",
            "description": "The index the clicked result belongs to",
            "schema": {
              "enum": [
                "contacts",
                "partnerships"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchClickEventDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Send a click event",
        "tags": [
          "search"
        ]
      }
    },
    "/v1/teams/create": {
      "post": {
        "description": "Create a new team with the provided data.",
        "operationId": "TeamsController_create_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTeamDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the created team object.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/TeamPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super",
                            "admin"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Create a team",
        "tags": [
          "teams"
        ]
      }
    },
    "/v1/teams": {
      "get": {
        "description": "Get a list of all teams based on the provided query parameters.",
        "operationId": "TeamsController_findAll_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of teams based on the filter specified.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "teams": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/TeamPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all teams",
        "tags": [
          "teams"
        ]
      }
    },
    "/v1/teams/{teamId}": {
      "get": {
        "description": "Get a team by its ID.",
        "operationId": "TeamsController_findOne_v1",
        "parameters": [
          {
            "name": "teamId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the team.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/TeamPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Retrieve a team",
        "tags": [
          "teams"
        ]
      }
    },
    "/v1/teams/{teamId}/update": {
      "post": {
        "description": "Update an existing team with the provided data.",
        "operationId": "TeamsController_update_v1",
        "parameters": [
          {
            "name": "teamId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTeamDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the updated team object.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/TeamPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super",
                            "admin"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Update team",
        "tags": [
          "teams"
        ]
      }
    },
    "/v1/teams/{teamId}/delete": {
      "post": {
        "description": "Delete an existing team by its ID.",
        "operationId": "TeamsController_remove_v1",
        "parameters": [
          {
            "name": "teamId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super",
                            "admin"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Delete team",
        "tags": [
          "teams"
        ]
      }
    },
    "/v1/views/create": {
      "post": {
        "description": "Create a new view with the provided data. A view is a pre-determined set of query filters for a specific entity.",
        "operationId": "ViewsController_create_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateViewDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the created view.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/ViewPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Create a view",
        "tags": [
          "views"
        ]
      }
    },
    "/v1/views": {
      "get": {
        "description": "Get a list of all views based on the provided query parameters.",
        "operationId": "ViewsController_findAll_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of views.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "views": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/ViewPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all views",
        "tags": [
          "views"
        ]
      }
    },
    "/v1/views/{viewId}": {
      "get": {
        "description": "Get a view by its ID.",
        "operationId": "ViewsController_findOne_v1",
        "parameters": [
          {
            "name": "viewId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the view.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/ViewPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Retrieve a view",
        "tags": [
          "views"
        ]
      }
    },
    "/v1/views/{viewId}/update": {
      "post": {
        "description": "Update an existing view with the provided data.",
        "operationId": "ViewsController_update_v1",
        "parameters": [
          {
            "name": "viewId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateViewDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the updated view.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/ViewPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Update a view",
        "tags": [
          "views"
        ]
      }
    },
    "/v1/views/{viewId}/delete": {
      "post": {
        "description": "Delete an existing view by its ID.",
        "operationId": "ViewsController_remove_v1",
        "parameters": [
          {
            "name": "viewId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Delete a view",
        "tags": [
          "views"
        ]
      }
    },
    "/v1/contacts/create": {
      "post": {
        "description": "Create a new contact with the provided information.",
        "operationId": "ContactsController_create_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateContactDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the created contact.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/ContactDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "contacts:edit:all",
                            "contacts:edit:team",
                            "contacts:edit:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Create a contact",
        "tags": [
          "contacts"
        ]
      }
    },
    "/v1/contacts/login": {
      "post": {
        "description": "Request a magic link to authenticate the contact to obtain access to the Contact portal. The link is sent via email.",
        "operationId": "ContactsController_login_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactLoginDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Request login token",
        "tags": [
          "contacts"
        ]
      }
    },
    "/v1/contacts/generate": {
      "post": {
        "description": "Generate suggestions for creating a new contact based on the provided data.",
        "operationId": "ContactsController_generate_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateContactDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns AI-extracted contact suggestions from the uploaded document.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/GenerateContactSuggestionsPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "contacts:edit:all",
                            "contacts:edit:team",
                            "contacts:edit:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Generate contact suggestions",
        "tags": [
          "contacts"
        ]
      }
    },
    "/v1/contacts/merge": {
      "post": {
        "description": "Merge two contacts into one.",
        "operationId": "ContactsController_merge_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MergeContactDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the merged contact.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/ContactDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "contacts:edit:all"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Merge contacts",
        "tags": [
          "contacts"
        ]
      }
    },
    "/v1/contacts": {
      "get": {
        "description": "Get a list of all contacts based on the provided query parameters.",
        "operationId": "ContactsController_findAll_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of contacts.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "contacts": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/ContactListPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "contacts:view:all",
                            "contacts:view:team",
                            "contacts:view:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all contacts",
        "tags": [
          "contacts"
        ]
      }
    },
    "/v1/contacts/{contactId}": {
      "get": {
        "description": "Get detailed information about a specific contact based on their ID.",
        "operationId": "ContactsController_findOne_v1",
        "parameters": [
          {
            "name": "contactId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the contact with populated references.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/ContactDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "contacts:view:all",
                            "contacts:view:team",
                            "contacts:view:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Retrieve a contact",
        "tags": [
          "contacts"
        ]
      }
    },
    "/v1/contacts/{contactId}/update": {
      "post": {
        "description": "Modify the details of a specific contact.",
        "operationId": "ContactsController_update_v1",
        "parameters": [
          {
            "name": "contactId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateContactDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the updated contact.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/ContactDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "contacts:edit:all",
                            "contacts:edit:team",
                            "contacts:edit:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Update a contact",
        "tags": [
          "contacts"
        ]
      }
    },
    "/v1/contacts/{contactId}/delete": {
      "post": {
        "description": "Remove a specific contact.",
        "operationId": "ContactsController_remove_v1",
        "parameters": [
          {
            "name": "contactId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "contacts:delete:all",
                            "contacts:delete:team",
                            "contacts:delete:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Delete a contact",
        "tags": [
          "contacts"
        ]
      }
    },
    "/v1/contacts/{contactId}/view-as": {
      "post": {
        "description": "Generate a token that grants time-limited access to a contact's portal. The token is short-lived.",
        "operationId": "ContactsController_viewAs_v1",
        "parameters": [
          {
            "name": "contactId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a token with a time-limited access to this contact's portal",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/ViewAsPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin",
                            "paymentIntents:view:all",
                            "paymentIntents:view:team",
                            "paymentIntents:view:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "View contact portal as...",
        "tags": [
          "contacts"
        ]
      }
    },
    "/v1/imports/create": {
      "post": {
        "description": "Create a new import using the provided data and user information.",
        "operationId": "ImportsController_create_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateImportDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the created import.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/ImportPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Create a import",
        "tags": [
          "imports"
        ]
      }
    },
    "/v1/imports": {
      "get": {
        "description": "Get a list of all imports based on the provided query parameters.",
        "operationId": "ImportsController_findAll_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of imports.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "imports": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/ImportPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "import:contacts",
                            "import:partnerships",
                            "import:paymentIntents"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all imports",
        "tags": [
          "imports"
        ]
      }
    },
    "/v1/imports/import-from/{type}/{url}": {
      "get": {
        "description": "Import data from a specified source type and URL.",
        "operationId": "ImportsController_importFrom_v1",
        "parameters": [
          {
            "name": "type",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "url",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "import:partnerships"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Import data from source",
        "tags": [
          "imports"
        ]
      }
    },
    "/v1/imports/{importId}": {
      "get": {
        "description": "Get an import record details by its ID.",
        "operationId": "ImportsController_findOne_v1",
        "parameters": [
          {
            "name": "importId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the import.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/ImportPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "import:contacts",
                            "import:partnerships",
                            "import:paymentIntents"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Retrieve an import",
        "tags": [
          "imports"
        ]
      }
    },
    "/v1/payment-splits/create": {
      "post": {
        "description": "Create a new payment split intent with the provided information.",
        "operationId": "SplitIntentsController_create_v1",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique key for idempotent request processing. If the same key is sent again, the cached response is returned.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSplitIntentDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the created payment split.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/PaymentSplitDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "splits:edit:all",
                            "splits:edit:me",
                            "splits:edit:team"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Create a payment split",
        "tags": [
          "payment splits"
        ]
      }
    },
    "/v1/payment-splits": {
      "get": {
        "description": "Get a list of all payment split intents based on the provided query parameters.",
        "operationId": "SplitIntentsController_findAll_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of payment splits.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "paymentSplits": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/PaymentSplitPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "splits:view:all",
                            "splits:view:me",
                            "splits:view:team"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Lis tall payment splits",
        "tags": [
          "payment splits"
        ]
      }
    },
    "/v1/payment-splits/stats": {
      "get": {
        "description": "Get statistics and analytics for payment split intents, including options for filtering by country, date, and FX data extraction. Use format=fx-report to get FX conversion insights including payin and payout quotes.",
        "operationId": "SplitIntentsController_stats_v1",
        "parameters": [
          {
            "name": "filter",
            "required": true,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "required": false,
            "in": "query",
            "schema": {
              "enum": [
                "by-country",
                "stats",
                "month-by-month",
                "by-partner",
                "month-by-month-by-partner",
                "month-by-month-by-team",
                "markup-by-month",
                "partnership-reconciliation"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns payment split statistics."
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "splits:view:all",
                            "splits:view:me",
                            "splits:view:team"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Get payment split analytics",
        "tags": [
          "payment splits"
        ]
      }
    },
    "/v1/payment-splits/{paymentSplitId}": {
      "get": {
        "description": "Get detailed information about a specific payment split intent based on its ID.",
        "operationId": "SplitIntentsController_findOne_v1",
        "parameters": [
          {
            "name": "paymentSplitId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the payment split.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/PaymentSplitDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "splits:view:all",
                            "splits:view:me",
                            "splits:view:team"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          },
          {
            "jwt": []
          }
        ],
        "summary": "Retrieve a specific payment split",
        "tags": [
          "payment splits"
        ]
      }
    },
    "/v1/payment-splits/{paymentSplitId}/update": {
      "post": {
        "description": "Modify the details of a specific payment split intent.",
        "operationId": "SplitIntentsController_update_v1",
        "parameters": [
          {
            "name": "paymentSplitId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSplitIntentDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the updated payment split.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/PaymentSplitDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "splits:edit:all",
                            "splits:edit:me",
                            "splits:edit:team"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Update a payment split",
        "tags": [
          "payment splits"
        ]
      }
    },
    "/v1/payment-splits/{paymentSplitId}/rcti": {
      "post": {
        "description": "Generate a Recipient Created Tax Invoice for a payment split.",
        "operationId": "SplitIntentsController_rcti_v1",
        "parameters": [
          {
            "name": "paymentSplitId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the generated RCTI document."
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Generate an RCTI",
        "tags": [
          "payment splits"
        ]
      }
    },
    "/v1/payment-splits/{paymentSplitId}/invoice": {
      "post": {
        "description": "Generate a tax invoice for a payment split.",
        "operationId": "SplitIntentsController_invoice_v1",
        "parameters": [
          {
            "name": "paymentSplitId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the generated tax invoice."
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Generate a Tax Invoice",
        "tags": [
          "payment splits"
        ]
      }
    },
    "/v1/payment-splits/{paymentSplitId}/options": {
      "get": {
        "description": "Get a list of actions available for a payment split.",
        "operationId": "SplitIntentsController_options_v1",
        "parameters": [
          {
            "name": "paymentSplitId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Return a list of actions available for a payment split.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "options": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/PaymentSplitOptionsPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          },
          {
            "jwt": []
          }
        ],
        "summary": "Get payment split actions",
        "tags": [
          "payment splits"
        ]
      }
    },
    "/v1/payment-splits/{paymentSplitId}/send": {
      "post": {
        "description": "Send a tax invoice for a payment split.",
        "operationId": "SplitIntentsController_send_v1",
        "parameters": [
          {
            "name": "paymentSplitId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "splits:edit:all",
                            "splits:edit:me",
                            "splits:edit:team"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          },
          {
            "jwt": []
          }
        ],
        "summary": "Send a Tax Invoice",
        "tags": [
          "payment splits"
        ]
      }
    },
    "/v1/payment-splits/{paymentSplitId}/delete": {
      "post": {
        "description": "Remove a specific payment split intent from the system.",
        "operationId": "SplitIntentsController_remove_v1",
        "parameters": [
          {
            "name": "paymentSplitId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "splits:delete:all",
                            "splits:delete:me",
                            "splits:delete:team"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Delete a payment split",
        "tags": [
          "payment splits"
        ]
      }
    },
    "/v1/partnerships/create": {
      "post": {
        "description": "Create a new partnership with the provided data.",
        "operationId": "PartnershipsController_create_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePartnershipDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the created partnership.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/PartnershipDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "partnerships:edit:all",
                            "partnerships:edit:team",
                            "partnerships:edit:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Create a partnership",
        "tags": [
          "partnerships"
        ]
      }
    },
    "/v1/partnerships/login": {
      "post": {
        "description": "Send a magic link to the provided email address to login in the partner portal.",
        "operationId": "PartnershipsController_login_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerLoginDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Send login magic link",
        "tags": [
          "partnerships"
        ]
      }
    },
    "/v1/partnerships/generate": {
      "post": {
        "description": "Generate suggestions for creating a new contact based on the provided data.",
        "operationId": "PartnershipsController_generate_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GeneratePartnershipDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "partnerships:edit:all"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Generate contact suggestions",
        "tags": [
          "partnerships"
        ]
      }
    },
    "/v1/partnerships": {
      "get": {
        "description": "Get a list of all partnerships based on the provided query parameters.",
        "operationId": "PartnershipsController_findAll_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of partnerships.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "partnerships": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/PartnershipListPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all partnerships",
        "tags": [
          "partnerships"
        ]
      }
    },
    "/v1/partnerships/merge": {
      "post": {
        "description": "Merge two partnerships into one.",
        "operationId": "PartnershipsController_merge_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MergePartnershipDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the merged partnership.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/PartnershipDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "partnerships:edit:all"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Merge partnerships",
        "tags": [
          "partnerships"
        ]
      }
    },
    "/v1/partnerships/{partnershipId}": {
      "get": {
        "description": "Get a partnership by its ID.",
        "operationId": "PartnershipsController_findOne_v1",
        "parameters": [
          {
            "name": "partnershipId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the partnership with populated references.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/PartnershipDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "partnerships:view:all",
                            "partnerships:view:team",
                            "partnerships:view:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Retrieve a partnership",
        "tags": [
          "partnerships"
        ]
      }
    },
    "/v1/partnerships/{partnershipId}/update": {
      "post": {
        "description": "Update an existing partnership with the provided data.",
        "operationId": "PartnershipsController_update_v1",
        "parameters": [
          {
            "name": "partnershipId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePartnershipDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the updated partnership.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/PartnershipDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "partnerships:edit:all",
                            "partnerships:edit:team",
                            "partnerships:edit:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Update a partnership",
        "tags": [
          "partnerships"
        ]
      }
    },
    "/v1/partnerships/{partnershipId}/contacts/{contactId}/update": {
      "post": {
        "description": "Update an existing contact with the provided data.",
        "operationId": "PartnershipsController_updateContact_v1",
        "parameters": [
          {
            "name": "partnershipId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "contactId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePartnershipContactDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "partnerships:edit:all"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Update contact",
        "tags": [
          "partnerships"
        ]
      }
    },
    "/v1/partnerships/{partnershipId}/delete": {
      "post": {
        "description": "The partnership will be marked as inactive.",
        "operationId": "PartnershipsController_remove_v1",
        "parameters": [
          {
            "name": "partnershipId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "partnerships:delete:all",
                            "partnerships:delete:team",
                            "partnerships:delete:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Delete partnership",
        "tags": [
          "partnerships"
        ]
      }
    },
    "/v1/partnerships/{partnershipId}/splits/create": {
      "post": {
        "description": "Create a new split with the provided data.",
        "operationId": "PartnershipsController_createSplit_v1",
        "parameters": [
          {
            "name": "partnershipId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSplitDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "partnerships:edit:all",
                            "partnerships:edit:team",
                            "partnerships:edit:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Create a split",
        "tags": [
          "partnerships"
        ]
      }
    },
    "/v1/partnerships/{partnershipId}/view-as": {
      "post": {
        "description": "Get a token to access the partner portal as a specific user.",
        "operationId": "PartnershipsController_viewAs_v1",
        "parameters": [
          {
            "name": "partnershipId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a token with a time-limited access to this partnership's portal",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/ViewAsPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "partnerships:view:all"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "View partner portal as...",
        "tags": [
          "partnerships"
        ]
      }
    },
    "/v1/partnerships/{partnershipId}/splits": {
      "get": {
        "description": "Get a list of all splits for a specific partnership.",
        "operationId": "PartnershipsController_findAllSplits_v1",
        "parameters": [
          {
            "name": "partnershipId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "partnerships:view:all",
                            "partnerships:view:team",
                            "partnerships:view:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all splits",
        "tags": [
          "partnerships"
        ]
      }
    },
    "/v1/partnerships/{partnershipId}/splits/{splitId}": {
      "get": {
        "description": "Get a partnership's split by its ID.",
        "operationId": "PartnershipsController_findOneSplit_v1",
        "parameters": [
          {
            "name": "partnershipId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "splitId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "partnerships:view:all",
                            "partnerships:view:team",
                            "partnerships:view:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Retrieve a split",
        "tags": [
          "partnerships"
        ]
      }
    },
    "/v1/partnerships/{partnershipId}/splits/{splitId}/update": {
      "post": {
        "description": "Update an existing partnership with the provided data.",
        "operationId": "PartnershipsController_updateSplit_v1",
        "parameters": [
          {
            "name": "partnershipId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "splitId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSplitDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "partnerships:edit:all",
                            "partnerships:edit:team",
                            "partnerships:edit:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Update partnership",
        "tags": [
          "partnerships"
        ]
      }
    },
    "/v1/partnerships/{partnershipId}/splits/{splitId}/delete": {
      "post": {
        "description": "Remove a split from a partnership.",
        "operationId": "PartnershipsController_removeSplit_v1",
        "parameters": [
          {
            "name": "partnershipId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "splitId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "partnerships:edit:all",
                            "partnerships:edit:team",
                            "partnerships:edit:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Delete a split",
        "tags": [
          "partnerships"
        ]
      }
    },
    "/v1/bank-accounts/create": {
      "post": {
        "description": "Creates a new bank account with the provided information. If there's no bank account on file, it will set the created bank account as the default one.",
        "operationId": "BankAccountsController_create_v1",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique key for idempotent request processing. If the same key is sent again, the cached response is returned.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBankAccountDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return the created bank account.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/BankAccountPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.\n\nToken is too old for this operation. The user must re-authenticate.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "code": {
                      "type": "string",
                      "example": "[AUT1081]"
                    },
                    "message": {
                      "type": "string",
                      "example": "[AUT1081] Token is too old for this operation. Please re-authenticate."
                    },
                    "timestamp": {
                      "type": "string",
                      "example": "2026-01-01T00:00:00.000Z"
                    },
                    "details": {
                      "type": "object",
                      "properties": {
                        "maxAgeInSeconds": {
                          "type": "integer",
                          "example": 900
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Create bank account",
        "tags": [
          "bank accounts"
        ]
      }
    },
    "/v1/bank-accounts": {
      "get": {
        "description": "Get a list of all bank accounts that match the specified filter.",
        "operationId": "BankAccountsController_findAll_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "An array with all bank accounts that match the filter.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "bankAccounts": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/BankAccountPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "bankAccounts:view:all"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all bank accounts",
        "tags": [
          "bank accounts"
        ]
      }
    },
    "/v1/bank-accounts/requirements/{country}/{currency}": {
      "get": {
        "description": "Return the fields required to create a bank account for a specific country and currency.",
        "operationId": "BankAccountsController_requirements_v1",
        "parameters": [
          {
            "name": "country",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "currency",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The fields required to create a bank account for the country and currency provided.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "requirements": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/BankRequirementsFieldsDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Get bank account creation requirements",
        "tags": [
          "bank accounts"
        ]
      }
    },
    "/v1/bank-accounts/{bankAccountId}": {
      "get": {
        "description": "Return detailed information about a specific bank account based on its ID.",
        "operationId": "BankAccountsController_findOne_v1",
        "parameters": [
          {
            "name": "bankAccountId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Return the bank account.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/BankAccountPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "bankAccounts:view:all"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Retrieve a bank account",
        "tags": [
          "bank accounts"
        ]
      }
    },
    "/v1/bank-accounts/{bankAccountId}/set-default": {
      "post": {
        "description": "Set a specific bank account as the default for its scope (partnership, contact, or tenant level). Unsets the default flag on all other accounts in the same scope.",
        "operationId": "BankAccountsController_setDefault_v1",
        "parameters": [
          {
            "name": "bankAccountId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetDefaultBankAccountDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the updated bank account.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/BankAccountPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.\n\nToken is too old for this operation. The user must re-authenticate.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "code": {
                      "type": "string",
                      "example": "[AUT1081]"
                    },
                    "message": {
                      "type": "string",
                      "example": "[AUT1081] Token is too old for this operation. Please re-authenticate."
                    },
                    "timestamp": {
                      "type": "string",
                      "example": "2026-01-01T00:00:00.000Z"
                    },
                    "details": {
                      "type": "object",
                      "properties": {
                        "maxAgeInSeconds": {
                          "type": "integer",
                          "example": 900
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Set a bank account as default",
        "tags": [
          "bank accounts"
        ]
      }
    },
    "/v1/bank-accounts/{bankAccountId}/delete": {
      "post": {
        "description": "Remove a specific bank account. The bank account will be marked as archived but not fully deleted from Qualy",
        "operationId": "BankAccountsController_remove_v1",
        "parameters": [
          {
            "name": "bankAccountId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.\n\nToken is too old for this operation. The user must re-authenticate.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "code": {
                      "type": "string",
                      "example": "[AUT1081]"
                    },
                    "message": {
                      "type": "string",
                      "example": "[AUT1081] Token is too old for this operation. Please re-authenticate."
                    },
                    "timestamp": {
                      "type": "string",
                      "example": "2026-01-01T00:00:00.000Z"
                    },
                    "details": {
                      "type": "object",
                      "properties": {
                        "maxAgeInSeconds": {
                          "type": "integer",
                          "example": 900
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Delete a bank account",
        "tags": [
          "bank accounts"
        ]
      }
    },
    "/v1/tax/create": {
      "post": {
        "description": "Create a new tax with the provided information.",
        "operationId": "TaxController_create_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTaxDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the created tax.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/TaxDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super",
                            "admin"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Create a tax",
        "tags": [
          "tax"
        ]
      }
    },
    "/v1/tax": {
      "get": {
        "description": "Get a list of all taxes based on the provided query parameters.",
        "operationId": "TaxController_findAll_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of taxes.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "taxItems": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/TaxListPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all taxes",
        "tags": [
          "tax"
        ]
      }
    },
    "/v1/tax/{taxId}": {
      "get": {
        "description": "Return detailed information about a specific tax based on its ID.",
        "operationId": "TaxController_findOne_v1",
        "parameters": [
          {
            "name": "taxId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the tax.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/TaxDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Retrieve a tax",
        "tags": [
          "tax"
        ]
      }
    },
    "/v1/tax/{taxId}/update": {
      "post": {
        "description": "Modify the details of a specific tax. It creates a new Tax item so current payments using the provided Tax ID will need to be updated to use the new Tax ID returned.",
        "operationId": "TaxController_update_v1",
        "parameters": [
          {
            "name": "taxId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTaxDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the updated tax.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/TaxDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super",
                            "admin"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Update a tax",
        "tags": [
          "tax"
        ]
      }
    },
    "/v1/tax/{taxId}/delete": {
      "post": {
        "description": "Remove a specific tax. Entities currently using this Tax item have to be updated mannually.",
        "operationId": "TaxController_remove_v1",
        "parameters": [
          {
            "name": "taxId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super",
                            "admin"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Delete a tax",
        "tags": [
          "tax"
        ]
      }
    },
    "/v1/transactions/create": {
      "post": {
        "description": "Create a new transaction with the provided information. Transactions will pay or refund a payment.",
        "operationId": "TransactionsController_create_v1",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique key for idempotent request processing. If the same key is sent again, the cached response is returned.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTransactionDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the created transaction.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/TransactionDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Create a transaction",
        "tags": [
          "transactions"
        ]
      }
    },
    "/v1/transactions/{transactionId}/approve": {
      "post": {
        "description": "Approve a specific transaction based on its ID. Only available for transactions with type \"EXTERNAL\".",
        "operationId": "TransactionsController_approve_v1",
        "parameters": [
          {
            "name": "transactionId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the approved transaction.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/TransactionDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "transactions:edit:all"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Approve a transaction",
        "tags": [
          "transactions"
        ]
      }
    },
    "/v1/transactions/{transactionId}/reject": {
      "post": {
        "description": "Reject a specific transaction based on its ID. Only available for transactions with type \"EXTERNAL\".",
        "operationId": "TransactionsController_reject_v1",
        "parameters": [
          {
            "name": "transactionId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the rejected transaction.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/TransactionDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "transactions:edit:all"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Reject a transaction",
        "tags": [
          "transactions"
        ]
      }
    },
    "/v1/transactions": {
      "get": {
        "description": "Get a list of all transactions based on the provided query parameters.",
        "operationId": "TransactionsController_findAll_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of transactions.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "transactions": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/TransactionPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "transactions:view:all",
                            "paymentIntents:view:all",
                            "paymentIntents:edit:all",
                            "transactions:view:team",
                            "paymentIntents:view:team",
                            "paymentIntents:edit:team",
                            "transactions:view:me",
                            "paymentIntents:view:me",
                            "paymentIntents:edit:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all transactions",
        "tags": [
          "transactions"
        ]
      }
    },
    "/v1/transactions/stats": {
      "get": {
        "description": "Get statistics and analytics for transactions based on the provided filter.",
        "operationId": "TransactionsController_stats_v1",
        "parameters": [
          {
            "name": "filter",
            "required": true,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "required": false,
            "in": "query",
            "schema": {
              "enum": [
                "status",
                "transactionType"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns transaction statistics grouped by currency.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TransactionStatsPayloadDto"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "transactions:view:all",
                            "paymentIntents:view:all",
                            "paymentIntents:edit:all",
                            "transactions:view:team",
                            "paymentIntents:view:team",
                            "paymentIntents:edit:team",
                            "transactions:view:me",
                            "paymentIntents:view:me",
                            "paymentIntents:edit:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Get transactions analytics",
        "tags": [
          "transactions"
        ]
      }
    },
    "/v1/transactions/{transactionId}": {
      "get": {
        "description": "Get detailed information about a specific transaction based on its ID.",
        "operationId": "TransactionsController_findOne_v1",
        "parameters": [
          {
            "name": "transactionId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the transaction.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/TransactionDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "transactions:view:all",
                            "paymentIntents:view:all",
                            "paymentIntents:edit:all",
                            "transactions:view:team",
                            "paymentIntents:view:team",
                            "paymentIntents:edit:team",
                            "transactions:view:me",
                            "paymentIntents:view:me",
                            "paymentIntents:edit:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Retrieve a specific transaction",
        "tags": [
          "transactions"
        ]
      }
    },
    "/v1/transactions/{transactionId}/options": {
      "get": {
        "description": "Get a list of actions available for a transaction.",
        "operationId": "TransactionsController_options_v1",
        "parameters": [
          {
            "name": "transactionId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Return a list of actions available for a transaction.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "options": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/TransactionOptionsPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "transactions:edit:all"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Get transaction actions",
        "tags": [
          "transactions"
        ]
      }
    },
    "/v1/transactions/{transactionId}/report": {
      "post": {
        "description": "Report an attempt of fraud for a specific transaction.",
        "operationId": "TransactionsController_report_v1",
        "parameters": [
          {
            "name": "transactionId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportTransactionDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the reported transaction.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/TransactionDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Report transaction",
        "tags": [
          "transactions"
        ]
      }
    },
    "/v1/transactions/migrate/{targetPaymentIntentId}": {
      "post": {
        "description": "Move transactions from one payment intent to another, resetting associated payouts and splits. Super admin only.",
        "operationId": "TransactionsController_migrate_v1",
        "parameters": [
          {
            "name": "targetPaymentIntentId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique key for idempotent request processing. If the same key is sent again, the cached response is returned.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MigrateTransactionsDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the migration result.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/TransactionMigrationPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Migrate transactions between payment intents",
        "tags": [
          "transactions"
        ]
      }
    },
    "/v1/payment-gateways/payment-options/{paymentIntentId}/{settlementCurrency}": {
      "get": {
        "description": "Returns a list of available payment options for a specific payment intent.",
        "operationId": "PaymentGatewaysController_paymentOptions_v1",
        "parameters": [
          {
            "name": "paymentIntentId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "settlementCurrency",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A list of options with the payment option status.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "options": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/PaymentOptionPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List payment options for a payment",
        "tags": [
          "payment gateways"
        ]
      }
    },
    "/v1/payment-gateways/sign": {
      "post": {
        "description": "Sign a new payment attempt for a payment intent.",
        "operationId": "PaymentGatewaysController_sign_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentGatewaySignDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/PaymentGatewaySignZaiCcPayloadDto"
                    },
                    {
                      "$ref": "#/components/schemas/PaymentGatewaySignZaiPayIdPayloadDto"
                    },
                    {
                      "$ref": "#/components/schemas/PaymentGatewaySignZaiBsbAccPayloadDto"
                    },
                    {
                      "$ref": "#/components/schemas/PaymentGatewaySignZaiPayToPayloadDto"
                    },
                    {
                      "$ref": "#/components/schemas/PaymentGatewaySignZaiDdPayloadDto"
                    },
                    {
                      "$ref": "#/components/schemas/PaymentGatewaySignBlueCcPayloadDto"
                    },
                    {
                      "$ref": "#/components/schemas/PaymentGatewaySignBlueDdPayloadDto"
                    },
                    {
                      "$ref": "#/components/schemas/PaymentGatewaySignAsPixPayloadDto"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Sign a new payment attempt",
        "tags": [
          "payment gateways"
        ]
      }
    },
    "/v1/payment-gateways/send-instructions": {
      "post": {
        "description": "Send payment instructions to someone.",
        "operationId": "PaymentGatewaysController_sendInstructions_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentGatewaySendInstructionsDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Send payment instructions",
        "tags": [
          "payment gateways"
        ]
      }
    },
    "/v1/payment-gateways/methods": {
      "get": {
        "description": "Retrieve all payment methods.",
        "operationId": "PaymentGatewaysController_findAll_v1",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PaymentGatewayDto"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all payment methods",
        "tags": [
          "payment gateways"
        ]
      }
    },
    "/v1/payment-gateways/methods/{method}/fields": {
      "get": {
        "description": "Retrieve the fields required for a specific payment method.",
        "operationId": "PaymentGatewaysController_fields_v1",
        "parameters": [
          {
            "name": "method",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Get payment method fields",
        "tags": [
          "payment gateways"
        ]
      }
    },
    "/v1/payment-gateways/methods/{method}": {
      "get": {
        "description": "Retrieve details of a specific payment method.",
        "operationId": "PaymentGatewaysController_findOne_v1",
        "parameters": [
          {
            "name": "method",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the details settings of the specified payment method.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/GatewayMethodPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Get payment method details",
        "tags": [
          "payment gateways"
        ]
      }
    },
    "/v1/payment-gateways/methods/{method}/update": {
      "post": {
        "description": "Update a payment method for the tenant.",
        "operationId": "PaymentGatewaysController_update_v1",
        "parameters": [
          {
            "name": "method",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePaymentMethodDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GatewayMethodPayloadDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Update payment method",
        "tags": [
          "payment gateways"
        ]
      }
    },
    "/v1/payment-gateways/methods/{method}/statement": {
      "post": {
        "description": "Generate a PDF statement for a payment method within a date range.",
        "operationId": "PaymentGatewaysController_generateStatement_v1",
        "parameters": [
          {
            "name": "method",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateStatementDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Generate a statement",
        "tags": [
          "payment gateways"
        ]
      }
    },
    "/v1/payment-gateways/payouts": {
      "get": {
        "description": "Get a list of all payouts based on the provided query parameters.",
        "operationId": "PaymentGatewaysController_findAllPayouts_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of payouts based on the filter specified.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "payouts": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/PayoutPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "splits:view:all",
                            "splits:view:me",
                            "splits:view:team"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all payouts",
        "tags": [
          "payment gateways"
        ]
      }
    },
    "/v1/payment-gateways/payouts/{payoutId}": {
      "get": {
        "description": "Retrieve a payout based on the ID specified.",
        "operationId": "PaymentGatewaysController_findOnePayout_v1",
        "parameters": [
          {
            "name": "payoutId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the payout.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/PayoutDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "summary": "Retrieve a payout",
        "tags": [
          "payment gateways"
        ]
      }
    },
    "/v1/payment-gateways/payouts/{payoutId}/remittance-advice": {
      "post": {
        "description": "Generate a remittance advice for a payout.",
        "operationId": "PaymentGatewaysController_remittanceAdvice_v1",
        "parameters": [
          {
            "name": "payoutId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Generate a Remittance Advice",
        "tags": [
          "payment gateways"
        ]
      }
    },
    "/v1/payment-gateways/payouts/{payoutId}/send/tenant": {
      "post": {
        "description": "Force payout to be sent to the tenant instead of a partnership.",
        "operationId": "PaymentGatewaysController_forcePayoutToTenant_v1",
        "parameters": [
          {
            "name": "payoutId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Send a payout to the tenant",
        "tags": [
          "payment gateways"
        ]
      }
    },
    "/v1/payment-gateways/payouts/{payoutId}/send": {
      "post": {
        "description": "Attempt to send a payout to a partnership.",
        "operationId": "PaymentGatewaysController_sendPayout_v1",
        "parameters": [
          {
            "name": "payoutId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Send a payout to a partnership",
        "tags": [
          "payment gateways"
        ]
      }
    },
    "/v1/payment-gateways/financing/options": {
      "post": {
        "description": "Get financing options based on the provided data.",
        "operationId": "PaymentGatewaysController_financingOptions_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FinancingOptionsPaymentDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A list of financing options available for giving payment.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "options": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/FinanceOptionPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Get financing options",
        "tags": [
          "payment gateways"
        ]
      }
    },
    "/v1/payment-gateways/financing/simulate": {
      "post": {
        "description": "Simulate financing options based on the provided data.",
        "operationId": "PaymentGatewaysController_simulateFinancing_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SimulateFinancingPaymentDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Simulate fiinancing options",
        "tags": [
          "payment gateways"
        ]
      }
    },
    "/v1/payment-gateways/fx/quote": {
      "post": {
        "description": "Get a foreign exchange quote based on the provided data.",
        "operationId": "PaymentGatewaysController_fxQuote_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFxQuoteDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Get a foreign exchange quote",
        "tags": [
          "payment gateways"
        ]
      }
    },
    "/v1/authorizations/find-one": {
      "post": {
        "description": "Get an authorization by its authorization ID or payment intent ID.",
        "operationId": "AuthorizationsController_findOne_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentGatewayAuthorizationFindOneDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the authorization.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/AuthorizationPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Retrieve an authorization",
        "tags": [
          "authorizations"
        ]
      }
    },
    "/v1/authorizations": {
      "get": {
        "description": "Get a list of all authorizations based on the provided query parameters.",
        "operationId": "AuthorizationsController_findAll_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of authorizations based on the filter specified.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "authorizations": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/AuthorizationPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Retrieve all authorizations",
        "tags": [
          "authorizations"
        ]
      }
    },
    "/v1/authorizations/logs": {
      "get": {
        "description": "Get a list of all authorization logs based on the provided query parameters.",
        "operationId": "AuthorizationsController_findAllLogs_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of authorization logs based on the filter specified.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "logs": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/AuthorizationLogPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Retrieve all authorization logs",
        "tags": [
          "authorizations"
        ]
      }
    },
    "/v1/authorizations/stats": {
      "get": {
        "description": "Get statistics and analytics for authorizations, including options for filtering by date.",
        "operationId": "AuthorizationsController_stats_v1",
        "parameters": [
          {
            "name": "filter",
            "required": true,
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns authorization statistics."
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "paymentIntents:view:all",
                            "paymentIntents:view:me",
                            "paymentIntents:view:team"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Get authorizations analytics",
        "tags": [
          "authorizations"
        ]
      }
    },
    "/v1/authorizations/{authorizationId}/authorize": {
      "post": {
        "description": "Authorize an authorization based on the authorization ID.",
        "operationId": "AuthorizationsController_authorize_v1",
        "parameters": [
          {
            "name": "authorizationId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentGatewayAuthorizationAuthorizeDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Authorize an authorization",
        "tags": [
          "authorizations"
        ]
      }
    },
    "/v1/authorizations/{authorizationId}/options": {
      "get": {
        "description": "Get a list of actions available for an authorization based on the authorization ID.",
        "operationId": "AuthorizationsController_options_v1",
        "parameters": [
          {
            "name": "authorizationId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A list of actions available for an authorization.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "options": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/AuhtorizationOptionsPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Get authorization options",
        "tags": [
          "authorizations"
        ]
      }
    },
    "/v1/authorizations/{authorizationId}/agreement": {
      "get": {
        "description": "Generate an agreement in PDF for an authorization.",
        "operationId": "AuthorizationsController_agreement_v1",
        "parameters": [
          {
            "name": "authorizationId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the authorization agreement."
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Generate authorization agreement",
        "tags": [
          "authorizations"
        ]
      }
    },
    "/v1/authorizations/{authorizationId}/cancel": {
      "get": {
        "description": "Cancel an authorization based on the authorization ID.",
        "operationId": "AuthorizationsController_cancel_v1",
        "parameters": [
          {
            "name": "authorizationId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A list of actions available for an authorization.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "options": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/AuhtorizationOptionsPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "204": {
            "description": ""
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Cancel authorization",
        "tags": [
          "authorizations"
        ]
      }
    },
    "/v1/compliance/dsar/{contactId}": {
      "get": {
        "description": "GDPR Art. 15/20 — Returns all personal data stored for a contact in a machine-readable format.",
        "operationId": "ComplianceController_exportContactData_v1",
        "parameters": [
          {
            "name": "contactId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a full DSAR export for the specified contact.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/DsarExportPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Export contact personal data (DSAR)",
        "tags": [
          "compliance"
        ]
      }
    },
    "/v1/compliance": {
      "get": {
        "operationId": "ComplianceController_getTenantForCompliance_v1",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Get full compliance data",
        "tags": [
          "compliance"
        ]
      }
    },
    "/v1/compliance/update": {
      "post": {
        "operationId": "ComplianceController_updateTenantForCompliance_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateComplianceRiskDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Update specific compliance data fields",
        "tags": [
          "compliance"
        ]
      }
    },
    "/v1/compliance/summary": {
      "get": {
        "description": "Retrieve a count of missing and completed compliance requirements to process payments.",
        "operationId": "ComplianceController_getComplianceSummary_v1",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Returns the current compliance status summary.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/ComplianceSummaryPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Get compliance summary",
        "tags": [
          "compliance"
        ]
      }
    },
    "/v1/compliance/requirements": {
      "get": {
        "description": "Retrieve the list of compliance requirements needed to process payments.",
        "operationId": "ComplianceController_findAllComplianceRequirements_v1",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Returns the compliance requirements list.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/ComplianceRequirementsPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Get compliance requirements",
        "tags": [
          "compliance"
        ]
      }
    },
    "/v1/compliance/upload": {
      "post": {
        "description": "Upload a compliance document to be used for processing payments.",
        "operationId": "ComplianceController_uploadComplianceDocument_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadComplianceDocumentDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Upload compliance document",
        "tags": [
          "compliance"
        ]
      }
    },
    "/v1/compliance/confirm": {
      "post": {
        "description": "Mark an external-link document requirement (e.g. Onfido selfie verification) as submitted. Records customer self-attestation.",
        "operationId": "ComplianceController_confirmComplianceDocument_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfirmComplianceDocumentDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Confirm external-link compliance document submission",
        "tags": [
          "compliance"
        ]
      }
    },
    "/v1/compliance/individuals": {
      "get": {
        "description": "Retrieve a list of individuals related to compliance requirements.",
        "operationId": "ComplianceController_findAllRelevantIndividuals_v1",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Get compliance individuals",
        "tags": [
          "compliance"
        ]
      }
    },
    "/v1/compliance/individuals/create": {
      "post": {
        "description": "Create a new individual related to compliance requirements.",
        "operationId": "ComplianceController_createRelevantIndividual_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertRelevantIndividualDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Create compliance individual",
        "tags": [
          "compliance"
        ]
      }
    },
    "/v1/compliance/individuals/{individualId}/update": {
      "post": {
        "description": "Update an existing individual related to compliance requirements.",
        "operationId": "ComplianceController_updateRelevantIndividual_v1",
        "parameters": [
          {
            "name": "individualId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertRelevantIndividualDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Update compliance individual",
        "tags": [
          "compliance"
        ]
      }
    },
    "/v1/compliance/individuals/{individualId}/archive": {
      "post": {
        "description": "Archive an individual related to compliance requirements.",
        "operationId": "ComplianceController_archiveRelevantIndividual_v1",
        "parameters": [
          {
            "name": "individualId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Archive compliance individual",
        "tags": [
          "compliance"
        ]
      }
    },
    "/v1/compliance/signatures/tc": {
      "get": {
        "description": "Retrieve the terms and conditions signature for compliance.",
        "operationId": "ComplianceController_getTcSignature_v1",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Get terms and conditions signature",
        "tags": [
          "compliance"
        ]
      }
    },
    "/v1/compliance/signatures/tc/accept": {
      "post": {
        "description": "Accept the terms and conditions signature for compliance.",
        "operationId": "ComplianceController_acceptTc_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TcAcceptanceDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Accept terms and conditions signature",
        "tags": [
          "compliance"
        ]
      }
    },
    "/v1/compliance/requirements/{requirementId}/clarification": {
      "post": {
        "description": "Submit a clarification answer for a specific compliance requirement.",
        "operationId": "ComplianceController_submitClarification_v1",
        "parameters": [
          {
            "name": "requirementId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitClarificationDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Submit compliance requirement clarification",
        "tags": [
          "compliance"
        ]
      }
    },
    "/v1/compliance/verification/legal-entity/{legalEntityId}/{countryCode}": {
      "get": {
        "description": "Validate a legal entity ID for compliance verification purposes.",
        "operationId": "ComplianceController_validateLegalEntity_v1",
        "parameters": [
          {
            "name": "legalEntityId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "countryCode",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Validate legal entity ID",
        "tags": [
          "compliance"
        ]
      }
    },
    "/v1/subscriptions/create": {
      "post": {
        "description": "Create a new subscription with the provided data.",
        "operationId": "SubscriptionsController_create_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSubscriptionDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the created subscription object.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/SubscriptionPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Create a subscription",
        "tags": [
          "subscriptions"
        ]
      }
    },
    "/v1/subscriptions": {
      "get": {
        "description": "Get a list of all subscriptions based on the provided query parameters.",
        "operationId": "SubscriptionsController_findAll_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of subscriptions based on the filter specified.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "subscriptions": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/SubscriptionPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all subscriptions",
        "tags": [
          "subscriptions"
        ]
      }
    },
    "/v1/subscriptions/{subscriptionId}": {
      "get": {
        "description": "Get a subscription by its ID.",
        "operationId": "SubscriptionsController_findOne_v1",
        "parameters": [
          {
            "name": "subscriptionId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/SubscriptionPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Retrieve a subscription",
        "tags": [
          "subscriptions"
        ]
      }
    },
    "/v1/subscriptions/{subscriptionId}/update": {
      "post": {
        "description": "Update an existing subscription with the provided data.",
        "operationId": "SubscriptionsController_update_v1",
        "parameters": [
          {
            "name": "subscriptionId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSubscriptionDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the updated subscription object.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/SubscriptionPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Update subscription",
        "tags": [
          "subscriptions"
        ]
      }
    },
    "/v1/subscriptions/{subscriptionId}/delete": {
      "post": {
        "description": "Delete an existing subscription by its ID.",
        "operationId": "SubscriptionsController_remove_v1",
        "parameters": [
          {
            "name": "subscriptionId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Delete subscription",
        "tags": [
          "subscriptions"
        ]
      }
    },
    "/v1/subscriptions/{subscriptionId}/options": {
      "get": {
        "description": "Get a list of actions available for a subscription.",
        "operationId": "SubscriptionsController_options_v1",
        "parameters": [
          {
            "name": "subscriptionId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of available actions for this subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "options": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/SubscriptionOptionPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          },
          {
            "jwt": []
          }
        ],
        "summary": "Get subscription actions",
        "tags": [
          "subscriptions"
        ]
      }
    },
    "/v1/fields/create": {
      "post": {
        "description": "Create a new field with the provided data. Only Admins can create fields.",
        "operationId": "FieldsController_create_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFieldDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the created field.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/FieldPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super",
                            "admin"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Create a field",
        "tags": [
          "custom fields"
        ]
      }
    },
    "/v1/fields": {
      "get": {
        "description": "List all fields with the possibility to filter, sort and paginate the results.",
        "operationId": "FieldsController_findAll_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of custom fields.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "customFields": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/FieldPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all fields",
        "tags": [
          "custom fields"
        ]
      }
    },
    "/v1/fields/{fieldId}": {
      "get": {
        "description": "Retrieve a field by its ID. ",
        "operationId": "FieldsController_findOne_v1",
        "parameters": [
          {
            "name": "fieldId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the field.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/FieldPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Retrieve a field",
        "tags": [
          "custom fields"
        ]
      }
    },
    "/v1/fields/{fieldId}/update": {
      "post": {
        "description": "Update a field with the provided data. Only Admins can update fields.",
        "operationId": "FieldsController_update_v1",
        "parameters": [
          {
            "name": "fieldId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateFieldDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the updated field.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/FieldPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super",
                            "admin"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Update a field",
        "tags": [
          "custom fields"
        ]
      }
    },
    "/v1/fields/{fieldId}/delete": {
      "post": {
        "description": "Remove a field by its ID. Only Admins can remove fields.",
        "operationId": "FieldsController_remove_v1",
        "parameters": [
          {
            "name": "fieldId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super",
                            "admin"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Delete a field",
        "tags": [
          "custom fields"
        ]
      }
    },
    "/v1/events/create": {
      "post": {
        "description": "Create an event/task.",
        "operationId": "EventsController_create_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEventDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the created event.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/EventDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "events:edit:all",
                            "events:edit:team",
                            "events:edit:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Create an event",
        "tags": [
          "events"
        ]
      }
    },
    "/v1/events/stats": {
      "get": {
        "description": "Get events analytics.",
        "operationId": "EventsController_monthStats_v1",
        "parameters": [
          {
            "name": "filter",
            "required": true,
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns event analytics/statistics for the month."
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "events:view:all",
                            "events:view:team",
                            "events:view:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Get events analytics",
        "tags": [
          "events"
        ]
      }
    },
    "/v1/events": {
      "get": {
        "description": "List all events/tasks.",
        "operationId": "EventsController_findAll_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of events.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "events": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/EventListPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "events:view:all",
                            "events:view:team",
                            "events:view:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all events",
        "tags": [
          "events"
        ]
      }
    },
    "/v1/events/{eventId}": {
      "get": {
        "description": "Retrieve an event/task.",
        "operationId": "EventsController_findOne_v1",
        "parameters": [
          {
            "name": "eventId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the event detail.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/EventDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "events:view:all",
                            "events:view:team",
                            "events:view:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Retrieve an event",
        "tags": [
          "events"
        ]
      }
    },
    "/v1/events/{eventId}/update": {
      "post": {
        "description": "Update an event/task.",
        "operationId": "EventsController_update_v1",
        "parameters": [
          {
            "name": "eventId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEventDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the updated event.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/EventDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "events:edit:all",
                            "events:edit:team",
                            "events:edit:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Update an event",
        "tags": [
          "events"
        ]
      }
    },
    "/v1/events/{eventId}/delete": {
      "post": {
        "description": "Remove an event/task.",
        "operationId": "EventsController_remove_v1",
        "parameters": [
          {
            "name": "eventId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "events:delete:all",
                            "events:delete:team",
                            "events:delete:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Delete an event",
        "tags": [
          "events"
        ]
      }
    },
    "/v1/add-ons/{provider}": {
      "get": {
        "description": "Retrieve the current configuration and status for a specific add-on provider.",
        "operationId": "AddOnsController_findOne_v1",
        "parameters": [
          {
            "name": "provider",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the add-on provider configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/AddOnActionPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super",
                            "admin"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Get add-on configuration",
        "tags": [
          "addons"
        ]
      }
    },
    "/v1/add-ons/{provider}/fields": {
      "get": {
        "description": "Retrieve the configurable fields for a specific add-on provider.",
        "operationId": "AddOnsController_fields_v1",
        "parameters": [
          {
            "name": "provider",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the add-on provider fields.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/AddOnActionPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super",
                            "admin"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Get add-on provider fields",
        "tags": [
          "addons"
        ]
      }
    },
    "/v1/add-ons/{provider}/update": {
      "post": {
        "description": "Update the configuration for a specific add-on provider.",
        "operationId": "AddOnsController_update_v1",
        "parameters": [
          {
            "name": "provider",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the updated add-on configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/AddOnActionPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super",
                            "admin"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Update add-on configuration",
        "tags": [
          "addons"
        ]
      }
    },
    "/v1/add-ons/{provider}/oauth": {
      "post": {
        "description": "Start the OAuth authorization flow for a specific add-on provider. Returns a redirect URL if the provider requires OAuth.",
        "operationId": "AddOnsController_oauth_v1",
        "parameters": [
          {
            "name": "provider",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the OAuth redirect URL.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/AddOnActionPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super",
                            "admin"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Initiate add-on OAuth flow",
        "tags": [
          "addons"
        ]
      }
    },
    "/v1/dev/api-keys/create": {
      "post": {
        "description": "Create a new API key user for this tenant.",
        "operationId": "DevController_createApiKey_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the invited API key user.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/UserDetailedPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "201": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Create an API key",
        "tags": [
          "dev"
        ]
      }
    },
    "/v1/dev/api-keys": {
      "get": {
        "description": "Get a list of all API keys for this tenant.",
        "operationId": "DevController_findAllApiKeys_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of API key users.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "apiKeys": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/UserDetailedPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all API keys",
        "tags": [
          "dev"
        ]
      }
    },
    "/v1/dev/api-keys/{apikeyId}/delete": {
      "post": {
        "description": "Remove an API key by its ID.",
        "operationId": "DevController_removeApiKey_v1",
        "parameters": [
          {
            "name": "apikeyId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Delete an API key",
        "tags": [
          "dev"
        ]
      }
    },
    "/v1/dev/webhooks/create": {
      "post": {
        "description": "Create a new webhook associated to the tenant.",
        "operationId": "DevController_createWebhook_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the created webhook.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/WebhookPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Create a webhook",
        "tags": [
          "dev"
        ]
      }
    },
    "/v1/dev/webhooks": {
      "get": {
        "description": "List all webhooks associated to the tenant.",
        "operationId": "DevController_findAllWebhooks_v1",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Returns a list of active webhooks.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "webhooks": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/WebhookPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all webhooks",
        "tags": [
          "dev"
        ]
      }
    },
    "/v1/dev/webhooks/{webhookId}/delete": {
      "post": {
        "description": "Delete a webhook associated to the tenant.",
        "operationId": "DevController_removeWebhook_v1",
        "parameters": [
          {
            "name": "webhookId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of active webhooks.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "webhooks": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/WebhookPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Delete a webhook",
        "tags": [
          "dev"
        ]
      }
    },
    "/v1/videos/sign": {
      "post": {
        "description": "Get a signed URL for direct video upload.",
        "operationId": "VideosController_signDirectUpload_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVideoDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns signed upload URL and video metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/VideoSignUploadPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Sign direct upload for video",
        "tags": [
          "videos"
        ]
      }
    },
    "/v1/videos": {
      "get": {
        "description": "Get a list of all videos based on the provided query parameters.",
        "operationId": "VideosController_findAll_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of videos.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "videos": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/VideoPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all videos",
        "tags": [
          "videos"
        ]
      }
    },
    "/v1/videos/{videoId}/view": {
      "get": {
        "description": "Get a signed URL to view the video by its ID.",
        "operationId": "VideosController_view_v1",
        "parameters": [
          {
            "name": "videoId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a temporary signed video playback URL.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/VideoViewPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Get signed URL for video",
        "tags": [
          "videos"
        ]
      }
    },
    "/v1/videos/{videoId}/delete": {
      "post": {
        "description": "Delete an existing video by its ID.",
        "operationId": "VideosController_remove_v1",
        "parameters": [
          {
            "name": "videoId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Delete video",
        "tags": [
          "videos"
        ]
      }
    },
    "/v1/reports": {
      "get": {
        "description": "Get a list of all reports based on the provided query parameters.",
        "operationId": "ReportsController_findAll_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of reports.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "reports": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/ReportPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "reports:generate"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all reports",
        "tags": [
          "reports"
        ]
      }
    },
    "/v1/reports/create": {
      "post": {
        "description": "Create a new report using the provided data and user information.",
        "operationId": "ReportsController_create_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateReportDto"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Report creation accepted."
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "reports:generate"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Create a new report",
        "tags": [
          "reports"
        ]
      }
    },
    "/v1/reports/generate/{reportId}": {
      "post": {
        "description": "Generate a report with the specified report ID and payload.",
        "operationId": "ReportsController_generate_v1",
        "parameters": [
          {
            "name": "reportId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "reports:generate"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Generate report",
        "tags": [
          "reports"
        ]
      }
    },
    "/v1/reports/entities": {
      "get": {
        "description": "Get a list of report entities.",
        "operationId": "ReportsController_entities_v1",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Returns available report entities."
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "reports:generate"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all report entities",
        "tags": [
          "reports"
        ]
      }
    },
    "/v1/forms/create": {
      "post": {
        "operationId": "FormsController_create_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFormDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the created form.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/FormDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "forms:edit:all"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "forms"
        ]
      }
    },
    "/v1/forms": {
      "get": {
        "operationId": "FormsController_findAll_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of forms.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "forms": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/FormListPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "forms:view:all"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "forms"
        ]
      }
    },
    "/v1/forms/submissions": {
      "get": {
        "operationId": "FormsController_findAllSubmissions_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of form submissions.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "submissions": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/FormSubmissionListPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "forms"
        ]
      }
    },
    "/v1/forms/{formId}": {
      "get": {
        "operationId": "FormsController_findOne_v1",
        "parameters": [
          {
            "name": "formId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the form with populated references.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/FormDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "forms"
        ]
      }
    },
    "/v1/forms/{formId}/update": {
      "post": {
        "operationId": "FormsController_update_v1",
        "parameters": [
          {
            "name": "formId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateFormDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the updated form.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/FormDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "forms:edit:all"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "forms"
        ]
      }
    },
    "/v1/forms/{formId}/delete": {
      "post": {
        "operationId": "FormsController_remove_v1",
        "parameters": [
          {
            "name": "formId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "forms:delete:all"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "forms"
        ]
      }
    },
    "/v1/forms/{formId}/submit": {
      "post": {
        "operationId": "FormsController_submit_v1",
        "parameters": [
          {
            "name": "formId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitFormDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the submitted form submission.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/FormSubmissionDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "forms"
        ]
      }
    },
    "/v1/forms/{formId}/submit/{submissionId}": {
      "get": {
        "operationId": "FormsController_findOneSubmission_v1",
        "parameters": [
          {
            "name": "formId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "submissionId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the form submission with populated references.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/FormSubmissionDetailPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "forms"
        ]
      }
    },
    "/v1/forms/{formId}/submit/{submissionId}/delete": {
      "post": {
        "operationId": "FormsController_removeSubmission_v1",
        "parameters": [
          {
            "name": "formId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "submissionId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "forms:delete:all"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "forms"
        ]
      }
    },
    "/v1/feedback/create": {
      "post": {
        "description": "Create a feedback entry.",
        "operationId": "FeedbacksController_create_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFeedbackDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return the feedback created.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/FeedbackPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "summary": "Create a feedback entry",
        "tags": [
          "feedback"
        ]
      }
    },
    "/v1/feedback": {
      "get": {
        "description": "Retrieve a list of feedback objects.",
        "operationId": "FeedbacksController_findAll_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Return a list of feedback objects.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "feedback": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/FeedbackPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Retrieve feedback list",
        "tags": [
          "feedback"
        ]
      }
    },
    "/v1/feedback/stats": {
      "get": {
        "description": "Get feedback analytics.",
        "operationId": "FeedbacksController_stats_v1",
        "parameters": [
          {
            "name": "filter",
            "required": true,
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns feedback statistics grouped by response type.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "stats": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/FeedbackStatsPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Get feedback analytics",
        "tags": [
          "feedback"
        ]
      }
    },
    "/v1/feedback/{feedbackId}": {
      "get": {
        "description": "Retrieve a feedback by its id.",
        "operationId": "FeedbacksController_findOne_v1",
        "parameters": [
          {
            "name": "feedbackId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Return the feedback.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/FeedbackPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Retrieve a feedback",
        "tags": [
          "feedback"
        ]
      }
    },
    "/v1/feedback/{feedbackId}/delete": {
      "post": {
        "description": "Remove a feedback by its id.",
        "operationId": "FeedbacksController_remove_v1",
        "parameters": [
          {
            "name": "feedbackId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Delete a feedback",
        "tags": [
          "feedback"
        ]
      }
    },
    "/v1/bulk": {
      "get": {
        "description": "Get a list of all bulk payment split intents based on the provided query parameters.",
        "operationId": "BulkOperationsController_findAll_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "splits:view:all",
                            "splits:view:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all bulk payment splits",
        "tags": [
          "bulk"
        ]
      }
    },
    "/v1/bulk/{bulkOperationId}": {
      "get": {
        "description": "Get detailed information about a specific bulk operation based on its ID.",
        "operationId": "BulkOperationsController_findOne_v1",
        "parameters": [
          {
            "name": "bulkOperationId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the bulk operation.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/BulkOperationPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "splits:view:all",
                            "splits:view:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Retrieve a specific bulk operation",
        "tags": [
          "bulk"
        ]
      }
    },
    "/v1/bulk/{bulkOperationId}/options": {
      "get": {
        "description": "Get a list of actions available for a bulk operation based on the bulk operation ID.",
        "operationId": "BulkOperationsController_options_v1",
        "parameters": [
          {
            "name": "bulkOperationId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Return a list of actions available for a bulk operation.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "options": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/BulkOperationOptionsPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "splits:edit:all",
                            "splits:edit:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Get bulk operation options",
        "tags": [
          "bulk"
        ]
      }
    },
    "/v1/bulk/create": {
      "post": {
        "description": "Create a new bulk operation with the provided information.",
        "operationId": "BulkOperationsController_create_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBulkOperationDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the created bulk operation.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/BulkOperationPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "splits:edit:all",
                            "splits:edit:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Create a bulk operation",
        "tags": [
          "bulk"
        ]
      }
    },
    "/v1/bulk/{bulkOperationId}/update": {
      "post": {
        "description": "Modify the details of a specific bulk operation.",
        "operationId": "BulkOperationsController_update_v1",
        "parameters": [
          {
            "name": "bulkOperationId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBulkOperationDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the updated bulk operation.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/BulkOperationPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "splits:edit:all",
                            "splits:edit:me"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Update a bulk operation",
        "tags": [
          "bulk"
        ]
      }
    },
    "/v1/bulk/{bulkOperationId}/pdf": {
      "post": {
        "description": "Generate a PDF file for a specific bulk operation.",
        "operationId": "BulkOperationsController_downloadPdf_v1",
        "parameters": [
          {
            "name": "bulkOperationId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Generate a PDF for a bulk operation",
        "tags": [
          "bulk"
        ]
      }
    },
    "/v1/support/onboarding": {
      "get": {
        "operationId": "SupportController_onboarding_v1",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Returns onboarding information",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/OnbordingPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "support"
        ]
      }
    },
    "/v1/support/onboarding/start": {
      "post": {
        "operationId": "SupportController_startOnboarding_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartOnboardingDto"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": ""
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "support"
        ]
      }
    },
    "/v1/support/tickets/create": {
      "post": {
        "operationId": "SupportController_createTicket_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTicketDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "support"
        ]
      }
    },
    "/v1/support/tickets": {
      "get": {
        "operationId": "SupportController_getTickets_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tickets for the user or tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "tickets": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/SupportTicketPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "support"
        ]
      }
    },
    "/v1/support/tenant/owner": {
      "get": {
        "operationId": "SupportController_getTenantOwners_v1",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Returns tenant owners with profile details",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "owners": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/TenantOwnerPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "support"
        ]
      }
    },
    "/v1/support/survey/cadence": {
      "get": {
        "operationId": "SupportController_getSurveyCadence_v1",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Returns survey cadence status for CSAT and NPS",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/SurveyCadencePayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "support"
        ]
      }
    },
    "/v1/support/survey/nps": {
      "post": {
        "operationId": "SupportController_submitNps_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitNpsDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "tags": [
          "support"
        ]
      }
    },
    "/v1/support/chat/rooms/{roomId}/token": {
      "post": {
        "description": "Returns { token, expiresAt, conversationSid, identity }. The dashboard uses these fields to boot the @twilio/conversations JS SDK in one round-trip and connect directly to the upstream Conversation. Used both at first-load and on tokenAboutToExpire from the SDK.",
        "operationId": "SupportChatController_mintToken_v1",
        "parameters": [
          {
            "name": "roomId",
            "required": true,
            "in": "path",
            "description": "Chat room ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "AccessToken plus boot metadata",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/MintChatTokenPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Mint a Twilio Conversations AccessToken for the caller",
        "tags": [
          "support"
        ]
      }
    },
    "/v1/support/chat/rooms/{roomId}/cancel": {
      "post": {
        "description": "Aborts the LangChain invocation tied to the room's AI listener so the model stops mid-stream rather than running to completion and being silently dropped. Wired to the dashboard's Stop button. Idempotent — returns 204 even when there is nothing in flight.",
        "operationId": "SupportChatController_cancelGeneration_v1",
        "parameters": [
          {
            "name": "roomId",
            "required": true,
            "in": "path",
            "description": "Chat room ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Cancel any in-flight AI generation for a chat room",
        "tags": [
          "support"
        ]
      }
    },
    "/v1/support/payment-intents/{paymentIntentId}/chat": {
      "post": {
        "description": "Creates (or reuses, if one already exists) a chat room for the authenticated user and the given payment intent. Verifies the user owns the payment intent before delegating. Subsequent messaging uses the generic /support/chat/rooms endpoints.",
        "operationId": "PaymentChatController_createChat_v1",
        "parameters": [
          {
            "name": "paymentIntentId",
            "required": true,
            "in": "path",
            "description": "Payment intent ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the created (or reused) room plus the caller participant ID",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/CreateSupportRoomPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Open a support chat scoped to a specific payment intent",
        "tags": [
          "support"
        ]
      }
    },
    "/v1/disputes": {
      "get": {
        "description": "Get a list of all disputes based on the provided query parameters.",
        "operationId": "DisputesController_findAll_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of disputes based on the filter specified.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "disputes": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/DisputePayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "List all disputes",
        "tags": [
          "disputes"
        ]
      }
    },
    "/v1/disputes/{disputeId}": {
      "get": {
        "description": "Get a dispute by its ID.",
        "operationId": "DisputesController_findOne_v1",
        "parameters": [
          {
            "name": "disputeId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the team.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/DisputePayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Retrieve a dispute",
        "tags": [
          "disputes"
        ]
      }
    },
    "/v1/disputes/{disputeId}/update": {
      "post": {
        "description": "Update an existing dispute with the provided data.",
        "operationId": "DisputesController_update_v1",
        "parameters": [
          {
            "name": "disputeId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDisputeDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the updated dispute object.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/DisputePayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "admin:super",
                            "admin"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "jwt": []
          }
        ],
        "summary": "Update a dispute",
        "tags": [
          "disputes"
        ]
      }
    },
    "/v1/ingest/jobs": {
      "post": {
        "operationId": "IngestController_createJob_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateIngestJobDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Job created and initial tasks queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/JobPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "import:contacts",
                            "import:partnerships",
                            "import:paymentIntents"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create ingest job",
        "tags": [
          "ingest"
        ]
      },
      "get": {
        "operationId": "IngestController_listJobs_v1",
        "parameters": [
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of ingest jobs based on the filter specified.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "jobs": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/JobPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "import:contacts",
                            "import:partnerships",
                            "import:paymentIntents"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List all ingest jobs for tenant",
        "tags": [
          "ingest"
        ]
      }
    },
    "/v1/ingest/jobs/{id}": {
      "get": {
        "operationId": "IngestController_getJob_v1",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the ingest job details.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/JobPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "import:contacts",
                            "import:partnerships",
                            "import:paymentIntents"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get ingest job details",
        "tags": [
          "ingest"
        ]
      }
    },
    "/v1/ingest/jobs/{id}/cancel": {
      "post": {
        "operationId": "IngestController_cancelJob_v1",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Job cancelled successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/JobPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "import:contacts",
                            "import:partnerships",
                            "import:paymentIntents"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Cancel ingest job",
        "tags": [
          "ingest"
        ]
      }
    },
    "/v1/ingest/jobs/{id}/tasks": {
      "get": {
        "operationId": "IngestController_listTasks_v1",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A list of properties to return in the response.",
            "name": "projection",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "example": "name status createdAt",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "The number of results to return in the response.",
            "name": "limit",
            "in": "query",
            "schema": {
              "minimum": 0,
              "maximum": 1000,
              "example": 5,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "The number of results to skip in the response.",
            "name": "skip",
            "in": "query",
            "schema": {
              "minimum": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "required": false,
            "description": "A query string to filter the results. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "filter",
            "in": "query",
            "schema": {
              "example": "{\"status\":\"active\"}",
              "type": "string"
            }
          },
          {
            "required": false,
            "description": "A population string in case you want to expand/populate certain properties. Check our documentation for more information <a href=\"https://docs.qualyhq.com/docs/queries\" target=\"_blank\">here</a>.",
            "name": "population",
            "in": "query",
            "schema": {
              "example": "createdBy,partnership",
              "type": "string"
            }
          },
          {
            "required": false,
            "name": "sort",
            "in": "query",
            "schema": {
              "maxLength": 1000,
              "pattern": "/^[a-zA-Z0-9_.\\-\\s]+$/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns tasks for the ingest job.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "tasks": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/TaskPayloadDto"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/EnvelopResponseDto"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "import:contacts",
                            "import:partnerships",
                            "import:paymentIntents"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List tasks for an ingest job",
        "tags": [
          "ingest"
        ]
      }
    },
    "/v1/ingest/jobs/{id}/tasks/{taskId}": {
      "get": {
        "operationId": "IngestController_getTask_v1",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "taskId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the ingest task details.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/TaskPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "import:contacts",
                            "import:partnerships",
                            "import:paymentIntents"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get ingest task details",
        "tags": [
          "ingest"
        ]
      }
    },
    "/v1/ingest/jobs/{id}/tasks/{taskId}/retry": {
      "post": {
        "operationId": "IngestController_retryTask_v1",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "taskId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Task retried successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/TaskPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "import:contacts",
                            "import:partnerships",
                            "import:paymentIntents"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Retry a failed ingest task",
        "tags": [
          "ingest"
        ]
      }
    },
    "/v1/ingest/jobs/{id}/approve": {
      "post": {
        "operationId": "IngestController_approveJob_v1",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Job approved and marked as completed.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/JobPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "import:contacts",
                            "import:partnerships",
                            "import:paymentIntents"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Approve a dry-run ingest job",
        "tags": [
          "ingest"
        ]
      }
    },
    "/v1/ingest/jobs/{id}/rollback": {
      "post": {
        "operationId": "IngestController_rollbackJob_v1",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Rollback auto-created records from ingest job",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "$ref": "#/components/schemas/RollbackPayloadDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "201": {
            "description": ""
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "This action is forbidden because the user lacks necessary roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 403
                    },
                    "message": {
                      "type": "string",
                      "example": "This action is forbidden because the user lacks necessary roles."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "import:contacts",
                            "import:partnerships",
                            "import:paymentIntents"
                          ]
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Rollback auto-created records from ingest job",
        "tags": [
          "ingest"
        ]
      }
    }
  },
  "info": {
    "title": "core",
    "description": "",
    "version": "0.0.1",
    "contact": {}
  },
  "tags": [],
  "servers": [
    {
      "url": "http://localhost:9000"
    }
  ],
  "components": {
    "securitySchemes": {
      "jwt": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "type": "http",
        "name": "JWT",
        "description": "JWT token added to the Authorization header as Bearer.",
        "in": "header"
      }
    },
    "schemas": {
      "EnvelopResponseDto": {
        "type": "object",
        "properties": {
          "count": {
            "type": "number",
            "description": "Number of elements returned by the request",
            "example": 1
          },
          "hasMore": {
            "type": "boolean",
            "description": "True if the number of items has reached the limit requested.",
            "example": false
          }
        },
        "required": [
          "count",
          "hasMore"
        ]
      },
      "CreatedTenantDto": {
        "type": "object",
        "properties": {
          "tenantId": {
            "type": "string",
            "description": "The new tenant ID",
            "example": "acme-corp"
          },
          "prefix": {
            "type": "string",
            "description": "The tenant prefix used for routing",
            "example": "acme"
          }
        },
        "required": [
          "tenantId",
          "prefix"
        ]
      },
      "CreateTenantDto": {
        "type": "object",
        "properties": {
          "prefix": {
            "type": "string",
            "pattern": "/^[a-z0-9]{3}$/"
          }
        }
      },
      "SignedUploadPayloadDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "The _id of the document in the DB.",
            "example": "507f1f77bcf86cd799439011"
          },
          "cloud": {
            "type": "string",
            "description": "The cloud where the file will be uploaded.",
            "example": "cloudinary"
          },
          "path": {
            "type": "string",
            "description": "The path of the uploaded file. May not be the same as requested. A prefix for the cloud will be added (e.g. \"c/\" for Cloudinary).",
            "example": "c/my/file/path"
          },
          "url": {
            "type": "string",
            "description": "When uploading for GCP cloud, a signed URL to be used for client-side file upload.",
            "example": "https://storage.example.com/upload?token=abc"
          },
          "signature": {
            "type": "string",
            "description": "When uploading to Cloudinary, this is the signature string for client-side file upload.",
            "example": "b232f5d134dbe135966a60ce8c4a432a96c81558"
          },
          "timestamp": {
            "type": "number",
            "description": "The timestamp for the file upload.",
            "example": 1705312200
          }
        },
        "required": [
          "_id",
          "cloud",
          "path"
        ]
      },
      "SignUploadDto": {
        "type": "object",
        "properties": {
          "targetId": {
            "type": "string",
            "description": "The ID of the target where the file will be uploaded.",
            "example": "507f1f77bcf86cd799439011"
          },
          "targetType": {
            "type": "string",
            "enum": [
              "contact",
              "user",
              "report",
              "paymentIntent",
              "partnership"
            ],
            "description": "The type of the target where the file will be uploaded.",
            "example": "user"
          },
          "folder": {
            "type": "string",
            "description": "The ID of the folder where the file will be uploaded.",
            "example": "507f1f77bcf86cd799439011"
          },
          "cloud": {
            "type": "string",
            "enum": [
              "gcp",
              "cloudinary"
            ],
            "description": "The cloud where the file will be uploaded.",
            "example": "cloudinary"
          },
          "contentType": {
            "type": "string",
            "description": "The MIME type of the file to be uploaded.",
            "example": "image/gif"
          },
          "path": {
            "type": "string",
            "description": "The path of the uploaded file. The final path may not be the same as requested.",
            "example": "my/file/path"
          },
          "lastModified": {
            "format": "date-time",
            "type": "string",
            "description": "When was the file last modified.",
            "example": "2024-01-15T09:30:00.000Z"
          },
          "filename": {
            "type": "string",
            "description": "The file name of the uploaded file.",
            "example": "my-file-name.gif"
          },
          "size": {
            "type": "number",
            "minimum": 1,
            "description": "File size in bytes.",
            "example": 1048576
          },
          "requestId": {
            "type": "string",
            "description": "The ID of the request for the file upload.",
            "example": "507f1f77bcf86cd799439011"
          },
          "description": {
            "type": "string",
            "description": "A description of the file to be uploaded.",
            "example": "This is a sample file."
          },
          "orderItems": {
            "description": "The IDs of the order items associated with the file.",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "paymentIntents": {
            "description": "The IDs of the payment intents associated with the file.",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "formSubmissions": {
            "description": "The IDs of the form submissions associated with the file.",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "category": {
            "type": "string",
            "enum": [
              "letter-of-offer",
              "letter-of-acceptance",
              "statement-of-purpose",
              "confirmation-of-enrollment",
              "visa",
              "language-test",
              "insurance-certificate",
              "academic-transcript",
              "passport",
              "national-id",
              "birth-certificate",
              "marriage-certificate",
              "proof-of-address",
              "bank-statement",
              "contract",
              "invoice",
              "cv",
              "payment-receipt",
              "transfer-receipt",
              "other"
            ],
            "description": "The category of the file to be uploaded.",
            "example": "profile_picture"
          }
        },
        "required": [
          "targetType",
          "cloud",
          "contentType",
          "path",
          "lastModified",
          "filename",
          "size"
        ]
      },
      "UserProfileRefDto": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "description": "First name",
            "example": "John"
          },
          "lastName": {
            "type": "string",
            "description": "Last name",
            "example": "Doe"
          },
          "nickname": {
            "type": "string",
            "description": "Nickname",
            "example": "JD"
          },
          "picture": {
            "type": "string",
            "description": "Profile picture path",
            "example": "c/avatars/user123"
          },
          "phone": {
            "type": "string",
            "description": "Phone number",
            "example": "+1-555-123-4567"
          },
          "gender": {
            "type": "string",
            "nullable": true,
            "description": "Gender",
            "enum": [
              "male",
              "female",
              "other",
              null
            ]
          }
        }
      },
      "UserRefDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "User ID (MongoDB ObjectId)",
            "example": "507f1f77bcf86cd799439011"
          },
          "profile": {
            "description": "User profile information",
            "allOf": [
              {
                "$ref": "#/components/schemas/UserProfileRefDto"
              }
            ]
          }
        },
        "required": [
          "_id",
          "profile"
        ]
      },
      "FolderRefDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Folder ID (MongoDB ObjectId)",
            "example": "507f1f77bcf86cd799439011"
          },
          "name": {
            "type": "string",
            "description": "Folder name",
            "example": "Documents"
          }
        },
        "required": [
          "_id"
        ]
      },
      "FilePayloadDto": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "example": "Project files and documents"
          },
          "targetId": {
            "type": "string"
          },
          "targetType": {
            "type": "string",
            "description": "Target entity type for this file",
            "enum": [
              "contact",
              "user",
              "report",
              "paymentIntent",
              "partnership"
            ],
            "example": "contact"
          },
          "public": {
            "type": "boolean"
          },
          "file": {
            "type": "object",
            "description": "File metadata (name, size, content type)",
            "additionalProperties": true
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "description": "Creation timestamp",
            "example": "2024-01-15T10:30:00.000Z"
          },
          "createdBy": {
            "description": "User who created this file (ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "folder": {
            "description": "Folder reference (ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/FolderRefDto"
              }
            ]
          },
          "status": {
            "type": "string",
            "description": "File processing status",
            "enum": [
              "requested",
              "pending-upload",
              "ready",
              "deleted"
            ],
            "example": "ready"
          },
          "path": {
            "type": "string"
          },
          "storage": {
            "type": "string",
            "description": "Cloud storage provider",
            "enum": [
              "gcp",
              "cloudinary"
            ],
            "example": "gcp"
          },
          "orderItems": {
            "description": "Order item IDs associated with this file",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "paymentIntents": {
            "description": "Payment intent IDs associated with this file",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "formSubmissions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "category": {
            "type": "string",
            "description": "File category classification",
            "enum": [
              "letter-of-offer",
              "letter-of-acceptance",
              "statement-of-purpose",
              "confirmation-of-enrollment",
              "visa",
              "language-test",
              "insurance-certificate",
              "academic-transcript",
              "passport",
              "national-id",
              "birth-certificate",
              "marriage-certificate",
              "proof-of-address",
              "bank-statement",
              "contract",
              "invoice",
              "cv",
              "payment-receipt",
              "transfer-receipt",
              "other"
            ],
            "example": "document"
          }
        },
        "required": [
          "targetId",
          "targetType",
          "public",
          "createdAt",
          "createdBy",
          "status",
          "formSubmissions"
        ]
      },
      "FileOpenPayloadDto": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "Temporary signed URL for file access",
            "example": "https://storage.example.com/file.pdf"
          }
        },
        "required": [
          "url"
        ]
      },
      "UpdateFileDto": {
        "type": "object",
        "properties": {
          "targetId": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "contact": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "orderItems": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "formSubmissions": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "paymentIntents": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "description": {
            "type": "string",
            "example": "Project files and documents"
          },
          "public": {
            "type": "boolean"
          }
        }
      },
      "FolderPayloadDto": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "example": "Project files and documents"
          },
          "targetId": {
            "type": "string"
          },
          "targetType": {
            "type": "string",
            "description": "Target entity type for this folder",
            "enum": [
              "contact",
              "user",
              "report",
              "paymentIntent",
              "partnership"
            ],
            "example": "contact"
          },
          "name": {
            "type": "string"
          },
          "parent": {
            "description": "Parent folder reference (ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/FolderRefDto"
              }
            ]
          },
          "createdBy": {
            "description": "User who created this folder (ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "primaryColor": {
            "type": "string"
          },
          "nFiles": {
            "type": "number"
          }
        },
        "required": [
          "targetId",
          "targetType",
          "name",
          "createdBy"
        ]
      },
      "CreateFolderDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Documents"
          },
          "description": {
            "type": "string",
            "example": "Project files and documents"
          },
          "targetId": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "parent": {
            "type": "string"
          },
          "primaryColor": {
            "type": "string",
            "pattern": "^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$"
          },
          "targetType": {
            "type": "string",
            "enum": [
              "contact",
              "user",
              "report",
              "paymentIntent",
              "partnership"
            ]
          }
        },
        "required": [
          "name",
          "targetId",
          "targetType"
        ]
      },
      "UpdateFolderDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Documents"
          },
          "description": {
            "type": "string",
            "example": "Project files and documents"
          },
          "targetId": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "parent": {
            "type": "string"
          },
          "primaryColor": {
            "type": "string",
            "pattern": "^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$"
          },
          "targetType": {
            "type": "string",
            "enum": [
              "contact",
              "user",
              "report",
              "paymentIntent",
              "partnership"
            ]
          }
        }
      },
      "AddressSchema": {
        "type": "object",
        "properties": {
          "country": {
            "type": "string"
          },
          "line1": {
            "type": "string"
          },
          "line2": {
            "type": "string"
          },
          "postalCode": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "city": {
            "type": "string"
          }
        },
        "required": [
          "country",
          "line1",
          "postalCode",
          "state",
          "city"
        ]
      },
      "TaxId": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "ad_nrt",
              "ae_trn",
              "al_vat",
              "ar_cuit",
              "at_vat",
              "at_uid",
              "au_abn",
              "au_arn",
              "ba_vat",
              "bg_uic",
              "be_vat",
              "bh_vat",
              "bo_tin",
              "br_cnpj",
              "br_cpf",
              "ca_bn",
              "ca_gst_hst",
              "ca_pst_bc",
              "ca_pst_mb",
              "ca_pst_sk",
              "ca_qst",
              "ch_uid",
              "ch_vat",
              "cl_tin",
              "cn_tin",
              "co_nit",
              "cr_tin",
              "cy_vat",
              "cz_vat",
              "cz_dic",
              "de_stn",
              "de_hrn",
              "do_rcn",
              "dk_vat",
              "ec_ruc",
              "ee_vat",
              "ee_rc",
              "eg_tin",
              "es_cif",
              "eu_oss_vat",
              "eu_vat",
              "fi_vat",
              "fr_vat",
              "fr_siren",
              "fr_siret",
              "gb_vat",
              "gb_crn",
              "ge_vat",
              "gr_vat",
              "hk_br",
              "hr_oib",
              "hu_tin",
              "id_npwp",
              "ie_vat",
              "ie_crn",
              "il_vat",
              "in_gst",
              "is_vat",
              "it_vat",
              "it_cf",
              "jp_cn",
              "jp_rn",
              "jp_trn",
              "pk_ntn",
              "ke_pin",
              "kr_brn",
              "kz_bin",
              "li_uid",
              "lt_vat",
              "lu_vat",
              "lv_vat",
              "md_vat",
              "me_vat",
              "mk_vat",
              "mt_vat",
              "mx_rfc",
              "my_frp",
              "my_itn",
              "my_sst",
              "ng_tin",
              "nl_vat",
              "nl_kvk",
              "no_vat",
              "no_voec",
              "nz_gst",
              "om_vat",
              "pe_ruc",
              "ph_tin",
              "pl_vat",
              "pl_nip",
              "pt_vat",
              "pt_nif",
              "ro_tin",
              "rs_pib",
              "ru_inn",
              "ru_kpp",
              "sa_vat",
              "se_vat",
              "se_orgnr",
              "sg_gst",
              "sg_uen",
              "si_tin",
              "sk_vat",
              "sv_nit",
              "th_vat",
              "tr_tin",
              "tw_vat",
              "ua_vat",
              "us_ein",
              "uy_ruc",
              "ve_rif",
              "vn_tin",
              "za_vat"
            ],
            "example": "au_abn"
          },
          "number": {
            "type": "string",
            "example": "12345678912"
          },
          "id": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "number"
        ]
      },
      "BillingSchema": {
        "type": "object",
        "properties": {
          "businessType": {
            "type": "string",
            "enum": [
              null,
              "corporation",
              "sole-prop",
              "non-profit",
              "partnership"
            ]
          },
          "phone": {
            "type": "string",
            "example": "+61 412 345 678"
          },
          "legalName": {
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "incorporatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "address": {
            "$ref": "#/components/schemas/AddressSchema"
          },
          "taxIds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxId"
            }
          }
        },
        "required": [
          "locale"
        ]
      },
      "ContactSchema": {
        "type": "object",
        "properties": {
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "summaryFields": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "requiredFields": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "Category": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "color": {
            "type": "string"
          }
        },
        "required": [
          "color"
        ]
      },
      "Task": {
        "type": "object",
        "properties": {
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Category"
            }
          }
        },
        "required": [
          "categories"
        ]
      },
      "Service": {
        "type": "object",
        "properties": {
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Category"
            }
          }
        },
        "required": [
          "categories"
        ]
      },
      "PayoutSchema": {
        "type": "object",
        "properties": {
          "statementDescriptor": {
            "type": "string",
            "enum": [
              "name",
              "unique-number-name"
            ]
          },
          "bankAccountMode": {
            "type": "string",
            "enum": [
              "prioritize-settlement-currency",
              "prioritize-original-currency",
              "prioritize-same-currency"
            ]
          },
          "partnershipBankAccountMode": {
            "type": "string",
            "enum": [
              "prioritize-settlement-currency",
              "prioritize-original-currency",
              "prioritize-same-currency"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "interval": {
            "type": "string"
          },
          "approval": {
            "type": "boolean"
          }
        },
        "required": [
          "bankAccountMode",
          "partnershipBankAccountMode"
        ]
      },
      "OverdueFee": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ]
          },
          "amount": {
            "type": "number",
            "example": 5000
          },
          "reminder": {
            "type": "string",
            "enum": [
              "becomes-overdue",
              "1-day-overdue",
              "2-days-overdue",
              "3-days-overdue",
              "5-days-overdue",
              "7-days-overdue",
              "10-days-overdue",
              "14-days-overdue",
              "20-days-overdue",
              "27-days-overdue"
            ]
          },
          "category": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "currency",
          "amount",
          "reminder",
          "category"
        ]
      },
      "EarlyPayoffSchema": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "example": false
          },
          "method": {
            "type": "string",
            "enum": [
              "none",
              "percentage-on-amount",
              "fixed",
              "fx-adjustment"
            ]
          },
          "amount": {
            "type": "number",
            "example": 0.1
          }
        }
      },
      "SelfServiceInstallmentAuthorizationsSchema": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "example": false
          }
        }
      },
      "PaymentMarkupSchema": {
        "type": "object",
        "properties": {
          "gatewayMethod": {
            "type": "string",
            "enum": [
              "ZAI_CC",
              "ZAI_PAYID",
              "ZAI_BSBACC",
              "ZAI_PAYTO",
              "ZAI_DD",
              "AS_PIX",
              "AS_BOLETO",
              "PGBNK_CC",
              "WISE_MCACC",
              "KLARNA_PYMT",
              "TM_BANK_TRANSFER",
              "TM_CC",
              "BLUE_DD",
              "BLUE_CC",
              "BLUE_WERO",
              "EXTERNAL",
              "PARTNERSHIP",
              "OFFSET"
            ]
          },
          "method": {
            "type": "string",
            "enum": [
              "percentage-on-amount",
              "fixed"
            ]
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ]
          },
          "amount": {
            "type": "number",
            "example": 250
          },
          "enabled": {
            "type": "boolean"
          },
          "type": {
            "type": "string"
          },
          "label": {
            "type": "string"
          }
        },
        "required": [
          "currency",
          "label"
        ]
      },
      "Payment": {
        "type": "object",
        "properties": {
          "reminders": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "1-day-overdue",
                "2-days-overdue",
                "3-days-overdue",
                "5-days-overdue",
                "7-days-overdue",
                "10-days-overdue",
                "14-days-overdue",
                "20-days-overdue",
                "27-days-overdue",
                "becomes-overdue",
                "1-day",
                "3-days",
                "7-days",
                "14-days",
                "27-days"
              ]
            }
          },
          "reminderChannels": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "email",
                "sms",
                "push"
              ]
            }
          },
          "partnerSummary": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "payments-summary",
                "split-summary"
              ]
            }
          },
          "ti": {
            "type": "boolean",
            "example": false
          },
          "overdueFees": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OverdueFee"
            }
          },
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Category"
            }
          },
          "publicDisplay": {
            "type": "boolean"
          },
          "allowPartialPayments": {
            "type": "boolean"
          },
          "displayOwnerInfo": {
            "type": "boolean"
          },
          "displayOtherPayments": {
            "type": "boolean"
          },
          "earlyPayoff": {
            "$ref": "#/components/schemas/EarlyPayoffSchema"
          },
          "selfServiceInstallmentAuthorizations": {
            "$ref": "#/components/schemas/SelfServiceInstallmentAuthorizationsSchema"
          },
          "markup": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaymentMarkupSchema"
            }
          }
        },
        "required": [
          "reminders",
          "reminderChannels",
          "partnerSummary",
          "overdueFees",
          "categories",
          "publicDisplay",
          "allowPartialPayments",
          "displayOwnerInfo",
          "displayOtherPayments",
          "markup"
        ]
      },
      "FieldSchema": {
        "type": "object",
        "properties": {
          "groups": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "SocialSchema": {
        "type": "object",
        "properties": {
          "facebook": {
            "type": "string",
            "example": "https://facebook.com/acmecorp"
          },
          "instagram": {
            "type": "string",
            "example": "https://instagram.com/acmecorp"
          },
          "linkedin": {
            "type": "string",
            "example": "https://linkedin.com/company/acmecorp"
          },
          "medium": {
            "type": "string",
            "example": "https://medium.com/@acmecorp"
          },
          "twitter": {
            "type": "string",
            "example": "https://twitter.com/acmecorp"
          },
          "youtube": {
            "type": "string",
            "example": "https://youtube.com/@acmecorp"
          }
        }
      },
      "DomainsDnsRecord": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "value"
        ]
      },
      "CustomDomain": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "not-started",
              "in-progress",
              "active"
            ]
          },
          "nsName": {
            "type": "string"
          },
          "dnsRecords": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DomainsDnsRecord"
            }
          },
          "zoneTag": {
            "type": "string"
          }
        },
        "required": [
          "status",
          "nsName",
          "zoneTag"
        ]
      },
      "PartnershipSchema": {
        "type": "object",
        "properties": {
          "displayPortal": {
            "type": "boolean"
          }
        },
        "required": [
          "displayPortal"
        ]
      },
      "Geo": {
        "type": "object",
        "properties": {
          "countries": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "countries"
        ]
      },
      "Marketing": {
        "type": "object",
        "properties": {
          "geo": {
            "$ref": "#/components/schemas/Geo"
          }
        },
        "required": [
          "geo"
        ]
      },
      "FxMarkupCurrencySchema": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ]
          },
          "amount": {
            "type": "number",
            "example": 250
          },
          "method": {
            "type": "string"
          }
        },
        "required": [
          "currency"
        ]
      },
      "FxMarkupMethodSchema": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "example": 250
          },
          "enabled": {
            "type": "boolean"
          },
          "type": {
            "type": "string"
          },
          "method": {
            "type": "string"
          },
          "currencies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FxMarkupCurrencySchema"
            }
          }
        }
      },
      "FxMarkupSchema": {
        "type": "object",
        "properties": {
          "refunds": {
            "$ref": "#/components/schemas/FxMarkupMethodSchema"
          },
          "payouts": {
            "$ref": "#/components/schemas/FxMarkupMethodSchema"
          },
          "paymentIntents": {
            "$ref": "#/components/schemas/FxMarkupMethodSchema"
          }
        },
        "required": [
          "refunds",
          "payouts",
          "paymentIntents"
        ]
      },
      "FxToleranceSchema": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "example": 250
          },
          "enabled": {
            "type": "boolean"
          },
          "method": {
            "type": "string"
          }
        },
        "required": [
          "amount",
          "method"
        ]
      },
      "FxPreferredGatewaySchema": {
        "type": "object",
        "properties": {
          "paymentIntents": {
            "type": "string",
            "enum": [
              "xe",
              "wise",
              "nexpay",
              "transfermate",
              "edwallet",
              "abraseeio"
            ]
          },
          "payouts": {
            "type": "string",
            "enum": [
              "xe",
              "wise",
              "nexpay",
              "transfermate",
              "edwallet",
              "abraseeio"
            ]
          },
          "refunds": {
            "type": "string",
            "enum": [
              "xe",
              "wise",
              "nexpay",
              "transfermate",
              "edwallet",
              "abraseeio"
            ]
          }
        }
      },
      "FxSchema": {
        "type": "object",
        "properties": {
          "priority": {
            "type": "string",
            "enum": [
              "hold-rate",
              "optimize-cost"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "markup": {
            "$ref": "#/components/schemas/FxMarkupSchema"
          },
          "tolerance": {
            "$ref": "#/components/schemas/FxToleranceSchema"
          },
          "preferredGateway": {
            "$ref": "#/components/schemas/FxPreferredGatewaySchema"
          }
        },
        "required": [
          "priority",
          "tolerance",
          "preferredGateway"
        ]
      },
      "SettingPayloadDto": {
        "type": "object",
        "properties": {
          "websiteUrl": {
            "type": "string",
            "example": "https://acme.com"
          },
          "name": {
            "type": "string"
          },
          "shortName": {
            "type": "string"
          },
          "billing": {
            "$ref": "#/components/schemas/BillingSchema"
          },
          "industry": {
            "type": "string",
            "enum": [
              "accounting",
              "accommodation-provider",
              "airlines-aviation",
              "alternative-dispute-resolution",
              "alternative-medicine",
              "animation",
              "apparel-fashion",
              "architecture-planning",
              "arts-and-crafts",
              "automotive",
              "aviation-aerospace",
              "banking",
              "biotechnology",
              "broadcast-media",
              "building-materials",
              "business-supplies-and-equipment",
              "capital-markets",
              "chemicals",
              "civic-social-organization",
              "civil-engineering",
              "commercial-real-estate",
              "computer-network-security",
              "computer-games",
              "computer-hardware",
              "computer-networking",
              "computer-software",
              "internet",
              "construction",
              "consumer-electronics",
              "consumer-goods",
              "consumer-services",
              "cosmetics",
              "dairy",
              "defense-space",
              "design",
              "education-management",
              "education-agent",
              "education-provider",
              "immigration-agent",
              "e-learning",
              "electrical-electronic-manufacturing",
              "entertainment",
              "environmental-services",
              "events-services",
              "executive-office",
              "facilities-services",
              "farming",
              "financial-services",
              "fine-art",
              "fishery",
              "food-beverages",
              "food-production",
              "fund-raising",
              "furniture",
              "gambling-casinos",
              "glass-ceramics-concrete",
              "government-administration",
              "government-relations",
              "graphic-design",
              "health-wellness-and-fitness",
              "higher-education",
              "hospital-health-care",
              "hospitality",
              "human-resources",
              "import-and-export",
              "immigration-services",
              "individual-family-services",
              "industrial-automation",
              "information-services",
              "information-technology-and-services",
              "insurance",
              "international-affairs",
              "international-trade-and-development",
              "investment-banking",
              "investment-management",
              "judiciary",
              "law-enforcement",
              "law-practice",
              "legal-services",
              "legislative-office",
              "leisure-travel-tourism",
              "libraries",
              "logistics-and-supply-chain",
              "luxury-goods-jewelry",
              "machinery",
              "management-consulting",
              "maritime",
              "market-research",
              "marketing-and-advertising",
              "mechanical-or-industrial-engineering",
              "media-production",
              "medical-devices",
              "medical-practice",
              "mental-health-care",
              "military",
              "mining-metals",
              "motion-pictures-and-film",
              "museums-and-institutions",
              "music",
              "nanotechnology",
              "newspapers",
              "non-profit-organization-management",
              "oil-energy",
              "online-media",
              "outsourcing-offshoring",
              "package-freight-delivery",
              "packaging-and-containers",
              "paper-forest-products",
              "performing-arts",
              "pharmaceuticals",
              "philanthropy",
              "photography",
              "plastics",
              "political-organization",
              "primary-secondary-education",
              "printing",
              "professional-training-coaching",
              "program-development",
              "public-policy",
              "public-relations-and-communications",
              "public-safety",
              "publishing",
              "railroad-manufacture",
              "ranching",
              "real-estate",
              "recreational-facilities-and-services",
              "religious-institutions",
              "renewables-environment",
              "research",
              "restaurants",
              "retail",
              "security-and-investigations",
              "semiconductors",
              "shipbuilding",
              "sporting-goods",
              "sports",
              "staffing-and-recruiting",
              "supermarkets",
              "telecommunications",
              "textiles",
              "think-tanks",
              "tobacco",
              "translation-and-localization",
              "transportation-trucking-railroad",
              "utilities",
              "venture-capital-private-equity",
              "veterinary",
              "warehousing",
              "wholesale",
              "wine-and-spirits",
              "wireless",
              "writing-and-editing"
            ]
          },
          "size": {
            "type": "string",
            "enum": [
              "self-employed",
              "1-10",
              "11-50",
              "51-200",
              "201-500",
              "501-1000",
              "1001-5000",
              "5001-10000",
              "10001+"
            ]
          },
          "contact": {
            "$ref": "#/components/schemas/ContactSchema"
          },
          "task": {
            "$ref": "#/components/schemas/Task"
          },
          "service": {
            "$ref": "#/components/schemas/Service"
          },
          "primaryColor": {
            "type": "string"
          },
          "secondaryColor": {
            "type": "string"
          },
          "tertiaryColor": {
            "type": "string"
          },
          "payout": {
            "$ref": "#/components/schemas/PayoutSchema"
          },
          "payment": {
            "$ref": "#/components/schemas/Payment"
          },
          "logo": {
            "type": "string"
          },
          "gdpr": {
            "type": "boolean"
          },
          "field": {
            "$ref": "#/components/schemas/FieldSchema"
          },
          "accountAccess": {
            "type": "boolean"
          },
          "social": {
            "$ref": "#/components/schemas/SocialSchema"
          },
          "domains": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomDomain"
            }
          },
          "partnership": {
            "$ref": "#/components/schemas/PartnershipSchema"
          },
          "marketing": {
            "$ref": "#/components/schemas/Marketing"
          },
          "fx": {
            "$ref": "#/components/schemas/FxSchema"
          }
        },
        "required": [
          "primaryColor",
          "secondaryColor",
          "tertiaryColor",
          "social",
          "domains"
        ]
      },
      "Gateway": {
        "type": "object",
        "properties": {
          "status": {
            "type": "boolean"
          }
        },
        "required": [
          "status"
        ]
      },
      "GatewayWithPayIn": {
        "type": "object",
        "properties": {
          "payInFeePayee": {
            "type": "string",
            "enum": [
              "tenant",
              "contact"
            ]
          },
          "status": {
            "type": "boolean"
          }
        },
        "required": [
          "payInFeePayee",
          "status"
        ]
      },
      "GatewayPgbnkCc": {
        "type": "object",
        "properties": {
          "payInFeePayee": {
            "type": "string",
            "enum": [
              "tenant",
              "contact"
            ]
          },
          "advanceRelease": {
            "type": "string",
            "enum": [
              "automatic"
            ]
          },
          "status": {
            "type": "boolean"
          },
          "payInFeePayeeIsTenantUpToNInstallments": {
            "type": "number"
          }
        },
        "required": [
          "payInFeePayee",
          "advanceRelease",
          "status",
          "payInFeePayeeIsTenantUpToNInstallments"
        ]
      },
      "GatewayAsCc": {
        "type": "object",
        "properties": {
          "advanceRelease": {
            "type": "string",
            "enum": [
              "never",
              "automatic",
              "manual"
            ]
          },
          "status": {
            "type": "boolean"
          }
        },
        "required": [
          "advanceRelease",
          "status"
        ]
      },
      "Gateways": {
        "type": "object",
        "properties": {
          "EXTERNAL": {
            "$ref": "#/components/schemas/Gateway"
          },
          "ZAI_CC": {
            "$ref": "#/components/schemas/GatewayWithPayIn"
          },
          "ZAI_PAYID": {
            "$ref": "#/components/schemas/Gateway"
          },
          "ZAI_BSBACC": {
            "$ref": "#/components/schemas/Gateway"
          },
          "ZAI_PAYTO": {
            "$ref": "#/components/schemas/Gateway"
          },
          "ZAI_DD": {
            "$ref": "#/components/schemas/Gateway"
          },
          "BLUE_DD": {
            "$ref": "#/components/schemas/GatewayWithPayIn"
          },
          "BLUE_CC": {
            "$ref": "#/components/schemas/GatewayWithPayIn"
          },
          "BLUE_WERO": {
            "$ref": "#/components/schemas/GatewayWithPayIn"
          },
          "AS_PIX": {
            "$ref": "#/components/schemas/GatewayWithPayIn"
          },
          "PGBNK_CC": {
            "$ref": "#/components/schemas/GatewayPgbnkCc"
          },
          "AS_BOLETO": {
            "$ref": "#/components/schemas/GatewayWithPayIn"
          },
          "WISE_MCACC": {
            "$ref": "#/components/schemas/Gateway"
          },
          "KLARNA_PYMT": {
            "$ref": "#/components/schemas/GatewayAsCc"
          },
          "TM_BANK_TRANSFER": {
            "$ref": "#/components/schemas/GatewayWithPayIn"
          },
          "TM_CC": {
            "$ref": "#/components/schemas/GatewayWithPayIn"
          },
          "PARTNERSHIP": {
            "$ref": "#/components/schemas/Gateway"
          }
        },
        "required": [
          "EXTERNAL",
          "ZAI_CC",
          "ZAI_PAYID",
          "ZAI_BSBACC",
          "ZAI_PAYTO",
          "ZAI_DD",
          "BLUE_DD",
          "BLUE_CC",
          "BLUE_WERO",
          "AS_PIX",
          "PGBNK_CC",
          "AS_BOLETO",
          "WISE_MCACC",
          "KLARNA_PYMT",
          "TM_BANK_TRANSFER",
          "TM_CC",
          "PARTNERSHIP"
        ]
      },
      "MarkupDto": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "example": "AUD"
          },
          "gatewayMethod": {
            "type": "string"
          },
          "label": {
            "type": "string"
          }
        },
        "required": [
          "currency",
          "gatewayMethod",
          "label"
        ]
      },
      "PortalPayloadDto": {
        "type": "object",
        "properties": {
          "websiteUrl": {
            "type": "string",
            "example": "https://acme.com"
          },
          "name": {
            "type": "string"
          },
          "logo": {
            "type": "string"
          },
          "primaryColor": {
            "type": "string"
          },
          "secondaryColor": {
            "type": "string"
          },
          "tertiaryColor": {
            "type": "string"
          },
          "field": {
            "$ref": "#/components/schemas/FieldSchema"
          },
          "task": {
            "$ref": "#/components/schemas/Task"
          },
          "contact": {
            "$ref": "#/components/schemas/ContactSchema"
          },
          "industry": {
            "type": "string",
            "enum": [
              "accounting",
              "accommodation-provider",
              "airlines-aviation",
              "alternative-dispute-resolution",
              "alternative-medicine",
              "animation",
              "apparel-fashion",
              "architecture-planning",
              "arts-and-crafts",
              "automotive",
              "aviation-aerospace",
              "banking",
              "biotechnology",
              "broadcast-media",
              "building-materials",
              "business-supplies-and-equipment",
              "capital-markets",
              "chemicals",
              "civic-social-organization",
              "civil-engineering",
              "commercial-real-estate",
              "computer-network-security",
              "computer-games",
              "computer-hardware",
              "computer-networking",
              "computer-software",
              "internet",
              "construction",
              "consumer-electronics",
              "consumer-goods",
              "consumer-services",
              "cosmetics",
              "dairy",
              "defense-space",
              "design",
              "education-management",
              "education-agent",
              "education-provider",
              "immigration-agent",
              "e-learning",
              "electrical-electronic-manufacturing",
              "entertainment",
              "environmental-services",
              "events-services",
              "executive-office",
              "facilities-services",
              "farming",
              "financial-services",
              "fine-art",
              "fishery",
              "food-beverages",
              "food-production",
              "fund-raising",
              "furniture",
              "gambling-casinos",
              "glass-ceramics-concrete",
              "government-administration",
              "government-relations",
              "graphic-design",
              "health-wellness-and-fitness",
              "higher-education",
              "hospital-health-care",
              "hospitality",
              "human-resources",
              "import-and-export",
              "immigration-services",
              "individual-family-services",
              "industrial-automation",
              "information-services",
              "information-technology-and-services",
              "insurance",
              "international-affairs",
              "international-trade-and-development",
              "investment-banking",
              "investment-management",
              "judiciary",
              "law-enforcement",
              "law-practice",
              "legal-services",
              "legislative-office",
              "leisure-travel-tourism",
              "libraries",
              "logistics-and-supply-chain",
              "luxury-goods-jewelry",
              "machinery",
              "management-consulting",
              "maritime",
              "market-research",
              "marketing-and-advertising",
              "mechanical-or-industrial-engineering",
              "media-production",
              "medical-devices",
              "medical-practice",
              "mental-health-care",
              "military",
              "mining-metals",
              "motion-pictures-and-film",
              "museums-and-institutions",
              "music",
              "nanotechnology",
              "newspapers",
              "non-profit-organization-management",
              "oil-energy",
              "online-media",
              "outsourcing-offshoring",
              "package-freight-delivery",
              "packaging-and-containers",
              "paper-forest-products",
              "performing-arts",
              "pharmaceuticals",
              "philanthropy",
              "photography",
              "plastics",
              "political-organization",
              "primary-secondary-education",
              "printing",
              "professional-training-coaching",
              "program-development",
              "public-policy",
              "public-relations-and-communications",
              "public-safety",
              "publishing",
              "railroad-manufacture",
              "ranching",
              "real-estate",
              "recreational-facilities-and-services",
              "religious-institutions",
              "renewables-environment",
              "research",
              "restaurants",
              "retail",
              "security-and-investigations",
              "semiconductors",
              "shipbuilding",
              "sporting-goods",
              "sports",
              "staffing-and-recruiting",
              "supermarkets",
              "telecommunications",
              "textiles",
              "think-tanks",
              "tobacco",
              "translation-and-localization",
              "transportation-trucking-railroad",
              "utilities",
              "venture-capital-private-equity",
              "veterinary",
              "warehousing",
              "wholesale",
              "wine-and-spirits",
              "wireless",
              "writing-and-editing"
            ]
          },
          "service": {
            "$ref": "#/components/schemas/Service"
          },
          "gdpr": {
            "type": "boolean"
          },
          "gateways": {
            "$ref": "#/components/schemas/Gateways"
          },
          "billing": {
            "type": "object",
            "properties": {
              "address": {
                "type": "object",
                "properties": {
                  "country": {
                    "type": "string"
                  }
                },
                "selfRequired": false
              }
            },
            "required": [
              "address"
            ]
          },
          "payment": {
            "type": "object",
            "properties": {
              "markup": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/MarkupDto"
                }
              },
              "displayOtherPayments": {
                "type": "boolean"
              },
              "displayOwnerInfo": {
                "type": "boolean"
              },
              "allowPartialPayments": {
                "type": "boolean"
              },
              "earlyPayoff": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "method": {
                    "type": "string"
                  },
                  "amount": {
                    "type": "number"
                  }
                },
                "selfRequired": false
              },
              "selfServiceInstallmentAuthorizations": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                },
                "selfRequired": false
              }
            },
            "required": [
              "earlyPayoff",
              "selfServiceInstallmentAuthorizations"
            ]
          }
        },
        "required": [
          "primaryColor",
          "secondaryColor",
          "tertiaryColor"
        ]
      },
      "AddressDto": {
        "type": "object",
        "properties": {
          "country": {
            "type": "string"
          },
          "line1": {
            "type": "string"
          },
          "line2": {
            "type": "string"
          },
          "postalCode": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "city": {
            "type": "string"
          }
        }
      },
      "TaxIdDto": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "ad_nrt",
              "ae_trn",
              "al_vat",
              "ar_cuit",
              "at_vat",
              "at_uid",
              "au_abn",
              "au_arn",
              "ba_vat",
              "bg_uic",
              "be_vat",
              "bh_vat",
              "bo_tin",
              "br_cnpj",
              "br_cpf",
              "ca_bn",
              "ca_gst_hst",
              "ca_pst_bc",
              "ca_pst_mb",
              "ca_pst_sk",
              "ca_qst",
              "ch_uid",
              "ch_vat",
              "cl_tin",
              "cn_tin",
              "co_nit",
              "cr_tin",
              "cy_vat",
              "cz_vat",
              "cz_dic",
              "de_stn",
              "de_hrn",
              "do_rcn",
              "dk_vat",
              "ec_ruc",
              "ee_vat",
              "ee_rc",
              "eg_tin",
              "es_cif",
              "eu_oss_vat",
              "eu_vat",
              "fi_vat",
              "fr_vat",
              "fr_siren",
              "fr_siret",
              "gb_vat",
              "gb_crn",
              "ge_vat",
              "gr_vat",
              "hk_br",
              "hr_oib",
              "hu_tin",
              "id_npwp",
              "ie_vat",
              "ie_crn",
              "il_vat",
              "in_gst",
              "is_vat",
              "it_vat",
              "it_cf",
              "jp_cn",
              "jp_rn",
              "jp_trn",
              "pk_ntn",
              "ke_pin",
              "kr_brn",
              "kz_bin",
              "li_uid",
              "lt_vat",
              "lu_vat",
              "lv_vat",
              "md_vat",
              "me_vat",
              "mk_vat",
              "mt_vat",
              "mx_rfc",
              "my_frp",
              "my_itn",
              "my_sst",
              "ng_tin",
              "nl_vat",
              "nl_kvk",
              "no_vat",
              "no_voec",
              "nz_gst",
              "om_vat",
              "pe_ruc",
              "ph_tin",
              "pl_vat",
              "pl_nip",
              "pt_vat",
              "pt_nif",
              "ro_tin",
              "rs_pib",
              "ru_inn",
              "ru_kpp",
              "sa_vat",
              "se_vat",
              "se_orgnr",
              "sg_gst",
              "sg_uen",
              "si_tin",
              "sk_vat",
              "sv_nit",
              "th_vat",
              "tr_tin",
              "tw_vat",
              "ua_vat",
              "us_ein",
              "uy_ruc",
              "ve_rif",
              "vn_tin",
              "za_vat"
            ]
          },
          "number": {
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "number"
        ]
      },
      "BillingDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "example": "user@example.com"
          },
          "phone": {
            "type": "string",
            "example": "+61 412 345 678"
          },
          "legalName": {
            "type": "string"
          },
          "businessType": {
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "incorporatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "address": {
            "$ref": "#/components/schemas/AddressDto"
          },
          "taxIds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxIdDto"
            }
          }
        },
        "required": [
          "locale"
        ]
      },
      "ContactPreferencesDto": {
        "type": "object",
        "properties": {
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "summaryFields": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "requiredFields": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "TaskCategoriesDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Sample Item"
          },
          "color": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "color"
        ]
      },
      "TaskPreferencesDto": {
        "type": "object",
        "properties": {
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaskCategoriesDto"
            }
          }
        }
      },
      "ServiceCategoriesDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Sample Item"
          },
          "color": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "color"
        ]
      },
      "ServicePreferencesDto": {
        "type": "object",
        "properties": {
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ServiceCategoriesDto"
            }
          }
        }
      },
      "PaymentCategoriesDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Sample Item"
          },
          "color": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "color"
        ]
      },
      "OverdueFeeDto": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "object",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "amount": {
            "type": "number",
            "example": 5000
          },
          "name": {
            "type": "string",
            "example": "Sample Item"
          },
          "category": {
            "type": "string"
          },
          "reminder": {
            "type": "string",
            "enum": [
              "becomes-overdue",
              "1-day-overdue",
              "2-days-overdue",
              "3-days-overdue",
              "5-days-overdue",
              "7-days-overdue",
              "10-days-overdue",
              "14-days-overdue",
              "20-days-overdue",
              "27-days-overdue"
            ]
          }
        },
        "required": [
          "currency",
          "amount",
          "name",
          "reminder"
        ]
      },
      "EarlyPayoffDto": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "minimum": 0,
            "example": 0.1
          },
          "enabled": {
            "type": "boolean"
          },
          "method": {
            "type": "string",
            "enum": [
              "none",
              "percentage-on-amount",
              "fixed",
              "fx-adjustment"
            ]
          }
        }
      },
      "SelfServiceInstallmentAuthorizationsDto": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "PaymentMarkupDto": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "object",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "amount": {
            "type": "number",
            "minimum": 0,
            "example": 250
          },
          "enabled": {
            "type": "boolean"
          },
          "gatewayMethod": {
            "type": "string",
            "enum": [
              "ZAI_CC",
              "ZAI_PAYID",
              "ZAI_BSBACC",
              "ZAI_PAYTO",
              "ZAI_DD",
              "AS_PIX",
              "AS_BOLETO",
              "PGBNK_CC",
              "WISE_MCACC",
              "KLARNA_PYMT",
              "TM_BANK_TRANSFER",
              "TM_CC",
              "BLUE_DD",
              "BLUE_CC",
              "BLUE_WERO",
              "EXTERNAL",
              "PARTNERSHIP",
              "OFFSET"
            ]
          },
          "type": {
            "type": "string",
            "enum": [
              "always"
            ]
          },
          "method": {
            "type": "string",
            "enum": [
              "percentage-on-amount",
              "fixed"
            ]
          },
          "label": {
            "type": "string",
            "enum": [
              "convenience-fee"
            ]
          }
        },
        "required": [
          "currency",
          "enabled",
          "label"
        ]
      },
      "PaymentPreferencesDto": {
        "type": "object",
        "properties": {
          "reminders": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "1-day-overdue",
                "2-days-overdue",
                "3-days-overdue",
                "5-days-overdue",
                "7-days-overdue",
                "10-days-overdue",
                "14-days-overdue",
                "20-days-overdue",
                "27-days-overdue",
                "becomes-overdue",
                "1-day",
                "3-days",
                "7-days",
                "14-days",
                "27-days"
              ]
            }
          },
          "reminderChannels": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "email",
                "sms",
                "push"
              ]
            }
          },
          "partnerSummary": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "payments-summary",
                "split-summary"
              ]
            }
          },
          "ti": {
            "type": "boolean",
            "example": false
          },
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaymentCategoriesDto"
            }
          },
          "overdueFees": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OverdueFeeDto"
            }
          },
          "publicDisplay": {
            "type": "boolean"
          },
          "allowPartialPayments": {
            "type": "boolean"
          },
          "displayOwnerInfo": {
            "type": "boolean"
          },
          "displayOtherPayments": {
            "type": "boolean"
          },
          "earlyPayoff": {
            "$ref": "#/components/schemas/EarlyPayoffDto"
          },
          "selfServiceInstallmentAuthorizations": {
            "$ref": "#/components/schemas/SelfServiceInstallmentAuthorizationsDto"
          },
          "markup": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaymentMarkupDto"
            }
          }
        }
      },
      "PartnershipPreferencesDto": {
        "type": "object",
        "properties": {
          "displayPortal": {
            "type": "boolean"
          }
        }
      },
      "FieldPreferencesDto": {
        "type": "object",
        "properties": {
          "groups": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "SettingsSocialDto": {
        "type": "object",
        "properties": {
          "facebook": {
            "type": "string",
            "format": "uri",
            "example": "https://facebook.com/acmecorp"
          },
          "instagram": {
            "type": "string",
            "format": "uri",
            "example": "https://instagram.com/acmecorp"
          },
          "linkedin": {
            "type": "string",
            "format": "uri",
            "example": "https://linkedin.com/company/acmecorp"
          },
          "medium": {
            "type": "string",
            "format": "uri",
            "example": "https://medium.com/@acmecorp"
          },
          "twitter": {
            "type": "string",
            "format": "uri",
            "example": "https://twitter.com/acmecorp"
          },
          "youtube": {
            "type": "string",
            "format": "uri",
            "example": "https://youtube.com/@acmecorp"
          }
        }
      },
      "SettingsMarketingGeoDto": {
        "type": "object",
        "properties": {
          "countries": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "countries"
        ]
      },
      "SettingsMarketingDto": {
        "type": "object",
        "properties": {
          "geo": {
            "$ref": "#/components/schemas/SettingsMarketingGeoDto"
          }
        },
        "required": [
          "geo"
        ]
      },
      "TenantPayoutDto": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "interval": {
            "type": "string",
            "enum": [
              "instant"
            ]
          },
          "approval": {
            "type": "boolean"
          },
          "statementDescriptor": {
            "type": "string",
            "enum": [
              "name",
              "unique-number-name"
            ]
          },
          "bankAccountMode": {
            "type": "string",
            "enum": [
              "prioritize-settlement-currency",
              "prioritize-original-currency",
              "prioritize-same-currency"
            ]
          },
          "partnershipBankAccountMode": {
            "type": "string",
            "enum": [
              "prioritize-settlement-currency",
              "prioritize-original-currency",
              "prioritize-same-currency"
            ]
          }
        },
        "required": [
          "enabled",
          "interval",
          "approval"
        ]
      },
      "FxMarkupCurrencyDto": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "object",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "amount": {
            "type": "number",
            "minimum": 0,
            "example": 250
          },
          "method": {
            "type": "string",
            "enum": [
              "percentage-on-amount"
            ]
          }
        },
        "required": [
          "currency"
        ]
      },
      "FxMarkupMethodDto": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "minimum": 0,
            "example": 250
          },
          "enabled": {
            "type": "boolean"
          },
          "type": {
            "type": "string",
            "enum": [
              "always"
            ]
          },
          "method": {
            "type": "string",
            "enum": [
              "percentage-on-amount"
            ]
          },
          "currencies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FxMarkupCurrencyDto"
            }
          }
        },
        "required": [
          "enabled"
        ]
      },
      "FxMarkupDto": {
        "type": "object",
        "properties": {
          "refunds": {
            "$ref": "#/components/schemas/FxMarkupMethodDto"
          },
          "payouts": {
            "$ref": "#/components/schemas/FxMarkupMethodDto"
          },
          "paymentIntents": {
            "$ref": "#/components/schemas/FxMarkupMethodDto"
          }
        },
        "required": [
          "refunds",
          "payouts",
          "paymentIntents"
        ]
      },
      "FxToleranceDto": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "minimum": 0,
            "example": 250
          },
          "enabled": {
            "type": "boolean"
          },
          "method": {
            "type": "string",
            "enum": [
              "percentage-on-amount"
            ]
          }
        },
        "required": [
          "enabled"
        ]
      },
      "FxPreferredGatewayDto": {
        "type": "object",
        "properties": {
          "paymentIntents": {
            "type": "string",
            "enum": [
              "xe",
              "wise",
              "nexpay",
              "transfermate",
              "edwallet",
              "abraseeio"
            ]
          },
          "payouts": {
            "type": "string",
            "enum": [
              "xe",
              "wise",
              "nexpay",
              "transfermate",
              "edwallet",
              "abraseeio"
            ]
          },
          "refunds": {
            "type": "string",
            "enum": [
              "xe",
              "wise",
              "nexpay",
              "transfermate",
              "edwallet",
              "abraseeio"
            ]
          }
        }
      },
      "FxDto": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "markup": {
            "$ref": "#/components/schemas/FxMarkupDto"
          },
          "priority": {
            "type": "string",
            "enum": [
              "hold-rate",
              "optimize-cost"
            ]
          },
          "tolerance": {
            "$ref": "#/components/schemas/FxToleranceDto"
          },
          "preferredGateway": {
            "$ref": "#/components/schemas/FxPreferredGatewayDto"
          }
        },
        "required": [
          "enabled",
          "markup",
          "tolerance"
        ]
      },
      "GatewayDto": {
        "type": "object",
        "properties": {
          "status": {
            "type": "boolean"
          }
        },
        "required": [
          "status"
        ]
      },
      "GatewayWithPayInDto": {
        "type": "object",
        "properties": {
          "status": {
            "type": "boolean"
          },
          "payInFeePayee": {
            "type": "string",
            "enum": [
              "tenant",
              "contact"
            ]
          }
        },
        "required": [
          "status"
        ]
      },
      "GatewaysDto": {
        "type": "object",
        "properties": {
          "EXTERNAL": {
            "$ref": "#/components/schemas/GatewayDto"
          },
          "ZAI_CC": {
            "$ref": "#/components/schemas/GatewayWithPayInDto"
          },
          "ZAI_PAYID": {
            "$ref": "#/components/schemas/GatewayDto"
          },
          "ZAI_BSBACC": {
            "$ref": "#/components/schemas/GatewayDto"
          },
          "ZAI_DD": {
            "$ref": "#/components/schemas/GatewayDto"
          },
          "PGBNK_CC": {
            "$ref": "#/components/schemas/GatewayDto"
          },
          "AS_PIX": {
            "$ref": "#/components/schemas/GatewayDto"
          },
          "AS_BOLETO": {
            "$ref": "#/components/schemas/GatewayDto"
          },
          "KLARNA_PYMT": {
            "$ref": "#/components/schemas/GatewayDto"
          },
          "WISE_MCACC": {
            "$ref": "#/components/schemas/GatewayDto"
          },
          "TM_BANK_TRANSFER": {
            "$ref": "#/components/schemas/GatewayDto"
          },
          "TM_CC": {
            "$ref": "#/components/schemas/GatewayDto"
          },
          "PARTNERSHIP": {
            "$ref": "#/components/schemas/GatewayDto"
          }
        }
      },
      "UpdateSettingDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Sample Item"
          },
          "websiteUrl": {
            "type": "string",
            "format": "uri",
            "example": "https://acme.com"
          },
          "shortName": {
            "type": "string"
          },
          "size": {
            "type": "string",
            "enum": [
              "self-employed",
              "1-10",
              "11-50",
              "51-200",
              "201-500",
              "501-1000",
              "1001-5000",
              "5001-10000",
              "10001+"
            ]
          },
          "industry": {
            "type": "string",
            "enum": [
              "accounting",
              "accommodation-provider",
              "airlines-aviation",
              "alternative-dispute-resolution",
              "alternative-medicine",
              "animation",
              "apparel-fashion",
              "architecture-planning",
              "arts-and-crafts",
              "automotive",
              "aviation-aerospace",
              "banking",
              "biotechnology",
              "broadcast-media",
              "building-materials",
              "business-supplies-and-equipment",
              "capital-markets",
              "chemicals",
              "civic-social-organization",
              "civil-engineering",
              "commercial-real-estate",
              "computer-network-security",
              "computer-games",
              "computer-hardware",
              "computer-networking",
              "computer-software",
              "internet",
              "construction",
              "consumer-electronics",
              "consumer-goods",
              "consumer-services",
              "cosmetics",
              "dairy",
              "defense-space",
              "design",
              "education-management",
              "education-agent",
              "education-provider",
              "immigration-agent",
              "e-learning",
              "electrical-electronic-manufacturing",
              "entertainment",
              "environmental-services",
              "events-services",
              "executive-office",
              "facilities-services",
              "farming",
              "financial-services",
              "fine-art",
              "fishery",
              "food-beverages",
              "food-production",
              "fund-raising",
              "furniture",
              "gambling-casinos",
              "glass-ceramics-concrete",
              "government-administration",
              "government-relations",
              "graphic-design",
              "health-wellness-and-fitness",
              "higher-education",
              "hospital-health-care",
              "hospitality",
              "human-resources",
              "import-and-export",
              "immigration-services",
              "individual-family-services",
              "industrial-automation",
              "information-services",
              "information-technology-and-services",
              "insurance",
              "international-affairs",
              "international-trade-and-development",
              "investment-banking",
              "investment-management",
              "judiciary",
              "law-enforcement",
              "law-practice",
              "legal-services",
              "legislative-office",
              "leisure-travel-tourism",
              "libraries",
              "logistics-and-supply-chain",
              "luxury-goods-jewelry",
              "machinery",
              "management-consulting",
              "maritime",
              "market-research",
              "marketing-and-advertising",
              "mechanical-or-industrial-engineering",
              "media-production",
              "medical-devices",
              "medical-practice",
              "mental-health-care",
              "military",
              "mining-metals",
              "motion-pictures-and-film",
              "museums-and-institutions",
              "music",
              "nanotechnology",
              "newspapers",
              "non-profit-organization-management",
              "oil-energy",
              "online-media",
              "outsourcing-offshoring",
              "package-freight-delivery",
              "packaging-and-containers",
              "paper-forest-products",
              "performing-arts",
              "pharmaceuticals",
              "philanthropy",
              "photography",
              "plastics",
              "political-organization",
              "primary-secondary-education",
              "printing",
              "professional-training-coaching",
              "program-development",
              "public-policy",
              "public-relations-and-communications",
              "public-safety",
              "publishing",
              "railroad-manufacture",
              "ranching",
              "real-estate",
              "recreational-facilities-and-services",
              "religious-institutions",
              "renewables-environment",
              "research",
              "restaurants",
              "retail",
              "security-and-investigations",
              "semiconductors",
              "shipbuilding",
              "sporting-goods",
              "sports",
              "staffing-and-recruiting",
              "supermarkets",
              "telecommunications",
              "textiles",
              "think-tanks",
              "tobacco",
              "translation-and-localization",
              "transportation-trucking-railroad",
              "utilities",
              "venture-capital-private-equity",
              "veterinary",
              "warehousing",
              "wholesale",
              "wine-and-spirits",
              "wireless",
              "writing-and-editing"
            ]
          },
          "logo": {
            "type": "string"
          },
          "primaryColor": {
            "type": "string",
            "pattern": "^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$"
          },
          "secondaryColor": {
            "type": "string",
            "pattern": "^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$"
          },
          "tertiaryColor": {
            "type": "string",
            "pattern": "^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$"
          },
          "gdpr": {
            "type": "boolean"
          },
          "accountAccess": {
            "type": "boolean"
          },
          "billing": {
            "$ref": "#/components/schemas/BillingDto"
          },
          "contact": {
            "$ref": "#/components/schemas/ContactPreferencesDto"
          },
          "task": {
            "$ref": "#/components/schemas/TaskPreferencesDto"
          },
          "service": {
            "$ref": "#/components/schemas/ServicePreferencesDto"
          },
          "payment": {
            "$ref": "#/components/schemas/PaymentPreferencesDto"
          },
          "partnership": {
            "$ref": "#/components/schemas/PartnershipPreferencesDto"
          },
          "field": {
            "$ref": "#/components/schemas/FieldPreferencesDto"
          },
          "social": {
            "$ref": "#/components/schemas/SettingsSocialDto"
          },
          "marketing": {
            "$ref": "#/components/schemas/SettingsMarketingDto"
          },
          "payout": {
            "$ref": "#/components/schemas/TenantPayoutDto"
          },
          "fx": {
            "$ref": "#/components/schemas/FxDto"
          },
          "gateways": {
            "$ref": "#/components/schemas/GatewaysDto"
          }
        }
      },
      "CreateDomainDto": {
        "type": "object",
        "properties": {
          "nsName": {
            "type": "string"
          }
        },
        "required": [
          "nsName"
        ]
      },
      "SenderIdentityPayloadDto": {
        "type": "object",
        "properties": {
          "identityId": {
            "type": "number",
            "description": "Postmark sender signature ID",
            "example": 12345
          },
          "domain": {
            "type": "string",
            "description": "Email domain for this sender identity",
            "example": "example.com"
          },
          "fromEmail": {
            "type": "string",
            "description": "From email address for outgoing emails",
            "example": "noreply@example.com"
          },
          "replyEmail": {
            "type": "string",
            "description": "Reply-to email address",
            "example": "support@example.com"
          },
          "name": {
            "type": "string",
            "description": "Display name for the sender identity",
            "example": "Acme Inc"
          },
          "confirmed": {
            "type": "boolean",
            "description": "Whether the sender identity email has been confirmed",
            "example": true
          },
          "spfHost": {
            "type": "string",
            "description": "SPF host record for email authentication",
            "example": "example.com"
          },
          "spfTextValue": {
            "type": "string",
            "description": "SPF TXT record value for DNS configuration",
            "example": "v=spf1 a mx include:spf.mtasv.net ~all"
          },
          "dkimVerified": {
            "type": "boolean",
            "description": "Whether DKIM has been verified for this identity",
            "example": false
          },
          "weakDkim": {
            "type": "boolean",
            "description": "Whether weak DKIM is in use",
            "example": false
          },
          "dkimHost": {
            "type": "string",
            "description": "DKIM host record for email authentication",
            "example": "20230601._domainkey.example.com"
          },
          "dkimTextValue": {
            "type": "string",
            "description": "DKIM TXT record value for DNS configuration",
            "example": "k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4..."
          },
          "dkimPendingHost": {
            "type": "string",
            "description": "Pending DKIM host record awaiting verification",
            "example": ""
          },
          "dkimPendingTextValue": {
            "type": "string",
            "description": "Pending DKIM TXT record value awaiting verification",
            "example": ""
          },
          "dkimRevokedHost": {
            "type": "string",
            "description": "Revoked DKIM host record that should be removed from DNS",
            "example": ""
          },
          "dkimRevokedTextValue": {
            "type": "string",
            "description": "Revoked DKIM TXT record value that should be removed from DNS",
            "example": ""
          }
        },
        "required": [
          "identityId",
          "domain",
          "fromEmail",
          "replyEmail",
          "name",
          "confirmed",
          "spfHost",
          "spfTextValue",
          "dkimVerified",
          "weakDkim",
          "dkimHost",
          "dkimTextValue",
          "dkimPendingHost",
          "dkimPendingTextValue",
          "dkimRevokedHost",
          "dkimRevokedTextValue"
        ]
      },
      "CreateSenderIdentityDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Acme Inc"
          },
          "fromEmail": {
            "type": "string",
            "format": "email",
            "example": "user@example.com"
          },
          "replyEmail": {
            "type": "string",
            "format": "email",
            "example": "user@example.com"
          },
          "returnPathDomain": {
            "type": "string"
          },
          "recipientType": {
            "type": "string",
            "enum": [
              "contact"
            ]
          }
        },
        "required": [
          "name",
          "fromEmail",
          "recipientType"
        ]
      },
      "InvoiceLineItemDto": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "description": "Line item description",
            "example": "Qualy Pro Plan (Jan 1 - Feb 1)"
          },
          "amount": {
            "type": "number",
            "description": "Line item amount in cents",
            "example": 4900
          },
          "quantity": {
            "type": "number",
            "description": "Quantity of the line item",
            "example": 1
          }
        },
        "required": [
          "description",
          "amount",
          "quantity"
        ]
      },
      "InvoiceDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Stripe invoice ID",
            "example": "in_1MsJLN2eZvKYlo2C"
          },
          "status": {
            "type": "string",
            "description": "Invoice status",
            "enum": [
              "draft",
              "open",
              "paid",
              "uncollectible",
              "void"
            ],
            "example": "paid"
          },
          "number": {
            "type": "string",
            "description": "Invoice number",
            "example": "INV-0001"
          },
          "total": {
            "type": "number",
            "description": "Total amount in cents",
            "example": 4900
          },
          "currency": {
            "type": "string",
            "description": "Three-letter ISO currency code",
            "example": "usd"
          },
          "invoicePdf": {
            "type": "string",
            "description": "URL to download the invoice PDF",
            "example": "https://pay.stripe.com/invoice/..."
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "description": "Invoice creation date",
            "example": "2025-01-15T00:00:00.000Z"
          },
          "dueDate": {
            "format": "date-time",
            "type": "string",
            "nullable": true,
            "description": "Invoice due date",
            "example": "2025-02-15T00:00:00.000Z"
          },
          "billingReason": {
            "type": "string",
            "description": "Reason the invoice was created",
            "example": "subscription_cycle"
          },
          "lines": {
            "description": "Invoice line items",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceLineItemDto"
            }
          }
        },
        "required": [
          "_id",
          "status",
          "number",
          "total",
          "currency",
          "invoicePdf",
          "createdAt",
          "dueDate",
          "billingReason",
          "lines"
        ]
      },
      "InvoicesDto": {
        "type": "object",
        "properties": {
          "invoices": {
            "description": "List of invoices",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceDto"
            }
          },
          "hasMore": {
            "type": "boolean",
            "description": "Whether more invoices are available",
            "example": false
          },
          "count": {
            "type": "number",
            "description": "Total number of invoices returned",
            "example": 10
          }
        },
        "required": [
          "invoices",
          "hasMore",
          "count"
        ]
      },
      "QueryInvoiceDueDateDto": {
        "type": "object",
        "properties": {
          "gte": {
            "format": "date-time",
            "type": "string"
          },
          "gt": {
            "format": "date-time",
            "type": "string"
          },
          "lte": {
            "format": "date-time",
            "type": "string"
          },
          "lt": {
            "format": "date-time",
            "type": "string"
          }
        }
      },
      "PriceDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Stripe price ID",
            "example": "price_1MsJLN2eZvKYlo2C"
          },
          "currency": {
            "type": "string",
            "description": "Three-letter ISO currency code",
            "example": "usd"
          },
          "type": {
            "type": "string",
            "description": "Price type",
            "enum": [
              "one_time",
              "recurring"
            ],
            "example": "recurring"
          },
          "interval": {
            "type": "string",
            "nullable": true,
            "description": "Billing interval",
            "enum": [
              "month",
              "year"
            ],
            "example": "month"
          },
          "intervalCount": {
            "type": "string",
            "nullable": true,
            "description": "Number of intervals between billings",
            "example": "1"
          },
          "amount": {
            "type": "number",
            "description": "Price amount in cents",
            "example": 4900
          }
        },
        "required": [
          "_id",
          "currency",
          "type",
          "interval",
          "intervalCount",
          "amount"
        ]
      },
      "ProductDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Stripe product ID",
            "example": "prod_1MsJLN2eZvKYlo2C"
          },
          "name": {
            "type": "string",
            "description": "Product name",
            "example": "Qualy Pro"
          },
          "images": {
            "description": "Product image URLs",
            "example": [
              "https://example.com/image.png"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string",
            "description": "Product status",
            "enum": [
              "active",
              "inactive",
              "archived"
            ],
            "example": "active"
          },
          "metadata": {
            "type": "object",
            "description": "Product metadata",
            "additionalProperties": true,
            "example": {
              "tier": "pro"
            }
          },
          "prices": {
            "description": "Available prices for this product",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PriceDto"
            }
          }
        },
        "required": [
          "_id",
          "name",
          "status",
          "metadata",
          "prices"
        ]
      },
      "ProductsDto": {
        "type": "object",
        "properties": {
          "products": {
            "description": "List of products",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductDto"
            }
          },
          "hasMore": {
            "type": "boolean",
            "description": "Whether more products are available",
            "example": false
          },
          "count": {
            "type": "number",
            "description": "Total number of products returned",
            "example": 3
          }
        },
        "required": [
          "products",
          "hasMore",
          "count"
        ]
      },
      "PaymentMethodDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Stripe payment method ID",
            "example": "pm_1MsJLN2eZvKYlo2C"
          },
          "country": {
            "type": "string",
            "description": "Two-letter ISO country code",
            "example": "US"
          },
          "brand": {
            "type": "string",
            "description": "Card brand name",
            "example": "Visa"
          },
          "expMonth": {
            "type": "number",
            "description": "Card expiration month (1-12)",
            "example": 12
          },
          "expYear": {
            "type": "number",
            "description": "Card expiration year",
            "example": 2027
          },
          "funding": {
            "type": "string",
            "description": "Card funding type",
            "enum": [
              "credit",
              "debit",
              "prepaid",
              "unknown"
            ],
            "example": "credit"
          },
          "threeDSecure": {
            "type": "boolean",
            "description": "Whether 3D Secure is supported",
            "example": true
          },
          "last4": {
            "type": "string",
            "description": "Last four digits of the card number",
            "example": "4242"
          },
          "type": {
            "type": "string",
            "description": "Payment method type",
            "example": "card"
          },
          "default": {
            "type": "boolean",
            "description": "Whether this is the default payment method",
            "example": true
          }
        },
        "required": [
          "_id",
          "country",
          "brand",
          "expMonth",
          "expYear",
          "funding",
          "threeDSecure",
          "last4",
          "type",
          "default"
        ]
      },
      "AttachPaymentMethodDto": {
        "type": "object",
        "properties": {
          "paymentMethodId": {
            "type": "string"
          }
        },
        "required": [
          "paymentMethodId"
        ]
      },
      "SubscriptionStatusDto": {
        "type": "object",
        "properties": {
          "nSubscriptions": {
            "type": "number",
            "description": "Total number of active subscriptions",
            "example": 2
          },
          "isMainSubscriptionActive": {
            "type": "boolean",
            "description": "Whether the main subscription is active",
            "example": true
          },
          "isTrial": {
            "type": "boolean",
            "description": "Whether the account is in trial period",
            "example": false
          },
          "hasPastDue": {
            "type": "boolean",
            "description": "Whether any subscription has past due payments",
            "example": false
          }
        },
        "required": [
          "nSubscriptions",
          "isMainSubscriptionActive",
          "isTrial",
          "hasPastDue"
        ]
      },
      "PeriodDto": {
        "type": "object",
        "properties": {
          "start": {
            "format": "date-time",
            "type": "string",
            "description": "Period start date",
            "example": "2025-01-15T00:00:00.000Z"
          },
          "end": {
            "format": "date-time",
            "type": "string",
            "nullable": true,
            "description": "Period end date",
            "example": "2025-02-15T00:00:00.000Z"
          }
        },
        "required": [
          "start",
          "end"
        ]
      },
      "SubscriptionProductDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Stripe product ID",
            "example": "prod_1MsJLN2eZvKYlo2C"
          },
          "subscriptionItem": {
            "type": "string",
            "description": "Stripe subscription item ID",
            "example": "si_1MsJLN2eZvKYlo2C"
          },
          "quantity": {
            "type": "number",
            "description": "Product quantity",
            "example": 1
          },
          "type": {
            "type": "string",
            "description": "Product type",
            "example": "service"
          },
          "name": {
            "type": "string",
            "description": "Product name",
            "example": "Qualy Pro"
          },
          "amount": {
            "type": "number",
            "description": "Price amount in cents",
            "example": 4900
          },
          "interval": {
            "type": "string",
            "description": "Billing interval",
            "example": "month"
          },
          "intervalCount": {
            "type": "number",
            "description": "Number of intervals between billings",
            "example": 1
          },
          "currency": {
            "type": "string",
            "description": "Three-letter ISO currency code",
            "example": "usd"
          },
          "metadata": {
            "type": "object",
            "description": "Product metadata",
            "additionalProperties": true
          }
        },
        "required": [
          "_id",
          "subscriptionItem",
          "quantity",
          "type",
          "name",
          "amount",
          "interval",
          "intervalCount",
          "currency",
          "metadata"
        ]
      },
      "DiscountOffDto": {
        "type": "object",
        "properties": {
          "percentOff": {
            "type": "number",
            "description": "Percentage discount (0-100)",
            "example": 20
          },
          "amountOff": {
            "type": "number",
            "description": "Fixed amount discount in cents",
            "example": 0
          }
        },
        "required": [
          "percentOff",
          "amountOff"
        ]
      },
      "DiscountDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Discount name",
            "example": "Early Bird"
          },
          "duration": {
            "type": "number",
            "description": "Discount duration in months",
            "example": 3
          },
          "perdiod": {
            "description": "Discount validity period",
            "allOf": [
              {
                "$ref": "#/components/schemas/PeriodDto"
              }
            ]
          },
          "type": {
            "type": "string",
            "description": "Discount type",
            "example": "coupon"
          },
          "off": {
            "description": "Discount amount details",
            "allOf": [
              {
                "$ref": "#/components/schemas/DiscountOffDto"
              }
            ]
          }
        },
        "required": [
          "name",
          "duration",
          "perdiod",
          "type",
          "off"
        ]
      },
      "SubscriptionDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Stripe subscription ID",
            "example": "sub_1MsJLN2eZvKYlo2C"
          },
          "status": {
            "type": "string",
            "description": "Subscription status",
            "enum": [
              "active",
              "past_due",
              "canceled",
              "incomplete",
              "trialing",
              "unpaid"
            ],
            "example": "active"
          },
          "collectionMethod": {
            "type": "string",
            "description": "Payment collection method",
            "example": "charge_automatically"
          },
          "cancelAtPeriodEnd": {
            "type": "boolean",
            "description": "Whether subscription cancels at the end of the current period",
            "example": false
          },
          "currentPeriod": {
            "description": "Current billing period",
            "allOf": [
              {
                "$ref": "#/components/schemas/PeriodDto"
              }
            ]
          },
          "products": {
            "description": "Products included in this subscription",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SubscriptionProductDto"
            }
          },
          "trial": {
            "description": "Trial period",
            "allOf": [
              {
                "$ref": "#/components/schemas/PeriodDto"
              }
            ]
          },
          "metadata": {
            "type": "object",
            "description": "Subscription metadata",
            "additionalProperties": true
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "description": "Subscription creation date",
            "example": "2024-06-15T00:00:00.000Z"
          },
          "discount": {
            "description": "Active discount on the subscription",
            "allOf": [
              {
                "$ref": "#/components/schemas/DiscountDto"
              }
            ]
          }
        },
        "required": [
          "_id",
          "status",
          "collectionMethod",
          "cancelAtPeriodEnd",
          "currentPeriod",
          "products",
          "trial",
          "metadata",
          "createdAt"
        ]
      },
      "ActiveSubscriptionsDto": {
        "type": "object",
        "properties": {
          "status": {
            "description": "Subscription status summary",
            "allOf": [
              {
                "$ref": "#/components/schemas/SubscriptionStatusDto"
              }
            ]
          },
          "subscriptions": {
            "description": "List of active subscriptions",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SubscriptionDto"
            }
          }
        },
        "required": [
          "status",
          "subscriptions"
        ]
      },
      "UpcomingInvoiceDto": {
        "type": "object",
        "properties": {
          "total": {
            "type": "number",
            "description": "Total amount in cents for the upcoming invoice",
            "example": 4900
          },
          "tax": {
            "type": "number",
            "description": "Tax amount in cents",
            "example": 0
          },
          "currency": {
            "type": "string",
            "description": "Three-letter ISO currency code",
            "example": "usd"
          }
        },
        "required": [
          "total",
          "tax",
          "currency"
        ]
      },
      "StatsDto": {
        "type": "object",
        "properties": {
          "balance": {
            "type": "number",
            "description": "Current account balance in cents",
            "example": 0
          },
          "currency": {
            "type": "string",
            "description": "Three-letter ISO currency code",
            "example": "usd"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "description": "Account creation date",
            "example": "2024-06-15T00:00:00.000Z"
          },
          "upcomingInvoice": {
            "description": "Upcoming invoice details",
            "allOf": [
              {
                "$ref": "#/components/schemas/UpcomingInvoiceDto"
              }
            ]
          }
        },
        "required": [
          "balance",
          "currency",
          "createdAt"
        ]
      },
      "AuthSignInDto": {
        "type": "object",
        "properties": {
          "userId": {
            "type": "string",
            "description": "Authenticated user ID (MongoDB ObjectId)",
            "example": "507f1f77bcf86cd799439011"
          },
          "tenantId": {
            "type": "string",
            "description": "Tenant ID for the authenticated user",
            "example": "507f1f77bcf86cd799439011"
          },
          "token": {
            "type": "string",
            "description": "JWT authentication token for subsequent API requests",
            "example": "eyJhbGciOiJIUzI1NiIs..."
          },
          "requires2fa": {
            "type": "boolean",
            "description": "Whether two-factor authentication verification is required before full access",
            "example": false
          }
        },
        "required": [
          "userId",
          "tenantId",
          "token",
          "requires2fa"
        ]
      },
      "AuthUserDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "example": "user@example.com"
          },
          "type": {
            "type": "string",
            "enum": [
              "password",
              "link",
              "2fa"
            ]
          },
          "password": {
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "2fa": {
            "type": "string"
          }
        },
        "required": [
          "type"
        ]
      },
      "ResetPasswordDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "example": "user@example.com"
          }
        },
        "required": [
          "email"
        ]
      },
      "ProcessResultPayloadDto": {
        "type": "object",
        "properties": {
          "userId": {
            "type": "string",
            "description": "User ID of the processed user (MongoDB ObjectId)",
            "example": "507f1f77bcf86cd799439011"
          },
          "email": {
            "type": "string",
            "description": "Email address of the processed user",
            "example": "user@example.com"
          }
        },
        "required": [
          "userId",
          "email"
        ]
      },
      "ProcessResetPasswordDto": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          },
          "password": {
            "type": "string",
            "minLength": 8
          }
        },
        "required": [
          "token",
          "password"
        ]
      },
      "ProcessInviteDto": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          },
          "password": {
            "type": "string",
            "minLength": 8
          }
        },
        "required": [
          "token",
          "password"
        ]
      },
      "ValidateMagicLinkDto": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          }
        },
        "required": [
          "token"
        ]
      },
      "Profile": {
        "type": "object",
        "properties": {
          "gender": {
            "type": "string",
            "enum": [
              "male",
              "female",
              "other"
            ],
            "nullable": true
          },
          "phone": {
            "type": "string",
            "example": "+61 412 345 678"
          },
          "messenger": {
            "type": "string",
            "enum": [
              "whatsapp",
              "telegram",
              "imessage",
              "messenger",
              "signal",
              "wechat",
              "line",
              "viber",
              "none",
              "other"
            ]
          },
          "firstName": {
            "type": "string"
          },
          "middleName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "nickname": {
            "type": "string"
          },
          "picture": {
            "type": "string"
          },
          "dob": {
            "format": "date-time",
            "type": "string"
          },
          "position": {
            "type": "string"
          }
        },
        "required": [
          "firstName",
          "lastName"
        ]
      },
      "TeamRefDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Team ID (MongoDB ObjectId)",
            "example": "507f1f77bcf86cd799439011"
          },
          "name": {
            "type": "string",
            "description": "Team name",
            "example": "Engineering"
          },
          "department": {
            "type": "string",
            "description": "Team department",
            "enum": [
              "support",
              "sales",
              "accounting",
              "legal",
              "analytics",
              "hr",
              "operations",
              "marketing",
              "purchasing",
              "other"
            ],
            "example": "operations"
          },
          "preferredCurrency": {
            "type": "string",
            "description": "Preferred currency (ISO 4217)",
            "example": "AUD"
          },
          "preferredSettlementCurrency": {
            "type": "string",
            "description": "Preferred settlement currency (ISO 4217)",
            "example": "USD"
          },
          "timeZone": {
            "type": "string",
            "description": "Time zone identifier",
            "example": "Australia/Sydney"
          }
        },
        "required": [
          "_id",
          "name"
        ]
      },
      "Preferences": {
        "type": "object",
        "properties": {
          "colorMode": {
            "type": "string",
            "enum": [
              "system",
              "light",
              "dark",
              "sepia"
            ],
            "nullable": true
          },
          "hourCycle": {
            "type": "string",
            "enum": [
              "h11",
              "h12",
              "h23",
              "h24"
            ]
          },
          "calendar": {
            "type": "string"
          },
          "day": {
            "type": "string"
          },
          "month": {
            "type": "string"
          },
          "year": {
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "numberingSystem": {
            "type": "string"
          },
          "timeZone": {
            "type": "string"
          }
        },
        "required": [
          "calendar"
        ]
      },
      "Privacy": {
        "type": "object",
        "properties": {
          "doNotTrack": {
            "type": "boolean"
          }
        },
        "required": [
          "doNotTrack"
        ]
      },
      "UserDetailedPayloadDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "user",
              "api-key",
              "bot",
              "support"
            ]
          },
          "email": {
            "type": "string",
            "example": "user@example.com"
          },
          "profile": {
            "$ref": "#/components/schemas/Profile"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "active",
              "suspended",
              "blocked",
              "removed"
            ]
          },
          "primaryTeams": {
            "description": "Teams the user belongs to (populated)",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TeamRefDto"
            }
          },
          "emailVerified": {
            "type": "boolean"
          },
          "preferences": {
            "$ref": "#/components/schemas/Preferences"
          },
          "privacy": {
            "$ref": "#/components/schemas/Privacy"
          },
          "tc": {
            "type": "object",
            "description": "Terms and conditions acceptance record",
            "additionalProperties": true
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "admin:super",
                "admin",
                "contacts:view:me",
                "contacts:view:team",
                "contacts:view:all",
                "contacts:edit:me",
                "contacts:edit:team",
                "contacts:edit:all",
                "contacts:delete:me",
                "contacts:delete:team",
                "contacts:delete:all",
                "import:contacts",
                "import:partnerships",
                "import:paymentIntents",
                "import:transactions",
                "events:view:me",
                "events:view:team",
                "events:view:all",
                "events:edit:me",
                "events:edit:team",
                "events:edit:all",
                "events:delete:me",
                "events:delete:team",
                "events:delete:all",
                "paymentIntents:view:all",
                "paymentIntents:view:team",
                "paymentIntents:view:me",
                "paymentIntents:edit:all",
                "paymentIntents:edit:team",
                "paymentIntents:edit:me",
                "paymentIntents:delete:all",
                "paymentIntents:delete:team",
                "paymentIntents:delete:me",
                "splits:view:all",
                "splits:view:team",
                "splits:view:me",
                "splits:edit:all",
                "splits:edit:team",
                "splits:edit:me",
                "splits:delete:all",
                "splits:delete:team",
                "splits:delete:me",
                "services:edit:all",
                "services:delete:all",
                "bankAccounts:view:all",
                "bankAccounts:edit:all",
                "bankAccounts:delete:all",
                "storage:view:all",
                "storage:edit:all",
                "storage:delete:all",
                "partnerships:view:all",
                "partnerships:view:team",
                "partnerships:view:me",
                "partnerships:edit:all",
                "partnerships:edit:team",
                "partnerships:edit:me",
                "partnerships:delete:all",
                "partnerships:delete:team",
                "partnerships:delete:me",
                "reports:generate",
                "forms:view:all",
                "forms:edit:all",
                "forms:delete:all",
                "transactions:view:all",
                "transactions:view:team",
                "transactions:view:me",
                "transactions:edit:all",
                "authorizations:view:all",
                "authorizations:manage:all",
                "authorizations:authorize:all"
              ]
            }
          },
          "_id": {
            "type": "string"
          }
        },
        "required": [
          "email",
          "emailVerified",
          "preferences",
          "privacy",
          "roles",
          "_id"
        ]
      },
      "UserProfileDto": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "example": "Jane"
          },
          "lastName": {
            "type": "string",
            "example": "Smith"
          },
          "nickname": {
            "type": "string",
            "example": "JS"
          },
          "picture": {
            "type": "string",
            "example": "uploads/avatars/user-123.png"
          },
          "dob": {
            "format": "date-time",
            "type": "string",
            "example": "1990-05-20T00:00:00.000Z"
          },
          "gender": {
            "type": "string",
            "enum": [
              "male",
              "female",
              "other"
            ],
            "example": "female",
            "nullable": true
          },
          "position": {
            "type": "string",
            "example": "Software Engineer"
          },
          "phone": {
            "type": "string",
            "example": "+61 412 345 678"
          },
          "messenger": {
            "type": "string",
            "enum": [
              "whatsapp",
              "telegram",
              "imessage",
              "messenger",
              "signal",
              "wechat",
              "line",
              "viber",
              "none",
              "other"
            ],
            "example": "whatsapp"
          }
        }
      },
      "UserPreferencesDto": {
        "type": "object",
        "properties": {
          "colorMode": {
            "type": "string",
            "description": "This option allows users to set Qualy color scheme. It's currently not used. Potential values are: 'system', 'light', 'dark'.",
            "example": "system"
          },
          "calendar": {
            "type": "string",
            "description": "Must be a valid option from the <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/resolvedOptions\" target=\"_blank\">Intl.DateTimeFormat().resolvedOptions()</a>.calendar property.",
            "example": "gregory"
          },
          "day": {
            "type": "string",
            "description": "Must be a valid option from the <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/resolvedOptions\" target=\"_blank\">Intl.DateTimeFormat().resolvedOptions()</a>.day property.",
            "example": "2-digit"
          },
          "month": {
            "type": "string",
            "description": "Must be a valid option from the <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/resolvedOptions\" target=\"_blank\">Intl.DateTimeFormat().resolvedOptions()</a>.month property.",
            "example": "numeric"
          },
          "year": {
            "type": "string",
            "description": "Must be a valid option from the <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/resolvedOptions\" target=\"_blank\">Intl.DateTimeFormat().resolvedOptions()</a>.year property.",
            "example": "numeric"
          },
          "locale": {
            "type": "string",
            "description": "Must be a valid option from the <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/resolvedOptions\" target=\"_blank\">Intl.DateTimeFormat().resolvedOptions()</a>.locale property.",
            "example": "en"
          },
          "numberingSystem": {
            "type": "string",
            "description": "Must be a valid option from the <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/resolvedOptions\" target=\"_blank\">Intl.DateTimeFormat().resolvedOptions()</a>.numberingSystem property.",
            "example": "latn"
          },
          "timeZone": {
            "type": "string",
            "description": "Must be a valid option from the <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/resolvedOptions\" target=\"_blank\">Intl.DateTimeFormat().resolvedOptions()</a>.timeZone property.",
            "example": "UTC"
          },
          "hourCycle": {
            "type": "string",
            "enum": [
              "h11",
              "h12",
              "h23",
              "h24"
            ],
            "description": "Must be a valid option from the <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/resolvedOptions\" target=\"_blank\">Intl.DateTimeFormat().resolvedOptions()</a>.hourCycle property.",
            "example": "h12"
          }
        }
      },
      "UserPrivacyDto": {
        "type": "object",
        "properties": {
          "doNotTrack": {
            "type": "boolean",
            "example": false
          }
        }
      },
      "CreateUserDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "example": "user@example.com"
          },
          "tenantId": {
            "type": "string"
          },
          "password": {
            "type": "string",
            "minLength": 8
          },
          "profile": {
            "$ref": "#/components/schemas/UserProfileDto"
          },
          "preferences": {
            "$ref": "#/components/schemas/UserPreferencesDto"
          },
          "privacy": {
            "$ref": "#/components/schemas/UserPrivacyDto"
          }
        },
        "required": [
          "email",
          "profile",
          "preferences",
          "privacy"
        ]
      },
      "InviteUserDto": {
        "type": "object",
        "properties": {
          "primaryTeams": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "UserBasicPayloadDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "user",
              "api-key",
              "bot",
              "support"
            ]
          },
          "email": {
            "type": "string",
            "example": "user@example.com"
          },
          "profile": {
            "$ref": "#/components/schemas/Profile"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "active",
              "suspended",
              "blocked",
              "removed"
            ]
          },
          "primaryTeams": {
            "description": "Teams the user belongs to (raw ObjectId strings in basic projection)",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "_id": {
            "type": "string"
          }
        },
        "required": [
          "email",
          "_id"
        ]
      },
      "UpdateUserDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "example": "user@example.com"
          },
          "primaryTeams": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "admin:super",
                "admin",
                "contacts:view:me",
                "contacts:view:team",
                "contacts:view:all",
                "contacts:edit:me",
                "contacts:edit:team",
                "contacts:edit:all",
                "contacts:delete:me",
                "contacts:delete:team",
                "contacts:delete:all",
                "import:contacts",
                "import:partnerships",
                "import:paymentIntents",
                "import:transactions",
                "events:view:me",
                "events:view:team",
                "events:view:all",
                "events:edit:me",
                "events:edit:team",
                "events:edit:all",
                "events:delete:me",
                "events:delete:team",
                "events:delete:all",
                "paymentIntents:view:all",
                "paymentIntents:view:team",
                "paymentIntents:view:me",
                "paymentIntents:edit:all",
                "paymentIntents:edit:team",
                "paymentIntents:edit:me",
                "paymentIntents:delete:all",
                "paymentIntents:delete:team",
                "paymentIntents:delete:me",
                "splits:view:all",
                "splits:view:team",
                "splits:view:me",
                "splits:edit:all",
                "splits:edit:team",
                "splits:edit:me",
                "splits:delete:all",
                "splits:delete:team",
                "splits:delete:me",
                "services:edit:all",
                "services:delete:all",
                "bankAccounts:view:all",
                "bankAccounts:edit:all",
                "bankAccounts:delete:all",
                "storage:view:all",
                "storage:edit:all",
                "storage:delete:all",
                "partnerships:view:all",
                "partnerships:view:team",
                "partnerships:view:me",
                "partnerships:edit:all",
                "partnerships:edit:team",
                "partnerships:edit:me",
                "partnerships:delete:all",
                "partnerships:delete:team",
                "partnerships:delete:me",
                "reports:generate",
                "forms:view:all",
                "forms:edit:all",
                "forms:delete:all",
                "transactions:view:all",
                "transactions:view:team",
                "transactions:view:me",
                "transactions:edit:all",
                "authorizations:view:all",
                "authorizations:manage:all",
                "authorizations:authorize:all"
              ]
            }
          },
          "profile": {
            "$ref": "#/components/schemas/UserProfileDto"
          },
          "preferences": {
            "$ref": "#/components/schemas/UserPreferencesDto"
          },
          "privacy": {
            "$ref": "#/components/schemas/UserPrivacyDto"
          }
        }
      },
      "UpdateUserUiStateDto": {
        "type": "object",
        "properties": {}
      },
      "UpdatePasswordDto": {
        "type": "object",
        "properties": {
          "currentPassword": {
            "type": "string",
            "description": "The current password of the user which you want to update the password for.",
            "example": "123456"
          },
          "newPassword": {
            "type": "string",
            "description": "The new password of the user which you want to update the password for.",
            "example": "654321"
          }
        },
        "required": [
          "currentPassword",
          "newPassword"
        ]
      },
      "ChannelPreferencesDto": {
        "type": "object",
        "properties": {
          "channel": {
            "type": "string",
            "enum": [
              "sms",
              "push",
              "email"
            ]
          }
        },
        "required": [
          "channel"
        ]
      },
      "NotificationPreferenceDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "OPTED_IN",
              "OPTED_OUT"
            ]
          },
          "channelPreferences": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChannelPreferencesDto"
            }
          }
        },
        "required": [
          "id",
          "status",
          "channelPreferences"
        ]
      },
      "UpdatePreferencesDto": {
        "type": "object",
        "properties": {
          "notifications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NotificationPreferenceDto"
            }
          }
        },
        "required": [
          "notifications"
        ]
      },
      "NotificationThreadDto": {
        "type": "object",
        "properties": {
          "inReplyTo": {
            "type": "string"
          },
          "references": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "inReplyTo"
        ]
      },
      "CreateNotificationDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": true,
            "description": "Dynamic notification data"
          },
          "from": {
            "type": "string",
            "enum": [
              "system",
              "user",
              "contact",
              "partner"
            ]
          },
          "category": {
            "type": "string",
            "enum": [
              "general",
              "submission",
              "assign",
              "status",
              "account",
              "payment",
              "payout",
              "invoice",
              "payment-reminder",
              "order-item-reminder",
              "overdue-payment-reminder",
              "overdue-fee-warning",
              "payment-instruction",
              "document-request",
              "form-request",
              "form-request-complete",
              "auth",
              "report",
              "error",
              "authorization-notification",
              "feedback",
              "support"
            ]
          },
          "subcategory": {
            "type": "string",
            "enum": [
              "1-day-overdue",
              "2-days-overdue",
              "3-days-overdue",
              "5-days-overdue",
              "7-days-overdue",
              "10-days-overdue",
              "14-days-overdue",
              "20-days-overdue",
              "27-days-overdue",
              "becomes-overdue",
              "1-day",
              "3-days",
              "7-days",
              "14-days",
              "27-days",
              "advance-notice",
              "intervention-required",
              "authorization-active",
              "authorization-canceled",
              "payment-instructions"
            ]
          },
          "templateId": {
            "type": "string"
          },
          "brandId": {
            "type": "string"
          },
          "recipientId": {
            "type": "string"
          },
          "recipientType": {
            "type": "string",
            "enum": [
              "user",
              "contact",
              "partner",
              "related"
            ]
          },
          "thread": {
            "$ref": "#/components/schemas/NotificationThreadDto"
          }
        },
        "required": [
          "category",
          "templateId",
          "recipientId",
          "recipientType"
        ]
      },
      "StorageRefDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Storage document ID (MongoDB ObjectId)",
            "example": "507f1f77bcf86cd799439011"
          },
          "status": {
            "type": "string",
            "description": "File processing status",
            "example": "ready"
          }
        },
        "required": [
          "_id"
        ]
      },
      "FormSubmissionRefDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Form submission ID (MongoDB ObjectId)",
            "example": "507f1f77bcf86cd799439011"
          },
          "name": {
            "type": "string",
            "description": "Form submission name",
            "example": "Submission #1"
          },
          "status": {
            "type": "string",
            "description": "Form submission status",
            "example": "completed"
          }
        },
        "required": [
          "_id"
        ]
      },
      "OrderItemRefDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Order item ID (MongoDB ObjectId)",
            "example": "507f1f77bcf86cd799439011"
          },
          "name": {
            "type": "string",
            "description": "Order item name",
            "example": "Website Design"
          }
        },
        "required": [
          "_id"
        ]
      },
      "PaymentIntentRefDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Payment intent ID (MongoDB ObjectId)",
            "example": "507f1f77bcf86cd799439011"
          },
          "status": {
            "type": "string",
            "description": "Payment intent status",
            "example": "pending"
          },
          "number": {
            "type": "string",
            "description": "Payment intent number",
            "example": "1042"
          }
        },
        "required": [
          "_id"
        ]
      },
      "ContactRefDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Contact ID (MongoDB ObjectId)",
            "example": "507f1f77bcf86cd799439011"
          },
          "profile": {
            "description": "Contact profile information",
            "allOf": [
              {
                "$ref": "#/components/schemas/UserProfileRefDto"
              }
            ]
          },
          "email": {
            "type": "string",
            "description": "Contact email address",
            "example": "contact@example.com"
          },
          "number": {
            "type": "string",
            "description": "Contact number (auto-generated)",
            "example": "1042"
          }
        },
        "required": [
          "_id",
          "profile"
        ]
      },
      "NotificationRecipientDto": {
        "type": "object",
        "properties": {
          "user": {
            "description": "Recipient user (populated with profile)",
            "allOf": [
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "contact": {
            "description": "Recipient contact (populated)",
            "allOf": [
              {
                "$ref": "#/components/schemas/ContactRefDto"
              }
            ]
          },
          "partner": {
            "type": "string",
            "description": "Recipient partner ObjectId",
            "example": "507f1f77bcf86cd799439011"
          },
          "related": {
            "type": "string",
            "description": "Recipient related person ObjectId",
            "example": "507f1f77bcf86cd799439011"
          }
        }
      },
      "NotificationContentDto": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "Notification title",
            "example": "Payment Received"
          },
          "body": {
            "type": "string",
            "description": "Notification body text",
            "example": "Your payment of $500.00 has been processed"
          }
        }
      },
      "ObjectId": {
        "type": "string"
      },
      "NotificationQueuePayloadDto": {
        "type": "object",
        "properties": {
          "failedReason": {
            "type": "string",
            "example": "Email delivery failed: mailbox not found"
          },
          "paymentIntent": {
            "description": "Payment intent reference",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/PaymentIntentRefDto"
              }
            ]
          },
          "orderItem": {
            "description": "Order item reference",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/OrderItemRefDto"
              }
            ]
          },
          "form": {
            "description": "Form submission reference",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/FormSubmissionRefDto"
              }
            ]
          },
          "document": {
            "description": "Storage document reference",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/StorageRefDto"
              }
            ]
          },
          "recipient": {
            "description": "Notification recipient",
            "allOf": [
              {
                "$ref": "#/components/schemas/NotificationRecipientDto"
              }
            ]
          },
          "recipientType": {
            "type": "string",
            "description": "Notification recipient type",
            "enum": [
              "user",
              "contact"
            ]
          },
          "completedAt": {
            "format": "date-time",
            "type": "string"
          },
          "ignoredAt": {
            "format": "date-time",
            "type": "string"
          },
          "ignoredReason": {
            "type": "string",
            "description": "Reason this queue item was ignored",
            "enum": [
              "due-to-payment-status",
              "payment-not-found",
              "bank-debit-authorization",
              "send-date-is-past-at-creation",
              "opted-out",
              "tenant-all-channels-opted-out",
              "tenant-overdue-fee-warning-disabled"
            ]
          },
          "comment": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "description": "Dynamic notification data",
            "additionalProperties": true
          },
          "category": {
            "type": "string",
            "description": "Notification category",
            "enum": [
              "general",
              "submission",
              "assign",
              "status",
              "account",
              "payment",
              "payout",
              "invoice",
              "payment-reminder",
              "order-item-reminder",
              "overdue-payment-reminder",
              "overdue-fee-warning",
              "payment-instruction",
              "document-request",
              "form-request",
              "form-request-complete",
              "auth",
              "report",
              "error",
              "authorization-notification",
              "feedback",
              "support"
            ],
            "example": "payment"
          },
          "subcategory": {
            "type": "string",
            "description": "Notification subcategory",
            "enum": [
              "1-day-overdue",
              "2-days-overdue",
              "3-days-overdue",
              "5-days-overdue",
              "7-days-overdue",
              "10-days-overdue",
              "14-days-overdue",
              "20-days-overdue",
              "27-days-overdue",
              "becomes-overdue",
              "1-day",
              "3-days",
              "7-days",
              "14-days",
              "27-days",
              "advance-notice",
              "intervention-required",
              "authorization-active",
              "authorization-canceled",
              "payment-instructions"
            ],
            "example": "1-day-overdue"
          },
          "status": {
            "type": "string",
            "description": "Queue item status",
            "enum": [
              "queued",
              "failed",
              "completed",
              "ignored"
            ],
            "example": "queued"
          },
          "from": {
            "type": "string",
            "description": "Notification sender identifier",
            "enum": [
              "system",
              "user",
              "contact",
              "partner"
            ],
            "example": "system"
          },
          "content": {
            "description": "Notification content",
            "allOf": [
              {
                "$ref": "#/components/schemas/NotificationContentDto"
              }
            ]
          },
          "createdBy": {
            "description": "User who created this notification",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "sentAt": {
            "format": "date-time",
            "type": "string"
          },
          "failedAt": {
            "format": "date-time",
            "type": "string"
          },
          "contentTemplate": {
            "$ref": "#/components/schemas/ObjectId"
          },
          "sendAt": {
            "format": "date-time",
            "type": "string"
          },
          "group": {
            "type": "boolean"
          },
          "meta": {
            "type": "object",
            "description": "Queue metadata (task name, etc.)",
            "additionalProperties": true
          },
          "stale": {
            "type": "boolean"
          }
        },
        "required": [
          "category",
          "status",
          "from"
        ]
      },
      "CreateNotificationQueueItemDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": true,
            "description": "Dynamic notification data"
          },
          "contentTemplate": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "paymentIntent": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "orderItem": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "form": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "document": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "from": {
            "type": "string",
            "enum": [
              "system",
              "user",
              "contact",
              "partner"
            ]
          },
          "category": {
            "type": "string",
            "enum": [
              "general",
              "submission",
              "assign",
              "status",
              "account",
              "payment",
              "payout",
              "invoice",
              "payment-reminder",
              "order-item-reminder",
              "overdue-payment-reminder",
              "overdue-fee-warning",
              "payment-instruction",
              "document-request",
              "form-request",
              "form-request-complete",
              "auth",
              "report",
              "error",
              "authorization-notification",
              "feedback",
              "support"
            ]
          },
          "templateId": {
            "type": "string"
          },
          "brandId": {
            "type": "string"
          },
          "recipientId": {
            "type": "string"
          },
          "recipientType": {
            "type": "string",
            "enum": [
              "contact",
              "related"
            ]
          },
          "subcategory": {
            "type": "string",
            "enum": [
              "1-day-overdue",
              "2-days-overdue",
              "3-days-overdue",
              "5-days-overdue",
              "7-days-overdue",
              "10-days-overdue",
              "14-days-overdue",
              "20-days-overdue",
              "27-days-overdue",
              "becomes-overdue",
              "1-day",
              "3-days",
              "7-days",
              "14-days",
              "27-days",
              "advance-notice",
              "intervention-required",
              "authorization-active",
              "authorization-canceled",
              "payment-instructions"
            ]
          },
          "comment": {
            "type": "string"
          },
          "sendAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "category",
          "templateId",
          "recipientId",
          "recipientType"
        ]
      },
      "NotificationStats": {
        "type": "object",
        "properties": {
          "lastOpenAt": {
            "format": "date-time",
            "type": "string"
          },
          "lastClickAt": {
            "format": "date-time",
            "type": "string"
          },
          "nOpens": {
            "type": "number"
          },
          "nClicks": {
            "type": "number"
          },
          "bouncedAt": {
            "format": "date-time",
            "type": "string"
          },
          "complainedAt": {
            "format": "date-time",
            "type": "string"
          }
        }
      },
      "NotificationListPayloadDto": {
        "type": "object",
        "properties": {
          "statusReason": {
            "type": "string",
            "example": "Recipient email address bounced"
          },
          "category": {
            "type": "string",
            "description": "Notification category",
            "enum": [
              "general",
              "submission",
              "assign",
              "status",
              "account",
              "payment",
              "payout",
              "invoice",
              "payment-reminder",
              "order-item-reminder",
              "overdue-payment-reminder",
              "overdue-fee-warning",
              "payment-instruction",
              "document-request",
              "form-request",
              "form-request-complete",
              "auth",
              "report",
              "error",
              "authorization-notification",
              "feedback",
              "support"
            ],
            "example": "payment"
          },
          "subcategory": {
            "type": "string",
            "description": "Notification subcategory",
            "enum": [
              "1-day-overdue",
              "2-days-overdue",
              "3-days-overdue",
              "5-days-overdue",
              "7-days-overdue",
              "10-days-overdue",
              "14-days-overdue",
              "20-days-overdue",
              "27-days-overdue",
              "becomes-overdue",
              "1-day",
              "3-days",
              "7-days",
              "14-days",
              "27-days",
              "advance-notice",
              "intervention-required",
              "authorization-active",
              "authorization-canceled",
              "payment-instructions"
            ],
            "example": "1-day-overdue"
          },
          "status": {
            "type": "string",
            "description": "Notification status",
            "enum": [
              "pending",
              "processed",
              "supressed",
              "unread",
              "read",
              "errored",
              "archived"
            ],
            "example": "unread"
          },
          "from": {
            "type": "string",
            "description": "Notification sender identifier",
            "enum": [
              "system",
              "user",
              "contact",
              "partner"
            ],
            "example": "system"
          },
          "content": {
            "description": "Notification content (title, body)",
            "allOf": [
              {
                "$ref": "#/components/schemas/NotificationContentDto"
              }
            ]
          },
          "createdBy": {
            "description": "User who created this notification",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "sentAt": {
            "format": "date-time",
            "type": "string"
          },
          "failedAt": {
            "format": "date-time",
            "type": "string"
          },
          "stats": {
            "$ref": "#/components/schemas/NotificationStats"
          },
          "channels": {
            "type": "array",
            "description": "Channels this notification was sent through",
            "items": {
              "type": "string",
              "enum": [
                "sms",
                "push",
                "email"
              ]
            }
          },
          "paymentIntent": {
            "description": "Payment intent reference",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/PaymentIntentRefDto"
              }
            ]
          }
        },
        "required": [
          "category",
          "status",
          "from",
          "createdBy"
        ]
      },
      "NotifcationConfigDto": {
        "type": "object",
        "properties": {
          "fcmWeb": {
            "type": "string"
          },
          "fcmMobile": {
            "type": "string"
          }
        }
      },
      "NotificationStatsPayloadDto": {
        "type": "object",
        "properties": {}
      },
      "NotificationDetailPayloadDto": {
        "type": "object",
        "properties": {
          "statusReason": {
            "type": "string",
            "example": "Recipient email address bounced"
          },
          "category": {
            "type": "string",
            "description": "Notification category",
            "enum": [
              "general",
              "submission",
              "assign",
              "status",
              "account",
              "payment",
              "payout",
              "invoice",
              "payment-reminder",
              "order-item-reminder",
              "overdue-payment-reminder",
              "overdue-fee-warning",
              "payment-instruction",
              "document-request",
              "form-request",
              "form-request-complete",
              "auth",
              "report",
              "error",
              "authorization-notification",
              "feedback",
              "support"
            ],
            "example": "payment"
          },
          "subcategory": {
            "type": "string",
            "description": "Notification subcategory",
            "enum": [
              "1-day-overdue",
              "2-days-overdue",
              "3-days-overdue",
              "5-days-overdue",
              "7-days-overdue",
              "10-days-overdue",
              "14-days-overdue",
              "20-days-overdue",
              "27-days-overdue",
              "becomes-overdue",
              "1-day",
              "3-days",
              "7-days",
              "14-days",
              "27-days",
              "advance-notice",
              "intervention-required",
              "authorization-active",
              "authorization-canceled",
              "payment-instructions"
            ],
            "example": "1-day-overdue"
          },
          "status": {
            "type": "string",
            "description": "Notification status",
            "enum": [
              "pending",
              "processed",
              "supressed",
              "unread",
              "read",
              "errored",
              "archived"
            ],
            "example": "unread"
          },
          "from": {
            "type": "string",
            "description": "Notification sender identifier",
            "enum": [
              "system",
              "user",
              "contact",
              "partner"
            ],
            "example": "system"
          },
          "content": {
            "description": "Notification content (title, body)",
            "allOf": [
              {
                "$ref": "#/components/schemas/NotificationContentDto"
              }
            ]
          },
          "createdBy": {
            "description": "User who created this notification (populated with profile)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ],
            "allOf": [
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "sentAt": {
            "format": "date-time",
            "type": "string"
          },
          "failedAt": {
            "format": "date-time",
            "type": "string"
          },
          "stats": {
            "$ref": "#/components/schemas/NotificationStats"
          },
          "channels": {
            "type": "array",
            "description": "Channels this notification was sent through",
            "items": {
              "type": "string",
              "enum": [
                "sms",
                "push",
                "email"
              ]
            }
          },
          "paymentIntent": {
            "description": "Payment intent reference",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/PaymentIntentRefDto"
              }
            ]
          },
          "recipient": {
            "description": "Notification recipient with populated user/contact references",
            "allOf": [
              {
                "$ref": "#/components/schemas/NotificationRecipientDto"
              }
            ]
          }
        },
        "required": [
          "category",
          "status",
          "from"
        ]
      },
      "PushNotificationChannel": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "label"
        ]
      },
      "PushNotificationContent": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "example": "Payment Received"
          },
          "body": {
            "type": "string",
            "example": "Your payment of $500.00 has been processed"
          }
        },
        "required": [
          "title",
          "body"
        ]
      },
      "PushNotificationData": {
        "type": "object",
        "properties": {
          "messageId": {
            "type": "string",
            "example": "msg_abc123def456"
          },
          "channel": {
            "$ref": "#/components/schemas/PushNotificationChannel"
          },
          "content": {
            "$ref": "#/components/schemas/PushNotificationContent"
          }
        },
        "required": [
          "messageId",
          "content"
        ]
      },
      "PushNotificationDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/PushNotificationData"
          }
        },
        "required": [
          "type",
          "data"
        ]
      },
      "Meta": {
        "type": "object",
        "properties": {
          "notes": {
            "type": "string",
            "example": "Use this template for international clients"
          },
          "autoSelect": {
            "type": "string",
            "enum": [
              "partner",
              "supplier"
            ]
          },
          "useSplit": {
            "type": "string",
            "enum": [
              "default",
              "specific"
            ]
          },
          "split": {
            "type": "string"
          }
        }
      },
      "Split": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "percentage-on-amount",
              "percentage-on-splits",
              "fixed",
              "keep-percentage"
            ]
          },
          "amount": {
            "type": "number",
            "example": 5000
          },
          "partnership": {
            "type": "string"
          },
          "partnerReference": {
            "type": "string"
          },
          "tax": {
            "type": "string"
          },
          "keep": {
            "type": "number"
          },
          "percentage": {
            "type": "number"
          },
          "meta": {
            "$ref": "#/components/schemas/Meta"
          }
        },
        "required": [
          "type",
          "amount",
          "partnership"
        ]
      },
      "FrequencyRule": {
        "type": "object",
        "properties": {
          "frequency": {
            "type": "string",
            "enum": [
              "every-week",
              "every-2-weeks",
              "every-month",
              "every-2-months",
              "every-3-months",
              "every-6-months"
            ]
          },
          "depositAmount": {
            "type": "number",
            "example": 2000
          },
          "recurringAmount": {
            "type": "number",
            "example": 3000
          },
          "tax": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ]
          },
          "settlementCurrency": {
            "type": "string",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ]
          },
          "depositSplits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Split"
            }
          },
          "recurringSplits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Split"
            }
          }
        },
        "required": [
          "frequency",
          "depositAmount",
          "recurringAmount",
          "currency",
          "depositSplits",
          "recurringSplits"
        ]
      },
      "EmailReminderContent": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                }
              }
            }
          },
          "reminders": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "1-day-overdue",
                "2-days-overdue",
                "3-days-overdue",
                "5-days-overdue",
                "7-days-overdue",
                "10-days-overdue",
                "14-days-overdue",
                "20-days-overdue",
                "27-days-overdue",
                "becomes-overdue",
                "1-day",
                "3-days",
                "7-days",
                "14-days",
                "27-days"
              ]
            }
          },
          "locale": {
            "type": "string"
          }
        },
        "required": [
          "items",
          "reminders"
        ]
      },
      "TemplatePayloadDto": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "example": "Standard invoice template for recurring clients"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "category": {
            "type": "string",
            "description": "Template category",
            "enum": [
              "payment-ad-hoc-variable-amount",
              "payment-plan-list",
              "payment-plan-frequency-rule",
              "payment-reminder-email",
              "payment-intent"
            ],
            "example": "payment-plan-list"
          },
          "services": {
            "description": "Service IDs associated with this template",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "payments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Payment"
            }
          },
          "rule": {
            "$ref": "#/components/schemas/FrequencyRule"
          },
          "content": {
            "$ref": "#/components/schemas/EmailReminderContent"
          },
          "autoSelect": {
            "type": "string"
          },
          "displayPortal": {
            "type": "boolean"
          },
          "displayEcommerce": {
            "type": "boolean"
          },
          "autoGenerated": {
            "type": "boolean"
          },
          "default": {
            "type": "boolean"
          },
          "_id": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "status",
          "category",
          "payments",
          "content",
          "autoGenerated",
          "default",
          "_id"
        ]
      },
      "TemplateSplitMetaDto": {
        "type": "object",
        "properties": {
          "notes": {
            "type": "string",
            "example": "Use this template for international clients"
          },
          "split": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "autoSelect": {
            "type": "string",
            "enum": [
              "partner",
              "supplier"
            ]
          },
          "useSplit": {
            "type": "string",
            "enum": [
              "default",
              "specific"
            ]
          }
        }
      },
      "TemplateSplitDto": {
        "type": "object",
        "properties": {
          "partnership": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "tax": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "amount": {
            "type": "number",
            "minimum": 0,
            "example": 5000
          },
          "type": {
            "type": "string",
            "enum": [
              "percentage-on-amount",
              "percentage-on-splits",
              "fixed",
              "keep-percentage"
            ]
          },
          "partnerReference": {
            "type": "string"
          },
          "keep": {
            "type": "number",
            "minimum": 0
          },
          "percentage": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "meta": {
            "$ref": "#/components/schemas/TemplateSplitMetaDto"
          }
        }
      },
      "TemplateItemDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Invoice Template"
          },
          "description": {
            "type": "string",
            "example": "Standard invoice template for recurring clients"
          },
          "amount": {
            "type": "number",
            "example": 5000
          },
          "category": {
            "type": "string"
          },
          "splits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TemplateSplitDto"
            }
          }
        }
      },
      "TemplatePaymentDto": {
        "type": "object",
        "properties": {
          "tax": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "currency": {
            "type": "object",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "settlementCurrency": {
            "type": "object",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "USD"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TemplateItemDto"
            }
          }
        },
        "required": [
          "currency"
        ]
      },
      "TemplateFrequencyRuleDto": {
        "type": "object",
        "properties": {
          "depositAmount": {
            "type": "number",
            "example": 5000
          },
          "recurringAmount": {
            "type": "number",
            "example": 9900
          },
          "currency": {
            "type": "object",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "settlementCurrency": {
            "type": "object",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "USD"
          },
          "tax": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "frequency": {
            "type": "string",
            "enum": [
              "every-week",
              "every-2-weeks",
              "every-month",
              "every-2-months",
              "every-3-months",
              "every-6-months"
            ]
          },
          "depositSplits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TemplateSplitDto"
            }
          },
          "recurringSplits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TemplateSplitDto"
            }
          }
        },
        "required": [
          "currency",
          "frequency"
        ]
      },
      "CreateTemplateDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Invoice Template"
          },
          "description": {
            "type": "string",
            "example": "Standard invoice template for recurring clients"
          },
          "services": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "category": {
            "type": "string",
            "enum": [
              "payment-ad-hoc-variable-amount",
              "payment-plan-list",
              "payment-plan-frequency-rule",
              "payment-reminder-email",
              "payment-intent"
            ]
          },
          "autoSelect": {
            "type": "string",
            "enum": [
              "order-item"
            ]
          },
          "displayPortal": {
            "type": "boolean"
          },
          "displayEcommerce": {
            "type": "boolean"
          },
          "payments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TemplatePaymentDto"
            }
          },
          "rule": {
            "$ref": "#/components/schemas/TemplateFrequencyRuleDto"
          },
          "content": {
            "$ref": "#/components/schemas/EmailReminderContent"
          },
          "default": {
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "category"
        ]
      },
      "UpdateTemplateDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Invoice Template"
          },
          "description": {
            "type": "string",
            "example": "Standard invoice template for recurring clients"
          },
          "services": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "category": {
            "type": "string",
            "enum": [
              "payment-ad-hoc-variable-amount",
              "payment-plan-list",
              "payment-plan-frequency-rule",
              "payment-reminder-email",
              "payment-intent"
            ]
          },
          "autoSelect": {
            "type": "string",
            "enum": [
              "order-item"
            ]
          },
          "displayPortal": {
            "type": "boolean"
          },
          "displayEcommerce": {
            "type": "boolean"
          },
          "payments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TemplatePaymentDto"
            }
          },
          "rule": {
            "$ref": "#/components/schemas/TemplateFrequencyRuleDto"
          },
          "content": {
            "$ref": "#/components/schemas/EmailReminderContent"
          },
          "default": {
            "type": "boolean"
          }
        }
      },
      "PIDescription": {
        "type": "object",
        "properties": {
          "internal": {
            "type": "string",
            "description": "Internal description",
            "example": "Payment for consulting services"
          },
          "external": {
            "type": "string",
            "description": "External (customer-facing) description",
            "example": "Invoice #1234 payment"
          }
        }
      },
      "PICondition": {
        "type": "object",
        "properties": {
          "step": {
            "type": "string",
            "description": "Step ID condition",
            "example": "507f1f77bcf86cd799439011"
          }
        }
      },
      "PIProfile": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "example": "Jane"
          },
          "lastName": {
            "type": "string",
            "example": "Smith"
          },
          "phone": {
            "type": "string",
            "example": "+61 412 345 678"
          }
        }
      },
      "PIContact": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Contact ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "email": {
            "type": "string",
            "description": "Contact email",
            "example": "user@example.com"
          },
          "profile": {
            "$ref": "#/components/schemas/PIProfile"
          },
          "number": {
            "type": "string",
            "description": "Contact number",
            "example": "C-001"
          },
          "partnersReference": {
            "type": "object",
            "description": "Map of partnership IDs to reference values",
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "required": [
          "_id"
        ]
      },
      "PIOrderRef": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Order ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "number": {
            "type": "string",
            "description": "Order number",
            "example": "ORD-001"
          }
        },
        "required": [
          "_id"
        ]
      },
      "PIOrderItemSupplier": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Supplier partnership name",
            "example": "Business Account"
          },
          "websiteUrl": {
            "type": "string",
            "description": "Supplier website URL",
            "example": "https://acme.com"
          },
          "logo": {
            "type": "string",
            "description": "Supplier logo path",
            "example": "uploads/logos/supplier.png"
          }
        }
      },
      "PIOrderItem": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Order item ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "name": {
            "type": "string",
            "description": "Order item name",
            "example": "Website Design"
          },
          "status": {
            "type": "string",
            "description": "Order item status",
            "example": "completed"
          },
          "health": {
            "type": "string",
            "description": "Order item health",
            "example": "on-track"
          },
          "supplier": {
            "$ref": "#/components/schemas/PIOrderItemSupplier"
          }
        },
        "required": [
          "_id"
        ]
      },
      "PIItem": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Payment item ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "index": {
            "type": "number",
            "description": "Item index",
            "example": 0
          },
          "name": {
            "type": "string",
            "description": "Item name",
            "example": "Website Design"
          },
          "category": {
            "type": "string",
            "description": "Item category",
            "example": "service"
          },
          "description": {
            "type": "string",
            "description": "Item description",
            "example": "Website redesign project - Phase 1"
          },
          "paymentIntent": {
            "type": "string",
            "description": "Parent payment intent ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "amount": {
            "type": "number",
            "description": "Item amount",
            "example": 2500
          },
          "discount": {
            "type": "boolean",
            "description": "Whether item is a discount",
            "example": false
          },
          "cancelled": {
            "type": "string",
            "description": "Cancellation reason for item",
            "example": "Customer requested cancellation"
          },
          "order": {
            "type": "string",
            "description": "Associated order ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "orderItem": {
            "type": "string",
            "description": "Associated order item ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "paymentSplits": {
            "description": "Payment split IDs",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "service": {
            "type": "string",
            "description": "Associated service ID",
            "example": "507f1f77bcf86cd799439011"
          }
        },
        "required": [
          "_id"
        ]
      },
      "PaymentIntentTaxRefDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Tax ID (MongoDB ObjectId)",
            "example": "507f1f77bcf86cd799439011"
          },
          "name": {
            "type": "string",
            "description": "Tax name",
            "example": "GST"
          },
          "description": {
            "type": "string",
            "description": "Tax description",
            "example": "Goods and Services Tax"
          },
          "percentage": {
            "type": "number",
            "description": "Tax percentage (0-1)",
            "example": 0.1
          },
          "inclusive": {
            "type": "boolean",
            "description": "Whether tax is inclusive",
            "example": true
          },
          "taxType": {
            "type": "string",
            "description": "Tax type",
            "example": "vat"
          }
        },
        "required": [
          "_id",
          "name",
          "percentage",
          "inclusive"
        ]
      },
      "PITransactionPartnership": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Partnership ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "name": {
            "type": "string",
            "description": "Partnership name",
            "example": "Business Account"
          },
          "logo": {
            "type": "string",
            "description": "Partnership logo path",
            "example": "uploads/logos/partner.png"
          }
        },
        "required": [
          "_id"
        ]
      },
      "PITransactionQuote": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Quote ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "rate": {
            "type": "number",
            "description": "Exchange rate",
            "example": 0.75
          }
        },
        "required": [
          "_id"
        ]
      },
      "PITransaction": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Transaction ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "fees": {
            "type": "number",
            "description": "Transaction fees",
            "example": 150
          },
          "released": {
            "type": "boolean",
            "description": "Whether funds have been released",
            "example": true
          },
          "number": {
            "type": "number",
            "description": "Transaction number",
            "example": 1
          },
          "transactionType": {
            "type": "string",
            "description": "Transaction type",
            "example": "bank_transfer"
          },
          "method": {
            "type": "string",
            "description": "Payment method",
            "example": "bank_transfer"
          },
          "amount": {
            "type": "number",
            "description": "Transaction amount",
            "example": 5000
          },
          "currency": {
            "type": "string",
            "description": "Currency code",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "externalMethod": {
            "type": "string",
            "description": "External payment method name",
            "example": "Visa ending 4242"
          },
          "status": {
            "type": "string",
            "description": "Transaction status",
            "example": "completed"
          },
          "notes": {
            "type": "string",
            "description": "Transaction notes",
            "example": "Payment received via bank transfer"
          },
          "documents": {
            "description": "Attached document IDs",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "description": "Transaction creation date",
            "example": "2024-01-15T09:30:00.000Z"
          },
          "approvedAt": {
            "format": "date-time",
            "type": "string",
            "description": "Transaction approval date",
            "example": "2024-01-16T10:00:00.000Z"
          },
          "rejectedAt": {
            "format": "date-time",
            "type": "string",
            "description": "Transaction rejection date",
            "example": "2024-01-17T14:00:00.000Z"
          },
          "paidAt": {
            "format": "date-time",
            "type": "string",
            "description": "Transaction paid date",
            "example": "2024-01-18T09:00:00.000Z"
          },
          "partnership": {
            "description": "Populated partnership reference",
            "allOf": [
              {
                "$ref": "#/components/schemas/PITransactionPartnership"
              }
            ]
          },
          "quote": {
            "description": "Populated FX quote reference",
            "allOf": [
              {
                "$ref": "#/components/schemas/PITransactionQuote"
              }
            ]
          }
        },
        "required": [
          "_id"
        ]
      },
      "PISupplierPayment": {
        "type": "object",
        "properties": {
          "usePartnerBrandingWhenSupplier": {
            "type": "boolean",
            "description": "Use partner branding when supplier",
            "example": true
          }
        }
      },
      "PISupplierAddress": {
        "type": "object",
        "properties": {
          "country": {
            "type": "string",
            "example": "AU"
          },
          "line1": {
            "type": "string",
            "example": "123 Business St"
          },
          "line2": {
            "type": "string",
            "example": "Suite 100"
          },
          "postalCode": {
            "type": "string",
            "example": "2000"
          },
          "state": {
            "type": "string",
            "example": "NSW"
          },
          "city": {
            "type": "string",
            "example": "Sydney"
          }
        }
      },
      "PISupplierTaxId": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "example": "ABN"
          },
          "number": {
            "type": "string",
            "example": "51 824 753 556"
          },
          "id": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          }
        }
      },
      "PISupplier": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Supplier partnership ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "name": {
            "type": "string",
            "description": "Supplier name",
            "example": "Business Account"
          },
          "websiteUrl": {
            "type": "string",
            "description": "Supplier website URL",
            "example": "https://acme.com"
          },
          "logo": {
            "type": "string",
            "description": "Supplier logo path",
            "example": "uploads/logos/supplier.png"
          },
          "primaryColor": {
            "type": "string",
            "description": "Supplier primary color",
            "example": "#4F46E5"
          },
          "payment": {
            "$ref": "#/components/schemas/PISupplierPayment"
          },
          "address": {
            "$ref": "#/components/schemas/PISupplierAddress"
          },
          "taxIds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PISupplierTaxId"
            }
          }
        },
        "required": [
          "_id"
        ]
      },
      "PIUserProfile": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "example": "Jane"
          },
          "lastName": {
            "type": "string",
            "example": "Smith"
          },
          "nickname": {
            "type": "string",
            "example": "jsmith"
          },
          "picture": {
            "type": "string",
            "example": "https://example.com/avatar.jpg"
          },
          "gender": {
            "type": "string",
            "example": "female"
          },
          "phone": {
            "type": "string",
            "example": "+61 412 345 678"
          }
        }
      },
      "PICreatedBy": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "User ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "profile": {
            "$ref": "#/components/schemas/PIUserProfile"
          }
        },
        "required": [
          "_id"
        ]
      },
      "PIAuthorization": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Authorization ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "type": {
            "type": "string",
            "description": "Authorization type",
            "example": "pre-auth"
          },
          "status": {
            "type": "string",
            "description": "Authorization status",
            "example": "approved"
          },
          "method": {
            "type": "string",
            "description": "Authorization method",
            "example": "credit_card"
          },
          "details": {
            "type": "object",
            "description": "Authorization details",
            "additionalProperties": true
          }
        },
        "required": [
          "_id"
        ]
      },
      "PILinks": {
        "type": "object",
        "properties": {
          "short": {
            "type": "string",
            "description": "Short payment link URL",
            "example": "https://pay.example.com/abc"
          }
        }
      },
      "PIBranding": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Branding partnership ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "name": {
            "type": "string",
            "description": "Brand name",
            "example": "Business Account"
          },
          "websiteUrl": {
            "type": "string",
            "description": "Brand website URL",
            "example": "https://acme.com"
          },
          "logo": {
            "type": "string",
            "description": "Brand logo path",
            "example": "uploads/logos/brand.png"
          },
          "primaryColor": {
            "type": "string",
            "description": "Brand primary color",
            "example": "#4F46E5"
          }
        },
        "required": [
          "_id"
        ]
      },
      "PIQuote": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Quote ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "automatic": {
            "type": "boolean",
            "description": "Whether quote was auto-generated",
            "example": true
          },
          "rate": {
            "type": "number",
            "description": "Exchange rate",
            "example": 0.75
          },
          "sourceCurrency": {
            "type": "string",
            "description": "Source currency",
            "example": "AUD"
          },
          "targetCurrency": {
            "type": "string",
            "description": "Target currency",
            "example": "USD"
          },
          "sourceAmount": {
            "type": "number",
            "description": "Source amount",
            "example": 10000
          },
          "targetAmount": {
            "type": "number",
            "description": "Target amount",
            "example": 7500
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "description": "Quote creation date",
            "example": "2024-01-15T09:30:00.000Z"
          },
          "markup": {
            "type": "number",
            "description": "FX markup",
            "example": 150
          },
          "comparison": {
            "type": "object",
            "description": "FX comparison data",
            "additionalProperties": true
          }
        },
        "required": [
          "_id"
        ]
      },
      "PIFees": {
        "type": "object",
        "properties": {
          "gateway": {
            "type": "number",
            "description": "Gateway fee amount",
            "example": 150
          },
          "tenant": {
            "type": "number",
            "description": "Tenant fee amount",
            "example": 100
          }
        }
      },
      "PISubscription": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Subscription ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "name": {
            "type": "string",
            "description": "Subscription name",
            "example": "Monthly Plan"
          },
          "amount": {
            "type": "number",
            "description": "Subscription amount",
            "example": 9900
          },
          "curency": {
            "type": "string",
            "description": "Subscription currency (note: entity typo \"curency\")",
            "example": "AUD"
          },
          "billing": {
            "type": "object",
            "description": "Billing configuration",
            "additionalProperties": true
          },
          "schedule": {
            "type": "object",
            "description": "Schedule configuration",
            "additionalProperties": true
          }
        },
        "required": [
          "_id"
        ]
      },
      "PaymentIntentPayloadDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Payment intent ID (MongoDB ObjectId)",
            "example": "507f1f77bcf86cd799439011"
          },
          "description": {
            "description": "Payment description (internal/external)",
            "allOf": [
              {
                "$ref": "#/components/schemas/PIDescription"
              }
            ]
          },
          "condition": {
            "description": "Condition for step-based payment intents",
            "allOf": [
              {
                "$ref": "#/components/schemas/PICondition"
              }
            ]
          },
          "contact": {
            "description": "Populated contact reference",
            "allOf": [
              {
                "$ref": "#/components/schemas/PIContact"
              }
            ]
          },
          "order": {
            "description": "Populated order reference (number only)",
            "allOf": [
              {
                "$ref": "#/components/schemas/PIOrderRef"
              }
            ]
          },
          "orderItems": {
            "description": "Populated order items",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PIOrderItem"
            }
          },
          "items": {
            "description": "Populated payment items",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PIItem"
            }
          },
          "paymentSplits": {
            "description": "Payment split IDs",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string",
            "description": "Payment intent status",
            "enum": [
              "added",
              "requires-condition",
              "due",
              "overdue",
              "canceled",
              "review-pending",
              "paid-partial",
              "paid-full",
              "processing",
              "refunded-partial",
              "refunded-full"
            ],
            "example": "due"
          },
          "amount": {
            "type": "number",
            "description": "Payment amount (subtotal before tax)",
            "example": 5000
          },
          "total": {
            "type": "number",
            "description": "Total amount including tax",
            "example": 5500
          },
          "due": {
            "type": "number",
            "description": "Remaining due amount",
            "example": 5500
          },
          "taxTotal": {
            "type": "number",
            "description": "Tax total amount",
            "example": 500
          },
          "currency": {
            "type": "string",
            "description": "Currency code (ISO 4217)",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "settlementCurrency": {
            "type": "string",
            "nullable": true,
            "description": "Settlement currency code (ISO 4217)",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "USD"
          },
          "paidAt": {
            "format": "date-time",
            "type": "string",
            "description": "Date payment was completed",
            "example": "2024-03-15T14:30:00.000Z"
          },
          "dueAt": {
            "format": "date-time",
            "type": "string",
            "description": "Payment due date",
            "example": "2024-02-15T00:00:00.000Z"
          },
          "canceledAt": {
            "format": "date-time",
            "type": "string",
            "description": "Date payment was canceled",
            "example": "2024-04-01T10:00:00.000Z"
          },
          "cancelationReason": {
            "type": "string",
            "description": "Cancellation reason",
            "enum": [
              "duplicate",
              "fraudulent",
              "abandoned",
              "requested-by-customer",
              "changed-service",
              "not-eligible-for-service",
              "void-invoice",
              "bad-debt",
              "other"
            ]
          },
          "tax": {
            "description": "Populated tax reference",
            "allOf": [
              {
                "$ref": "#/components/schemas/PaymentIntentTaxRefDto"
              }
            ]
          },
          "transactions": {
            "description": "Populated transactions",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PITransaction"
            }
          },
          "suppliers": {
            "description": "Populated supplier partnerships",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PISupplier"
            }
          },
          "createdBy": {
            "description": "Populated user who created the payment intent",
            "allOf": [
              {
                "$ref": "#/components/schemas/PICreatedBy"
              }
            ]
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "description": "Creation date",
            "example": "2024-01-15T09:30:00.000Z"
          },
          "number": {
            "type": "string",
            "description": "Payment intent number",
            "example": "42"
          },
          "authorizations": {
            "description": "Authorization records",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PIAuthorization"
            }
          },
          "links": {
            "description": "Payment links",
            "allOf": [
              {
                "$ref": "#/components/schemas/PILinks"
              }
            ]
          },
          "branding": {
            "description": "Populated branding partnership",
            "allOf": [
              {
                "$ref": "#/components/schemas/PIBranding"
              }
            ]
          },
          "quote": {
            "description": "Populated FX quote",
            "allOf": [
              {
                "$ref": "#/components/schemas/PIQuote"
              }
            ]
          },
          "fees": {
            "description": "Fee breakdown",
            "allOf": [
              {
                "$ref": "#/components/schemas/PIFees"
              }
            ]
          },
          "custom": {
            "type": "object",
            "description": "Custom metadata object",
            "additionalProperties": true
          },
          "primaryTeams": {
            "description": "Primary team IDs",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "owners": {
            "description": "Owner user IDs",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "partnerships": {
            "description": "Partnership IDs",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "intentType": {
            "type": "string",
            "description": "Payment intent type",
            "enum": [
              "ad-hoc",
              "installment",
              "step",
              "portal",
              "ecommerce",
              "subscription",
              "early-payoff"
            ],
            "example": "ad-hoc"
          },
          "subscription": {
            "description": "Populated subscription reference",
            "allOf": [
              {
                "$ref": "#/components/schemas/PISubscription"
              }
            ]
          }
        },
        "required": [
          "_id",
          "status",
          "currency"
        ]
      },
      "CreatePaymentIndentDescriptionDto": {
        "type": "object",
        "properties": {
          "internal": {
            "type": "string",
            "description": "This description will only be visible to users.",
            "example": "Internal note: client prefers bank transfer"
          },
          "external": {
            "type": "string",
            "description": "This description may be publicly visible to the contact.",
            "example": "Invoice #1234 payment"
          }
        }
      },
      "CreatePaymentIndentConditionnDto": {
        "type": "object",
        "properties": {
          "step": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          }
        }
      },
      "CreatePaymentIndentWithServiceDto": {
        "type": "object",
        "properties": {
          "service": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "template": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "partnership": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          }
        },
        "required": [
          "service",
          "template"
        ]
      },
      "CreatePaymentItemDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Website Design"
          },
          "description": {
            "type": "string",
            "example": "Website redesign project - Phase 1"
          },
          "amount": {
            "type": "number",
            "minimum": -999999999,
            "maximum": 999999999,
            "example": 2500
          },
          "order": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "orderItem": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "service": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "category": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "amount"
        ]
      },
      "CreateQuoteDto": {
        "type": "object",
        "properties": {
          "sourceCurrency": {
            "type": "object",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "targetCurrency": {
            "type": "object",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "USD"
          },
          "sourceAmount": {
            "type": "number",
            "example": 5000
          },
          "targetAmount": {
            "type": "number",
            "example": 3750
          },
          "rate": {
            "type": "number",
            "example": 0.75
          },
          "markup": {
            "$ref": "#/components/schemas/MarkupDto"
          }
        },
        "required": [
          "sourceCurrency",
          "targetCurrency",
          "sourceAmount",
          "targetAmount",
          "rate"
        ]
      },
      "CreatePaymentIntentDto": {
        "type": "object",
        "properties": {
          "number": {
            "type": "string",
            "pattern": "/^[A-Za-z0-9._-]+$/",
            "description": "If no number is provided, an unique number will be generated. Allowed characters: letters, digits, dots, underscores, hyphens. Must not start with \"QLY-PYMT-\" (reserved).",
            "example": "PI-001"
          },
          "intentType": {
            "type": "string",
            "enum": [
              "ad-hoc",
              "installment",
              "step",
              "portal",
              "ecommerce",
              "subscription",
              "early-payoff"
            ],
            "description": "If the payment is part of a set of paments (payment plan), use the \"installment\" type. This property is important for accurate reporting and analytics.",
            "default": "ad-hoc"
          },
          "contact": {
            "type": "string",
            "description": "The ID of the contact which the payment will be associated with.",
            "example": "507f1f77bcf86cd799439011"
          },
          "order": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "orderItems": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "settlementCurrency": {
            "type": "string",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW",
              null
            ],
            "example": "USD"
          },
          "tax": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "dueAt": {
            "format": "date-time",
            "type": "string",
            "description": "The due date is uses for automatic payment reminders and analytics.",
            "example": "2024-01-15T09:30:00.000Z"
          },
          "custom": {
            "type": "object",
            "additionalProperties": true,
            "description": "Use this property to store custom data. It will only be visible to the user if a Custom Field with the same name is present."
          },
          "suppliers": {
            "description": "Qualy will transfer all payment items to this partnership, unless a payment split is present.",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "branding": {
            "type": "string",
            "description": "The logo, and colors of this partnership will be used to brand the payment link.",
            "example": "507f1f77bcf86cd799439011"
          },
          "template": {
            "type": "string",
            "description": "Optional template ID to link this payment intent to a suggested template. Used for analytics only.",
            "example": "507f1f77bcf86cd799439011"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "example": "2024-01-15T09:30:00.000Z"
          },
          "description": {
            "$ref": "#/components/schemas/CreatePaymentIndentDescriptionDto"
          },
          "condition": {
            "$ref": "#/components/schemas/CreatePaymentIndentConditionnDto"
          },
          "services": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreatePaymentIndentWithServiceDto"
            }
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreatePaymentItemDto"
            }
          },
          "quote": {
            "$ref": "#/components/schemas/CreateQuoteDto"
          }
        },
        "required": [
          "intentType",
          "contact"
        ]
      },
      "CreateEarlyPayoffDto": {
        "type": "object",
        "properties": {
          "quote": {
            "$ref": "#/components/schemas/CreateQuoteDto"
          },
          "contact": {
            "type": "string"
          }
        },
        "required": [
          "contact"
        ]
      },
      "SuggestedPaymentItemDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Item name",
            "example": "Website Design"
          },
          "description": {
            "type": "string",
            "description": "User-friendly description of the payment",
            "example": "Initial design and discovery work"
          }
        },
        "required": [
          "name",
          "description"
        ]
      },
      "GenerateSuggestionsPayloadDto": {
        "type": "object",
        "properties": {
          "suggestions": {
            "description": "Suggested payment items",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SuggestedPaymentItemDto"
            }
          }
        },
        "required": [
          "suggestions"
        ]
      },
      "GeneratePaymentIntentDto": {
        "type": "object",
        "properties": {
          "process": {
            "type": "string"
          }
        },
        "required": [
          "process"
        ]
      },
      "OrderRefPayloadDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Order ID (MongoDB ObjectId)",
            "example": "507f1f77bcf86cd799439011"
          },
          "number": {
            "type": "string",
            "description": "Order number",
            "example": "1042"
          }
        },
        "required": [
          "_id",
          "number"
        ]
      },
      "SubscriptionRefDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Subscription ID (MongoDB ObjectId)",
            "example": "507f1f77bcf86cd799439011"
          },
          "name": {
            "type": "string",
            "description": "Subscription name",
            "example": "Monthly Plan"
          },
          "status": {
            "type": "string",
            "description": "Subscription status",
            "example": "active"
          }
        },
        "required": [
          "_id"
        ]
      },
      "PaymentIntentListPayloadDto": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "example": 5000
          },
          "total": {
            "type": "number",
            "example": 5500
          },
          "due": {
            "type": "number",
            "example": 5500
          },
          "taxTotal": {
            "type": "number",
            "example": 500
          },
          "condition": {
            "type": "object",
            "description": "Condition for step-based payment intents",
            "additionalProperties": true
          },
          "contact": {
            "description": "Contact reference (raw ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/ContactRefDto"
              }
            ]
          },
          "order": {
            "description": "Order reference (raw ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/OrderRefPayloadDto"
              }
            ]
          },
          "orderItems": {
            "description": "Order item IDs associated with this payment intent",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string",
            "description": "Payment intent status",
            "enum": [
              "added",
              "requires-condition",
              "due",
              "overdue",
              "canceled",
              "review-pending",
              "paid-partial",
              "paid-full",
              "processing",
              "refunded-partial",
              "refunded-full"
            ],
            "example": "pending"
          },
          "currency": {
            "type": "string",
            "description": "Currency code (ISO 4217)",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "settlementCurrency": {
            "type": "string",
            "nullable": true,
            "description": "Settlement currency code (ISO 4217)",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "paidAt": {
            "format": "date-time",
            "type": "string"
          },
          "canceledAt": {
            "format": "date-time",
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "dueAt": {
            "format": "date-time",
            "type": "string"
          },
          "tax": {
            "description": "Tax applied to this payment intent (populated even in list)",
            "allOf": [
              {
                "$ref": "#/components/schemas/PaymentIntentTaxRefDto"
              }
            ]
          },
          "transactions": {
            "description": "Transaction IDs associated with this payment intent",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "number": {
            "type": "string"
          },
          "paymentSplits": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "custom": {
            "type": "object",
            "description": "Custom metadata object",
            "additionalProperties": true
          },
          "fees": {
            "type": "object",
            "description": "Fee breakdown",
            "additionalProperties": true
          },
          "description": {
            "type": "object",
            "description": "Payment description (internal/external)",
            "additionalProperties": true
          },
          "links": {
            "type": "object",
            "description": "Payment links",
            "additionalProperties": true
          },
          "suppliers": {
            "description": "Partnership IDs acting as suppliers",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "branding": {
            "type": "string",
            "description": "Partnership ID used for branding",
            "example": "507f1f77bcf86cd799439011"
          },
          "authorizations": {
            "description": "Gateway authorization IDs",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "primaryTeams": {
            "description": "Primary team IDs",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "owners": {
            "description": "Owner user IDs",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "partnerships": {
            "description": "Partnership IDs",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "intentType": {
            "type": "string",
            "description": "Type of payment intent",
            "enum": [
              "ad-hoc",
              "installment",
              "step",
              "portal",
              "ecommerce",
              "subscription",
              "early-payoff"
            ],
            "example": "ad-hoc"
          },
          "subscription": {
            "description": "Subscription reference (raw ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/SubscriptionRefDto"
              }
            ]
          }
        },
        "required": [
          "amount",
          "total",
          "due",
          "status",
          "currency",
          "createdAt",
          "number",
          "paymentSplits"
        ]
      },
      "BreakdownItemDto": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "example": 250000
          },
          "nPayments": {
            "type": "number",
            "example": 42
          }
        },
        "required": [
          "amount",
          "nPayments"
        ]
      },
      "BreakdownDto": {
        "type": "object",
        "properties": {
          "added": {
            "$ref": "#/components/schemas/BreakdownItemDto"
          },
          "requires-condition": {
            "$ref": "#/components/schemas/BreakdownItemDto"
          },
          "due": {
            "$ref": "#/components/schemas/BreakdownItemDto"
          },
          "overdue": {
            "$ref": "#/components/schemas/BreakdownItemDto"
          },
          "review-pending": {
            "$ref": "#/components/schemas/BreakdownItemDto"
          },
          "paid-partial": {
            "$ref": "#/components/schemas/BreakdownItemDto"
          },
          "paid-full": {
            "$ref": "#/components/schemas/BreakdownItemDto"
          },
          "refunded-full": {
            "$ref": "#/components/schemas/BreakdownItemDto"
          },
          "refunded-partial": {
            "$ref": "#/components/schemas/BreakdownItemDto"
          }
        },
        "required": [
          "added",
          "requires-condition",
          "due",
          "overdue",
          "review-pending",
          "paid-partial",
          "paid-full",
          "refunded-full",
          "refunded-partial"
        ]
      },
      "GroupResultDto": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "example": "AUD"
          },
          "nPayments": {
            "type": "number",
            "example": 42
          },
          "total": {
            "type": "number",
            "example": 250000
          },
          "breakdown": {
            "$ref": "#/components/schemas/BreakdownDto"
          }
        },
        "required": [
          "currency",
          "nPayments",
          "total",
          "breakdown"
        ]
      },
      "StatsPayloadDto": {
        "type": "object",
        "properties": {
          "orderId": {
            "type": "string"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GroupResultDto"
            }
          }
        },
        "required": [
          "results"
        ]
      },
      "MonthlyResultDto": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "example": "AUD"
          },
          "nPayments": {
            "type": "number",
            "example": 42
          },
          "total": {
            "type": "number",
            "example": 250000
          },
          "year": {
            "type": "number",
            "example": 2026
          },
          "month": {
            "type": "number",
            "example": 3
          },
          "breakdown": {
            "$ref": "#/components/schemas/BreakdownDto"
          }
        },
        "required": [
          "currency",
          "nPayments",
          "total",
          "year",
          "month",
          "breakdown"
        ]
      },
      "MonthlyStatsPayloadDto": {
        "type": "object",
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GroupResultDto"
            }
          },
          "monthlyResults": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MonthlyResultDto"
            }
          }
        },
        "required": [
          "results",
          "monthlyResults"
        ]
      },
      "BehaviorStatsPayloadDto": {
        "type": "object",
        "properties": {}
      },
      "PdfUrlPayloadDto": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "Signed URL to the generated PDF file",
            "example": "https://storage.googleapis.com/bucket/receipts/abc123?X-Goog-Signature=..."
          }
        },
        "required": [
          "url"
        ]
      },
      "StatementDto": {
        "type": "object",
        "properties": {
          "orderItemIds": {
            "description": "Optional array of order item IDs to include in the statement",
            "example": [
              "507f1f77bcf86cd799439011",
              "507f1f77bcf86cd799439012"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "UpdatePaymentItemDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Website Design"
          },
          "description": {
            "type": "string",
            "example": "Website redesign project - Phase 1"
          },
          "amount": {
            "type": "number",
            "minimum": -999999999,
            "maximum": 999999999,
            "example": 2500
          },
          "category": {
            "type": "string"
          }
        }
      },
      "UpdatePaymentIntentDto": {
        "type": "object",
        "properties": {
          "tax": {
            "type": "string",
            "description": "Tax configuration to apply to the payment intent",
            "example": "507f1f77bcf86cd799439011"
          },
          "dueAt": {
            "format": "date-time",
            "type": "string",
            "description": "Due date for the payment",
            "example": "2026-12-31T00:00:00.000Z"
          },
          "custom": {
            "type": "object",
            "additionalProperties": true,
            "description": "Custom metadata object for additional information",
            "example": {
              "customField": "value"
            }
          },
          "suppliers": {
            "description": "Qualy will transfer all payment items to this partnership, unless a payment split is present.",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "branding": {
            "type": "string",
            "description": "The logo, and colors of this partnership will be used to brand the payment link.",
            "example": "507f1f77bcf86cd799439011"
          },
          "settlementCurrency": {
            "type": "string",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "description": "Settlement currency for FX quotes (currency in which the payment will be settled)",
            "example": "EUR"
          },
          "number": {
            "type": "string",
            "pattern": "/^[A-Za-z0-9._-]+$/",
            "description": "Optionally change the number of the payment intent. Must be unique. Allowed characters: letters, digits, dots, underscores, hyphens. Must not start with \"QLY-PYMT-\" (reserved).",
            "example": "PI-001"
          },
          "quote": {
            "description": "Manual quote object to create or update the payment intent quote",
            "allOf": [
              {
                "$ref": "#/components/schemas/CreateQuoteDto"
              }
            ]
          },
          "order": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "orderItems": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "description": {
            "$ref": "#/components/schemas/CreatePaymentIndentDescriptionDto"
          }
        }
      },
      "CancelPaymentIntentDto": {
        "type": "object",
        "properties": {
          "cancelationReason": {
            "type": "string",
            "enum": [
              "duplicate",
              "fraudulent",
              "abandoned",
              "requested-by-customer",
              "changed-service",
              "not-eligible-for-service",
              "void-invoice",
              "bad-debt",
              "other"
            ]
          }
        },
        "required": [
          "cancelationReason"
        ]
      },
      "PartnershipRefDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Partnership ID (MongoDB ObjectId)",
            "example": "507f1f77bcf86cd799439011"
          },
          "name": {
            "type": "string",
            "description": "Partnership name",
            "example": "Acme Corp"
          },
          "logo": {
            "type": "string",
            "description": "Partnership logo path",
            "example": "c/logos/acme"
          },
          "websiteUrl": {
            "type": "string",
            "description": "Partnership website URL",
            "example": "https://acme.com"
          }
        },
        "required": [
          "_id",
          "name"
        ]
      },
      "StepMetaDto": {
        "type": "object",
        "properties": {
          "skippable": {
            "type": "boolean",
            "description": "Whether this step can be skipped",
            "example": false
          },
          "nps": {
            "type": "boolean",
            "description": "Whether NPS is enabled for this step",
            "example": true
          },
          "requirePayment": {
            "type": "boolean",
            "description": "Whether payment is required at this step",
            "example": false
          },
          "restrictBackMovement": {
            "type": "boolean",
            "description": "Whether backward movement is restricted",
            "example": false
          },
          "requireFormSubmission": {
            "type": "boolean",
            "description": "Whether a form submission is required",
            "example": false
          }
        }
      },
      "StepPaymentDto": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "description": "Payment amount in cents",
            "example": 5000
          },
          "currency": {
            "type": "string",
            "description": "Currency code (ISO 4217)",
            "example": "AUD"
          },
          "options": {
            "type": "array",
            "description": "Payment options",
            "items": {
              "type": "string",
              "enum": [
                "card",
                "invoice"
              ]
            }
          },
          "billingScheme": {
            "type": "string",
            "description": "Billing scheme",
            "enum": [
              "one-time",
              "recurring"
            ],
            "example": "one-time"
          }
        }
      },
      "StepDueDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "Due type",
            "enum": [
              "rolling",
              "fixed"
            ],
            "example": "rolling"
          },
          "unit": {
            "type": "string",
            "description": "Due unit",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year"
            ],
            "example": "day"
          },
          "date": {
            "format": "date-time",
            "type": "string",
            "description": "Fixed due date",
            "example": "2024-02-28T00:00:00.000Z"
          },
          "value": {
            "type": "number",
            "description": "Due value (number of units)",
            "example": 7
          }
        }
      },
      "StepPayloadDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Step ID (MongoDB ObjectId)",
            "example": "507f1f77bcf86cd799439011"
          },
          "name": {
            "type": "string",
            "description": "Step name",
            "example": "Onboarding"
          },
          "description": {
            "type": "string",
            "description": "Step description",
            "example": "Initial consultation and requirements gathering"
          },
          "index": {
            "type": "number",
            "description": "Step index (order position)",
            "example": 0
          },
          "meta": {
            "description": "Step meta configuration",
            "allOf": [
              {
                "$ref": "#/components/schemas/StepMetaDto"
              }
            ]
          },
          "payment": {
            "description": "Step payment configuration",
            "allOf": [
              {
                "$ref": "#/components/schemas/StepPaymentDto"
              }
            ]
          },
          "due": {
            "description": "Step due date configuration",
            "allOf": [
              {
                "$ref": "#/components/schemas/StepDueDto"
              }
            ]
          }
        },
        "required": [
          "_id",
          "name",
          "index"
        ]
      },
      "Availability": {
        "type": "object",
        "properties": {
          "controlType": {
            "type": "string",
            "enum": [
              "no-availability-control",
              "stop-purchase-on-max-capacity",
              null
            ]
          },
          "maxCapacity": {
            "type": "number"
          },
          "currentCapacity": {
            "type": "number"
          }
        }
      },
      "ServiceDetailPayloadDto": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "example": "Professional web design and development services"
          },
          "websiteUrl": {
            "type": "string",
            "example": "https://acme.com/services"
          },
          "name": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "Service status",
            "enum": [
              "active",
              "archived"
            ],
            "example": "active"
          },
          "locale": {
            "type": "string"
          },
          "steps": {
            "description": "Steps for this service (populated, sorted by index)",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StepPayloadDto"
            }
          },
          "logo": {
            "type": "string"
          },
          "repeatPurchase": {
            "type": "boolean"
          },
          "requireSupplier": {
            "type": "boolean"
          },
          "supplier": {
            "description": "Supplier partnership reference",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/PartnershipRefDto"
              }
            ]
          },
          "displayPortal": {
            "type": "boolean"
          },
          "displayEcommerce": {
            "type": "boolean"
          },
          "availability": {
            "$ref": "#/components/schemas/Availability"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "createdBy": {
            "description": "User who created this service (populated)",
            "allOf": [
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          }
        },
        "required": [
          "name",
          "status",
          "steps",
          "repeatPurchase",
          "requireSupplier",
          "displayPortal",
          "updatedAt"
        ]
      },
      "CreateServiceStepDueDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "rolling",
              "fixed"
            ]
          },
          "unit": {
            "type": "string",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year"
            ]
          },
          "date": {
            "format": "date-time",
            "type": "string"
          },
          "value": {
            "type": "number",
            "minimum": 0
          }
        },
        "required": [
          "type",
          "unit",
          "date",
          "value"
        ]
      },
      "CreateServiceMetaDto": {
        "type": "object",
        "properties": {
          "skippable": {
            "type": "boolean"
          },
          "nps": {
            "type": "boolean"
          },
          "requirePayment": {
            "type": "boolean"
          },
          "restrictBackMovement": {
            "type": "boolean"
          },
          "requireFormSubmission": {
            "type": "boolean"
          }
        },
        "required": [
          "skippable",
          "nps",
          "requirePayment",
          "restrictBackMovement",
          "requireFormSubmission"
        ]
      },
      "CreateServicePaymentDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Initial Consultation"
          },
          "description": {
            "type": "string",
            "example": "Initial consultation and requirements gathering"
          },
          "amount": {
            "type": "number",
            "example": 5000
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "options": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "card",
                "invoice"
              ]
            }
          },
          "billingScheme": {
            "type": "string",
            "enum": [
              "one-time",
              "recurring"
            ]
          }
        },
        "required": [
          "amount",
          "currency",
          "billingScheme"
        ]
      },
      "CreateServiceStepDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Initial Consultation"
          },
          "description": {
            "type": "string",
            "example": "Initial consultation and requirements gathering"
          },
          "forms": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          },
          "due": {
            "$ref": "#/components/schemas/CreateServiceStepDueDto"
          },
          "meta": {
            "$ref": "#/components/schemas/CreateServiceMetaDto"
          },
          "payment": {
            "$ref": "#/components/schemas/CreateServicePaymentDto"
          }
        },
        "required": [
          "name",
          "meta"
        ]
      },
      "CreateServiceAvailabilityDto": {
        "type": "object",
        "properties": {
          "controlType": {
            "type": "string",
            "enum": [
              "no-availability-control",
              "stop-purchase-on-max-capacity",
              null
            ]
          },
          "maxCapacity": {
            "type": "number"
          },
          "currentCapacity": {
            "type": "number"
          }
        }
      },
      "CreateServiceDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Website Design"
          },
          "description": {
            "type": "string",
            "example": "Professional web design and development services"
          },
          "supplier": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "websiteUrl": {
            "type": "string",
            "format": "uri",
            "example": "https://acme.com/services"
          },
          "sku": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "repeatPurchase": {
            "type": "string"
          },
          "requireSupplier": {
            "type": "string"
          },
          "displayPortal": {
            "type": "boolean"
          },
          "displayEcommerce": {
            "type": "boolean"
          },
          "logo": {
            "type": "string"
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateServiceStepDto"
            }
          },
          "availability": {
            "$ref": "#/components/schemas/CreateServiceAvailabilityDto"
          }
        }
      },
      "ServiceListPayloadDto": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "example": "Professional web design and development services"
          },
          "websiteUrl": {
            "type": "string",
            "example": "https://acme.com/services"
          },
          "name": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "Service status",
            "enum": [
              "active",
              "archived"
            ],
            "example": "active"
          },
          "locale": {
            "type": "string"
          },
          "steps": {
            "description": "Step IDs associated with this service",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "logo": {
            "type": "string"
          },
          "repeatPurchase": {
            "type": "boolean"
          },
          "requireSupplier": {
            "type": "boolean"
          },
          "supplier": {
            "description": "Supplier partnership reference",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/PartnershipRefDto"
              }
            ]
          },
          "displayPortal": {
            "type": "boolean"
          },
          "displayEcommerce": {
            "type": "boolean"
          },
          "availability": {
            "$ref": "#/components/schemas/Availability"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "name",
          "status",
          "steps",
          "repeatPurchase",
          "requireSupplier",
          "displayPortal",
          "updatedAt"
        ]
      },
      "UpdateServiceDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Website Design"
          },
          "description": {
            "type": "string",
            "example": "Professional web design and development services"
          },
          "supplier": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "websiteUrl": {
            "type": "string",
            "format": "uri",
            "example": "https://acme.com/services"
          },
          "sku": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "repeatPurchase": {
            "type": "string"
          },
          "requireSupplier": {
            "type": "string"
          },
          "displayPortal": {
            "type": "boolean"
          },
          "displayEcommerce": {
            "type": "boolean"
          },
          "logo": {
            "type": "string"
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateServiceStepDto"
            }
          },
          "availability": {
            "$ref": "#/components/schemas/CreateServiceAvailabilityDto"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          }
        }
      },
      "GenerateStepsDto": {
        "type": "object",
        "properties": {
          "process": {
            "type": "string"
          },
          "save": {
            "type": "boolean"
          }
        },
        "required": [
          "process"
        ]
      },
      "UpdateStepDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Initial Consultation"
          },
          "description": {
            "type": "string",
            "example": "Initial consultation and requirements gathering"
          },
          "forms": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          },
          "due": {
            "$ref": "#/components/schemas/CreateServiceStepDueDto"
          },
          "meta": {
            "$ref": "#/components/schemas/CreateServiceMetaDto"
          },
          "payment": {
            "$ref": "#/components/schemas/CreateServicePaymentDto"
          },
          "index": {
            "type": "number",
            "minimum": 0
          }
        }
      },
      "ActivityDetailPayloadDto": {
        "type": "object",
        "properties": {
          "targetType": {
            "type": "string",
            "description": "Target entity type",
            "enum": [
              "contact",
              "event",
              "service",
              "paymentIntent",
              "paymentSplit",
              "transaction",
              "orderItem",
              "partnership",
              "ingestJob"
            ],
            "example": "contact"
          },
          "targetId": {
            "type": "string"
          },
          "public": {
            "type": "boolean"
          },
          "category": {
            "type": "string",
            "description": "Activity category",
            "enum": [
              "lead-status-update",
              "create",
              "transaction-add",
              "total-update",
              "status-update",
              "tags-update",
              "internal-comment",
              "external-comment",
              "user-add",
              "user-remove",
              "team-add",
              "team-remove",
              "task-add",
              "task-complete",
              "service-add",
              "service-remove",
              "pre-processing",
              "processing"
            ],
            "example": "create"
          },
          "createdBy": {
            "description": "User who created this activity (populated)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ],
            "allOf": [
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "service": {
            "type": "string"
          },
          "team": {
            "description": "Team associated with this activity (populated)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/TeamRefDto"
              }
            ],
            "allOf": [
              {
                "$ref": "#/components/schemas/TeamRefDto"
              }
            ]
          },
          "user": {
            "description": "User associated with this activity (populated)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ],
            "allOf": [
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "status": {
            "type": "string"
          },
          "comment": {
            "type": "string"
          },
          "removedTags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "transactionType": {
            "type": "string",
            "description": "Transaction type",
            "enum": [
              "charge",
              "refund"
            ],
            "example": "charge"
          },
          "total": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "description": "Currency code (ISO 4217)",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "leadStatus": {
            "type": "string"
          },
          "addedTags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "traces": {
            "type": "array",
            "description": "Activity traces",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "nTraces": {
            "type": "number"
          }
        },
        "required": [
          "targetType",
          "targetId",
          "public",
          "category",
          "removedTags",
          "addedTags",
          "nTraces"
        ]
      },
      "CreateActivityDto": {
        "type": "object",
        "properties": {
          "targetId": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "total": {
            "type": "number",
            "example": 5000
          },
          "currency": {
            "type": "string",
            "example": "AUD"
          },
          "team": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "user": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "task": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "service": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "trace": {
            "type": "object",
            "description": "Trace definition to create with the activity",
            "additionalProperties": true
          },
          "targetType": {
            "type": "string",
            "enum": [
              "contact",
              "event",
              "service",
              "paymentIntent",
              "paymentSplit",
              "transaction",
              "orderItem",
              "partnership",
              "ingestJob"
            ]
          },
          "category": {
            "type": "string",
            "enum": [
              "lead-status-update",
              "create",
              "transaction-add",
              "total-update",
              "status-update",
              "tags-update",
              "internal-comment",
              "external-comment",
              "user-add",
              "user-remove",
              "team-add",
              "team-remove",
              "task-add",
              "task-complete",
              "service-add",
              "service-remove",
              "pre-processing",
              "processing"
            ]
          },
          "leadStatus": {
            "type": "string",
            "enum": [
              "nurture",
              "mql",
              "pql",
              "new",
              "assigned",
              "in-progress",
              "sql",
              "unqualified",
              "no-response",
              "closed-won",
              "closed-lost"
            ]
          },
          "status": {
            "type": "string"
          },
          "transactionType": {
            "type": "string",
            "enum": [
              "charge",
              "refund"
            ]
          },
          "addedTags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "removedTags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "comment": {
            "type": "string"
          },
          "temporaryId": {
            "type": "string",
            "description": "Optional gateway transaction ID for pre-transaction activities.\nUsed to link activities created before a transaction exists."
          }
        },
        "required": [
          "targetId",
          "targetType",
          "category"
        ]
      },
      "ActivityListPayloadDto": {
        "type": "object",
        "properties": {
          "targetType": {
            "type": "string",
            "description": "Target entity type",
            "enum": [
              "contact",
              "event",
              "service",
              "paymentIntent",
              "paymentSplit",
              "transaction",
              "orderItem",
              "partnership",
              "ingestJob"
            ],
            "example": "contact"
          },
          "targetId": {
            "type": "string"
          },
          "public": {
            "type": "boolean"
          },
          "category": {
            "type": "string",
            "description": "Activity category",
            "enum": [
              "lead-status-update",
              "create",
              "transaction-add",
              "total-update",
              "status-update",
              "tags-update",
              "internal-comment",
              "external-comment",
              "user-add",
              "user-remove",
              "team-add",
              "team-remove",
              "task-add",
              "task-complete",
              "service-add",
              "service-remove",
              "pre-processing",
              "processing"
            ],
            "example": "create"
          },
          "createdBy": {
            "description": "User who created this activity",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "service": {
            "type": "string"
          },
          "team": {
            "description": "Team reference",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/TeamRefDto"
              }
            ]
          },
          "user": {
            "description": "User reference",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "status": {
            "type": "string"
          },
          "comment": {
            "type": "string"
          },
          "removedTags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "transactionType": {
            "type": "string",
            "description": "Transaction type",
            "enum": [
              "charge",
              "refund"
            ],
            "example": "charge"
          },
          "total": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "description": "Currency code (ISO 4217)",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "leadStatus": {
            "type": "string"
          },
          "addedTags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "traces": {
            "type": "array",
            "description": "Activity traces",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "nTraces": {
            "type": "number"
          }
        },
        "required": [
          "targetType",
          "targetId",
          "public",
          "category",
          "createdBy",
          "removedTags",
          "addedTags",
          "nTraces"
        ]
      },
      "OrderDetailPayloadDto": {
        "type": "object",
        "properties": {
          "number": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "example": "Website Design"
          },
          "contact": {
            "description": "Contact associated with this order (populated)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/ContactRefDto"
              }
            ],
            "allOf": [
              {
                "$ref": "#/components/schemas/ContactRefDto"
              }
            ]
          },
          "source": {
            "type": "string",
            "description": "Order source channel",
            "enum": [
              "manual",
              "import",
              "portal",
              "ecommerce",
              "workflow"
            ],
            "example": "manual"
          },
          "services": {
            "description": "Services associated with this order (ObjectId references)",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string",
            "description": "Order status",
            "enum": [
              "creating",
              "active",
              "archived"
            ],
            "example": "active"
          },
          "stats": {
            "type": "object",
            "description": "Order statistics",
            "additionalProperties": true
          },
          "createdBy": {
            "description": "User who created this order (populated)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ],
            "allOf": [
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "items": {
            "description": "Order items (ObjectId references)",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "number",
          "name",
          "status"
        ]
      },
      "CreateOrderDto": {
        "type": "object",
        "properties": {
          "contact": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "services": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "custom": {
            "type": "object",
            "additionalProperties": true
          },
          "number": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "enum": [
              "manual",
              "import",
              "portal",
              "ecommerce",
              "workflow"
            ]
          }
        },
        "required": [
          "contact",
          "source"
        ]
      },
      "OrderListPayloadDto": {
        "type": "object",
        "properties": {
          "number": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "example": "Website Design"
          },
          "contact": {
            "description": "Contact reference",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/ContactRefDto"
              }
            ]
          },
          "source": {
            "type": "string",
            "description": "Order source channel",
            "enum": [
              "manual",
              "import",
              "portal",
              "ecommerce",
              "workflow"
            ],
            "example": "manual"
          },
          "services": {
            "description": "Services associated with this order (ObjectId references)",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string",
            "description": "Order status",
            "enum": [
              "creating",
              "active",
              "archived"
            ],
            "example": "active"
          },
          "stats": {
            "type": "object",
            "description": "Order statistics",
            "additionalProperties": true
          },
          "createdBy": {
            "description": "User who created this order",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "items": {
            "description": "Order items (ObjectId references)",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "number",
          "name",
          "contact",
          "status",
          "createdBy"
        ]
      },
      "ServiceRefDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Service ID (MongoDB ObjectId)",
            "example": "507f1f77bcf86cd799439011"
          },
          "name": {
            "type": "string",
            "description": "Service name",
            "example": "Web Development"
          }
        },
        "required": [
          "_id"
        ]
      },
      "OrderItemControlStepDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Step ID (MongoDB ObjectId)",
            "example": "507f1f77bcf86cd799439011"
          },
          "date": {
            "format": "date-time",
            "type": "string",
            "description": "Date the step was reached",
            "example": "2024-01-15T09:30:00.000Z"
          },
          "user": {
            "type": "string",
            "description": "User who triggered the step",
            "example": "507f1f77bcf86cd799439011"
          }
        },
        "required": [
          "_id"
        ]
      },
      "OrderItemControlDto": {
        "type": "object",
        "properties": {
          "currentStep": {
            "description": "Current active step",
            "allOf": [
              {
                "$ref": "#/components/schemas/OrderItemControlStepDto"
              }
            ]
          },
          "completedSteps": {
            "description": "Steps that have been completed",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderItemControlStepDto"
            }
          },
          "skippedSteps": {
            "description": "Steps that have been skipped",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderItemControlStepDto"
            }
          }
        }
      },
      "OrderItemListPayloadDto": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "example": "Monthly retainer for design services"
          },
          "notes": {
            "type": "string",
            "example": "Rush delivery requested"
          },
          "name": {
            "type": "string",
            "example": "Website Design"
          },
          "startAt": {
            "format": "date-time",
            "type": "string"
          },
          "endAt": {
            "format": "date-time",
            "type": "string"
          },
          "index": {
            "type": "number"
          },
          "contact": {
            "description": "Contact reference",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/ContactRefDto"
              }
            ]
          },
          "order": {
            "description": "Parent order reference",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/OrderRefPayloadDto"
              }
            ]
          },
          "service": {
            "description": "Service reference",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/ServiceRefDto"
              }
            ]
          },
          "status": {
            "type": "string",
            "description": "Order item workflow status",
            "enum": [
              "not-started",
              "in-progress",
              "done",
              "archived"
            ],
            "example": "in-progress"
          },
          "favorite": {
            "type": "boolean"
          },
          "owners": {
            "description": "Users who own this order item (ObjectId references)",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "primaryTeams": {
            "description": "Primary teams assigned to this order item (ObjectId references)",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "stats": {
            "type": "object",
            "properties": {
              "nSteps": {
                "type": "number"
              },
              "lastPayment": {
                "format": "date-time",
                "type": "string"
              },
              "isFirstOrder": {
                "type": "boolean"
              }
            },
            "required": [
              "nSteps",
              "lastPayment",
              "isFirstOrder"
            ]
          },
          "control": {
            "description": "Order item workflow control state",
            "allOf": [
              {
                "$ref": "#/components/schemas/OrderItemControlDto"
              }
            ]
          },
          "custom": {
            "type": "object",
            "description": "Custom freeform data",
            "additionalProperties": true
          },
          "health": {
            "type": "string",
            "description": "Order item health indicator",
            "enum": [
              "needs-attention",
              "good",
              "at-risk"
            ],
            "example": "good"
          },
          "supplier": {
            "description": "Supplier partnership reference",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/PartnershipRefDto"
              }
            ]
          }
        },
        "required": [
          "name",
          "contact",
          "order",
          "status",
          "health"
        ]
      },
      "OrderItemDetailPayloadDto": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "example": "Monthly retainer for design services"
          },
          "notes": {
            "type": "string",
            "example": "Rush delivery requested"
          },
          "name": {
            "type": "string",
            "example": "Website Design"
          },
          "startAt": {
            "format": "date-time",
            "type": "string"
          },
          "endAt": {
            "format": "date-time",
            "type": "string"
          },
          "index": {
            "type": "number"
          },
          "contact": {
            "description": "Contact associated with this order item (populated)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/ContactRefDto"
              }
            ],
            "allOf": [
              {
                "$ref": "#/components/schemas/ContactRefDto"
              }
            ]
          },
          "order": {
            "description": "Parent order (populated with number)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/OrderRefPayloadDto"
              }
            ],
            "allOf": [
              {
                "$ref": "#/components/schemas/OrderRefPayloadDto"
              }
            ]
          },
          "service": {
            "description": "Service reference",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/ServiceRefDto"
              }
            ]
          },
          "status": {
            "type": "string",
            "description": "Order item workflow status",
            "enum": [
              "not-started",
              "in-progress",
              "done",
              "archived"
            ],
            "example": "in-progress"
          },
          "favorite": {
            "type": "boolean"
          },
          "owners": {
            "description": "Users who own this order item (populated)",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserRefDto"
            }
          },
          "primaryTeams": {
            "description": "Primary teams assigned to this order item (ObjectId references)",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "stats": {
            "type": "object",
            "properties": {
              "nSteps": {
                "type": "number"
              },
              "lastPayment": {
                "format": "date-time",
                "type": "string"
              },
              "isFirstOrder": {
                "type": "boolean"
              }
            },
            "required": [
              "nSteps",
              "lastPayment",
              "isFirstOrder"
            ]
          },
          "control": {
            "description": "Order item workflow control state",
            "allOf": [
              {
                "$ref": "#/components/schemas/OrderItemControlDto"
              }
            ]
          },
          "custom": {
            "type": "object",
            "description": "Custom freeform data",
            "additionalProperties": true
          },
          "health": {
            "type": "string",
            "description": "Order item health indicator",
            "enum": [
              "needs-attention",
              "good",
              "at-risk"
            ],
            "example": "good"
          },
          "supplier": {
            "description": "Supplier partnership (populated with name and logo)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/PartnershipRefDto"
              }
            ],
            "allOf": [
              {
                "$ref": "#/components/schemas/PartnershipRefDto"
              }
            ]
          },
          "createdBy": {
            "description": "User who created this order item (populated)",
            "allOf": [
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          }
        },
        "required": [
          "name",
          "status",
          "health"
        ]
      },
      "CreateOrderItemDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Website Design"
          },
          "description": {
            "type": "string",
            "example": "Monthly retainer for design services"
          },
          "service": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "supplier": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "custom": {
            "type": "object",
            "additionalProperties": true
          },
          "startAt": {
            "format": "date-time",
            "type": "string"
          },
          "endAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "service"
        ]
      },
      "UpdateOrderItemDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Website Design"
          },
          "notes": {
            "type": "string",
            "example": "Rush delivery requested"
          },
          "supplier": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "owners": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "primaryTeams": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "custom": {
            "type": "object",
            "additionalProperties": true
          },
          "service": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "status": {
            "type": "string",
            "enum": [
              "not-started",
              "in-progress",
              "done",
              "archived"
            ]
          },
          "health": {
            "type": "string",
            "enum": [
              "needs-attention",
              "good",
              "at-risk"
            ]
          },
          "favorite": {
            "type": "boolean"
          }
        }
      },
      "ControlOrderItemDto": {
        "type": "object",
        "properties": {
          "moveToStep": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "pos": {
            "type": "number"
          }
        }
      },
      "SearchDto": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "maxLength": 225
          }
        },
        "required": [
          "query"
        ]
      },
      "SearchResultsDto": {
        "type": "object",
        "properties": {
          "hits": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "description": "Search result hits"
          },
          "page": {
            "type": "number",
            "example": 1
          },
          "nHits": {
            "type": "number",
            "example": 42
          },
          "nPages": {
            "type": "number",
            "example": 3
          },
          "hitsPerPage": {
            "type": "number",
            "example": 20
          },
          "processingTimeMs": {
            "type": "number",
            "example": 12
          },
          "queryId": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          }
        },
        "required": [
          "hits",
          "page",
          "nHits",
          "nPages",
          "hitsPerPage",
          "processingTimeMs",
          "queryId"
        ]
      },
      "SearchClickEventDto": {
        "type": "object",
        "properties": {
          "queryId": {
            "type": "string"
          },
          "objectId": {
            "type": "string"
          },
          "position": {
            "type": "number",
            "minimum": 1
          }
        },
        "required": [
          "queryId",
          "objectId",
          "position"
        ]
      },
      "ContactDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "Contact email address",
            "example": "team@example.com"
          },
          "phone": {
            "type": "string",
            "description": "Contact phone number",
            "example": "+1-555-123-4567"
          }
        }
      },
      "TeamPayloadDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Unique identifier for the team (MongoDB ObjectId)",
            "example": "507f1f77bcf86cd799439011"
          },
          "name": {
            "type": "string",
            "description": "Name of the team",
            "example": "Engineering"
          },
          "department": {
            "type": "string",
            "description": "Department the team belongs to",
            "enum": [
              "support",
              "sales",
              "accounting",
              "legal",
              "analytics",
              "hr",
              "operations",
              "marketing",
              "purchasing",
              "other"
            ],
            "example": "operations"
          },
          "status": {
            "type": "string",
            "description": "Status of the team",
            "enum": [
              "active",
              "archived"
            ],
            "example": "active"
          },
          "timeZone": {
            "type": "string",
            "description": "Timezone for the team (IANA timezone identifier)",
            "example": "America/New_York"
          },
          "preferredCurrency": {
            "type": "string",
            "description": "Preferred currency for the team (ISO 4217 currency code)",
            "example": "USD"
          },
          "preferredSettlementCurrency": {
            "type": "string",
            "description": "Preferred settlement currency for the team (ISO 4217 currency code)",
            "example": "USD"
          },
          "address": {
            "description": "Address information for the team",
            "allOf": [
              {
                "$ref": "#/components/schemas/AddressDto"
              }
            ]
          },
          "contact": {
            "description": "Contact information for the team",
            "allOf": [
              {
                "$ref": "#/components/schemas/ContactDto"
              }
            ]
          }
        },
        "required": [
          "_id",
          "name",
          "department",
          "status"
        ]
      },
      "TeamAddressDto": {
        "type": "object",
        "properties": {
          "country": {
            "type": "string"
          },
          "line1": {
            "type": "string"
          },
          "line2": {
            "type": "string"
          },
          "postalCode": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "city": {
            "type": "string"
          }
        }
      },
      "TeamContactDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "example": "team@example.com"
          },
          "phone": {
            "type": "string",
            "example": "+61 412 345 678"
          }
        }
      },
      "CreateTeamDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Engineering"
          },
          "department": {
            "type": "string",
            "enum": [
              "support",
              "sales",
              "accounting",
              "legal",
              "analytics",
              "hr",
              "operations",
              "marketing",
              "purchasing",
              "other"
            ]
          },
          "timeZone": {
            "type": "string"
          },
          "preferredCurrency": {
            "type": "string",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ]
          },
          "preferredSettlementCurrency": {
            "type": "string",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ]
          },
          "address": {
            "$ref": "#/components/schemas/TeamAddressDto"
          },
          "contact": {
            "$ref": "#/components/schemas/TeamContactDto"
          }
        },
        "required": [
          "name",
          "department"
        ]
      },
      "UpdateTeamDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Engineering"
          },
          "department": {
            "type": "string",
            "enum": [
              "support",
              "sales",
              "accounting",
              "legal",
              "analytics",
              "hr",
              "operations",
              "marketing",
              "purchasing",
              "other"
            ]
          },
          "timeZone": {
            "type": "string"
          },
          "preferredCurrency": {
            "type": "string",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ]
          },
          "preferredSettlementCurrency": {
            "type": "string",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ]
          },
          "address": {
            "$ref": "#/components/schemas/TeamAddressDto"
          },
          "contact": {
            "$ref": "#/components/schemas/TeamContactDto"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          }
        }
      },
      "ViewPayloadDto": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "example": "Filtered view of active orders"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "description": "Type of view (determines which entity list it applies to)",
            "enum": [
              "contacts",
              "orders",
              "payment-intents",
              "payment-splits",
              "bulk-operations"
            ],
            "example": "contacts"
          },
          "filters": {
            "type": "object",
            "description": "Freeform filter object",
            "additionalProperties": true
          },
          "dbSelectors": {
            "type": "object",
            "description": "Freeform database selector object",
            "additionalProperties": true
          },
          "sharingType": {
            "type": "string",
            "description": "Sharing visibility scope for this view",
            "enum": [
              "user-only",
              "all-teams",
              "specific-teams",
              "specific-users",
              "all-users",
              "workflow"
            ],
            "example": "user-only"
          },
          "users": {
            "description": "User IDs with access to this view",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "teams": {
            "description": "Team IDs with access to this view",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "name",
          "type",
          "sharingType"
        ]
      },
      "CreateViewDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Active Orders"
          },
          "description": {
            "type": "string",
            "example": "Filtered view of active orders"
          },
          "filters": {
            "type": "object",
            "additionalProperties": true
          },
          "dbSelectors": {
            "type": "object",
            "additionalProperties": true
          },
          "teams": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "users": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "type": {
            "type": "string",
            "enum": [
              "contacts",
              "orders",
              "payment-intents",
              "payment-splits",
              "bulk-operations"
            ]
          },
          "sharingType": {
            "type": "string",
            "enum": [
              "user-only",
              "all-teams",
              "specific-teams",
              "specific-users",
              "all-users",
              "workflow"
            ]
          }
        },
        "required": [
          "name",
          "type",
          "sharingType"
        ]
      },
      "UpdateViewDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Active Orders"
          },
          "description": {
            "type": "string",
            "example": "Filtered view of active orders"
          },
          "filters": {
            "type": "object",
            "additionalProperties": true
          },
          "dbSelectors": {
            "type": "object",
            "additionalProperties": true
          },
          "teams": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "users": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "type": {
            "type": "string",
            "enum": [
              "contacts",
              "orders",
              "payment-intents",
              "payment-splits",
              "bulk-operations"
            ]
          },
          "sharingType": {
            "type": "string",
            "enum": [
              "user-only",
              "all-teams",
              "specific-teams",
              "specific-users",
              "all-users",
              "workflow"
            ]
          }
        }
      },
      "UserOwnerRefDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "User ID (MongoDB ObjectId)",
            "example": "507f1f77bcf86cd799439011"
          },
          "profile": {
            "description": "User profile information",
            "allOf": [
              {
                "$ref": "#/components/schemas/UserProfileRefDto"
              }
            ]
          },
          "email": {
            "type": "string",
            "description": "User email address",
            "example": "user@example.com"
          },
          "primaryTeams": {
            "description": "Teams the user belongs to",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TeamRefDto"
            }
          }
        },
        "required": [
          "_id",
          "profile"
        ]
      },
      "Lead": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          }
        },
        "required": [
          "source"
        ]
      },
      "Stats": {
        "type": "object",
        "properties": {
          "session": {
            "type": "object",
            "properties": {
              "last": {
                "format": "date-time",
                "type": "string"
              }
            },
            "required": [
              "last"
            ]
          },
          "nps": {
            "type": "object",
            "properties": {
              "avg": {
                "type": "number"
              }
            },
            "required": [
              "avg"
            ]
          },
          "csat": {
            "type": "object",
            "properties": {
              "current": {
                "type": "string"
              }
            },
            "required": [
              "current"
            ]
          }
        }
      },
      "Ids": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "passport",
              "national-id",
              "birth-certificate",
              "resident-permit",
              "social-security-number",
              "drivers-license",
              "voter-id",
              "tax-id",
              "visa",
              "military-id",
              "student-id",
              "employee-id",
              "other"
            ]
          },
          "notes": {
            "type": "string",
            "example": "Preferred contact method: email"
          },
          "number": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "issueDate": {
            "format": "date-time",
            "type": "string"
          },
          "expiryDate": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "type",
          "number",
          "country"
        ]
      },
      "IntegrationLinks": {
        "type": "object",
        "properties": {
          "allyhub": {
            "type": "string",
            "example": "https://app.allyhub.co/contacts/123"
          },
          "hubspot": {
            "type": "string",
            "example": "https://app.hubspot.com/contacts/123"
          },
          "xero": {
            "type": "string",
            "example": "https://go.xero.com/Contacts/123"
          },
          "quickbooks": {
            "type": "string",
            "example": "https://app.qbo.intuit.com/customer/123"
          },
          "contaazul": {
            "type": "string",
            "example": "https://app.contaazul.com/contacts/123"
          },
          "mondaycom": {
            "type": "string",
            "example": "https://monday.com/contacts/123"
          },
          "rtoManager": {
            "type": "string",
            "example": "https://app.rtomanager.com.au/students/123"
          },
          "mailchimp": {
            "type": "string",
            "example": "https://us1.admin.mailchimp.com/lists/members/123"
          }
        }
      },
      "RelatedPerson": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "partner",
              "parent",
              "friend",
              "family",
              "colleague",
              "other"
            ]
          },
          "notes": {
            "type": "string",
            "example": "Preferred contact method: email"
          },
          "_id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "profile": {
            "$ref": "#/components/schemas/Profile"
          },
          "address": {
            "$ref": "#/components/schemas/AddressSchema"
          }
        },
        "required": [
          "type",
          "_id",
          "email",
          "profile",
          "address"
        ]
      },
      "NativeName": {
        "type": "object",
        "properties": {
          "notes": {
            "type": "string",
            "example": "Preferred contact method: email"
          },
          "locale": {
            "type": "string"
          },
          "firstName": {
            "type": "string"
          },
          "middleName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          }
        },
        "required": [
          "locale"
        ]
      },
      "ContactDetailPayloadDto": {
        "type": "object",
        "properties": {
          "notes": {
            "type": "string",
            "example": "Preferred contact method: email"
          },
          "number": {
            "type": "string"
          },
          "profile": {
            "$ref": "#/components/schemas/Profile"
          },
          "email": {
            "type": "string",
            "example": "contact@example.com"
          },
          "emailVerified": {
            "type": "boolean"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "owners": {
            "description": "Owners of this contact (populated with email, profile, primaryTeams)",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserOwnerRefDto"
            }
          },
          "primaryTeams": {
            "description": "Primary teams for this contact (populated with name, department)",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TeamRefDto"
            }
          },
          "custom": {
            "type": "object",
            "description": "Custom freeform data",
            "additionalProperties": true
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "leadStatus": {
            "type": "string",
            "description": "Lead status",
            "enum": [
              "nurture",
              "mql",
              "pql",
              "new",
              "assigned",
              "in-progress",
              "sql",
              "unqualified",
              "no-response",
              "closed-won",
              "closed-lost"
            ],
            "example": "assigned"
          },
          "lead": {
            "$ref": "#/components/schemas/Lead"
          },
          "preferences": {
            "$ref": "#/components/schemas/Preferences"
          },
          "type": {
            "type": "string"
          },
          "stats": {
            "$ref": "#/components/schemas/Stats"
          },
          "partnerships": {
            "description": "Partnerships associated with this contact (ObjectId references)",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "addresses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AddressSchema"
            }
          },
          "ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Ids"
            }
          },
          "integrationLinks": {
            "$ref": "#/components/schemas/IntegrationLinks"
          },
          "relatedPersons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RelatedPerson"
            }
          },
          "nativeNames": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NativeName"
            }
          },
          "status": {
            "type": "string",
            "description": "Contact status",
            "enum": [
              "active",
              "inactive"
            ],
            "example": "active"
          },
          "partnersReference": {
            "type": "object",
            "description": "Map of partnership IDs to reference values",
            "additionalProperties": {
              "type": "string"
            }
          },
          "createdBy": {
            "description": "User who created this contact (populated with profile)",
            "allOf": [
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          }
        },
        "required": [
          "number",
          "profile",
          "email",
          "emailVerified",
          "tags",
          "createdAt",
          "leadStatus",
          "type",
          "stats",
          "addresses",
          "ids",
          "integrationLinks",
          "relatedPersons",
          "nativeNames",
          "status"
        ]
      },
      "NativeNameDto": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "example": "Jane"
          },
          "lastName": {
            "type": "string",
            "example": "Smith"
          },
          "notes": {
            "type": "string",
            "example": "Preferred contact method: email"
          },
          "locale": {
            "type": "string"
          },
          "middleName": {
            "type": "string"
          }
        },
        "required": [
          "locale"
        ]
      },
      "ContactLeadDto": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          }
        },
        "required": [
          "source"
        ]
      },
      "ContactAddressDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "primary",
              "secondary",
              "office",
              "mailing",
              "emergency",
              "billing",
              "other"
            ]
          },
          "country": {
            "type": "string"
          },
          "line1": {
            "type": "string"
          },
          "line2": {
            "type": "string"
          },
          "postalCode": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "city": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "country"
        ]
      },
      "ContactIdDto": {
        "type": "object",
        "properties": {
          "notes": {
            "type": "string",
            "example": "Preferred contact method: email"
          },
          "type": {
            "type": "string",
            "enum": [
              "passport",
              "national-id",
              "birth-certificate",
              "resident-permit",
              "social-security-number",
              "drivers-license",
              "voter-id",
              "tax-id",
              "visa",
              "military-id",
              "student-id",
              "employee-id",
              "other"
            ]
          },
          "number": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "issueDate": {
            "format": "date-time",
            "type": "string"
          },
          "expiryDate": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "type",
          "country"
        ]
      },
      "ContactRelatedPersonDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "example": "contact@example.com"
          },
          "notes": {
            "type": "string",
            "example": "Preferred contact method: email"
          },
          "type": {
            "type": "string",
            "enum": [
              "partner",
              "parent",
              "friend",
              "family",
              "colleague",
              "other"
            ]
          },
          "profile": {
            "$ref": "#/components/schemas/UserProfileDto"
          },
          "address": {
            "$ref": "#/components/schemas/ContactAddressDto"
          }
        },
        "required": [
          "type",
          "profile"
        ]
      },
      "IntegrationLinksDto": {
        "type": "object",
        "properties": {
          "allyhub": {
            "type": "string",
            "format": "uri",
            "example": "https://app.allyhub.co/contacts/123"
          },
          "hubspot": {
            "type": "string",
            "format": "uri",
            "example": "https://app.hubspot.com/contacts/123"
          },
          "xero": {
            "type": "string",
            "format": "uri",
            "example": "https://go.xero.com/Contacts/123"
          },
          "quickbooks": {
            "type": "string",
            "format": "uri",
            "example": "https://app.qbo.intuit.com/customer/123"
          },
          "rtoManager": {
            "type": "string",
            "format": "uri",
            "example": "https://app.rtomanager.com.au/students/123"
          },
          "mailchimp": {
            "type": "string",
            "format": "uri",
            "example": "https://us1.admin.mailchimp.com/lists/members/123"
          }
        }
      },
      "CreateContactDto": {
        "type": "object",
        "properties": {
          "number": {
            "type": "string",
            "pattern": "/^[A-Za-z0-9._-]+$/",
            "description": "Optional human-readable contact number. If omitted, an auto-incremented value is generated. Allowed characters: letters, digits, dots, underscores, hyphens.",
            "example": "C-001"
          },
          "email": {
            "type": "string",
            "format": "email",
            "example": "contact@example.com"
          },
          "notes": {
            "type": "string",
            "example": "Preferred contact method: email"
          },
          "owners": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "primaryTeams": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "custom": {
            "type": "object",
            "additionalProperties": true
          },
          "profile": {
            "$ref": "#/components/schemas/UserProfileDto"
          },
          "nativeNames": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NativeNameDto"
            }
          },
          "preferences": {
            "$ref": "#/components/schemas/UserPreferencesDto"
          },
          "privacy": {
            "$ref": "#/components/schemas/UserPrivacyDto"
          },
          "leadStatus": {
            "type": "string",
            "enum": [
              "nurture",
              "mql",
              "pql",
              "new",
              "assigned",
              "in-progress",
              "sql",
              "unqualified",
              "no-response",
              "closed-won",
              "closed-lost"
            ]
          },
          "lead": {
            "$ref": "#/components/schemas/ContactLeadDto"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "addresses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactAddressDto"
            }
          },
          "ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactIdDto"
            }
          },
          "relatedPersons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactRelatedPersonDto"
            }
          },
          "integrationLinks": {
            "$ref": "#/components/schemas/IntegrationLinksDto"
          }
        },
        "required": [
          "email",
          "profile"
        ]
      },
      "ContactLoginDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "example": "contact@example.com"
          }
        },
        "required": [
          "email"
        ]
      },
      "ContactProfileDto": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "description": "First name",
            "example": "Jane"
          },
          "lastName": {
            "type": "string",
            "description": "Last name",
            "example": "Smith"
          },
          "dob": {
            "format": "date-time",
            "type": "string",
            "description": "Date of birth",
            "example": "1990-05-15T00:00:00.000Z"
          },
          "phone": {
            "type": "string",
            "description": "Phone number with country code",
            "example": "+1234567890"
          },
          "gender": {
            "type": "string",
            "description": "Gender",
            "example": "female"
          }
        }
      },
      "ContactSuggestionDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "Email address",
            "example": "contact@example.com"
          },
          "profile": {
            "description": "Contact profile data",
            "allOf": [
              {
                "$ref": "#/components/schemas/ContactProfileDto"
              }
            ]
          },
          "ids": {
            "description": "Identity documents",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactIdDto"
            }
          }
        },
        "required": [
          "profile",
          "ids"
        ]
      },
      "GenerateContactSuggestionsPayloadDto": {
        "type": "object",
        "properties": {
          "suggestions": {
            "description": "Extracted contact suggestions",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactSuggestionDto"
            }
          },
          "expressResult": {
            "type": "boolean",
            "description": "Whether express (non-thinkHarder) mode was used for extraction",
            "example": true
          },
          "processingTimeMs": {
            "type": "number",
            "description": "AI processing time in milliseconds",
            "example": 3200
          }
        },
        "required": [
          "suggestions"
        ]
      },
      "GenerateContactDto": {
        "type": "object",
        "properties": {
          "file": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "thinkHarder": {
            "type": "boolean",
            "description": "When true, uses Gemini 3 Flash instead of the default Groq models.\nIntended for retry flows when the first attempt produced poor or incomplete results."
          }
        },
        "required": [
          "file"
        ]
      },
      "MergeContactDto": {
        "type": "object",
        "properties": {
          "sourceContactId": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "destinationContactId": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          }
        },
        "required": [
          "sourceContactId",
          "destinationContactId"
        ]
      },
      "ContactListPayloadDto": {
        "type": "object",
        "properties": {
          "notes": {
            "type": "string",
            "example": "Preferred contact method: email"
          },
          "number": {
            "type": "string"
          },
          "profile": {
            "$ref": "#/components/schemas/Profile"
          },
          "email": {
            "type": "string",
            "example": "contact@example.com"
          },
          "emailVerified": {
            "type": "boolean"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "owners": {
            "description": "Owners of this contact (ObjectId references)",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "primaryTeams": {
            "description": "Primary teams assigned to this contact (ObjectId references)",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "custom": {
            "type": "object",
            "description": "Custom freeform data",
            "additionalProperties": true
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "leadStatus": {
            "type": "string",
            "description": "Lead status",
            "enum": [
              "nurture",
              "mql",
              "pql",
              "new",
              "assigned",
              "in-progress",
              "sql",
              "unqualified",
              "no-response",
              "closed-won",
              "closed-lost"
            ],
            "example": "assigned"
          },
          "lead": {
            "$ref": "#/components/schemas/Lead"
          },
          "preferences": {
            "$ref": "#/components/schemas/Preferences"
          },
          "type": {
            "type": "string"
          },
          "stats": {
            "$ref": "#/components/schemas/Stats"
          },
          "partnerships": {
            "description": "Partnerships associated with this contact (ObjectId references)",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "addresses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AddressSchema"
            }
          },
          "ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Ids"
            }
          },
          "integrationLinks": {
            "$ref": "#/components/schemas/IntegrationLinks"
          },
          "relatedPersons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RelatedPerson"
            }
          },
          "nativeNames": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NativeName"
            }
          },
          "status": {
            "type": "string",
            "description": "Contact status",
            "enum": [
              "active",
              "inactive"
            ],
            "example": "active"
          },
          "partnersReference": {
            "type": "object",
            "description": "Map of partnership IDs to reference values",
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "required": [
          "number",
          "profile",
          "email",
          "emailVerified",
          "tags",
          "createdAt",
          "leadStatus",
          "type",
          "stats",
          "addresses",
          "ids",
          "integrationLinks",
          "relatedPersons",
          "nativeNames",
          "status"
        ]
      },
      "UpdateContactDto": {
        "type": "object",
        "properties": {
          "number": {
            "type": "string",
            "pattern": "/^[A-Za-z0-9._-]+$/",
            "description": "Optional human-readable contact number. If omitted, an auto-incremented value is generated. Allowed characters: letters, digits, dots, underscores, hyphens.",
            "example": "C-001"
          },
          "email": {
            "type": "string",
            "format": "email",
            "example": "contact@example.com"
          },
          "notes": {
            "type": "string",
            "example": "Preferred contact method: email"
          },
          "owners": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "primaryTeams": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "custom": {
            "type": "object",
            "additionalProperties": true
          },
          "profile": {
            "$ref": "#/components/schemas/UserProfileDto"
          },
          "nativeNames": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NativeNameDto"
            }
          },
          "preferences": {
            "$ref": "#/components/schemas/UserPreferencesDto"
          },
          "privacy": {
            "$ref": "#/components/schemas/UserPrivacyDto"
          },
          "leadStatus": {
            "type": "string",
            "enum": [
              "nurture",
              "mql",
              "pql",
              "new",
              "assigned",
              "in-progress",
              "sql",
              "unqualified",
              "no-response",
              "closed-won",
              "closed-lost"
            ]
          },
          "lead": {
            "$ref": "#/components/schemas/ContactLeadDto"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "addresses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactAddressDto"
            }
          },
          "ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactIdDto"
            }
          },
          "relatedPersons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactRelatedPersonDto"
            }
          },
          "integrationLinks": {
            "$ref": "#/components/schemas/IntegrationLinksDto"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive"
            ]
          }
        }
      },
      "ViewAsPayloadContactDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "firstName": {
            "type": "string",
            "example": "Jane"
          },
          "lastName": {
            "type": "string",
            "example": "Smith"
          },
          "email": {
            "type": "string",
            "example": "contact@example.com"
          }
        },
        "required": [
          "_id",
          "firstName",
          "lastName",
          "email"
        ]
      },
      "ViewAsPayloadDto": {
        "type": "object",
        "properties": {
          "contact": {
            "$ref": "#/components/schemas/ViewAsPayloadContactDto"
          },
          "token": {
            "type": "string",
            "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
          }
        },
        "required": [
          "contact",
          "token"
        ]
      },
      "ImportOptionsDto": {
        "type": "object",
        "properties": {
          "dateFormat": {
            "type": "string",
            "description": "Date format for parsing imported data",
            "enum": [
              "DD/MM/YYYY",
              "MM/DD/YYYY",
              "YYYY-MM-DD"
            ],
            "example": "DD/MM/YYYY"
          }
        }
      },
      "ImportPayloadDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "Current status of the import job",
            "enum": [
              "pending",
              "in-progress",
              "failed",
              "completed"
            ],
            "example": "completed"
          },
          "options": {
            "description": "Import configuration options",
            "allOf": [
              {
                "$ref": "#/components/schemas/ImportOptionsDto"
              }
            ]
          },
          "stats": {
            "type": "object",
            "properties": {
              "nTotal": {
                "type": "number"
              },
              "nAdded": {
                "type": "number"
              },
              "nUpdated": {
                "type": "number"
              },
              "nSkipped": {
                "type": "number"
              },
              "nError": {
                "type": "number"
              }
            },
            "required": [
              "nTotal",
              "nAdded",
              "nUpdated",
              "nSkipped",
              "nError"
            ]
          },
          "entity": {
            "type": "string",
            "description": "Entity type being imported",
            "enum": [
              "contact",
              "payment-intent",
              "partnership",
              "transaction"
            ],
            "example": "contact"
          },
          "source": {
            "type": "string",
            "description": "Source type used for this import",
            "enum": [
              "file",
              "scrape"
            ],
            "example": "file"
          }
        },
        "required": [
          "name",
          "status",
          "entity",
          "source"
        ]
      },
      "CreateImportDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Import Contacts"
          },
          "entity": {
            "type": "string",
            "enum": [
              "contact",
              "payment-intent",
              "partnership",
              "transaction"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "file",
              "scrape"
            ]
          },
          "options": {
            "$ref": "#/components/schemas/ImportOptionsDto"
          },
          "payload": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImportPayloadDto"
            }
          }
        },
        "required": [
          "entity",
          "source",
          "options",
          "payload"
        ]
      },
      "GatewayAuthorizationRefDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Gateway authorization ID (MongoDB ObjectId)",
            "example": "507f1f77bcf86cd799439011"
          },
          "type": {
            "type": "string",
            "description": "Authorization type",
            "example": "card"
          },
          "status": {
            "type": "string",
            "description": "Authorization status",
            "example": "active"
          }
        },
        "required": [
          "_id"
        ]
      },
      "TaxRefPayloadDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Tax ID (MongoDB ObjectId)",
            "example": "507f1f77bcf86cd799439011"
          },
          "name": {
            "type": "string",
            "description": "Tax name",
            "example": "GST"
          },
          "description": {
            "type": "string",
            "description": "Tax description",
            "example": "Goods and Services Tax"
          },
          "percentage": {
            "type": "number",
            "description": "Tax percentage (0-1)",
            "example": 0.1
          },
          "inclusive": {
            "type": "boolean",
            "description": "Whether tax is inclusive",
            "example": true
          },
          "taxType": {
            "type": "string",
            "description": "Type of tax",
            "enum": [
              "vat",
              "sales-tax"
            ],
            "example": "vat"
          }
        },
        "required": [
          "_id",
          "name",
          "percentage",
          "inclusive"
        ]
      },
      "BulkRefPayloadDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Bulk operation ID (MongoDB ObjectId)",
            "example": "507f1f77bcf86cd799439011"
          },
          "name": {
            "type": "string",
            "description": "Bulk operation name",
            "example": "January Payouts"
          },
          "type": {
            "type": "string",
            "description": "Bulk operation type",
            "example": "payout"
          },
          "number": {
            "type": "number",
            "description": "Bulk operation number",
            "example": 1
          },
          "status": {
            "type": "string",
            "description": "Bulk operation status",
            "example": "completed"
          }
        },
        "required": [
          "_id"
        ]
      },
      "PaymentSplitDetailPayloadDto": {
        "type": "object",
        "properties": {
          "total": {
            "type": "number",
            "example": 5500
          },
          "amount": {
            "type": "number",
            "example": 5000
          },
          "description": {
            "type": "string",
            "example": "Revenue share for partner services"
          },
          "taxTotal": {
            "type": "number",
            "example": 500
          },
          "type": {
            "type": "string",
            "description": "Split type",
            "enum": [
              "percentage-on-amount",
              "percentage-on-splits",
              "fixed",
              "keep-percentage",
              "self",
              "supplier",
              "markup"
            ],
            "example": "self"
          },
          "number": {
            "type": "number"
          },
          "invoiceNumber": {
            "type": "string"
          },
          "ti": {
            "type": "boolean"
          },
          "rcti": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "keep": {
            "type": "number"
          },
          "ref": {
            "type": "string",
            "description": "Reference to another payment split",
            "example": "507f1f77bcf86cd799439011"
          },
          "currency": {
            "type": "string",
            "description": "Currency code (ISO 4217)",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "percentage": {
            "type": "number"
          },
          "dueAt": {
            "format": "date-time",
            "type": "string"
          },
          "paidAt": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "Payment split status",
            "enum": [
              "canceled",
              "pending",
              "processing",
              "due",
              "overdue",
              "review-pending",
              "failed",
              "paused",
              "paid"
            ],
            "example": "pending"
          },
          "partnership": {
            "description": "Partnership reference (raw ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/PartnershipRefDto"
              }
            ]
          },
          "item": {
            "type": "string",
            "description": "Payment intent item ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "tax": {
            "description": "Tax applied to this split (populated)",
            "example": "507f1f77bcf86cd799439011",
            "allOf": [
              {
                "$ref": "#/components/schemas/TaxRefPayloadDto"
              }
            ]
          },
          "paymentIntent": {
            "description": "Payment intent reference (raw ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/PaymentIntentRefDto"
              }
            ]
          },
          "authorization": {
            "description": "Authorization reference (raw ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/GatewayAuthorizationRefDto"
              }
            ]
          },
          "payoutMethod": {
            "type": "string",
            "description": "Payout method",
            "enum": [
              "manual",
              "automatic"
            ],
            "example": "automatic"
          },
          "contact": {
            "description": "Contact reference (raw ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/ContactRefDto"
              }
            ]
          },
          "split": {
            "type": "string",
            "description": "Partnership split configuration ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "createdBy": {
            "description": "User who created this split (raw ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "updatedBy": {
            "description": "User who last updated this split (raw ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "pendingReviewAt": {
            "format": "date-time",
            "type": "string"
          },
          "approvedAt": {
            "format": "date-time",
            "type": "string"
          },
          "approvedBy": {
            "description": "User who approved this split (populated)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ],
            "allOf": [
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "partnerReference": {
            "type": "string"
          },
          "failedAt": {
            "format": "date-time",
            "type": "string"
          },
          "payout": {
            "type": "string",
            "description": "Payout ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "primaryTeams": {
            "description": "Primary team IDs",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "bulk": {
            "description": "Bulk operation this split belongs to (populated)",
            "example": "507f1f77bcf86cd799439011",
            "allOf": [
              {
                "$ref": "#/components/schemas/BulkRefPayloadDto"
              }
            ]
          },
          "_id": {
            "type": "string"
          }
        },
        "required": [
          "total",
          "amount",
          "type",
          "number",
          "ti",
          "rcti",
          "name",
          "currency",
          "status",
          "paymentIntent",
          "_id"
        ]
      },
      "SplitIntentMetaDto": {
        "type": "object",
        "properties": {
          "sources": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "payin",
                "payout"
              ]
            }
          },
          "result": {
            "type": "string",
            "enum": [
              "gain",
              "loss"
            ]
          },
          "isMarkupApplied": {
            "type": "boolean"
          }
        },
        "required": [
          "sources",
          "result",
          "isMarkupApplied"
        ]
      },
      "CreateSplitIntentDto": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "minimum": 0,
            "maximum": 999999999,
            "example": 3000
          },
          "keep": {
            "type": "number",
            "minimum": 0,
            "maximum": 999999999,
            "example": 1000
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "description": {
            "type": "string",
            "example": "Revenue share for partner services"
          },
          "partnership": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "item": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "paymentIntent": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "contact": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "split": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "tax": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "ref": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "order": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "orderItems": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "type": {
            "type": "string",
            "enum": [
              "percentage-on-amount",
              "percentage-on-splits",
              "fixed",
              "keep-percentage",
              "self",
              "supplier",
              "markup"
            ]
          },
          "percentage": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "dueAt": {
            "format": "date-time",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "ti": {
            "type": "boolean"
          },
          "rcti": {
            "type": "boolean"
          },
          "partnerReference": {
            "type": "string"
          },
          "meta": {
            "$ref": "#/components/schemas/SplitIntentMetaDto"
          }
        },
        "required": [
          "amount",
          "currency",
          "type"
        ]
      },
      "PaymentSplitPayloadDto": {
        "type": "object",
        "properties": {
          "total": {
            "type": "number",
            "example": 5500
          },
          "amount": {
            "type": "number",
            "example": 5000
          },
          "description": {
            "type": "string",
            "example": "Revenue share for partner services"
          },
          "taxTotal": {
            "type": "number",
            "example": 500
          },
          "type": {
            "type": "string",
            "description": "Split type",
            "enum": [
              "percentage-on-amount",
              "percentage-on-splits",
              "fixed",
              "keep-percentage",
              "self",
              "supplier",
              "markup"
            ],
            "example": "self"
          },
          "number": {
            "type": "number"
          },
          "invoiceNumber": {
            "type": "string"
          },
          "ti": {
            "type": "boolean"
          },
          "rcti": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "keep": {
            "type": "number"
          },
          "ref": {
            "type": "string",
            "description": "Reference to another payment split",
            "example": "507f1f77bcf86cd799439011"
          },
          "currency": {
            "type": "string",
            "description": "Currency code (ISO 4217)",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "percentage": {
            "type": "number"
          },
          "dueAt": {
            "format": "date-time",
            "type": "string"
          },
          "paidAt": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "Payment split status",
            "enum": [
              "canceled",
              "pending",
              "processing",
              "due",
              "overdue",
              "review-pending",
              "failed",
              "paused",
              "paid"
            ],
            "example": "pending"
          },
          "partnership": {
            "description": "Partnership reference (raw ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/PartnershipRefDto"
              }
            ]
          },
          "item": {
            "type": "string",
            "description": "Payment intent item ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "tax": {
            "type": "string",
            "description": "Tax ID applied to this split",
            "example": "507f1f77bcf86cd799439011"
          },
          "paymentIntent": {
            "description": "Payment intent reference (raw ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/PaymentIntentRefDto"
              }
            ]
          },
          "authorization": {
            "description": "Authorization reference (raw ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/GatewayAuthorizationRefDto"
              }
            ]
          },
          "payoutMethod": {
            "type": "string",
            "description": "Payout method",
            "enum": [
              "manual",
              "automatic"
            ],
            "example": "automatic"
          },
          "contact": {
            "description": "Contact reference (raw ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/ContactRefDto"
              }
            ]
          },
          "split": {
            "type": "string",
            "description": "Partnership split configuration ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "createdBy": {
            "description": "User who created this split (raw ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "updatedBy": {
            "description": "User who last updated this split (raw ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "pendingReviewAt": {
            "format": "date-time",
            "type": "string"
          },
          "approvedAt": {
            "format": "date-time",
            "type": "string"
          },
          "approvedBy": {
            "description": "User who approved this split (raw ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "partnerReference": {
            "type": "string"
          },
          "failedAt": {
            "format": "date-time",
            "type": "string"
          },
          "payout": {
            "type": "string",
            "description": "Payout ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "primaryTeams": {
            "description": "Primary team IDs",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "bulk": {
            "type": "string",
            "description": "Bulk operation ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "_id": {
            "type": "string"
          }
        },
        "required": [
          "total",
          "amount",
          "type",
          "number",
          "ti",
          "rcti",
          "name",
          "currency",
          "status",
          "paymentIntent",
          "_id"
        ]
      },
      "UpdateSplitIntentDto": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "minimum": 0,
            "maximum": 999999999,
            "example": 3000
          },
          "keep": {
            "type": "number",
            "minimum": 0,
            "maximum": 999999999,
            "example": 1000
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "description": {
            "type": "string",
            "example": "Revenue share for partner services"
          },
          "partnership": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "item": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "paymentIntent": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "contact": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "split": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "tax": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "ref": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "order": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "orderItems": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "type": {
            "type": "string",
            "enum": [
              "percentage-on-amount",
              "percentage-on-splits",
              "fixed",
              "keep-percentage",
              "self",
              "supplier",
              "markup"
            ]
          },
          "percentage": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "dueAt": {
            "format": "date-time",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "ti": {
            "type": "boolean"
          },
          "rcti": {
            "type": "boolean"
          },
          "partnerReference": {
            "type": "string"
          },
          "meta": {
            "$ref": "#/components/schemas/SplitIntentMetaDto"
          },
          "bulk": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "paidAt": {
            "format": "date-time",
            "type": "string",
            "nullable": true
          },
          "payoutMethod": {
            "type": "string",
            "enum": [
              "manual"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "canceled"
            ]
          }
        }
      },
      "Option": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive"
            ]
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "type": {
            "type": "string",
            "enum": [
              "ZAI_DD",
              "ZAI_PAYTO",
              "EXTERNAL"
            ]
          },
          "amount": {
            "type": "number",
            "example": 3000
          }
        },
        "required": [
          "status",
          "currency",
          "type",
          "amount"
        ]
      },
      "PaymentSplitOptionsPayloadDto": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "send-payout-tenant",
              "send-payout-partnership",
              "pay-payment-split-via-qualy",
              "mark-as-paid",
              "revert-mark-as-paid",
              "send-invoice",
              "remove",
              "cancel"
            ]
          },
          "available": {
            "type": "boolean",
            "example": true
          },
          "options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Option"
            }
          }
        },
        "required": [
          "action",
          "available",
          "options"
        ]
      },
      "TaxIds": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "ad_nrt",
              "ae_trn",
              "al_vat",
              "ar_cuit",
              "at_vat",
              "at_uid",
              "au_abn",
              "au_arn",
              "ba_vat",
              "bg_uic",
              "be_vat",
              "bh_vat",
              "bo_tin",
              "br_cnpj",
              "br_cpf",
              "ca_bn",
              "ca_gst_hst",
              "ca_pst_bc",
              "ca_pst_mb",
              "ca_pst_sk",
              "ca_qst",
              "ch_uid",
              "ch_vat",
              "cl_tin",
              "cn_tin",
              "co_nit",
              "cr_tin",
              "cy_vat",
              "cz_vat",
              "cz_dic",
              "de_stn",
              "de_hrn",
              "do_rcn",
              "dk_vat",
              "ec_ruc",
              "ee_vat",
              "ee_rc",
              "eg_tin",
              "es_cif",
              "eu_oss_vat",
              "eu_vat",
              "fi_vat",
              "fr_vat",
              "fr_siren",
              "fr_siret",
              "gb_vat",
              "gb_crn",
              "ge_vat",
              "gr_vat",
              "hk_br",
              "hr_oib",
              "hu_tin",
              "id_npwp",
              "ie_vat",
              "ie_crn",
              "il_vat",
              "in_gst",
              "is_vat",
              "it_vat",
              "it_cf",
              "jp_cn",
              "jp_rn",
              "jp_trn",
              "pk_ntn",
              "ke_pin",
              "kr_brn",
              "kz_bin",
              "li_uid",
              "lt_vat",
              "lu_vat",
              "lv_vat",
              "md_vat",
              "me_vat",
              "mk_vat",
              "mt_vat",
              "mx_rfc",
              "my_frp",
              "my_itn",
              "my_sst",
              "ng_tin",
              "nl_vat",
              "nl_kvk",
              "no_vat",
              "no_voec",
              "nz_gst",
              "om_vat",
              "pe_ruc",
              "ph_tin",
              "pl_vat",
              "pl_nip",
              "pt_vat",
              "pt_nif",
              "ro_tin",
              "rs_pib",
              "ru_inn",
              "ru_kpp",
              "sa_vat",
              "se_vat",
              "se_orgnr",
              "sg_gst",
              "sg_uen",
              "si_tin",
              "sk_vat",
              "sv_nit",
              "th_vat",
              "tr_tin",
              "tw_vat",
              "ua_vat",
              "us_ein",
              "uy_ruc",
              "ve_rif",
              "vn_tin",
              "za_vat"
            ]
          },
          "number": {
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "number"
        ]
      },
      "PartnershipAddressDto": {
        "type": "object",
        "properties": {
          "country": {
            "type": "string",
            "description": "Country",
            "example": "Australia"
          },
          "line1": {
            "type": "string",
            "description": "Address line 1",
            "example": "123 Business St"
          },
          "line2": {
            "type": "string",
            "description": "Address line 2",
            "example": "Suite 400"
          },
          "postalCode": {
            "type": "string",
            "description": "Postal code",
            "example": "2000"
          },
          "state": {
            "type": "string",
            "description": "State or region",
            "example": "NSW"
          },
          "city": {
            "type": "string",
            "description": "City",
            "example": "Sydney"
          }
        }
      },
      "Payout": {
        "type": "object",
        "properties": {
          "statementDescriptor": {
            "type": "string",
            "enum": [
              "name",
              "unique-number-name"
            ]
          },
          "behavior": {
            "type": "string",
            "enum": [
              "always-net",
              "always-gross",
              "net-if-same-currency",
              "gross-if-same-currency"
            ]
          },
          "bankAccountMode": {
            "type": "string",
            "enum": [
              "prioritize-settlement-currency",
              "prioritize-original-currency",
              "prioritize-same-currency"
            ]
          },
          "splitDueDate": {
            "type": "string",
            "enum": [
              "payment-due-date",
              "7-days",
              "14-days",
              "30-days",
              "45-days",
              "60-days",
              "90-days"
            ]
          },
          "splitOverdueDate": {
            "type": "string",
            "enum": [
              "immediate",
              "7-days",
              "14-days",
              "30-days",
              "45-days",
              "60-days",
              "90-days"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "interval": {
            "type": "string"
          },
          "rcti": {
            "type": "boolean"
          },
          "ti": {
            "type": "boolean"
          },
          "approval": {
            "type": "boolean"
          }
        },
        "required": [
          "statementDescriptor",
          "behavior",
          "enabled",
          "interval"
        ]
      },
      "PartnershipContactDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Contact entry ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "firstName": {
            "type": "string",
            "description": "First name",
            "example": "Jane"
          },
          "lastName": {
            "type": "string",
            "description": "Last name",
            "example": "Smith"
          },
          "email": {
            "type": "string",
            "description": "Email address",
            "example": "contact@example.com"
          },
          "phone": {
            "type": "string",
            "description": "Phone number",
            "example": "+61 412 345 678"
          },
          "department": {
            "type": "string",
            "description": "Department",
            "example": "Finance"
          },
          "comments": {
            "type": "string",
            "description": "Comments",
            "example": "Primary billing contact"
          },
          "primary": {
            "type": "boolean",
            "description": "Whether this is the primary contact",
            "example": true
          },
          "notify": {
            "type": "boolean",
            "description": "Whether to send notifications",
            "example": true
          },
          "dob": {
            "format": "date-time",
            "type": "string",
            "description": "Date of birth",
            "example": "1990-05-20T00:00:00.000Z"
          }
        }
      },
      "Relationship": {
        "type": "object",
        "properties": {
          "tier": {
            "type": "string",
            "enum": [
              "tier-0",
              "tier-1",
              "tier-2",
              "tier-3"
            ]
          }
        }
      },
      "Contract": {
        "type": "object",
        "properties": {
          "startAt": {
            "format": "date-time",
            "type": "string"
          },
          "endAt": {
            "format": "date-time",
            "type": "string"
          }
        }
      },
      "PartnershipDetailPayloadDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Acme Corp"
          },
          "legalName": {
            "type": "string",
            "example": "Acme Pty Ltd"
          },
          "notes": {
            "type": "string",
            "example": "Key supplier for design services"
          },
          "websiteUrl": {
            "type": "string",
            "example": "https://acme.com"
          },
          "type": {
            "type": "string",
            "description": "Partnership type",
            "enum": [
              "supplier",
              "referral",
              "agent",
              "partner"
            ],
            "example": "referral"
          },
          "invoicePrefix": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "Partnership status",
            "enum": [
              "active",
              "inactive",
              "pending"
            ],
            "example": "active"
          },
          "logo": {
            "type": "string"
          },
          "businessType": {
            "type": "string",
            "description": "Business type",
            "enum": [
              null,
              "corporation",
              "sole-prop",
              "non-profit",
              "partnership"
            ],
            "example": "corporation"
          },
          "locale": {
            "type": "string"
          },
          "taxIds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxIds"
            }
          },
          "address": {
            "description": "Partnership address",
            "allOf": [
              {
                "$ref": "#/components/schemas/PartnershipAddressDto"
              }
            ]
          },
          "bankAccounts": {
            "description": "Bank accounts associated with this partnership (ObjectId references)",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "splits": {
            "description": "Payment splits associated with this partnership (ObjectId references)",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "payout": {
            "$ref": "#/components/schemas/Payout"
          },
          "contacts": {
            "description": "Partnership contact entries",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartnershipContactDto"
            }
          },
          "createdBy": {
            "description": "User who created this partnership (ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "code": {
            "type": "string"
          },
          "payment": {
            "$ref": "#/components/schemas/Payment"
          },
          "primaryColor": {
            "type": "string"
          },
          "owners": {
            "description": "Owners of this partnership (populated with profile, primaryTeams)",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserRefDto"
            }
          },
          "primaryTeams": {
            "description": "Primary teams for this partnership (populated with name, department)",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TeamRefDto"
            }
          },
          "marketing": {
            "$ref": "#/components/schemas/Marketing"
          },
          "relationship": {
            "$ref": "#/components/schemas/Relationship"
          },
          "contract": {
            "$ref": "#/components/schemas/Contract"
          }
        },
        "required": [
          "name",
          "type",
          "status",
          "businessType",
          "locale",
          "taxIds",
          "createdBy",
          "code"
        ]
      },
      "PayoutDto": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "interval": {
            "type": "string",
            "enum": [
              "instant"
            ]
          },
          "approval": {
            "type": "boolean"
          },
          "rcti": {
            "type": "boolean"
          },
          "ti": {
            "type": "boolean"
          },
          "statementDescriptor": {
            "type": "string",
            "enum": [
              "name",
              "unique-number-name"
            ]
          },
          "behavior": {
            "type": "string",
            "enum": [
              "always-net",
              "always-gross",
              "net-if-same-currency",
              "gross-if-same-currency"
            ]
          },
          "bankAccountMode": {
            "type": "string",
            "enum": [
              "prioritize-settlement-currency",
              "prioritize-original-currency",
              "prioritize-same-currency"
            ]
          },
          "splitDueDate": {
            "type": "string",
            "enum": [
              "payment-due-date",
              "7-days",
              "14-days",
              "30-days",
              "45-days",
              "60-days",
              "90-days"
            ]
          },
          "splitOverdueDate": {
            "type": "string",
            "enum": [
              "immediate",
              "7-days",
              "14-days",
              "30-days",
              "45-days",
              "60-days",
              "90-days"
            ]
          }
        }
      },
      "PartnershipMarketingGeoDto": {
        "type": "object",
        "properties": {
          "primaryCountry": {
            "type": "string"
          },
          "secondaryCountry": {
            "type": "string"
          }
        }
      },
      "PartnershipMarketingDto": {
        "type": "object",
        "properties": {
          "geo": {
            "$ref": "#/components/schemas/PartnershipMarketingGeoDto"
          }
        }
      },
      "PartnershipMarketingRelationshipDto": {
        "type": "object",
        "properties": {
          "tier": {
            "type": "string",
            "enum": [
              "tier-0",
              "tier-1",
              "tier-2",
              "tier-3"
            ]
          }
        }
      },
      "PartnershipMarketingContractDto": {
        "type": "object",
        "properties": {
          "startAt": {
            "format": "date-time",
            "type": "string"
          },
          "endAt": {
            "format": "date-time",
            "type": "string"
          }
        }
      },
      "PaymentDto": {
        "type": "object",
        "properties": {
          "usePartnerBrandingWhenSupplier": {
            "type": "boolean"
          },
          "suppressPaymentRemindersWhenSupplier": {
            "type": "boolean"
          },
          "allowPaymentAtPartner": {
            "type": "string",
            "enum": [
              "always",
              "overdue-only",
              "never"
            ]
          }
        }
      },
      "CreatePartnershipDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Acme Corp"
          },
          "legalName": {
            "type": "string",
            "example": "Acme Pty Ltd"
          },
          "notes": {
            "type": "string",
            "example": "Key supplier for design services"
          },
          "websiteUrl": {
            "type": "string",
            "format": "uri",
            "example": "https://acme.com"
          },
          "owners": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "primaryTeams": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "code": {
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "logo": {
            "type": "string"
          },
          "primaryColor": {
            "type": "string",
            "pattern": "^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$"
          },
          "businessType": {
            "type": "string",
            "enum": [
              null,
              "corporation",
              "sole-prop",
              "non-profit",
              "partnership"
            ]
          },
          "type": {
            "type": "string",
            "enum": [
              "supplier",
              "referral",
              "agent",
              "partner"
            ]
          },
          "address": {
            "$ref": "#/components/schemas/AddressDto"
          },
          "taxIds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxIdDto"
            }
          },
          "payout": {
            "$ref": "#/components/schemas/PayoutDto"
          },
          "contacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartnershipContactDto"
            }
          },
          "marketing": {
            "$ref": "#/components/schemas/PartnershipMarketingDto"
          },
          "relationship": {
            "$ref": "#/components/schemas/PartnershipMarketingRelationshipDto"
          },
          "contract": {
            "$ref": "#/components/schemas/PartnershipMarketingContractDto"
          },
          "payment": {
            "$ref": "#/components/schemas/PaymentDto"
          }
        }
      },
      "PartnerLoginDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "example": "partner@example.com"
          }
        },
        "required": [
          "email"
        ]
      },
      "GeneratePartnershipDto": {
        "type": "object",
        "properties": {
          "file": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          }
        },
        "required": [
          "file"
        ]
      },
      "PartnershipListPayloadDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Acme Corp"
          },
          "legalName": {
            "type": "string",
            "example": "Acme Pty Ltd"
          },
          "notes": {
            "type": "string",
            "example": "Key supplier for design services"
          },
          "websiteUrl": {
            "type": "string",
            "example": "https://acme.com"
          },
          "type": {
            "type": "string",
            "description": "Partnership type",
            "enum": [
              "supplier",
              "referral",
              "agent",
              "partner"
            ],
            "example": "referral"
          },
          "invoicePrefix": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "Partnership status",
            "enum": [
              "active",
              "inactive",
              "pending"
            ],
            "example": "active"
          },
          "logo": {
            "type": "string"
          },
          "businessType": {
            "type": "string",
            "description": "Business type",
            "enum": [
              null,
              "corporation",
              "sole-prop",
              "non-profit",
              "partnership"
            ],
            "example": "corporation"
          },
          "locale": {
            "type": "string"
          },
          "taxIds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxIds"
            }
          },
          "address": {
            "description": "Partnership address",
            "allOf": [
              {
                "$ref": "#/components/schemas/PartnershipAddressDto"
              }
            ]
          },
          "bankAccounts": {
            "description": "Bank accounts associated with this partnership (ObjectId references)",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "splits": {
            "description": "Payment splits associated with this partnership (ObjectId references)",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "payout": {
            "$ref": "#/components/schemas/Payout"
          },
          "contacts": {
            "description": "Partnership contact entries",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartnershipContactDto"
            }
          },
          "createdBy": {
            "description": "User who created this partnership (ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "code": {
            "type": "string"
          },
          "payment": {
            "$ref": "#/components/schemas/Payment"
          },
          "primaryColor": {
            "type": "string"
          },
          "owners": {
            "description": "Owners of this partnership (ObjectId references)",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "primaryTeams": {
            "description": "Primary teams assigned to this partnership (ObjectId references)",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "marketing": {
            "$ref": "#/components/schemas/Marketing"
          },
          "relationship": {
            "$ref": "#/components/schemas/Relationship"
          },
          "contract": {
            "$ref": "#/components/schemas/Contract"
          }
        },
        "required": [
          "name",
          "type",
          "status",
          "businessType",
          "locale",
          "taxIds",
          "createdBy",
          "code"
        ]
      },
      "MergePartnershipDto": {
        "type": "object",
        "properties": {
          "sourcePartnershipId": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "destinationPartnershipId": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          }
        },
        "required": [
          "sourcePartnershipId",
          "destinationPartnershipId"
        ]
      },
      "UpdatePartnershipDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Acme Corp"
          },
          "legalName": {
            "type": "string",
            "example": "Acme Pty Ltd"
          },
          "notes": {
            "type": "string",
            "example": "Key supplier for design services"
          },
          "websiteUrl": {
            "type": "string",
            "format": "uri",
            "example": "https://acme.com"
          },
          "owners": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "primaryTeams": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "code": {
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "logo": {
            "type": "string"
          },
          "primaryColor": {
            "type": "string",
            "pattern": "^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$"
          },
          "businessType": {
            "type": "string",
            "enum": [
              null,
              "corporation",
              "sole-prop",
              "non-profit",
              "partnership"
            ]
          },
          "type": {
            "type": "string",
            "enum": [
              "supplier",
              "referral",
              "agent",
              "partner"
            ]
          },
          "address": {
            "$ref": "#/components/schemas/AddressDto"
          },
          "taxIds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxIdDto"
            }
          },
          "payout": {
            "$ref": "#/components/schemas/PayoutDto"
          },
          "contacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartnershipContactDto"
            }
          },
          "marketing": {
            "$ref": "#/components/schemas/PartnershipMarketingDto"
          },
          "relationship": {
            "$ref": "#/components/schemas/PartnershipMarketingRelationshipDto"
          },
          "contract": {
            "$ref": "#/components/schemas/PartnershipMarketingContractDto"
          },
          "payment": {
            "$ref": "#/components/schemas/PaymentDto"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive",
              "pending"
            ]
          }
        }
      },
      "UpdatePartnershipContactDto": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "example": "Jane"
          },
          "lastName": {
            "type": "string",
            "example": "Smith"
          },
          "email": {
            "type": "string",
            "format": "email",
            "example": "contact@example.com"
          },
          "phone": {
            "type": "string",
            "example": "+61 412 345 678"
          },
          "notify": {
            "type": "boolean",
            "example": true
          },
          "primary": {
            "type": "boolean",
            "example": false
          },
          "comments": {
            "type": "string"
          },
          "dob": {
            "format": "date-time",
            "type": "string"
          },
          "department": {
            "type": "string",
            "enum": [
              "support",
              "sales",
              "accounting",
              "legal",
              "analytics",
              "hr",
              "operations",
              "marketing",
              "purchasing",
              "other"
            ]
          }
        },
        "required": [
          "firstName",
          "lastName",
          "email"
        ]
      },
      "CreateSplitDto": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "minimum": 0,
            "example": 3000
          },
          "description": {
            "type": "string",
            "example": "Revenue share for partner services"
          },
          "tax": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "type": {
            "type": "string",
            "enum": [
              "percentage-on-amount",
              "percentage-on-splits",
              "fixed",
              "keep-percentage"
            ]
          },
          "default": {
            "type": "boolean"
          }
        },
        "required": [
          "amount",
          "type"
        ]
      },
      "UpdateSplitDto": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "minimum": 0,
            "example": 3000
          },
          "description": {
            "type": "string",
            "example": "Revenue share for partner services"
          },
          "tax": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "type": {
            "type": "string",
            "enum": [
              "percentage-on-amount",
              "percentage-on-splits",
              "fixed",
              "keep-percentage"
            ]
          },
          "default": {
            "type": "boolean"
          }
        }
      },
      "BankAccountPayloadDto": {
        "type": "object",
        "properties": {
          "partnership": {
            "type": "string"
          },
          "contact": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "country": {
            "type": "string"
          },
          "default": {
            "type": "boolean"
          },
          "iban": {
            "type": "string"
          },
          "accountName": {
            "type": "string"
          },
          "routingNumber": {
            "type": "string"
          },
          "bic": {
            "type": "string"
          },
          "sortCode": {
            "type": "string"
          },
          "bankName": {
            "type": "string"
          },
          "holderType": {
            "type": "string",
            "enum": [
              "personal",
              "business"
            ]
          },
          "accountNumber": {
            "type": "string"
          },
          "accountType": {
            "type": "string"
          },
          "swiftCode": {
            "type": "string"
          },
          "requirementType": {
            "type": "string",
            "enum": [
              "united-arab-emirates",
              "euro",
              "european",
              "colombia",
              "brazil",
              "united-kingdom",
              "new-zealand",
              "united-states",
              "india",
              "pakistan",
              "australian",
              "swift_code",
              "turkey",
              "thailand",
              "romania",
              "argentina",
              "mexico",
              "china",
              "canada",
              "cayman-islands",
              "panama"
            ]
          },
          "address": {
            "type": "object",
            "description": "Bank account address",
            "additionalProperties": true
          },
          "bankCode": {
            "type": "string"
          },
          "pixKey": {
            "type": "string"
          },
          "pixType": {
            "type": "string"
          },
          "_id": {
            "type": "string"
          }
        },
        "required": [
          "currency",
          "country",
          "accountName",
          "sortCode",
          "holderType",
          "_id"
        ]
      },
      "CreateBankAccountDto": {
        "type": "object",
        "properties": {
          "partnership": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "contact": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "currency": {
            "type": "object",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "accountName": {
            "type": "string",
            "example": "Business Account"
          },
          "bankName": {
            "type": "string",
            "example": "Commonwealth Bank"
          },
          "country": {
            "type": "string"
          },
          "default": {
            "type": "boolean"
          },
          "iban": {
            "type": "string"
          },
          "routingNumber": {
            "type": "string"
          },
          "sortCode": {
            "type": "string"
          },
          "holderType": {
            "type": "string",
            "enum": [
              "personal",
              "business"
            ]
          },
          "accountNumber": {
            "type": "string"
          },
          "bic": {
            "type": "string"
          },
          "bankCode": {
            "type": "string"
          },
          "institutionNumber": {
            "type": "string"
          },
          "transitNumber": {
            "type": "string"
          },
          "rut": {
            "type": "string"
          },
          "clabe": {
            "type": "string"
          },
          "ifscCode": {
            "type": "string"
          },
          "pixType": {
            "type": "string"
          },
          "pixKey": {
            "type": "string"
          },
          "accountType": {
            "type": "string"
          },
          "taxId": {
            "type": "string"
          },
          "requirementType": {
            "type": "string",
            "enum": [
              "united-arab-emirates",
              "euro",
              "european",
              "colombia",
              "brazil",
              "united-kingdom",
              "new-zealand",
              "united-states",
              "india",
              "pakistan",
              "australian",
              "swift_code",
              "turkey",
              "thailand",
              "romania",
              "argentina",
              "mexico",
              "china",
              "canada",
              "cayman-islands",
              "panama"
            ]
          },
          "swiftCode": {
            "type": "string"
          }
        },
        "required": [
          "currency",
          "country",
          "holderType",
          "requirementType"
        ]
      },
      "BankRequirementsFieldsDto": {
        "type": "object",
        "properties": {}
      },
      "SetDefaultBankAccountDto": {
        "type": "object",
        "properties": {
          "default": {
            "type": "boolean",
            "example": true,
            "description": "Must be true"
          }
        },
        "required": [
          "default"
        ]
      },
      "TaxDetailPayloadDto": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "example": "Goods and Services Tax"
          },
          "name": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "Tax status",
            "enum": [
              "active",
              "archived"
            ],
            "example": "active"
          },
          "inclusive": {
            "type": "boolean"
          },
          "percentage": {
            "type": "number"
          },
          "createdBy": {
            "description": "User who created this tax entry (populated)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ],
            "allOf": [
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "taxType": {
            "type": "string",
            "description": "Type of tax",
            "enum": [
              "vat",
              "sales-tax"
            ],
            "example": "vat"
          }
        },
        "required": [
          "name",
          "country",
          "status",
          "inclusive",
          "percentage",
          "taxType"
        ]
      },
      "CreateTaxDto": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "example": "Goods and Services Tax"
          },
          "name": {
            "type": "string"
          },
          "taxType": {
            "type": "string",
            "enum": [
              "vat",
              "sales-tax"
            ]
          },
          "inclusive": {
            "type": "boolean"
          },
          "country": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "percentage": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          }
        },
        "required": [
          "name",
          "taxType",
          "percentage"
        ]
      },
      "TaxListPayloadDto": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "example": "Goods and Services Tax"
          },
          "name": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "Tax status",
            "enum": [
              "active",
              "archived"
            ],
            "example": "active"
          },
          "inclusive": {
            "type": "boolean"
          },
          "percentage": {
            "type": "number"
          },
          "createdBy": {
            "description": "User who created this tax (ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "taxType": {
            "type": "string",
            "description": "Type of tax",
            "enum": [
              "vat",
              "sales-tax"
            ],
            "example": "vat"
          }
        },
        "required": [
          "name",
          "country",
          "status",
          "inclusive",
          "percentage",
          "createdBy",
          "taxType"
        ]
      },
      "UpdateTaxDto": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "example": "Goods and Services Tax"
          },
          "name": {
            "type": "string"
          },
          "taxType": {
            "type": "string",
            "enum": [
              "vat",
              "sales-tax"
            ]
          },
          "inclusive": {
            "type": "boolean"
          },
          "country": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "percentage": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          }
        }
      },
      "FeeSchema": {
        "type": "object",
        "properties": {
          "gateway": {
            "type": "number"
          },
          "tenant": {
            "type": "number"
          },
          "tax": {
            "type": "number"
          }
        },
        "required": [
          "tax"
        ]
      },
      "AdvanceRelease": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "example": 5000
          },
          "status": {
            "type": "string",
            "enum": [
              "requested",
              "approved",
              "canceled",
              "denied"
            ]
          },
          "mode": {
            "type": "string",
            "enum": [
              "manual",
              "automatic"
            ]
          },
          "requestedAt": {
            "format": "date-time",
            "type": "string"
          },
          "requestId": {
            "type": "string"
          },
          "approvedAt": {
            "format": "date-time",
            "type": "string"
          },
          "canceledAt": {
            "format": "date-time",
            "type": "string"
          },
          "deniedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "amount",
          "status",
          "mode"
        ]
      },
      "QuoteRefPayloadDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Quote ID (MongoDB ObjectId)",
            "example": "507f1f77bcf86cd799439011"
          },
          "sourceCurrency": {
            "type": "string",
            "description": "Source currency (ISO 4217)",
            "example": "AUD"
          },
          "targetCurrency": {
            "type": "string",
            "description": "Target currency (ISO 4217)",
            "example": "USD"
          },
          "targetAmount": {
            "type": "number",
            "description": "Target amount in cents",
            "example": 10000
          },
          "rate": {
            "type": "number",
            "description": "Exchange rate",
            "example": 0.65
          },
          "status": {
            "type": "string",
            "description": "Quote status",
            "example": "completed"
          },
          "reference": {
            "type": "string",
            "description": "Gateway reference ID",
            "example": "QT-12345"
          },
          "expectedAt": {
            "format": "date-time",
            "type": "string",
            "description": "Expected settlement date",
            "example": "2024-01-15T09:30:00.000Z"
          }
        },
        "required": [
          "_id"
        ]
      },
      "FinancingRefPayloadDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Financing ID (MongoDB ObjectId)",
            "example": "507f1f77bcf86cd799439011"
          },
          "nInstallments": {
            "type": "number",
            "description": "Number of installments",
            "example": 12
          },
          "installmentAmount": {
            "type": "number",
            "description": "Installment amount in cents",
            "example": 1000
          },
          "total": {
            "type": "number",
            "description": "Total financing amount in cents",
            "example": 12000
          },
          "currency": {
            "type": "string",
            "description": "Currency code (ISO 4217)",
            "example": "AUD"
          },
          "type": {
            "type": "string",
            "description": "Financing type",
            "example": "installment"
          }
        },
        "required": [
          "_id"
        ]
      },
      "TransactionDetailPayloadDto": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "example": 5000
          },
          "notes": {
            "type": "string",
            "example": "Payment received via bank transfer"
          },
          "failedReason": {
            "type": "string",
            "example": "Insufficient funds in source account"
          },
          "number": {
            "type": "number"
          },
          "contact": {
            "description": "Contact reference (raw ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/ContactRefDto"
              }
            ]
          },
          "fees": {
            "$ref": "#/components/schemas/FeeSchema"
          },
          "transactionType": {
            "type": "string",
            "description": "Transaction type",
            "enum": [
              "charge",
              "refund"
            ],
            "example": "charge"
          },
          "paymentIntent": {
            "type": "string"
          },
          "cardName": {
            "type": "string"
          },
          "cardType": {
            "type": "string"
          },
          "cardExpiryMonth": {
            "type": "string"
          },
          "cardExpiryYear": {
            "type": "string"
          },
          "cardNumber": {
            "type": "string"
          },
          "method": {
            "type": "string",
            "description": "Payment method",
            "enum": [
              "ZAI_CC",
              "ZAI_PAYID",
              "ZAI_BSBACC",
              "ZAI_PAYTO",
              "ZAI_DD",
              "AS_PIX",
              "AS_BOLETO",
              "PGBNK_CC",
              "WISE_MCACC",
              "KLARNA_PYMT",
              "TM_BANK_TRANSFER",
              "TM_CC",
              "BLUE_DD",
              "BLUE_CC",
              "BLUE_WERO",
              "EXTERNAL",
              "PARTNERSHIP",
              "OFFSET"
            ],
            "example": "ZAI_CC"
          },
          "currency": {
            "type": "string",
            "description": "Currency code (ISO 4217)",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "externalMethod": {
            "type": "string",
            "description": "External payment method",
            "enum": [
              "cash",
              "paypal",
              "alipay",
              "wechat-pay",
              "apple-pay",
              "external-bank-transfer",
              "crypto",
              "third-party",
              "other"
            ],
            "example": "cash"
          },
          "status": {
            "type": "string",
            "description": "Transaction status",
            "enum": [
              "review-pending",
              "approved",
              "rejected",
              "processing",
              "failed",
              "succeeded"
            ],
            "example": "succeeded"
          },
          "documents": {
            "description": "Document storage IDs",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "createdBy": {
            "description": "User who created this transaction (populated)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ],
            "allOf": [
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "approvedAt": {
            "format": "date-time",
            "type": "string"
          },
          "rejectedAt": {
            "format": "date-time",
            "type": "string"
          },
          "released": {
            "type": "boolean"
          },
          "advanceRelease": {
            "$ref": "#/components/schemas/AdvanceRelease"
          },
          "failedCode": {
            "type": "number"
          },
          "address": {
            "type": "object",
            "description": "Billing address",
            "additionalProperties": true
          },
          "cardHolder": {
            "type": "object",
            "description": "Card holder information",
            "additionalProperties": true
          },
          "thirdParty": {
            "type": "boolean"
          },
          "authorization": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "partnership": {
            "description": "Partnership reference (raw ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/PartnershipRefDto"
              }
            ]
          },
          "ref": {
            "type": "string",
            "description": "Reference transaction ID (for refunds)",
            "example": "507f1f77bcf86cd799439011"
          },
          "disputes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "reportedBy": {
            "description": "User who reported this transaction (raw ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "reportedAt": {
            "format": "date-time",
            "type": "string"
          },
          "reportType": {
            "type": "string",
            "description": "Fraud report type",
            "enum": [
              "fraud-attempt-from-user",
              "fraud-attempt-from-cardholder",
              "fraud-attempt-from-user-and-cardholder"
            ],
            "example": "fraud-attempt-from-user"
          },
          "quote": {
            "description": "FX quote for this transaction (populated)",
            "example": "507f1f77bcf86cd799439011",
            "allOf": [
              {
                "$ref": "#/components/schemas/QuoteRefPayloadDto"
              }
            ]
          },
          "financing": {
            "description": "Financing arrangement for this transaction (populated)",
            "example": "507f1f77bcf86cd799439011",
            "allOf": [
              {
                "$ref": "#/components/schemas/FinancingRefPayloadDto"
              }
            ]
          },
          "paidAt": {
            "format": "date-time",
            "type": "string"
          },
          "relativePaidAt": {
            "type": "string",
            "description": "Relative time when payment was made",
            "enum": [
              "today",
              "yesterday",
              "last-week",
              "2-weeks-ago",
              "3-weeks-ago"
            ],
            "example": "today"
          },
          "_id": {
            "type": "string"
          }
        },
        "required": [
          "amount",
          "number",
          "contact",
          "transactionType",
          "paymentIntent",
          "method",
          "currency",
          "externalMethod",
          "status",
          "createdAt",
          "advanceRelease",
          "disputes",
          "relativePaidAt",
          "_id"
        ]
      },
      "TransactionSignatureDto": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          },
          "deviceId": {
            "type": "string"
          },
          "remember": {
            "type": "string",
            "enum": [
              "store",
              "backup"
            ]
          }
        },
        "required": [
          "token",
          "deviceId"
        ]
      },
      "IdDto": {
        "type": "object",
        "properties": {
          "country": {
            "type": "string"
          },
          "number": {
            "type": "string"
          }
        },
        "required": [
          "country",
          "number"
        ]
      },
      "PaymentGatewayPayerDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "example": "user@example.com"
          },
          "type": {
            "type": "string",
            "enum": [
              "partner",
              "parent",
              "friend",
              "family",
              "colleague",
              "other",
              "myself"
            ]
          },
          "profile": {
            "$ref": "#/components/schemas/UserProfileDto"
          },
          "address": {
            "$ref": "#/components/schemas/ContactAddressDto"
          },
          "id": {
            "$ref": "#/components/schemas/IdDto"
          },
          "indiaFxExceed": {
            "type": "boolean"
          },
          "indiaDeclarationAmt": {
            "type": "number"
          },
          "indiaSourceOfFunds": {
            "type": "string",
            "enum": [
              "payer-savings",
              "loan"
            ]
          }
        }
      },
      "CardHolderDto": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "example": "Jane"
          },
          "lastName": {
            "type": "string",
            "example": "Smith"
          },
          "relationship": {
            "type": "string",
            "enum": [
              "family",
              "partner",
              "friend",
              "other"
            ]
          }
        }
      },
      "CreateTransactionDto": {
        "type": "object",
        "properties": {
          "paymentIntent": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "contact": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "amount": {
            "type": "number",
            "example": 5000
          },
          "currency": {
            "type": "object",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "method": {
            "type": "string",
            "description": "Payment method",
            "enum": [
              "ZAI_CC",
              "ZAI_PAYID",
              "ZAI_BSBACC",
              "ZAI_PAYTO",
              "ZAI_DD",
              "AS_PIX",
              "AS_BOLETO",
              "PGBNK_CC",
              "WISE_MCACC",
              "KLARNA_PYMT",
              "TM_BANK_TRANSFER",
              "TM_CC",
              "BLUE_DD",
              "BLUE_CC",
              "BLUE_WERO",
              "EXTERNAL",
              "PARTNERSHIP",
              "OFFSET"
            ],
            "example": "ZAI_CC"
          },
          "notes": {
            "type": "string",
            "example": "Payment received via bank transfer"
          },
          "documents": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "ref": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "bankAccount": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "provider": {
            "type": "string"
          },
          "externalMethod": {
            "type": "string",
            "enum": [
              "cash",
              "paypal",
              "alipay",
              "wechat-pay",
              "apple-pay",
              "external-bank-transfer",
              "crypto",
              "third-party",
              "other"
            ]
          },
          "relativePaidAt": {
            "type": "string"
          },
          "paidAt": {
            "format": "date-time",
            "type": "string",
            "description": "Effective accounting date for the transaction.\n\nFor EXTERNAL: when the customer paid you outside Qualy.\nFor PARTNERSHIP: when the partnership recorded the payment.\nFor OFFSET: the date the operator wants the allocation to take effect\n  (typically the date of the operational decision to apply the\n  deposit; not necessarily today, not necessarily the source's\n  original paidAt). Operator's choice — pin it down per tenant policy\n  if you need stricter semantics.\n\nDrives `paidAt` on the resulting transaction document and is the\neffective date the accounting/period-close logic anchors to."
          },
          "partnership": {
            "type": "string"
          },
          "thirdParty": {
            "type": "boolean"
          },
          "signature": {
            "$ref": "#/components/schemas/TransactionSignatureDto"
          },
          "payer": {
            "$ref": "#/components/schemas/PaymentGatewayPayerDto"
          },
          "address": {
            "$ref": "#/components/schemas/AddressDto"
          },
          "cardHolder": {
            "$ref": "#/components/schemas/CardHolderDto"
          }
        },
        "required": [
          "paymentIntent",
          "amount",
          "currency",
          "method"
        ]
      },
      "TransactionPayloadDto": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "example": 5000
          },
          "notes": {
            "type": "string",
            "example": "Payment received via bank transfer"
          },
          "failedReason": {
            "type": "string",
            "example": "Insufficient funds in source account"
          },
          "number": {
            "type": "number"
          },
          "contact": {
            "description": "Contact reference (raw ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/ContactRefDto"
              }
            ]
          },
          "fees": {
            "$ref": "#/components/schemas/FeeSchema"
          },
          "transactionType": {
            "type": "string",
            "description": "Transaction type",
            "enum": [
              "charge",
              "refund"
            ],
            "example": "charge"
          },
          "paymentIntent": {
            "type": "string"
          },
          "cardName": {
            "type": "string"
          },
          "cardType": {
            "type": "string"
          },
          "cardExpiryMonth": {
            "type": "string"
          },
          "cardExpiryYear": {
            "type": "string"
          },
          "cardNumber": {
            "type": "string"
          },
          "method": {
            "type": "string",
            "description": "Payment method",
            "enum": [
              "ZAI_CC",
              "ZAI_PAYID",
              "ZAI_BSBACC",
              "ZAI_PAYTO",
              "ZAI_DD",
              "AS_PIX",
              "AS_BOLETO",
              "PGBNK_CC",
              "WISE_MCACC",
              "KLARNA_PYMT",
              "TM_BANK_TRANSFER",
              "TM_CC",
              "BLUE_DD",
              "BLUE_CC",
              "BLUE_WERO",
              "EXTERNAL",
              "PARTNERSHIP",
              "OFFSET"
            ],
            "example": "ZAI_CC"
          },
          "currency": {
            "type": "string",
            "description": "Currency code (ISO 4217)",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "externalMethod": {
            "type": "string",
            "description": "External payment method",
            "enum": [
              "cash",
              "paypal",
              "alipay",
              "wechat-pay",
              "apple-pay",
              "external-bank-transfer",
              "crypto",
              "third-party",
              "other"
            ],
            "example": "cash"
          },
          "status": {
            "type": "string",
            "description": "Transaction status",
            "enum": [
              "review-pending",
              "approved",
              "rejected",
              "processing",
              "failed",
              "succeeded"
            ],
            "example": "succeeded"
          },
          "documents": {
            "description": "Document storage IDs",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "createdBy": {
            "description": "User who created this transaction (raw ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "approvedAt": {
            "format": "date-time",
            "type": "string"
          },
          "rejectedAt": {
            "format": "date-time",
            "type": "string"
          },
          "released": {
            "type": "boolean"
          },
          "advanceRelease": {
            "$ref": "#/components/schemas/AdvanceRelease"
          },
          "failedCode": {
            "type": "number"
          },
          "address": {
            "type": "object",
            "description": "Billing address",
            "additionalProperties": true
          },
          "cardHolder": {
            "type": "object",
            "description": "Card holder information",
            "additionalProperties": true
          },
          "thirdParty": {
            "type": "boolean"
          },
          "authorization": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "partnership": {
            "description": "Partnership reference (raw ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/PartnershipRefDto"
              }
            ]
          },
          "ref": {
            "type": "string",
            "description": "Reference transaction ID (for refunds)",
            "example": "507f1f77bcf86cd799439011"
          },
          "disputes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "reportedBy": {
            "description": "User who reported this transaction (raw ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "reportedAt": {
            "format": "date-time",
            "type": "string"
          },
          "reportType": {
            "type": "string",
            "description": "Fraud report type",
            "enum": [
              "fraud-attempt-from-user",
              "fraud-attempt-from-cardholder",
              "fraud-attempt-from-user-and-cardholder"
            ],
            "example": "fraud-attempt-from-user"
          },
          "quote": {
            "type": "string",
            "description": "FX quote ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "financing": {
            "type": "string",
            "description": "Financing arrangement ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "paidAt": {
            "format": "date-time",
            "type": "string"
          },
          "relativePaidAt": {
            "type": "string",
            "description": "Relative time when payment was made",
            "enum": [
              "today",
              "yesterday",
              "last-week",
              "2-weeks-ago",
              "3-weeks-ago"
            ],
            "example": "today"
          },
          "_id": {
            "type": "string"
          }
        },
        "required": [
          "amount",
          "number",
          "contact",
          "transactionType",
          "paymentIntent",
          "method",
          "currency",
          "externalMethod",
          "status",
          "createdAt",
          "advanceRelease",
          "disputes",
          "relativePaidAt",
          "_id"
        ]
      },
      "TransactionStatusBreakdownDto": {
        "type": "object",
        "properties": {
          "review-pending": {
            "type": "number",
            "description": "Amount in review-pending status (cents)",
            "example": 0
          },
          "processing": {
            "type": "number",
            "description": "Amount in processing status (cents)",
            "example": 5000
          },
          "approved": {
            "type": "number",
            "description": "Amount in approved status (cents)",
            "example": 100000
          },
          "rejected": {
            "type": "number",
            "description": "Amount in rejected status (cents)",
            "example": 0
          },
          "failed": {
            "type": "number",
            "description": "Amount in failed status (cents)",
            "example": 0
          },
          "succeeded": {
            "type": "number",
            "description": "Amount in succeeded status (cents)",
            "example": 95000
          }
        },
        "required": [
          "review-pending",
          "processing",
          "approved",
          "rejected",
          "failed",
          "succeeded"
        ]
      },
      "TransactionTypeBreakdownDto": {
        "type": "object",
        "properties": {
          "charges": {
            "type": "number",
            "description": "Total charge amount (cents)",
            "example": 100000
          },
          "refunds": {
            "type": "number",
            "description": "Total refund amount (cents)",
            "example": 5000
          }
        },
        "required": [
          "charges",
          "refunds"
        ]
      },
      "TransactionStatsPayloadDto": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "description": "Currency code",
            "example": "USD"
          },
          "nTransactions": {
            "type": "number",
            "description": "Number of transactions",
            "example": 42
          },
          "total": {
            "type": "number",
            "description": "Total amount in cents",
            "example": 250000
          },
          "totalMinusOffset": {
            "type": "number",
            "description": "`total` minus OFFSET allocations applied to whatever transactions the existing status filter passes. OFFSET amounts re-allocate already-received funds (e.g., applying a deposit to an invoice) and would double-count the source charge if summed with `total`. NOT a revenue or cash-flow figure on its own — the underlying status filter still includes review-pending / processing in some modes; consumers needing a settled-revenue number must apply their own status gate on top.",
            "example": 250000
          },
          "status": {
            "description": "Breakdown by transaction status (when format=status)",
            "allOf": [
              {
                "$ref": "#/components/schemas/TransactionStatusBreakdownDto"
              }
            ]
          },
          "type": {
            "description": "Breakdown by transaction type (when format=transactionType)",
            "allOf": [
              {
                "$ref": "#/components/schemas/TransactionTypeBreakdownDto"
              }
            ]
          }
        },
        "required": [
          "currency",
          "nTransactions",
          "total",
          "totalMinusOffset"
        ]
      },
      "TransactionOptionsPayloadDto": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "open-receipt",
              "refund",
              "approve",
              "reject",
              "report-fraud",
              "migrate"
            ]
          },
          "available": {
            "type": "boolean",
            "example": true
          }
        },
        "required": [
          "action",
          "available"
        ]
      },
      "ReportTransactionDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "fraud-attempt-from-user",
              "fraud-attempt-from-cardholder",
              "fraud-attempt-from-user-and-cardholder"
            ]
          }
        },
        "required": [
          "type"
        ]
      },
      "TransactionMigrationPayloadDto": {
        "type": "object",
        "properties": {
          "transactionIds": {
            "description": "IDs of the migrated transactions",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sourcePaymentIntentId": {
            "type": "string",
            "description": "Source payment intent ID"
          },
          "targetPaymentIntentId": {
            "type": "string",
            "description": "Target payment intent ID"
          },
          "sourceStatus": {
            "type": "string",
            "description": "Source payment intent status after migration",
            "example": "due"
          },
          "targetStatus": {
            "type": "string",
            "description": "Target payment intent status after migration",
            "example": "paid-full"
          },
          "payoutsReset": {
            "type": "number",
            "description": "Number of payouts reset on the source"
          }
        },
        "required": [
          "transactionIds",
          "sourcePaymentIntentId",
          "targetPaymentIntentId",
          "sourceStatus",
          "targetStatus",
          "payoutsReset"
        ]
      },
      "MigrateTransactionsDto": {
        "type": "object",
        "properties": {
          "transactionIds": {
            "description": "IDs of the transactions to migrate",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sourcePaymentIntentId": {
            "type": "string",
            "description": "Source payment intent ID. Must match the actual payment intent of all transactions.",
            "example": "507f1f77bcf86cd799439012"
          },
          "reason": {
            "type": "string",
            "description": "Reason for migrating transactions (recorded in audit trail)",
            "example": "Wrong reconciliation - contact deposited to incorrect payment"
          }
        },
        "required": [
          "transactionIds",
          "sourcePaymentIntentId",
          "reason"
        ]
      },
      "FeesPayloadDto": {
        "type": "object",
        "properties": {
          "gateway": {
            "type": "number"
          },
          "tenant": {
            "type": "number"
          },
          "tax": {
            "type": "number"
          }
        }
      },
      "PartnershipPaymentOptionPayloadDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "name": {
            "type": "string",
            "example": "Jane Smith"
          },
          "websiteUrl": {
            "type": "string",
            "format": "uri",
            "example": "https://acme.com"
          },
          "legalName": {
            "type": "string"
          },
          "primaryColor": {
            "type": "string",
            "pattern": "^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$"
          }
        },
        "required": [
          "_id",
          "name"
        ]
      },
      "FinanceOptionPayloadDto": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "example": 5000
          },
          "type": {
            "type": "string",
            "enum": [
              "installments",
              "pay-later"
            ]
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ]
          },
          "nInstallments": {
            "type": "number"
          }
        },
        "required": [
          "amount",
          "type",
          "currency"
        ]
      },
      "PaymentOptionPayloadDto": {
        "type": "object",
        "properties": {
          "statusReason": {
            "type": "string",
            "example": "Account verification required"
          },
          "amount": {
            "type": "number",
            "example": 5000
          },
          "gateway": {
            "type": "string",
            "enum": [
              "zai",
              "asaas",
              "wise",
              "klarna",
              "transfermate",
              "bluesnap",
              "pagbank",
              "xe"
            ]
          },
          "type": {
            "type": "string",
            "enum": [
              "ZAI_CC",
              "ZAI_PAYID",
              "ZAI_BSBACC",
              "ZAI_PAYTO",
              "ZAI_DD",
              "AS_PIX",
              "AS_BOLETO",
              "PGBNK_CC",
              "WISE_MCACC",
              "KLARNA_PYMT",
              "TM_BANK_TRANSFER",
              "TM_CC",
              "BLUE_DD",
              "BLUE_CC",
              "BLUE_WERO",
              "EXTERNAL",
              "PARTNERSHIP",
              "OFFSET"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "disabled"
            ]
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ]
          },
          "settlementCurrencies": {
            "type": "string",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ]
          },
          "eta": {
            "type": "string",
            "enum": [
              "seconds",
              "2-days",
              "3-days",
              "4-days",
              "5-days",
              "unknown"
            ]
          },
          "fees": {
            "$ref": "#/components/schemas/FeesPayloadDto"
          },
          "partnerships": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartnershipPaymentOptionPayloadDto"
            }
          },
          "financingOptions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FinanceOptionPayloadDto"
            }
          }
        },
        "required": [
          "statusReason",
          "amount",
          "type",
          "status",
          "currency"
        ]
      },
      "StoredCardDto": {
        "type": "object",
        "properties": {
          "isLastCardUsed": {
            "type": "boolean"
          },
          "cardType": {
            "type": "string"
          },
          "cardSubType": {
            "type": "string"
          },
          "cardExpiryMonth": {
            "type": "string"
          },
          "cardExpiryYear": {
            "type": "string"
          },
          "cardNumber": {
            "type": "string"
          }
        },
        "required": [
          "isLastCardUsed",
          "cardType",
          "cardExpiryMonth",
          "cardExpiryYear",
          "cardNumber"
        ]
      },
      "SignSessionDataDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "example": "user@example.com"
          },
          "billingFirstName": {
            "type": "string",
            "example": "Jane"
          },
          "billingLastName": {
            "type": "string",
            "example": "Smith"
          },
          "phone": {
            "type": "string",
            "example": "+61 412 345 678"
          },
          "amount": {
            "type": "number",
            "example": 5000
          },
          "currency": {
            "type": "string",
            "example": "AUD"
          },
          "billingAddress": {
            "type": "string"
          },
          "billingCity": {
            "type": "string"
          },
          "billingCountry": {
            "type": "string"
          },
          "billingZip": {
            "type": "string"
          }
        }
      },
      "SignSessionDto": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/SignSessionDataDto"
          }
        },
        "required": [
          "data"
        ]
      },
      "PaymentGatewaySignZaiCcPayloadDto": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "storedCards": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StoredCardDto"
            }
          },
          "session": {
            "$ref": "#/components/schemas/SignSessionDto"
          }
        },
        "required": [
          "token",
          "userId"
        ]
      },
      "PaymentGatewaySignZaiPayIdDetailsPayloadDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "PayID"
          },
          "legalName": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "legalName"
        ]
      },
      "PaymentGatewaySignZaiPayIdPayloadDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "example": "user@example.com"
          },
          "userId": {
            "type": "string"
          },
          "details": {
            "$ref": "#/components/schemas/PaymentGatewaySignZaiPayIdDetailsPayloadDto"
          }
        },
        "required": [
          "email",
          "userId",
          "details"
        ]
      },
      "PaymentGatewaySignZaiBsbAccPayloadDto": {
        "type": "object",
        "properties": {
          "accountName": {
            "type": "string",
            "example": "Business Account"
          },
          "routingNumber": {
            "type": "string"
          },
          "accountNumber": {
            "type": "string"
          }
        },
        "required": [
          "accountName",
          "routingNumber",
          "accountNumber"
        ]
      },
      "PaymentGatewaySignZaiPayToPayloadDto": {
        "type": "object",
        "properties": {
          "authorizationId": {
            "type": "string",
            "description": "The internal authorization ID of the Direct Debit mandate",
            "example": "507f1f77bcf86cd799439011"
          }
        },
        "required": [
          "authorizationId"
        ]
      },
      "PaymentGatewaySignZaiDdPayloadDto": {
        "type": "object",
        "properties": {
          "authorizationId": {
            "type": "string",
            "description": "The internal authorization ID of the Direct Debit mandate",
            "example": "507f1f77bcf86cd799439011"
          }
        },
        "required": [
          "authorizationId"
        ]
      },
      "SessionDataDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "description": "Session data for the payment form",
            "additionalProperties": true
          }
        },
        "required": [
          "data"
        ]
      },
      "PaymentGatewaySignBlueCcPayloadDto": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "description": "Composite token: base64-encoded JSON with the BIN (first 6-8 digits of the card) and the BlueSnap pfToken. The server decodes this to look up issuing-country and other card metadata for fee calculation. Format: base64(JSON.stringify({ bin, token })).",
            "example": "eyJiaW4iOiI0MTExMTEiLCJ0b2tlbiI6InRva18xMjM0NTY3ODkwYWJjZGVmIn0="
          },
          "userId": {
            "type": "string",
            "description": "BlueSnap vaulted shopper ID",
            "example": "shopper_1234567890"
          },
          "storedCards": {
            "description": "Previously stored cards for the shopper",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StoredCardDto"
            }
          },
          "session": {
            "description": "Session context for the payment form",
            "allOf": [
              {
                "$ref": "#/components/schemas/SessionDataDto"
              }
            ]
          }
        },
        "required": [
          "token"
        ]
      },
      "PaymentGatewaySignBlueDdPayloadDto": {
        "type": "object",
        "properties": {
          "authorizationId": {
            "type": "string",
            "description": "The internal authorization ID of the Direct Debit mandate",
            "example": "507f1f77bcf86cd799439011"
          }
        },
        "required": [
          "authorizationId"
        ]
      },
      "PaymentGatewaySignAsPixPayloadDto": {
        "type": "object",
        "properties": {
          "qrCodeLink": {
            "type": "string",
            "example": "https://pix.example.com/qr/abc123"
          },
          "encodedQrCode": {
            "type": "string"
          }
        },
        "required": [
          "qrCodeLink",
          "encodedQrCode"
        ]
      },
      "PaymentGatewayAddressDto": {
        "type": "object",
        "properties": {
          "country": {
            "type": "string"
          },
          "line1": {
            "type": "string"
          },
          "line2": {
            "type": "string"
          },
          "postalCode": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "city": {
            "type": "string"
          }
        }
      },
      "PaymentGatewayContactDto": {
        "type": "object",
        "properties": {
          "contactId": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "phone": {
            "type": "string",
            "example": "+61 412 345 678"
          },
          "dob": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "$ref": "#/components/schemas/IdDto"
          },
          "address": {
            "$ref": "#/components/schemas/PaymentGatewayAddressDto"
          },
          "nativeName": {
            "$ref": "#/components/schemas/NativeNameDto"
          }
        }
      },
      "PaymentGatewayExtraOptions": {
        "type": "object",
        "properties": {
          "accountName": {
            "type": "string",
            "example": "Business Account"
          },
          "accountIdType": {
            "type": "string",
            "enum": [
              "PAYID",
              "BBAN",
              "IBAN"
            ]
          },
          "accountCategory": {
            "type": "string",
            "enum": [
              "PERSONAL_CHECKING",
              "PERSONAL_SAVINGS",
              "BUSINESS_CHECKING",
              "BUSINESS_SAVINGS"
            ]
          },
          "accountId": {
            "type": "string"
          },
          "accountAddress": {
            "$ref": "#/components/schemas/PaymentGatewayAddressDto"
          },
          "payIdType": {
            "type": "string",
            "enum": [
              "EMAL",
              "TELI"
            ]
          },
          "payId": {
            "type": "string"
          }
        },
        "required": [
          "accountIdType",
          "accountCategory"
        ]
      },
      "PaymentGatewaySignDto": {
        "type": "object",
        "properties": {
          "paymentIntentId": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "financing": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "amount": {
            "type": "number",
            "example": 5000
          },
          "documents": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "gateway": {
            "type": "string",
            "enum": [
              "zai",
              "asaas",
              "wise",
              "klarna",
              "transfermate",
              "bluesnap",
              "pagbank",
              "xe"
            ]
          },
          "signatureType": {
            "type": "string",
            "enum": [
              "ZAI_CC",
              "ZAI_PAYID",
              "ZAI_BSBACC",
              "ZAI_PAYTO",
              "ZAI_DD",
              "AS_PIX",
              "AS_BOLETO",
              "WISE_MCACC",
              "KLARNA_PYMT",
              "TM_BANK_TRANSFER",
              "TM_CC",
              "PGBNK_CC",
              "BLUE_DD",
              "BLUE_CC",
              "BLUE_WERO"
            ]
          },
          "signatureSubtype": {
            "type": "string"
          },
          "entity": {
            "type": "string",
            "enum": [
              "payment-intent",
              "payment-split"
            ]
          },
          "countryOfPayment": {
            "type": "string"
          },
          "payer": {
            "$ref": "#/components/schemas/PaymentGatewayPayerDto"
          },
          "contact": {
            "$ref": "#/components/schemas/PaymentGatewayContactDto"
          },
          "authorizationId": {
            "type": "string"
          },
          "authorizeAllPayments": {
            "type": "boolean"
          },
          "options": {
            "$ref": "#/components/schemas/PaymentGatewayExtraOptions"
          },
          "token": {
            "type": "string",
            "description": "Gateway-specific signing token returned by a previous /sign call.\nFor BLUE_CC: send the base64-encoded JSON `{ bin, token }` (BIN = first\n6-8 digits of the card, token = the BlueSnap pfToken). The server\ndecodes this to look up issuing-country metadata for fee calculation."
          },
          "feeChangeAccepted": {
            "type": "boolean",
            "description": "Set to true when the customer has acknowledged a fee change (surcharge or discount).\nWhen true, the sign flow will not throw missingInformation for fee differences\nand will proceed with the updated fees."
          },
          "purpose": {
            "type": "string",
            "description": "The purpose of the authorization. Defaults to 'payment-intent' if not provided.\nUse 'payment-intent-partial' for installment payment plans.",
            "enum": [
              "payment-intent",
              "payment-split",
              "payment-intent-partial"
            ]
          },
          "frequency": {
            "type": "string",
            "description": "Required when purpose is 'payment-intent-partial'.\nDefines how often the partial charges will be triggered.",
            "enum": [
              "every-week",
              "every-2-weeks",
              "every-month"
            ]
          }
        },
        "required": [
          "gateway",
          "signatureType",
          "entity"
        ]
      },
      "PaymentGatewaySendToProfile": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "example": "Jane"
          },
          "lastName": {
            "type": "string",
            "example": "Smith"
          }
        },
        "required": [
          "lastName"
        ]
      },
      "PaymentGatewaySendToDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "example": "user@example.com"
          },
          "notes": {
            "type": "string",
            "example": "Manual payment recorded by admin"
          },
          "type": {
            "type": "string",
            "enum": [
              "partner",
              "parent",
              "friend",
              "family",
              "colleague",
              "other",
              "myself"
            ]
          },
          "profile": {
            "$ref": "#/components/schemas/PaymentGatewaySendToProfile"
          }
        },
        "required": [
          "type"
        ]
      },
      "PaymentGatewaySendInstructionsDto": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "download",
              "send"
            ]
          },
          "signingPayload": {
            "$ref": "#/components/schemas/PaymentGatewaySignDto"
          },
          "sendTo": {
            "$ref": "#/components/schemas/PaymentGatewaySendToDto"
          }
        },
        "required": [
          "action",
          "signingPayload"
        ]
      },
      "PaymentCurrenciesDto": {
        "type": "object",
        "properties": {
          "payIn": {
            "description": "Accepted pay-in currencies",
            "example": [
              "AUD",
              "USD"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "payOut": {
            "description": "Accepted pay-out currencies",
            "example": [
              "AUD",
              "USD"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "PaymentGatewayDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "PARTNERSHIP",
              "EXTERNAL",
              "ZAI_CC",
              "ZAI_PAYID",
              "ZAI_DD",
              "ZAI_BSBACC",
              "ZAI_PAYTO",
              "AS_PIX",
              "AS_BOLETO",
              "WISE_MCACC",
              "PGBNK_CC",
              "KLARNA_PYMT",
              "TM_BANK_TRANSFER",
              "TM_CC",
              "BLUE_DD",
              "BLUE_CC"
            ],
            "example": "PayID"
          },
          "currency": {
            "$ref": "#/components/schemas/PaymentCurrenciesDto"
          },
          "category": {
            "type": "string",
            "enum": [
              "manual",
              "credit-card",
              "bank-transfer",
              "bank-debit",
              "voucher",
              "other"
            ]
          },
          "status": {
            "type": "boolean"
          },
          "gateway": {
            "type": "string",
            "enum": [
              "zai",
              "asaas",
              "wise",
              "klarna",
              "transfermate",
              "bluesnap",
              "pagbank",
              "xe"
            ]
          },
          "payInFeePayee": {
            "type": "string"
          },
          "advanceRelease": {
            "type": "string",
            "enum": [
              "never",
              "automatic",
              "manual"
            ]
          }
        },
        "required": [
          "name",
          "currency",
          "category"
        ]
      },
      "GatewayMethodPayloadDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "PARTNERSHIP",
              "EXTERNAL",
              "ZAI_CC",
              "ZAI_PAYID",
              "ZAI_DD",
              "ZAI_BSBACC",
              "ZAI_PAYTO",
              "AS_PIX",
              "AS_BOLETO",
              "WISE_MCACC",
              "PGBNK_CC",
              "KLARNA_PYMT",
              "TM_BANK_TRANSFER",
              "TM_CC",
              "BLUE_DD",
              "BLUE_CC"
            ],
            "example": "PayID"
          },
          "currency": {
            "$ref": "#/components/schemas/PaymentCurrenciesDto"
          },
          "category": {
            "type": "string",
            "enum": [
              "manual",
              "credit-card",
              "bank-transfer",
              "bank-debit",
              "voucher",
              "other"
            ]
          },
          "status": {
            "type": "boolean"
          },
          "gateway": {
            "type": "string",
            "enum": [
              "zai",
              "asaas",
              "wise",
              "klarna",
              "transfermate",
              "bluesnap",
              "pagbank",
              "xe"
            ]
          },
          "payInFeePayee": {
            "type": "string"
          },
          "advanceRelease": {
            "type": "string",
            "enum": [
              "never",
              "automatic",
              "manual"
            ]
          },
          "setup": {
            "type": "string",
            "description": "Gateway method setup status",
            "enum": [
              "complete",
              "pending"
            ],
            "example": "complete"
          },
          "supportsStatements": {
            "type": "boolean",
            "description": "Whether the gateway supports statement descriptors",
            "example": true
          }
        },
        "required": [
          "name",
          "currency",
          "category",
          "setup"
        ]
      },
      "UpdatePaymentMethodDto": {
        "type": "object",
        "properties": {
          "custom": {
            "type": "object",
            "additionalProperties": true,
            "description": "Custom gateway method configuration"
          },
          "status": {
            "type": "boolean"
          },
          "advanceRelease": {
            "type": "string",
            "enum": [
              "never",
              "automatic",
              "manual"
            ]
          },
          "payInFeePayee": {
            "type": "string",
            "enum": [
              "tenant",
              "contact"
            ]
          }
        },
        "required": [
          "status"
        ]
      },
      "GenerateStatementDto": {
        "type": "object",
        "properties": {
          "dateFrom": {
            "format": "date-time",
            "type": "string"
          },
          "dateTo": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ]
          }
        },
        "required": [
          "dateFrom",
          "dateTo",
          "currency"
        ]
      },
      "BankAccountRefPayloadDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Bank account ID (MongoDB ObjectId)",
            "example": "507f1f77bcf86cd799439011"
          },
          "default": {
            "type": "boolean",
            "description": "Whether this is the default bank account",
            "example": true
          },
          "country": {
            "type": "string",
            "description": "Country code (ISO 3166-1 alpha-2)",
            "example": "AU"
          },
          "currency": {
            "type": "string",
            "description": "Currency code (ISO 4217)",
            "example": "AUD"
          },
          "accountName": {
            "type": "string",
            "description": "Account holder name",
            "example": "John Doe"
          },
          "bankName": {
            "type": "string",
            "description": "Bank name",
            "example": "Commonwealth Bank"
          },
          "accountNumber": {
            "type": "string",
            "description": "Account number",
            "example": "12345678"
          },
          "iban": {
            "type": "string",
            "description": "IBAN (International Bank Account Number)",
            "example": "DE89370400440532013000"
          },
          "status": {
            "type": "string",
            "description": "Bank account status",
            "example": "active"
          }
        },
        "required": [
          "_id"
        ]
      },
      "FxRefPayloadDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "FX record ID (MongoDB ObjectId)",
            "example": "507f1f77bcf86cd799439011"
          },
          "targetCurrency": {
            "type": "string",
            "description": "Target currency (ISO 4217)",
            "example": "USD"
          },
          "targetAmount": {
            "type": "number",
            "description": "Target amount in cents",
            "example": 10000
          },
          "fxRate": {
            "type": "number",
            "description": "FX exchange rate",
            "example": 0.65
          },
          "status": {
            "type": "string",
            "description": "FX status",
            "example": "completed"
          },
          "reference": {
            "type": "string",
            "description": "Gateway reference ID",
            "example": "FX-12345"
          },
          "expectedAt": {
            "format": "date-time",
            "type": "string",
            "description": "Expected settlement date",
            "example": "2024-01-15T09:30:00.000Z"
          }
        },
        "required": [
          "_id"
        ]
      },
      "TransactionRefDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Transaction ID (MongoDB ObjectId)",
            "example": "507f1f77bcf86cd799439011"
          },
          "status": {
            "type": "string",
            "description": "Transaction status",
            "example": "succeeded"
          },
          "transactionType": {
            "type": "string",
            "description": "Transaction type",
            "example": "charge"
          }
        },
        "required": [
          "_id"
        ]
      },
      "PayoutPayloadDto": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "example": 5000
          },
          "failedReason": {
            "type": "string",
            "example": "Insufficient funds in source account"
          },
          "pausedReason": {
            "type": "string",
            "example": "Awaiting compliance review"
          },
          "number": {
            "type": "number"
          },
          "invoiceNumber": {
            "type": "string"
          },
          "transaction": {
            "description": "Transaction reference (raw ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/TransactionRefDto"
              }
            ]
          },
          "partnership": {
            "description": "Partnership reference (raw ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/PartnershipRefDto"
              }
            ]
          },
          "rcti": {
            "type": "boolean"
          },
          "ti": {
            "type": "boolean"
          },
          "gateway": {
            "type": "string",
            "description": "Payment gateway",
            "enum": [
              "zai",
              "asaas",
              "transfermate",
              "pagbank",
              "wise"
            ],
            "example": "zai"
          },
          "status": {
            "type": "string",
            "description": "Payout status",
            "enum": [
              "pending",
              "review-pending",
              "processing",
              "failed",
              "paused",
              "paid"
            ],
            "example": "pending"
          },
          "statementDescriptor": {
            "type": "string"
          },
          "paymentSplit": {
            "type": "string"
          },
          "paymentIntent": {
            "description": "Payment intent reference (raw ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/PaymentIntentRefDto"
              }
            ]
          },
          "automatic": {
            "type": "boolean"
          },
          "currency": {
            "type": "string",
            "description": "Currency code (ISO 4217)",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "failedAt": {
            "format": "date-time",
            "type": "string"
          },
          "pausedAt": {
            "format": "date-time",
            "type": "string"
          },
          "paidAt": {
            "format": "date-time",
            "type": "string"
          },
          "nAttempts": {
            "type": "number"
          },
          "method": {
            "type": "string",
            "description": "Payout method",
            "enum": [
              "GATEWAY",
              "EXTERNAL",
              "SUPPLIER_PAYOUT",
              "MARKUP_PAYOUT"
            ],
            "example": "GATEWAY"
          },
          "methodReason": {
            "type": "string",
            "description": "Reason for the chosen payout method",
            "enum": [
              "user-request",
              "payment-paid-partial",
              "bank-account-country-not-supported",
              "gateway-intervention-required",
              "partnership-payment-splits-not-paid",
              "patnership-payment-split-not-supported",
              "gross-payout-behavior",
              "transaction-migrated",
              "over-allocation",
              "duplicate-split"
            ],
            "example": "user-request"
          },
          "bankAccount": {
            "description": "Bank account reference (raw ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/BankAccountRefPayloadDto"
              }
            ]
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "via": {
            "type": "string",
            "description": "Parent payout ID (remittance advice chain)",
            "example": "507f1f77bcf86cd799439011"
          },
          "destinationType": {
            "type": "string",
            "description": "Payout destination type",
            "enum": [
              "partnership",
              "tenant"
            ],
            "example": "partnership"
          },
          "traceId": {
            "type": "string"
          },
          "fees": {
            "$ref": "#/components/schemas/FeeSchema"
          },
          "fx": {
            "description": "FX conversion reference (raw ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/FxRefPayloadDto"
              }
            ]
          },
          "_id": {
            "type": "string"
          }
        },
        "required": [
          "amount",
          "number",
          "partnership",
          "rcti",
          "ti",
          "status",
          "currency",
          "method",
          "createdAt",
          "_id"
        ]
      },
      "PayoutDetailPayloadDto": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "example": 5000
          },
          "failedReason": {
            "type": "string",
            "example": "Insufficient funds in source account"
          },
          "pausedReason": {
            "type": "string",
            "example": "Awaiting compliance review"
          },
          "number": {
            "type": "number"
          },
          "invoiceNumber": {
            "type": "string"
          },
          "transaction": {
            "description": "Transaction reference (raw ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/TransactionRefDto"
              }
            ]
          },
          "partnership": {
            "description": "Partnership receiving this payout (populated)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/PartnershipRefDto"
              }
            ],
            "allOf": [
              {
                "$ref": "#/components/schemas/PartnershipRefDto"
              }
            ]
          },
          "rcti": {
            "type": "boolean"
          },
          "ti": {
            "type": "boolean"
          },
          "gateway": {
            "type": "string",
            "description": "Payment gateway",
            "enum": [
              "zai",
              "asaas",
              "transfermate",
              "pagbank",
              "wise"
            ],
            "example": "zai"
          },
          "status": {
            "type": "string",
            "description": "Payout status",
            "enum": [
              "pending",
              "review-pending",
              "processing",
              "failed",
              "paused",
              "paid"
            ],
            "example": "pending"
          },
          "statementDescriptor": {
            "type": "string"
          },
          "paymentSplit": {
            "type": "string"
          },
          "paymentIntent": {
            "description": "Payment intent reference (raw ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/PaymentIntentRefDto"
              }
            ]
          },
          "automatic": {
            "type": "boolean"
          },
          "currency": {
            "type": "string",
            "description": "Currency code (ISO 4217)",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "failedAt": {
            "format": "date-time",
            "type": "string"
          },
          "pausedAt": {
            "format": "date-time",
            "type": "string"
          },
          "paidAt": {
            "format": "date-time",
            "type": "string"
          },
          "nAttempts": {
            "type": "number"
          },
          "method": {
            "type": "string",
            "description": "Payout method",
            "enum": [
              "GATEWAY",
              "EXTERNAL",
              "SUPPLIER_PAYOUT",
              "MARKUP_PAYOUT"
            ],
            "example": "GATEWAY"
          },
          "methodReason": {
            "type": "string",
            "description": "Reason for the chosen payout method",
            "enum": [
              "user-request",
              "payment-paid-partial",
              "bank-account-country-not-supported",
              "gateway-intervention-required",
              "partnership-payment-splits-not-paid",
              "patnership-payment-split-not-supported",
              "gross-payout-behavior",
              "transaction-migrated",
              "over-allocation",
              "duplicate-split"
            ],
            "example": "user-request"
          },
          "bankAccount": {
            "description": "Bank account for this payout (populated)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/BankAccountRefPayloadDto"
              }
            ],
            "allOf": [
              {
                "$ref": "#/components/schemas/BankAccountRefPayloadDto"
              }
            ]
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "via": {
            "type": "string",
            "description": "Parent payout ID (remittance advice chain)",
            "example": "507f1f77bcf86cd799439011"
          },
          "destinationType": {
            "type": "string",
            "description": "Payout destination type",
            "enum": [
              "partnership",
              "tenant"
            ],
            "example": "partnership"
          },
          "traceId": {
            "type": "string"
          },
          "fees": {
            "$ref": "#/components/schemas/FeeSchema"
          },
          "fx": {
            "description": "FX conversion details for this payout (populated)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/FxRefPayloadDto"
              }
            ],
            "allOf": [
              {
                "$ref": "#/components/schemas/FxRefPayloadDto"
              }
            ]
          },
          "_id": {
            "type": "string"
          }
        },
        "required": [
          "amount",
          "number",
          "rcti",
          "ti",
          "status",
          "currency",
          "method",
          "createdAt",
          "_id"
        ]
      },
      "FinancingOptionsPaymentDto": {
        "type": "object",
        "properties": {
          "paymentIntent": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "amount": {
            "type": "number",
            "minimum": 0.01,
            "example": 5000
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "gateway": {
            "type": "string",
            "enum": [
              "klarna",
              "pagbank"
            ]
          },
          "method": {
            "type": "string",
            "enum": [
              "KLARNA_PYMT",
              "PGBNK_CC"
            ]
          }
        },
        "required": [
          "gateway",
          "method"
        ]
      },
      "SimulateFinancingPaymentDto": {
        "type": "object",
        "properties": {
          "paymentIntent": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "amount": {
            "type": "number",
            "minimum": 0.01,
            "example": 5000
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "nInstallments": {
            "type": "number",
            "minimum": 1
          },
          "gateway": {
            "type": "string",
            "enum": [
              "klarna",
              "pagbank"
            ]
          },
          "method": {
            "type": "string",
            "enum": [
              "KLARNA_PYMT",
              "PGBNK_CC"
            ]
          }
        },
        "required": [
          "nInstallments",
          "gateway",
          "method"
        ]
      },
      "CreateFxQuoteDto": {
        "type": "object",
        "properties": {
          "sourceCurrency": {
            "type": "object",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "targetCurrency": {
            "type": "object",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "USD"
          },
          "sourceAmount": {
            "type": "number",
            "minimum": 0,
            "example": 10000
          },
          "targetCountry": {
            "type": "string"
          }
        },
        "required": [
          "sourceCurrency",
          "targetCurrency",
          "sourceAmount",
          "targetCountry"
        ]
      },
      "PayIdDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "TELI",
              "EMAL"
            ]
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "id",
          "name"
        ]
      },
      "DebtorProfile": {
        "type": "object",
        "properties": {
          "phone": {
            "type": "string",
            "example": "+61 412 345 678"
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          }
        },
        "required": [
          "phone",
          "firstName",
          "lastName"
        ]
      },
      "DebtorAddress": {
        "type": "object",
        "properties": {
          "line1": {
            "type": "string"
          },
          "line2": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "postalCode": {
            "type": "string"
          }
        },
        "required": [
          "line1",
          "city",
          "state",
          "country",
          "postalCode"
        ]
      },
      "AuhtorizationDebtorInfo": {
        "type": "object",
        "properties": {
          "accountIdType": {
            "type": "string",
            "enum": [
              "PAYID",
              "BBAN",
              "IBAN"
            ]
          },
          "accountCategory": {
            "type": "string",
            "enum": [
              "PERSONAL_CHECKING",
              "PERSONAL_SAVINGS",
              "BUSINESS_CHECKING",
              "BUSINESS_SAVINGS"
            ]
          },
          "debtorType": {
            "type": "string",
            "enum": [
              "myself",
              "partner",
              "parent",
              "friend",
              "family",
              "colleague",
              "other"
            ]
          },
          "accountId": {
            "type": "string"
          },
          "accountName": {
            "type": "string"
          },
          "payIdDetails": {
            "$ref": "#/components/schemas/PayIdDetails"
          },
          "email": {
            "type": "string"
          },
          "profile": {
            "$ref": "#/components/schemas/DebtorProfile"
          },
          "address": {
            "$ref": "#/components/schemas/DebtorAddress"
          }
        },
        "required": [
          "accountIdType",
          "accountCategory",
          "debtorType",
          "accountId",
          "accountName",
          "payIdDetails",
          "email",
          "profile",
          "address"
        ]
      },
      "AuthorizationDetails": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "maximumAmount": {
            "type": "number",
            "example": 50000
          },
          "endDate": {
            "format": "date-time",
            "type": "string"
          },
          "debtorInfo": {
            "$ref": "#/components/schemas/AuhtorizationDebtorInfo"
          },
          "signature": {
            "type": "string"
          },
          "ipAddress": {
            "type": "string"
          }
        },
        "required": [
          "currency",
          "maximumAmount",
          "endDate",
          "debtorInfo"
        ]
      },
      "AuthorizationPayloadDto": {
        "type": "object",
        "properties": {
          "number": {
            "type": "number"
          },
          "method": {
            "type": "string",
            "enum": [
              "ZAI_PAYTO",
              "ZAI_DD",
              "BLUE_DD"
            ]
          },
          "agreementId": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "UNKNOWN",
              "PENDING_VALIDATION",
              "VALIDATED",
              "VALIDATION_FAILED",
              "PENDING_CREATION",
              "CREATED",
              "CREATION_FAILED",
              "ACTIVE",
              "SUSPENDED",
              "CANCELED"
            ]
          },
          "details": {
            "$ref": "#/components/schemas/AuthorizationDetails"
          },
          "contact": {
            "description": "Contact reference (ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/ContactRefDto"
              }
            ]
          },
          "onActivePay": {
            "type": "string"
          },
          "paymentIntents": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "purpose": {
            "type": "string",
            "enum": [
              "payment-intent",
              "payment-split",
              "payment-intent-partial"
            ]
          },
          "partnership": {
            "description": "Partnership reference (ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/PartnershipRefDto"
              }
            ]
          },
          "stats": {
            "$ref": "#/components/schemas/Stats"
          },
          "subscription": {
            "type": "string",
            "description": "Reference to the subscription created for payment-intent-partial purpose.\nThis links the authorization to its associated subscription for partial payments."
          },
          "frequency": {
            "type": "string",
            "description": "The frequency of partial payments for payment-intent-partial purpose.",
            "enum": [
              "every-week",
              "every-2-weeks",
              "every-month"
            ]
          },
          "_id": {
            "type": "string"
          }
        },
        "required": [
          "number",
          "method",
          "type",
          "status",
          "details",
          "contact",
          "paymentIntents",
          "purpose",
          "stats",
          "_id"
        ]
      },
      "PaymentGatewayAuthorizationFindOneDto": {
        "type": "object",
        "properties": {
          "authorizationId": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "paymentIntentId": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          }
        }
      },
      "AuthorizationLogPayloadDto": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "example": 5000
          },
          "statusDescription": {
            "type": "string",
            "example": "Transaction approved by issuing bank"
          },
          "authorization": {
            "description": "Authorization reference (ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/GatewayAuthorizationRefDto"
              }
            ]
          },
          "paymentIntent": {
            "type": "string"
          },
          "category": {
            "type": "string",
            "enum": [
              "payment-initiation",
              "authorization"
            ]
          },
          "method": {
            "type": "string",
            "enum": [
              "ZAI_PAYTO",
              "ZAI_DD",
              "BLUE_DD"
            ]
          },
          "contact": {
            "description": "Contact reference (ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/ContactRefDto"
              }
            ]
          },
          "event": {
            "type": "string",
            "enum": [
              "CREATE_AUTHORIZATION",
              "UPDATE_AUTHORIZATION",
              "PENDING_PAYMENT_INITIATION",
              "PAYMENT_INITIATED",
              "PAYMENT_INITIATION_COMPLETED",
              "PAYMENT_INITIATION_BANK_PROCESSING",
              "PAYMENT_INITIATION_REJECTED",
              "PAYMENT_INITIATION_NO_MORE_RETRIES",
              "PAYMENT_INITIATION_UNEXPECTED_FAILURE",
              "PAYMENT_INITIATION_SUPRESSED_AGREEMENT_NOT_ACTIVE",
              "PAYMENT_INITIATION_SUPRESSED_HIGHER_AMOUNT_THAN_AUTHORIZED",
              "PAYMENT_INITIATION_SUPRESSED_STATUS_PROCESSING",
              "PAYMENT_INITIATION_SUPRESSED_STATUS_REFUNDED_FULL",
              "PAYMENT_INITIATION_SUPRESSED_STATUS_REFUNDED_PARTIAL",
              "PAYMENT_INITIATION_SUPRESSED_STATUS_PAID_FULL",
              "PAYMENT_INITIATION_SUPRESSED_STATUS_PAID_PARTIAL",
              "PAYMENT_INITIATION_SUPRESSED_STATUS_CANCELED",
              "PAYMENT_INITIATION_SUPRESSED_STATUS_REQUIRES_CONDITION",
              "PAYMENT_INITIATION_SUPRESSED_STATUS_REVIEW_PENDING",
              "PAYMENT_INITIATION_SUPRESSED_AUTHORIZATIONS_MISSING_ON_PAYMENT",
              "PAYMENT_INITIATION_SUPRESSED_AUTHORIZATION_MISSING_ON_PAYMENT",
              "PAYMENT_INITIATION_QUEUED_EXECUTION",
              "PAYMENT_INITIATION_QUEUED_EXECUTION_RETRY",
              "PAYMENT_INITIATION_QUEUED_EXECUTION_FAILED",
              "PAYMENT_INITIATION_SUPRESSED_PAYMENT_NOT_FOUND",
              "PAYMENT_INITIATION_RECONCILED_BY_QUALY"
            ]
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "status": {
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "nRetryAttempts": {
            "type": "number"
          },
          "remittanceInfo": {
            "type": "string"
          },
          "_id": {
            "type": "string"
          }
        },
        "required": [
          "authorization",
          "category",
          "method",
          "event",
          "status",
          "createdAt",
          "_id"
        ]
      },
      "PaymentGatewayAuthorizationAuthorizeDto": {
        "type": "object",
        "properties": {
          "paymentIntentId": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "paymentSplitId": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "amount": {
            "type": "number",
            "minimum": 1,
            "example": 5000
          },
          "signature": {
            "type": "string"
          },
          "ipAddress": {
            "type": "string"
          }
        }
      },
      "AuhtorizationOptionsPayloadDto": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "agreement-pdf",
              "cancel"
            ]
          },
          "available": {
            "type": "boolean",
            "example": true
          }
        },
        "required": [
          "action",
          "available"
        ]
      },
      "DsarExportMetadataDto": {
        "type": "object",
        "properties": {
          "exportVersion": {
            "type": "string",
            "example": "1.0"
          },
          "format": {
            "type": "string",
            "example": "json"
          },
          "gdprArticles": {
            "example": [
              "Art. 15 — Right of Access",
              "Art. 20 — Data Portability"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "totalRecords": {
            "type": "number",
            "example": 42
          }
        },
        "required": [
          "exportVersion",
          "format",
          "gdprArticles",
          "totalRecords"
        ]
      },
      "DsarExportPayloadDto": {
        "type": "object",
        "properties": {
          "exportedAt": {
            "type": "string",
            "example": "2026-03-03T08:00:00.000Z"
          },
          "dataSubject": {
            "type": "object",
            "description": "Full contact profile and personal data",
            "additionalProperties": true
          },
          "paymentIntents": {
            "type": "array",
            "description": "Payment intents linked to this contact",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "transactions": {
            "type": "array",
            "description": "Transactions linked to this contact",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "bankAccounts": {
            "type": "array",
            "description": "Bank accounts linked to this contact (sensitive fields masked)",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "orders": {
            "type": "array",
            "description": "Orders linked to this contact",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "orderItems": {
            "type": "array",
            "description": "Order items linked to this contact",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "formSubmissions": {
            "type": "array",
            "description": "Form submissions linked to this contact",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "notifications": {
            "type": "array",
            "description": "Notifications sent to this contact",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "activities": {
            "type": "array",
            "description": "Activity log entries for this contact",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "subscriptions": {
            "type": "array",
            "description": "Subscriptions linked to this contact",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/DsarExportMetadataDto"
          }
        },
        "required": [
          "exportedAt",
          "dataSubject",
          "paymentIntents",
          "transactions",
          "bankAccounts",
          "orders",
          "orderItems",
          "formSubmissions",
          "notifications",
          "activities",
          "subscriptions",
          "metadata"
        ]
      },
      "CurrencyAmountDto": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "example": 100000
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          }
        },
        "required": [
          "amount",
          "currency"
        ]
      },
      "UpdateComplianceRiskDto": {
        "type": "object",
        "properties": {
          "salesVolume": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CurrencyAmountDto"
            }
          },
          "highestTransactionAmount": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CurrencyAmountDto"
            }
          },
          "averageTransactionAmount": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CurrencyAmountDto"
            }
          },
          "riskMonitoring": {
            "type": "boolean"
          },
          "riskPayment": {
            "type": "boolean"
          },
          "riskByCommission": {
            "type": "boolean"
          }
        }
      },
      "ComplianceSummaryPayloadDto": {
        "type": "object",
        "properties": {
          "totalRequirements": {
            "type": "number",
            "description": "Total number of requirements",
            "example": 15
          },
          "pendingCount": {
            "type": "number",
            "description": "Number of pending requirements",
            "example": 3
          },
          "completeCount": {
            "type": "number",
            "description": "Number of complete requirements",
            "example": 10
          },
          "failedCount": {
            "type": "number",
            "description": "Number of failed requirements",
            "example": 1
          },
          "waivedCount": {
            "type": "number",
            "description": "Number of waived requirements",
            "example": 0
          },
          "archivedCount": {
            "type": "number",
            "description": "Number of archived requirements",
            "example": 1
          },
          "lastAssessedAt": {
            "type": "string",
            "nullable": true,
            "description": "Date of last assessment",
            "example": "2024-01-15T00:00:00.000Z"
          },
          "hasValidSignature": {
            "type": "boolean",
            "description": "Whether the tenant has a valid signature",
            "example": true
          }
        },
        "required": [
          "totalRequirements",
          "pendingCount",
          "completeCount",
          "failedCount",
          "waivedCount",
          "archivedCount",
          "hasValidSignature"
        ]
      },
      "ComplianceRequirementItemDto": {
        "type": "object",
        "properties": {
          "category": {
            "type": "string",
            "enum": [
              "info",
              "marketing",
              "billing",
              "taxIds",
              "bankAccounts",
              "tcAcceptance",
              "documents",
              "relevantIndividuals"
            ],
            "description": "Requirement category"
          },
          "key": {
            "type": "string",
            "description": "Requirement key",
            "example": "billing.taxIds"
          },
          "status": {
            "type": "string",
            "enum": [
              "complete",
              "incomplete",
              "pending"
            ],
            "description": "Requirement status"
          },
          "reason": {
            "type": "string",
            "description": "Failure reason",
            "example": "Identity verification pending"
          },
          "failedAt": {
            "type": "string",
            "nullable": true,
            "description": "Date of failure",
            "example": "2024-02-10T14:30:00.000Z"
          },
          "completedAt": {
            "type": "string",
            "nullable": true,
            "description": "Date of completion",
            "example": "2024-02-15T10:00:00.000Z"
          },
          "lastUpdatedBy": {
            "type": "string",
            "description": "User who last updated this requirement",
            "example": "507f1f77bcf86cd799439011"
          },
          "type": {
            "type": "string",
            "enum": [
              "data",
              "question"
            ],
            "description": "Requirement type"
          },
          "question": {
            "type": "string",
            "description": "Question text",
            "example": "What is your business registration number?"
          },
          "answer": {
            "type": "object",
            "description": "Answer value",
            "additionalProperties": true
          },
          "data": {
            "type": "object",
            "description": "Additional data",
            "additionalProperties": true
          }
        },
        "required": [
          "category",
          "key",
          "status",
          "type"
        ]
      },
      "ComplianceRequirementsPayloadDto": {
        "type": "object",
        "properties": {
          "requirements": {
            "description": "List of compliance requirements",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ComplianceRequirementItemDto"
            }
          }
        },
        "required": [
          "requirements"
        ]
      },
      "UploadComplianceDocumentDto": {
        "type": "object",
        "properties": {
          "base64": {
            "type": "string"
          },
          "type": {
            "type": "object"
          },
          "ownerType": {
            "enum": [
              "legal-entity",
              "individual",
              "tenant"
            ],
            "type": "string"
          },
          "ownerId": {
            "type": "string"
          }
        },
        "required": [
          "base64",
          "type",
          "ownerType"
        ]
      },
      "ConfirmComplianceDocumentDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "object"
          },
          "ownerType": {
            "enum": [
              "legal-entity",
              "individual",
              "tenant"
            ],
            "type": "string"
          },
          "ownerId": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "ownerType"
        ]
      },
      "UpsertRelevantIndividualDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "firstName": {
            "type": "string",
            "example": "Jane"
          },
          "lastName": {
            "type": "string",
            "example": "Smith"
          },
          "email": {
            "type": "string",
            "format": "email",
            "example": "contact@example.com"
          },
          "phone": {
            "type": "string",
            "example": "+61 412 345 678"
          },
          "privileges": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "director",
                "controlling",
                "beneficial",
                "authorized"
              ]
            }
          },
          "shares": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "dob": {
            "format": "date-time",
            "type": "string"
          },
          "address": {
            "$ref": "#/components/schemas/AddressDto"
          },
          "nationality": {
            "type": "string"
          },
          "id": {
            "$ref": "#/components/schemas/IdDto"
          }
        }
      },
      "TcAcceptanceDto": {
        "type": "object",
        "properties": {
          "base64": {
            "type": "string"
          }
        }
      },
      "SubmitClarificationDto": {
        "type": "object",
        "properties": {
          "answer": {
            "type": "string",
            "maxLength": 10000
          }
        },
        "required": [
          "answer"
        ]
      },
      "SubscriptionDescription": {
        "type": "object",
        "properties": {
          "internal": {
            "type": "string"
          },
          "external": {
            "type": "string"
          }
        }
      },
      "ScheduleSchema": {
        "type": "object",
        "properties": {
          "frequency": {
            "type": "string",
            "enum": [
              "every-week",
              "every-2-weeks",
              "every-month"
            ]
          },
          "dayOfMonth": {
            "type": "number"
          },
          "dayOfWeek": {
            "type": "number"
          }
        },
        "required": [
          "frequency"
        ]
      },
      "SubscriptionStats": {
        "type": "object",
        "properties": {
          "total": {
            "type": "number",
            "example": 50000
          },
          "nPaymentsCreated": {
            "type": "number"
          },
          "lastPaymentCreatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "nextPaymentDueAt": {
            "format": "date-time",
            "type": "string"
          },
          "nChargesTriggered": {
            "type": "number",
            "description": "For payment-intent-partial mode: number of charges triggered against the source payment intent"
          },
          "totalCharged": {
            "type": "number",
            "description": "For payment-intent-partial mode: total amount successfully charged"
          },
          "lastChargeTriggeredAt": {
            "format": "date-time",
            "type": "string",
            "description": "For payment-intent-partial mode: when the last charge was triggered"
          },
          "nextChargeDueAt": {
            "format": "date-time",
            "type": "string",
            "description": "For payment-intent-partial mode: when the next charge is due"
          }
        }
      },
      "SubscriptionPayloadDto": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "example": 5000
          },
          "number": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "$ref": "#/components/schemas/SubscriptionDescription"
          },
          "status": {
            "type": "string",
            "description": "Subscription status",
            "enum": [
              "active",
              "canceled",
              "expired"
            ]
          },
          "mode": {
            "type": "string",
            "description": "Subscription mode",
            "enum": [
              "schedule",
              "amount-cap",
              "payment-intent-partial"
            ]
          },
          "contact": {
            "description": "Contact reference",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/ContactRefDto"
              }
            ]
          },
          "paymentIntents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ObjectId"
            }
          },
          "paymentIntent": {
            "description": "The source payment intent for payment-intent-partial mode.\nThis is the payment intent whose due amount will be paid in installments.",
            "allOf": [
              {
                "$ref": "#/components/schemas/ObjectId"
              }
            ]
          },
          "service": {
            "$ref": "#/components/schemas/ObjectId"
          },
          "currency": {
            "type": "string",
            "description": "Subscription currency",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "settlementCurrency": {
            "type": "string",
            "description": "Settlement currency (optional)",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "USD"
          },
          "billing": {
            "$ref": "#/components/schemas/BillingSchema"
          },
          "schedule": {
            "$ref": "#/components/schemas/ScheduleSchema"
          },
          "primaryTeams": {
            "description": "Primary teams assigned to this subscription (ObjectId references)",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "stats": {
            "$ref": "#/components/schemas/SubscriptionStats"
          },
          "authorizations": {
            "description": "Gateway authorizations (ObjectId references)",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "_id": {
            "$ref": "#/components/schemas/ObjectId"
          }
        },
        "required": [
          "amount",
          "number",
          "name",
          "description",
          "status",
          "mode",
          "contact",
          "paymentIntents",
          "currency",
          "stats",
          "createdAt",
          "updatedAt",
          "_id"
        ]
      },
      "SubscriptionDescriptionDto": {
        "type": "object",
        "properties": {
          "internal": {
            "type": "string"
          },
          "external": {
            "type": "string"
          }
        }
      },
      "SubscriptionBillingDto": {
        "type": "object",
        "properties": {
          "endAmount": {
            "type": "number",
            "minimum": 1,
            "example": 9900
          },
          "startAt": {
            "format": "date-time",
            "type": "string"
          },
          "endAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "startAt"
        ]
      },
      "SubscriptionScheduleDto": {
        "type": "object",
        "properties": {
          "frequency": {
            "type": "string",
            "enum": [
              "every-week",
              "every-2-weeks",
              "every-month"
            ]
          },
          "dayOfMonth": {
            "type": "number",
            "minimum": 1,
            "maximum": 28
          },
          "dayOfWeek": {
            "type": "number",
            "minimum": 0,
            "maximum": 6
          }
        },
        "required": [
          "frequency"
        ]
      },
      "CreateSubscriptionDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Monthly Plan"
          },
          "mode": {
            "type": "string",
            "enum": [
              "schedule",
              "amount-cap",
              "payment-intent-partial"
            ]
          },
          "contact": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "amount": {
            "type": "number",
            "minimum": 1,
            "example": 9900
          },
          "service": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "currency": {
            "type": "object",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "settlementCurrency": {
            "type": "object",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "USD"
          },
          "custom": {
            "type": "object",
            "additionalProperties": true
          },
          "description": {
            "$ref": "#/components/schemas/SubscriptionDescriptionDto"
          },
          "billing": {
            "$ref": "#/components/schemas/SubscriptionBillingDto"
          },
          "schedule": {
            "$ref": "#/components/schemas/SubscriptionScheduleDto"
          }
        },
        "required": [
          "name",
          "mode",
          "contact",
          "amount",
          "service",
          "currency",
          "billing",
          "schedule"
        ]
      },
      "UpdateSubscriptionDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Monthly Plan"
          },
          "mode": {
            "type": "string",
            "enum": [
              "schedule",
              "amount-cap",
              "payment-intent-partial"
            ]
          },
          "contact": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "amount": {
            "type": "number",
            "minimum": 1,
            "example": 9900
          },
          "service": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "currency": {
            "type": "object",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "settlementCurrency": {
            "type": "object",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "USD"
          },
          "custom": {
            "type": "object",
            "additionalProperties": true
          },
          "description": {
            "$ref": "#/components/schemas/SubscriptionDescriptionDto"
          },
          "billing": {
            "$ref": "#/components/schemas/SubscriptionBillingDto"
          },
          "schedule": {
            "$ref": "#/components/schemas/SubscriptionScheduleDto"
          },
          "status": {
            "type": "string",
            "enum": [
              "canceled"
            ]
          }
        }
      },
      "SubscriptionOptionPayloadDto": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "description": "The action name",
            "example": "cancel"
          },
          "available": {
            "type": "boolean",
            "description": "Whether this action is available",
            "example": true
          }
        },
        "required": [
          "action",
          "available"
        ]
      },
      "FieldOptionDto": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "description": "Option label",
            "example": "Option A"
          },
          "description": {
            "type": "string",
            "description": "Option description",
            "example": "Enter your company registration number"
          },
          "value": {
            "description": "Option value",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              }
            ],
            "example": "option_a"
          }
        },
        "required": [
          "label",
          "value"
        ]
      },
      "FieldPayloadDto": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "example": "Enter your company registration number"
          },
          "entity": {
            "type": "string",
            "description": "Entity type this field belongs to",
            "enum": [
              "contact",
              "task",
              "order-item",
              "payment-intent"
            ],
            "example": "contact"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "groupName": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "internalName": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "hidden": {
            "type": "boolean"
          },
          "archived": {
            "type": "boolean"
          },
          "fieldType": {
            "type": "string",
            "description": "Type of field control",
            "enum": [
              "checkbox",
              "date",
              "number",
              "radio",
              "select",
              "text",
              "textarea"
            ],
            "example": "text"
          },
          "options": {
            "description": "Options for select, radio, or checkbox fields",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FieldOptionDto"
            }
          },
          "displayPortal": {
            "type": "boolean"
          },
          "displayEcommerce": {
            "type": "boolean"
          },
          "createdBy": {
            "description": "User who created this field (ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          }
        },
        "required": [
          "entity",
          "scopes",
          "name",
          "internalName",
          "label",
          "hidden",
          "archived",
          "fieldType",
          "displayPortal",
          "createdBy"
        ]
      },
      "CreateFieldOptionsDto": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "example": "Enter your company registration number"
          },
          "value": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              }
            ],
            "description": "Option value (string or number)",
            "example": "option_a"
          },
          "label": {
            "type": "string"
          }
        },
        "required": [
          "label"
        ]
      },
      "CreateFieldDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Company Size"
          },
          "description": {
            "type": "string",
            "example": "Enter your company registration number"
          },
          "entity": {
            "type": "string",
            "enum": [
              "contact",
              "task",
              "order-item",
              "payment-intent"
            ]
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "insert",
                "update"
              ]
            }
          },
          "groupName": {
            "type": "string"
          },
          "internalName": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "placeholder": {
            "type": "string"
          },
          "hidden": {
            "type": "boolean"
          },
          "fieldType": {
            "type": "string",
            "enum": [
              "checkbox",
              "date",
              "number",
              "radio",
              "select",
              "text",
              "textarea"
            ]
          },
          "displayPortal": {
            "type": "boolean"
          },
          "displayEcommerce": {
            "type": "boolean"
          },
          "options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateFieldOptionsDto"
            }
          }
        },
        "required": [
          "name",
          "entity",
          "scopes",
          "groupName",
          "internalName",
          "label",
          "fieldType"
        ]
      },
      "UpdateFieldDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Company Size"
          },
          "description": {
            "type": "string",
            "example": "Enter your company registration number"
          },
          "entity": {
            "type": "string",
            "enum": [
              "contact",
              "task",
              "order-item",
              "payment-intent"
            ]
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "insert",
                "update"
              ]
            }
          },
          "groupName": {
            "type": "string"
          },
          "internalName": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "placeholder": {
            "type": "string"
          },
          "hidden": {
            "type": "boolean"
          },
          "fieldType": {
            "type": "string",
            "enum": [
              "checkbox",
              "date",
              "number",
              "radio",
              "select",
              "text",
              "textarea"
            ]
          },
          "displayPortal": {
            "type": "boolean"
          },
          "displayEcommerce": {
            "type": "boolean"
          },
          "options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateFieldOptionsDto"
            }
          }
        }
      },
      "EventRefDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Event ID (MongoDB ObjectId)",
            "example": "507f1f77bcf86cd799439011"
          },
          "title": {
            "type": "string",
            "description": "Event title",
            "example": "Team Meeting"
          }
        },
        "required": [
          "_id"
        ]
      },
      "EventParticipantDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "Participant type",
            "enum": [
              "user",
              "contact"
            ],
            "example": "user"
          },
          "user": {
            "description": "User reference (populated when type is user)",
            "allOf": [
              {
                "$ref": "#/components/schemas/UserOwnerRefDto"
              }
            ]
          },
          "contact": {
            "description": "Contact reference (populated when type is contact)",
            "allOf": [
              {
                "$ref": "#/components/schemas/ContactRefDto"
              }
            ]
          },
          "status": {
            "type": "string",
            "description": "Participant RSVP status",
            "enum": [
              "yes",
              "no",
              "maybe",
              "noreply"
            ],
            "example": "yes"
          },
          "comment": {
            "type": "string",
            "description": "Participant comment",
            "example": "Will arrive 10 minutes late"
          }
        }
      },
      "EventWhenTimeDto": {
        "type": "object",
        "properties": {
          "time": {
            "type": "string",
            "description": "Time string",
            "example": "14:30"
          },
          "timeZone": {
            "type": "string",
            "description": "Timezone identifier",
            "example": "Australia/Sydney"
          }
        }
      },
      "EventWhenTimespanDto": {
        "type": "object",
        "properties": {
          "startTime": {
            "type": "string",
            "description": "Start time string",
            "example": "09:00"
          },
          "endTime": {
            "type": "string",
            "description": "End time string",
            "example": "17:00"
          },
          "startTimeZone": {
            "type": "string",
            "description": "Start timezone identifier",
            "example": "Australia/Sydney"
          },
          "endTimeZone": {
            "type": "string",
            "description": "End timezone identifier",
            "example": "Australia/Sydney"
          }
        }
      },
      "EventWhenDateDto": {
        "type": "object",
        "properties": {
          "date": {
            "format": "date-time",
            "type": "string",
            "description": "Event date",
            "example": "2024-06-15T00:00:00.000Z"
          }
        }
      },
      "EventWhenDatespanDto": {
        "type": "object",
        "properties": {
          "startDate": {
            "format": "date-time",
            "type": "string",
            "description": "Start date",
            "example": "2024-06-15T00:00:00.000Z"
          },
          "endDate": {
            "format": "date-time",
            "type": "string",
            "description": "End date",
            "example": "2024-06-17T00:00:00.000Z"
          }
        }
      },
      "EventWhenDto": {
        "type": "object",
        "properties": {
          "time": {
            "description": "Single time point with timezone",
            "allOf": [
              {
                "$ref": "#/components/schemas/EventWhenTimeDto"
              }
            ]
          },
          "timespan": {
            "description": "Time range with start/end and timezones",
            "allOf": [
              {
                "$ref": "#/components/schemas/EventWhenTimespanDto"
              }
            ]
          },
          "date": {
            "description": "Single date",
            "allOf": [
              {
                "$ref": "#/components/schemas/EventWhenDateDto"
              }
            ]
          },
          "datespan": {
            "description": "Date range with start/end",
            "allOf": [
              {
                "$ref": "#/components/schemas/EventWhenDatespanDto"
              }
            ]
          }
        }
      },
      "EventDetailPayloadDto": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "example": "Annual company gathering and networking event"
          },
          "type": {
            "type": "string",
            "description": "Event type",
            "enum": [
              "task",
              "calendar"
            ],
            "example": "task"
          },
          "title": {
            "type": "string",
            "example": "Annual Conference"
          },
          "participants": {
            "description": "Event participants with populated user/contact references",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventParticipantDto"
            }
          },
          "category": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "Event status",
            "enum": [
              "pending",
              "in-progress",
              "complete",
              "confirmed",
              "tentative",
              "cancelled",
              "archived"
            ],
            "example": "pending"
          },
          "busy": {
            "type": "boolean"
          },
          "visibility": {
            "type": "string",
            "description": "Event visibility",
            "enum": [
              "public",
              "private"
            ],
            "example": "public"
          },
          "createdBy": {
            "description": "User who created this event (populated with profile)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ],
            "allOf": [
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "updatedBy": {
            "description": "User who last updated this event (populated)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ],
            "allOf": [
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "when": {
            "description": "Event scheduling information (time, timespan, date, or datespan)",
            "allOf": [
              {
                "$ref": "#/components/schemas/EventWhenDto"
              }
            ]
          },
          "custom": {
            "type": "object",
            "description": "Custom freeform data",
            "additionalProperties": true
          },
          "startedAt": {
            "format": "date-time",
            "type": "string"
          },
          "startedBy": {
            "description": "User who started this event",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "parent": {
            "description": "Parent event reference",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/EventRefDto"
              }
            ]
          },
          "children": {
            "description": "Child events (ObjectId references)",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "orderItems": {
            "description": "Order items associated with this event (ObjectId references)",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "primaryTeams": {
            "description": "Primary teams assigned to this event (ObjectId references)",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "targetType": {
            "type": "string",
            "description": "Target entity type",
            "enum": [
              "user",
              "contact"
            ],
            "example": "user"
          },
          "paymentIntents": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "busy",
          "visibility",
          "targetType",
          "paymentIntents"
        ]
      },
      "CreateEventParticipantDto": {
        "type": "object",
        "properties": {
          "user": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "contact": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "type": {
            "type": "string",
            "enum": [
              "user",
              "contact"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "yes",
              "no",
              "maybe",
              "noreply"
            ]
          },
          "comment": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "status"
        ]
      },
      "CreateEventDto": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "example": "Annual Conference"
          },
          "description": {
            "type": "string",
            "example": "Annual company gathering and networking event"
          },
          "orderItems": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "paymentIntents": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "custom": {
            "type": "object",
            "additionalProperties": true
          },
          "parent": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "targetType": {
            "type": "string",
            "enum": [
              "user",
              "contact"
            ]
          },
          "type": {
            "type": "string",
            "enum": [
              "task",
              "calendar"
            ]
          },
          "category": {
            "type": "string"
          },
          "participants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateEventParticipantDto"
            }
          },
          "location": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "in-progress",
              "complete",
              "confirmed",
              "tentative",
              "cancelled",
              "archived"
            ]
          },
          "priority": {
            "type": "string",
            "enum": [
              "none",
              "low",
              "medium",
              "high"
            ]
          },
          "busy": {
            "type": "boolean"
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "private"
            ]
          },
          "when": {
            "$ref": "#/components/schemas/EventWhenDto"
          }
        },
        "required": [
          "title",
          "type"
        ]
      },
      "EventListPayloadDto": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "example": "Annual company gathering and networking event"
          },
          "type": {
            "type": "string",
            "description": "Event type",
            "enum": [
              "task",
              "calendar"
            ],
            "example": "task"
          },
          "title": {
            "type": "string",
            "example": "Annual Conference"
          },
          "participants": {
            "description": "Event participants",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventParticipantDto"
            }
          },
          "category": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "Event status",
            "enum": [
              "pending",
              "in-progress",
              "complete",
              "confirmed",
              "tentative",
              "cancelled",
              "archived"
            ],
            "example": "pending"
          },
          "busy": {
            "type": "boolean"
          },
          "visibility": {
            "type": "string",
            "description": "Event visibility",
            "enum": [
              "public",
              "private"
            ],
            "example": "public"
          },
          "createdBy": {
            "description": "User who created this event",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "updatedBy": {
            "description": "User who last updated this event",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "when": {
            "description": "Event scheduling information (time, timespan, date, or datespan)",
            "allOf": [
              {
                "$ref": "#/components/schemas/EventWhenDto"
              }
            ]
          },
          "custom": {
            "type": "object",
            "description": "Custom freeform data",
            "additionalProperties": true
          },
          "startedAt": {
            "format": "date-time",
            "type": "string"
          },
          "startedBy": {
            "description": "User who started this event",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "parent": {
            "description": "Parent event reference",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/EventRefDto"
              }
            ]
          },
          "children": {
            "description": "Child events (ObjectId references)",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "orderItems": {
            "description": "Order items associated with this event (ObjectId references)",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "primaryTeams": {
            "description": "Primary teams assigned to this event (ObjectId references)",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "targetType": {
            "type": "string",
            "description": "Target entity type",
            "enum": [
              "user",
              "contact"
            ],
            "example": "user"
          },
          "paymentIntents": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "busy",
          "visibility",
          "createdBy",
          "targetType",
          "paymentIntents"
        ]
      },
      "UpdateEventDto": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "example": "Annual Conference"
          },
          "description": {
            "type": "string",
            "example": "Annual company gathering and networking event"
          },
          "orderItems": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "paymentIntents": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "custom": {
            "type": "object",
            "additionalProperties": true
          },
          "parent": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "targetType": {
            "type": "string",
            "enum": [
              "user",
              "contact"
            ]
          },
          "type": {
            "type": "string",
            "enum": [
              "task",
              "calendar"
            ]
          },
          "category": {
            "type": "string"
          },
          "participants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateEventParticipantDto"
            }
          },
          "location": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "in-progress",
              "complete",
              "confirmed",
              "tentative",
              "cancelled",
              "archived"
            ]
          },
          "priority": {
            "type": "string",
            "enum": [
              "none",
              "low",
              "medium",
              "high"
            ]
          },
          "busy": {
            "type": "boolean"
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "private"
            ]
          },
          "when": {
            "$ref": "#/components/schemas/EventWhenDto"
          }
        }
      },
      "AddOnActionPayloadDto": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "description": "Action type returned by the provider",
            "example": "redirect"
          },
          "redirectUrl": {
            "type": "string",
            "description": "URL to redirect the user for provider configuration or OAuth",
            "example": "https://provider.example.com/oauth/authorize?client_id=abc"
          }
        },
        "required": [
          "action"
        ]
      },
      "CreateApiKeyDto": {
        "type": "object",
        "properties": {
          "primaryTeams": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "provider": {
            "type": "string"
          }
        }
      },
      "WebhookPayloadDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "destinationUrl": {
            "type": "string",
            "example": "https://example.com/webhooks/receive"
          },
          "status": {
            "type": "string",
            "example": "active"
          },
          "events": {
            "example": [
              "payment_intent.created",
              "payment_intent.updated"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "example": "2025-01-15T10:30:00.000Z"
          },
          "createdBy": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "tenantId": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          }
        },
        "required": [
          "_id",
          "destinationUrl",
          "status",
          "events",
          "createdAt",
          "createdBy",
          "tenantId"
        ]
      },
      "CreateWebhookDto": {
        "type": "object",
        "properties": {
          "destinationUrl": {
            "type": "string",
            "example": "https://api.example.com/webhooks"
          },
          "hmacSecret": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "contacts.create",
                "contacts.update",
                "paymentIntents.create",
                "paymentIntents.update",
                "paymentIntents.delete",
                "partnerships.create",
                "partnerships.update",
                "splitIntents.create",
                "splitIntents.update",
                "splitIntents.delete",
                "transactions.create",
                "transactions.update",
                "ingest.job.completed",
                "ingest.job.failed",
                "ingest.job.partial",
                "ingest.job.review",
                "ingest.task.failed"
              ]
            }
          }
        },
        "required": [
          "destinationUrl",
          "hmacSecret"
        ]
      },
      "VideoSignUploadPayloadDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "The video document ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "cloud": {
            "type": "string",
            "description": "Cloud storage provider",
            "example": "stream"
          },
          "uploadUrl": {
            "type": "string",
            "description": "Signed upload URL for client-side upload",
            "example": "https://storage.example.com/upload?token=abc"
          },
          "videoId": {
            "type": "string",
            "description": "Cloud video identifier",
            "example": "cf-stream-abc123def456"
          },
          "name": {
            "type": "string",
            "description": "Video metadata name (entity=targetId,target=targetType)",
            "example": "entity=507f1f77bcf86cd799439011,target=payment-intent"
          }
        },
        "required": [
          "_id",
          "cloud",
          "uploadUrl",
          "videoId",
          "name"
        ]
      },
      "CreateVideoDto": {
        "type": "object",
        "properties": {
          "targetId": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "targetType": {
            "type": "string",
            "enum": [
              "payment-intent"
            ]
          },
          "length": {
            "type": "number"
          }
        },
        "required": [
          "targetId",
          "targetType",
          "length"
        ]
      },
      "VideoThumbnails": {
        "type": "object",
        "properties": {
          "standard": {
            "type": "string"
          },
          "gif": {
            "type": "string"
          },
          "preview": {
            "type": "string"
          },
          "animated": {
            "type": "string"
          }
        }
      },
      "VideoPayloadDto": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Current processing status of the video",
            "enum": [
              "pending-upload",
              "uploaded",
              "processing",
              "ready",
              "failed",
              "error"
            ],
            "example": "ready"
          },
          "videoId": {
            "type": "string"
          },
          "storage": {
            "type": "string"
          },
          "createdBy": {
            "description": "User who created this video (ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "thumbnails": {
            "$ref": "#/components/schemas/VideoThumbnails"
          },
          "duration": {
            "type": "number"
          },
          "size": {
            "type": "number"
          },
          "targetId": {
            "$ref": "#/components/schemas/ObjectId"
          },
          "targetType": {
            "type": "string",
            "description": "Target entity type this video is linked to",
            "enum": [
              "payment-intent"
            ],
            "example": "payment-intent"
          }
        },
        "required": [
          "status",
          "videoId",
          "storage",
          "targetId",
          "targetType"
        ]
      },
      "VideoViewPayloadDto": {
        "type": "object",
        "properties": {
          "videoUrl": {
            "type": "string",
            "description": "Temporary signed URL for video playback",
            "example": "https://cdn.example.com/video.mp4"
          }
        },
        "required": [
          "videoUrl"
        ]
      },
      "ReportPayloadDto": {
        "type": "object",
        "properties": {
          "failureReason": {
            "type": "string",
            "example": "Query timed out after 30 seconds"
          },
          "entity": {
            "type": "string",
            "description": "Entity type for this report",
            "enum": [
              "Contact",
              "PaymentIntent",
              "PaymentIntentItems",
              "Order",
              "Transaction",
              "SplitIntent",
              "BulkOperation",
              "Partnership",
              "PartnershipContact",
              "OrderItem",
              "BankAccount",
              "Import",
              "GatewayAuthorization"
            ],
            "example": "contact"
          },
          "status": {
            "type": "string",
            "description": "Current status of the report",
            "enum": [
              "requested",
              "in-progress",
              "failed",
              "completed"
            ],
            "example": "completed"
          },
          "stats": {
            "type": "object",
            "description": "Report execution statistics",
            "additionalProperties": true
          },
          "createdBy": {
            "description": "User who created this report (populated with profile)",
            "allOf": [
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "fileType": {
            "type": "string",
            "description": "File type of the generated report",
            "enum": [
              "csv",
              "json"
            ],
            "example": "csv"
          },
          "fileId": {
            "description": "File reference (ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/StorageRefDto"
              }
            ]
          }
        },
        "required": [
          "entity",
          "status",
          "fileType"
        ]
      },
      "CreateReportDto": {
        "type": "object",
        "properties": {
          "filters": {
            "type": "object",
            "additionalProperties": true,
            "description": "Report filter criteria"
          },
          "recipientId": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "entity": {
            "type": "string",
            "enum": [
              "Contact",
              "PaymentIntent",
              "PaymentIntentItems",
              "Order",
              "Transaction",
              "SplitIntent",
              "BulkOperation",
              "Partnership",
              "PartnershipContact",
              "OrderItem",
              "BankAccount",
              "Import",
              "GatewayAuthorization"
            ]
          }
        },
        "required": [
          "filters",
          "entity"
        ]
      },
      "FormDetailPayloadDto": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "example": "Please complete this form to get started"
          },
          "name": {
            "type": "string"
          },
          "stats": {
            "type": "object",
            "description": "Form statistics (pages, fields, responses)",
            "additionalProperties": true
          },
          "populateData": {
            "type": "boolean"
          },
          "method": {
            "type": "string"
          },
          "content": {
            "type": "object",
            "description": "Dynamic form content (pages, elements, conditions)",
            "additionalProperties": true
          },
          "createdBy": {
            "description": "User who created this form (populated with profile)",
            "allOf": [
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "updatedBy": {
            "description": "User who last updated this form (populated with profile)",
            "allOf": [
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          }
        },
        "required": [
          "name",
          "populateData",
          "method"
        ]
      },
      "CreateFormPageDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Customer Onboarding"
          },
          "elements": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "triggers": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "completedHtmlOnCondition": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "required": [
          "name",
          "elements"
        ]
      },
      "CreateFormContentDto": {
        "type": "object",
        "properties": {
          "logoPosition": {
            "type": "string"
          },
          "pages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateFormPageDto"
            }
          }
        },
        "required": [
          "pages"
        ]
      },
      "CreateFormDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Customer Onboarding"
          },
          "description": {
            "type": "string",
            "example": "Please complete this form to get started"
          },
          "content": {
            "$ref": "#/components/schemas/CreateFormContentDto"
          },
          "locale": {
            "type": "string"
          },
          "populateData": {
            "type": "boolean"
          },
          "displayPortal": {
            "type": "boolean"
          },
          "displayEcommerce": {
            "type": "boolean"
          }
        },
        "required": [
          "name"
        ]
      },
      "FormListPayloadDto": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "example": "Please complete this form to get started"
          },
          "name": {
            "type": "string"
          },
          "stats": {
            "type": "object",
            "description": "Form statistics (pages, fields, responses)",
            "additionalProperties": true
          },
          "populateData": {
            "type": "boolean"
          },
          "method": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "populateData",
          "method"
        ]
      },
      "FormRefDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Form ID (MongoDB ObjectId)",
            "example": "507f1f77bcf86cd799439011"
          },
          "name": {
            "type": "string",
            "description": "Form name",
            "example": "Customer Onboarding"
          }
        },
        "required": [
          "_id"
        ]
      },
      "FormSubmissionListPayloadDto": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "example": "Please complete this form to get started"
          },
          "name": {
            "type": "string"
          },
          "contact": {
            "description": "Contact reference (ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/ContactRefDto"
              }
            ]
          },
          "orderItems": {
            "description": "Order item IDs associated with this submission",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string",
            "description": "Form submission status",
            "enum": [
              "requested",
              "in-progress",
              "complete",
              "archived"
            ],
            "example": "completed"
          },
          "public": {
            "type": "boolean"
          },
          "locale": {
            "type": "string"
          },
          "progress": {
            "type": "number"
          },
          "form": {
            "description": "Form reference (ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/FormRefDto"
              }
            ]
          },
          "startedBy": {
            "type": "string",
            "description": "Who started the submission",
            "enum": [
              "user",
              "contact"
            ],
            "example": "user"
          },
          "requestedBy": {
            "description": "User who requested this submission (ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          }
        },
        "required": [
          "name",
          "contact",
          "status",
          "public",
          "progress",
          "form"
        ]
      },
      "UpdateFormDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Customer Onboarding"
          },
          "description": {
            "type": "string",
            "example": "Please complete this form to get started"
          },
          "content": {
            "$ref": "#/components/schemas/CreateFormContentDto"
          },
          "locale": {
            "type": "string"
          },
          "populateData": {
            "type": "boolean"
          },
          "displayPortal": {
            "type": "boolean"
          },
          "displayEcommerce": {
            "type": "boolean"
          }
        }
      },
      "FormSubmissionDetailPayloadDto": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "example": "Please complete this form to get started"
          },
          "name": {
            "type": "string"
          },
          "contact": {
            "description": "Contact who submitted the form (populated with profile)",
            "allOf": [
              {
                "$ref": "#/components/schemas/ContactRefDto"
              }
            ]
          },
          "orderItems": {
            "description": "Order item IDs associated with this submission",
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string",
            "description": "Form submission status",
            "enum": [
              "requested",
              "in-progress",
              "complete",
              "archived"
            ],
            "example": "completed"
          },
          "public": {
            "type": "boolean"
          },
          "locale": {
            "type": "string"
          },
          "progress": {
            "type": "number"
          },
          "form": {
            "description": "Form reference (ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/FormRefDto"
              }
            ]
          },
          "startedBy": {
            "type": "string",
            "description": "Who started the submission",
            "enum": [
              "user",
              "contact"
            ],
            "example": "user"
          },
          "requestedBy": {
            "description": "User who requested this submission (populated with profile)",
            "allOf": [
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "data": {
            "type": "object",
            "description": "Form submission data (dynamic key-value pairs)",
            "additionalProperties": true
          }
        },
        "required": [
          "name",
          "status",
          "public",
          "progress",
          "form"
        ]
      },
      "SubmitFormDataDto": {
        "type": "object",
        "properties": {}
      },
      "SubmitFormDto": {
        "type": "object",
        "properties": {
          "submission": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "contact": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "name": {
            "type": "string",
            "example": "Customer Onboarding"
          },
          "description": {
            "type": "string",
            "example": "Please complete this form to get started"
          },
          "order": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "orderItems": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "source": {
            "type": "string",
            "enum": [
              "manual",
              "workflow"
            ]
          },
          "public": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/SubmitFormDataDto"
          },
          "completed": {
            "type": "boolean"
          }
        },
        "required": [
          "contact"
        ]
      },
      "VideoRefDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Video ID (MongoDB ObjectId)",
            "example": "507f1f77bcf86cd799439011"
          },
          "status": {
            "type": "string",
            "description": "Video processing status",
            "example": "ready"
          }
        },
        "required": [
          "_id"
        ]
      },
      "FeedbackPayloadDto": {
        "type": "object",
        "properties": {
          "contact": {
            "description": "Contact reference (ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/ContactRefDto"
              }
            ]
          },
          "targetType": {
            "type": "string",
            "description": "Target entity type for this feedback",
            "enum": [
              "step",
              "payment-intent"
            ],
            "example": "payment-intent"
          },
          "targetId": {
            "type": "string"
          },
          "surveyType": {
            "type": "string",
            "description": "Type of survey",
            "enum": [
              "nps",
              "csat",
              "ces",
              "testimonial"
            ],
            "example": "nps"
          },
          "surveyChannel": {
            "type": "string",
            "description": "Channel used for the survey",
            "enum": [
              "email",
              "portal",
              "manual"
            ],
            "example": "email"
          },
          "score": {
            "type": "number"
          },
          "response": {
            "type": "string",
            "description": "Response category based on score",
            "enum": [
              "very-satisfied",
              "satisfied",
              "neutral",
              "unsatisfied",
              "very-unsatisfied",
              "promoter",
              "passive",
              "detractor",
              "very-low-effort",
              "low-effort",
              "high-effort",
              "very-high-effort"
            ],
            "example": "promoter"
          },
          "comment": {
            "type": "string"
          },
          "video": {
            "description": "Video reference (ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/VideoRefDto"
              }
            ]
          },
          "startedBy": {
            "type": "string",
            "description": "Who initiated the feedback",
            "enum": [
              "user",
              "contact"
            ],
            "example": "contact"
          },
          "createdBy": {
            "description": "User who created this feedback (ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/UserRefDto"
              }
            ]
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "description": "Creation timestamp",
            "example": "2024-01-15T10:30:00.000Z"
          }
        },
        "required": [
          "contact",
          "targetType",
          "targetId",
          "surveyType",
          "surveyChannel",
          "score",
          "startedBy",
          "createdAt"
        ]
      },
      "CreateFeedbackDto": {
        "type": "object",
        "properties": {
          "contact": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "targetId": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "video": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "targetType": {
            "type": "string",
            "enum": [
              "step",
              "payment-intent"
            ]
          },
          "surveyType": {
            "type": "string",
            "enum": [
              "nps",
              "csat",
              "ces",
              "testimonial"
            ]
          },
          "surveyChannel": {
            "type": "string",
            "enum": [
              "email",
              "portal",
              "manual"
            ]
          },
          "score": {
            "type": "number"
          },
          "response": {
            "type": "string",
            "enum": [
              "very-satisfied",
              "satisfied",
              "neutral",
              "unsatisfied",
              "very-unsatisfied",
              "promoter",
              "passive",
              "detractor",
              "very-low-effort",
              "low-effort",
              "high-effort",
              "very-high-effort"
            ]
          },
          "comment": {
            "type": "string"
          }
        },
        "required": [
          "contact",
          "targetType",
          "surveyType",
          "surveyChannel"
        ]
      },
      "FeedbackStatsPayloadDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "object",
            "properties": {
              "response": {
                "type": "string"
              }
            },
            "required": [
              "response"
            ]
          },
          "email": {
            "type": "number",
            "description": "Count of feedback submitted via email channel",
            "example": 5
          },
          "portal": {
            "type": "number",
            "description": "Count of feedback submitted via portal channel",
            "example": 3
          },
          "manual": {
            "type": "number",
            "description": "Count of feedback submitted manually",
            "example": 1
          },
          "startedByUser": {
            "type": "number",
            "description": "Count of feedback started by user",
            "example": 2
          }
        },
        "required": [
          "_id",
          "email",
          "portal",
          "manual",
          "startedByUser"
        ]
      },
      "BulkOperationPayloadDto": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "example": 5000
          },
          "taxTotal": {
            "type": "number",
            "example": 500
          },
          "number": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "paymentSplits": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "partnership": {
            "description": "Partnership reference (ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/PartnershipRefDto"
              }
            ]
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "type": {
            "type": "string",
            "enum": [
              "group",
              "remittance"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "due",
              "overdue",
              "paid",
              "canceled"
            ]
          },
          "dueAt": {
            "format": "date-time",
            "type": "string"
          },
          "paidAt": {
            "format": "date-time",
            "type": "string"
          },
          "keep": {
            "type": "number"
          },
          "_id": {
            "type": "string"
          }
        },
        "required": [
          "number",
          "name",
          "paymentSplits",
          "partnership",
          "currency",
          "type",
          "status",
          "_id"
        ]
      },
      "BulkOperationOptionsPayloadDto": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "download-pdf",
              "mark-as-paid",
              "cancel"
            ]
          },
          "available": {
            "type": "boolean",
            "example": true
          }
        },
        "required": [
          "action",
          "available"
        ]
      },
      "CreateBulkOperationDto": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "object",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "paymentSplits": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "partnership": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "group",
              "remittance"
            ]
          },
          "dueAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "currency",
          "partnership",
          "name",
          "type"
        ]
      },
      "UpdateBulkOperationDto": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "object",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "paymentSplits": {
            "example": [
              "507f1f77bcf86cd799439011"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "partnership": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "group",
              "remittance"
            ]
          },
          "dueAt": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "paid",
              "canceled",
              "pending",
              "due"
            ]
          },
          "paidAt": {
            "format": "date-time",
            "type": "string"
          }
        }
      },
      "OnboardingStats": {
        "type": "object",
        "properties": {
          "nTotalTickets": {
            "type": "number",
            "description": "Total number of onboarding tickets",
            "example": 10
          },
          "nOpenTickets": {
            "type": "number",
            "description": "Number of open tickets",
            "example": 5
          },
          "nClosedTickets": {
            "type": "number",
            "description": "Number of closed tickets",
            "example": 5
          }
        },
        "required": [
          "nTotalTickets",
          "nOpenTickets",
          "nClosedTickets"
        ]
      },
      "OnboardingTicket": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Ticket ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "title": {
            "type": "string",
            "description": "Ticket title",
            "example": "Set up your first payment"
          },
          "description": {
            "type": "string",
            "description": "Ticket description",
            "example": "Connect your bank account"
          },
          "section": {
            "type": "string",
            "description": "Section grouping",
            "example": "payments"
          },
          "category": {
            "type": "string",
            "description": "Category",
            "example": "setup"
          },
          "status": {
            "type": "string",
            "description": "Status",
            "example": "open",
            "enum": [
              "open",
              "closed"
            ]
          },
          "cta": {
            "type": "string",
            "description": "Call to action URL",
            "example": "/settings/bank"
          },
          "position": {
            "type": "number",
            "description": "Display position",
            "example": 1
          },
          "priority": {
            "type": "string",
            "description": "Priority",
            "example": "high",
            "enum": [
              "high",
              "medium",
              "low"
            ]
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "description": "Creation timestamp",
            "example": "2024-01-15T09:30:00.000Z"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string",
            "description": "Last update timestamp",
            "example": "2024-01-20T14:00:00.000Z"
          }
        },
        "required": [
          "_id",
          "title",
          "description",
          "category",
          "status",
          "createdAt",
          "updatedAt"
        ]
      },
      "OnbordingPayloadDto": {
        "type": "object",
        "properties": {
          "stats": {
            "description": "Onboarding statistics summary",
            "allOf": [
              {
                "$ref": "#/components/schemas/OnboardingStats"
              }
            ]
          },
          "tickets": {
            "description": "List of onboarding tickets",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OnboardingTicket"
            }
          }
        },
        "required": [
          "stats",
          "tickets"
        ]
      },
      "StartOnboardingDto": {
        "type": "object",
        "properties": {
          "onboardingType": {
            "type": "string",
            "enum": [
              "education-agent",
              "education-provider"
            ]
          }
        },
        "required": [
          "onboardingType"
        ]
      },
      "CreateTicketDto": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "example": "Login Issue"
          },
          "description": {
            "type": "string",
            "example": "Unable to access account settings page"
          },
          "partnershipId": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "paymentSplitId": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "paymentIntentId": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "contactId": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "payoutId": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "amount": {
            "type": "number",
            "example": 5000
          },
          "currency": {
            "type": "object",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "category": {
            "type": "string",
            "enum": [
              "PAYOUT_ISSUE",
              "PRODUCT_ISSUE",
              "BILLING_ISSUE",
              "FEATURE_REQUEST",
              "GENERAL_INQUIRY"
            ]
          },
          "subcategory": {
            "type": "string",
            "enum": [
              "PAYOUT_MISSING",
              "PAYOUT_UNKNOWN"
            ]
          }
        },
        "required": [
          "description",
          "category"
        ]
      },
      "SupportTicketLabelPayloadDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "name": {
            "type": "string",
            "example": "bug"
          },
          "color": {
            "type": "string",
            "example": "#ef4444"
          }
        },
        "required": [
          "_id",
          "name",
          "color"
        ]
      },
      "SupportTicketPayloadDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "title": {
            "type": "string",
            "example": "Payment failing"
          },
          "description": {
            "type": "string",
            "example": "Card declined when processing the payout."
          },
          "status": {
            "type": "string",
            "example": "backlog",
            "enum": [
              "backlog",
              "todo",
              "in-progress",
              "done"
            ]
          },
          "priority": {
            "type": "string",
            "example": "p1",
            "enum": [
              "p0",
              "p1",
              "p2",
              "p3"
            ]
          },
          "labels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SupportTicketLabelPayloadDto"
            }
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "example": "2026-05-28T10:00:00.000Z"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string",
            "example": "2026-05-28T12:00:00.000Z"
          }
        },
        "required": [
          "_id",
          "title",
          "description",
          "status",
          "priority",
          "createdAt",
          "updatedAt"
        ]
      },
      "TenantOwnerProfilePayloadDto": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "example": "Alice"
          },
          "lastName": {
            "type": "string",
            "example": "Smith"
          },
          "picture": {
            "type": "string",
            "example": "https://gravatar.com/..."
          },
          "phone": {
            "type": "string",
            "example": "+1-555-0100"
          },
          "calendarLink": {
            "type": "string",
            "example": "https://cal.com/alice"
          }
        }
      },
      "TenantOwnerPayloadDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "example": "agent@example.com"
          },
          "profile": {
            "$ref": "#/components/schemas/TenantOwnerProfilePayloadDto"
          },
          "_synthetic": {
            "type": "boolean",
            "description": "True when this is a synthetic fallback (no real owners assigned)",
            "example": false
          }
        },
        "required": [
          "email",
          "_synthetic"
        ]
      },
      "CadenceEntryPayloadDto": {
        "type": "object",
        "properties": {
          "isDue": {
            "type": "boolean",
            "description": "Whether the survey is due",
            "example": true
          },
          "lastScore": {
            "type": "number",
            "nullable": true,
            "description": "Last NPS/CSAT score",
            "example": 9
          },
          "nextDueAt": {
            "format": "date-time",
            "type": "string",
            "description": "Next due date for this survey type",
            "example": "2024-04-15T09:30:00.000Z"
          }
        },
        "required": [
          "isDue",
          "nextDueAt"
        ]
      },
      "SurveyCadencePayloadDto": {
        "type": "object",
        "properties": {
          "nps": {
            "description": "NPS survey cadence status",
            "allOf": [
              {
                "$ref": "#/components/schemas/CadenceEntryPayloadDto"
              }
            ]
          }
        },
        "required": [
          "nps"
        ]
      },
      "SubmitNpsDto": {
        "type": "object",
        "properties": {
          "score": {
            "type": "number",
            "minimum": 0,
            "maximum": 10
          },
          "comment": {
            "type": "string",
            "maxLength": 2000
          }
        },
        "required": [
          "score"
        ]
      },
      "MintChatTokenPayloadDto": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "description": "Twilio Access Token (JWT)",
            "example": "eyJhbGciOi..."
          },
          "expiresAt": {
            "type": "string",
            "description": "ISO timestamp at which the token expires",
            "example": "2026-05-04T13:00:00.000Z"
          },
          "conversationSid": {
            "type": "string",
            "description": "Twilio Conversation SID (`CHxxx`) — pass to getConversationBySid()",
            "example": "CHa7474f0282264b6f9a4f824372528dc7"
          },
          "identity": {
            "type": "string",
            "description": "Namespaced AGENT identity the token grants",
            "example": "tenant:abc123:agent:6800a1b2c3d4e5f678901234"
          }
        },
        "required": [
          "token",
          "expiresAt",
          "conversationSid",
          "identity"
        ]
      },
      "CreateSupportRoomPayloadDto": {
        "type": "object",
        "properties": {
          "roomId": {
            "type": "string",
            "description": "Identifier of the newly created chat room",
            "example": "64f0a1b2c3d4e5f6a7b8c9d1"
          },
          "participantId": {
            "type": "string",
            "description": "Identifier of the authenticated user's participant slot in the room — pass this on follow-up actions if needed",
            "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
          },
          "conversationSid": {
            "type": "string",
            "description": "Twilio Conversation SID. Pass this to client.getConversationBySid() in the @twilio/conversations JS SDK after minting a token via POST /support/chat/rooms/:roomId/token.",
            "example": "CHa7474f0282264b6f9a4f824372528dc7"
          },
          "skills": {
            "description": "Skills bound to this room, one entry per active AI participant. Single-AI rooms emit a 1-element array (e.g. `[\"customer-payment-inquiry\"]`); multi-AI rooms (future) emit every active AI's skill. Empty when no AI is active.",
            "example": [
              "customer-payment-inquiry"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "reused": {
            "type": "boolean",
            "description": "True when an existing chat was reused (e.g. user opened the same payment chat twice). False when a brand-new room was created.",
            "example": false
          }
        },
        "required": [
          "roomId",
          "participantId",
          "skills",
          "reused"
        ]
      },
      "DisputePayloadDto": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "example": 5000
          },
          "number": {
            "type": "number"
          },
          "contact": {
            "description": "Contact reference (ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/ContactRefDto"
              }
            ]
          },
          "currency": {
            "type": "string",
            "description": "Currency code (ISO 4217)",
            "enum": [
              "USD",
              "CAD",
              "EUR",
              "GBP",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BZD",
              "CDF",
              "CHF",
              "CLP",
              "CNH",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HRK",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRO",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLL",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "example": "AUD"
          },
          "transaction": {
            "description": "Transaction reference (ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/TransactionRefDto"
              }
            ]
          },
          "paymentIntent": {
            "description": "Payment intent reference (ObjectId or populated object)",
            "oneOf": [
              {
                "type": "string",
                "example": "507f1f77bcf86cd799439011"
              },
              {
                "$ref": "#/components/schemas/PaymentIntentRefDto"
              }
            ]
          },
          "status": {
            "type": "string",
            "description": "Dispute status",
            "enum": [
              "lost",
              "needs-response",
              "under-review",
              "warning-closed",
              "warning-needs-response",
              "warning-under-review",
              "won"
            ],
            "example": "needs-response"
          },
          "reason": {
            "type": "string",
            "description": "Dispute reason",
            "enum": [
              "bank-cannot-process",
              "credit-not-processed",
              "customer-initiated",
              "debit-not-authorized",
              "duplicate",
              "fraudulent",
              "general",
              "incorrect-account-details",
              "insufficient-funds",
              "unrecognized",
              "other"
            ],
            "example": "fraudulent"
          },
          "evidenceDueBy": {
            "format": "date-time",
            "type": "string"
          },
          "_id": {
            "type": "string"
          }
        },
        "required": [
          "amount",
          "number",
          "contact",
          "currency",
          "transaction",
          "paymentIntent",
          "status",
          "reason",
          "_id"
        ]
      },
      "UpdateDisputeEvidence": {
        "type": "object",
        "properties": {
          "document": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "comments": {
            "type": "string",
            "example": "Customer claims service not delivered"
          },
          "type": {
            "type": "string",
            "enum": [
              "activity-log",
              "customer-communication",
              "service-documentation",
              "uncategorized-file"
            ]
          }
        },
        "required": [
          "document",
          "type"
        ]
      },
      "UpdateDisputeDto": {
        "type": "object",
        "properties": {
          "evidence": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UpdateDisputeEvidence"
            }
          },
          "submit": {
            "type": "boolean"
          },
          "status": {
            "type": "string",
            "enum": [
              "lost"
            ]
          }
        },
        "required": [
          "submit"
        ]
      },
      "PipelineDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "Pipeline type",
            "enum": [
              "pdf",
              "csv"
            ],
            "example": "pdf"
          },
          "version": {
            "type": "string",
            "description": "Pipeline version",
            "example": "1.0.0"
          }
        },
        "required": [
          "type",
          "version"
        ]
      },
      "InputDto": {
        "type": "object",
        "properties": {
          "hash": {
            "type": "string",
            "description": "SHA256 dedup hash",
            "example": "abc123..."
          },
          "fileName": {
            "type": "string",
            "description": "Original file name",
            "example": "invoice_batch.pdf"
          },
          "targetType": {
            "type": "string",
            "description": "Target entity type",
            "example": "payment-intent"
          },
          "mode": {
            "type": "string",
            "description": "Processing mode",
            "example": "dry-run"
          }
        },
        "required": [
          "hash",
          "fileName",
          "targetType",
          "mode"
        ]
      },
      "TaskCountsDto": {
        "type": "object",
        "properties": {
          "queued": {
            "type": "number",
            "description": "Tasks in queued status",
            "example": 2
          },
          "running": {
            "type": "number",
            "description": "Tasks currently running",
            "example": 1
          },
          "completed": {
            "type": "number",
            "description": "Tasks completed successfully",
            "example": 4
          },
          "failed": {
            "type": "number",
            "description": "Tasks that failed",
            "example": 1
          },
          "cancelled": {
            "type": "number",
            "description": "Tasks that were cancelled",
            "example": 0
          }
        },
        "required": [
          "queued",
          "running",
          "completed",
          "failed",
          "cancelled"
        ]
      },
      "JobPayloadDto": {
        "type": "object",
        "properties": {
          "targetType": {
            "type": "string",
            "enum": [
              "payment-intent",
              "contact",
              "partnership"
            ],
            "example": "payment-intent",
            "description": "Target entity type"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "planning",
              "configuring",
              "analyzing",
              "ready",
              "processing",
              "completed",
              "partial",
              "failed",
              "cancelled",
              "review"
            ],
            "example": "queued",
            "description": "Current job status"
          },
          "createdBy": {
            "type": "string",
            "description": "User who created the job"
          },
          "activityId": {
            "description": "Activity ID for traces",
            "allOf": [
              {
                "$ref": "#/components/schemas/ObjectId"
              }
            ]
          },
          "pipeline": {
            "description": "Pipeline configuration",
            "allOf": [
              {
                "$ref": "#/components/schemas/PipelineDto"
              }
            ]
          },
          "mode": {
            "type": "string",
            "description": "Processing mode",
            "enum": [
              "dry-run",
              "auto-create"
            ],
            "example": "dry-run"
          },
          "priority": {
            "type": "string",
            "description": "Job priority",
            "enum": [
              "high",
              "normal",
              "low"
            ],
            "example": "normal"
          },
          "thinkHarder": {
            "type": "boolean",
            "description": "Whether to use advanced model",
            "example": false
          },
          "input": {
            "description": "Job input data",
            "allOf": [
              {
                "$ref": "#/components/schemas/InputDto"
              }
            ]
          },
          "result": {
            "type": "object",
            "description": "Aggregated results",
            "additionalProperties": true
          },
          "stats": {
            "description": "Task statistics",
            "allOf": [
              {
                "$ref": "#/components/schemas/StatsDto"
              }
            ]
          },
          "completedAt": {
            "format": "date-time",
            "type": "string",
            "description": "When the job completed"
          },
          "approvedBy": {
            "type": "string",
            "description": "User who approved the dry-run job"
          },
          "approvedAt": {
            "format": "date-time",
            "type": "string",
            "description": "When the dry-run job was approved"
          },
          "cancelledBy": {
            "type": "string",
            "description": "User who cancelled the dry-run job"
          },
          "cancelledAt": {
            "format": "date-time",
            "type": "string",
            "description": "When the dry-run job was cancelled"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "taskCounts": {
            "description": "Task counts grouped by status (computed aggregate, per D-11)",
            "allOf": [
              {
                "$ref": "#/components/schemas/TaskCountsDto"
              }
            ]
          }
        },
        "required": [
          "targetType",
          "status",
          "createdBy",
          "pipeline",
          "mode",
          "priority",
          "thinkHarder",
          "input",
          "stats"
        ]
      },
      "CreateIngestJobDto": {
        "type": "object",
        "properties": {
          "fileName": {
            "type": "string",
            "description": "Name of the file to process",
            "example": "invoice_batch.pdf"
          },
          "targetType": {
            "type": "string",
            "enum": [
              "payment-intent",
              "contact",
              "partnership"
            ],
            "description": "The type of entity to extract",
            "example": "payment-intent"
          },
          "mode": {
            "type": "string",
            "enum": [
              "dry-run",
              "auto-create"
            ],
            "description": "Processing mode",
            "example": "dry-run"
          },
          "pipelineType": {
            "type": "string",
            "enum": [
              "pdf",
              "csv"
            ],
            "description": "Pipeline type to use for processing",
            "example": "pdf"
          },
          "fileId": {
            "type": "string",
            "description": "File ID in storage (required for PDF pipeline)",
            "example": "507f1f77bcf86cd799439011"
          }
        },
        "required": [
          "fileName",
          "targetType",
          "mode",
          "pipelineType"
        ]
      },
      "TaskPayloadDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Task ID"
          },
          "jobId": {
            "type": "string",
            "description": "Parent job ID"
          },
          "taskType": {
            "type": "string",
            "description": "Task type",
            "example": "resolve:contact"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "processing",
              "completed",
              "failed"
            ],
            "description": "Task status",
            "example": "queued"
          },
          "output": {
            "type": "object",
            "description": "Task output data"
          },
          "error": {
            "type": "string",
            "description": "Error message if task failed"
          },
          "startedAt": {
            "format": "date-time",
            "type": "string",
            "description": "When the task started"
          },
          "completedAt": {
            "format": "date-time",
            "type": "string",
            "description": "When the task completed"
          },
          "durationMs": {
            "type": "number",
            "description": "Duration in milliseconds"
          }
        },
        "required": [
          "_id",
          "jobId",
          "taskType",
          "status"
        ]
      },
      "RollbackPayloadDto": {
        "type": "object",
        "properties": {
          "deletedRecords": {
            "type": "number",
            "description": "Number of records deleted",
            "example": 5
          }
        },
        "required": [
          "deletedRecords"
        ]
      }
    }
  }
}
