openapi: 3.0.3
info:
  title: 'AIC Online API Documentation'
  description: 'This is the API documentation for AIC Online Backend.'
  version: 1.0.0
servers:
  -
    url: 'http://localhost'
tags:
  -
    name: Address
    description: ''
  -
    name: Auth
    description: ''
  -
    name: Benchmark
    description: ''
  -
    name: Canton
    description: ''
  -
    name: 'Canton Index'
    description: ''
  -
    name: Collection
    description: ''
  -
    name: Contact
    description: ''
  -
    name: DamageReport
    description: ''
  -
    name: DamageTypeModuleProduct
    description: ''
  -
    name: Dashboard
    description: ''
  -
    name: Declaration
    description: ''
  -
    name: Endpoints
    description: ''
  -
    name: File
    description: ''
  -
    name: FormHint
    description: ''
  -
    name: FormLead
    description: ''
  -
    name: FormLeadAttribute
    description: ''
  -
    name: FormLeadUser
    description: ''
  -
    name: Geo
    description: ''
  -
    name: Group
    description: ''
  -
    name: GroupAttribute
    description: ''
  -
    name: GuestInvite
    description: ''
  -
    name: GustavoZip
    description: ''
  -
    name: Import
    description: ''
  -
    name: InsuranceAnnouncement
    description: ''
  -
    name: InsuranceCoverGrade
    description: ''
  -
    name: InsuranceOffer
    description: ''
  -
    name: 'Insurer AVB'
    description: ''
  -
    name: InsurerObligation
    description: ''
  -
    name: InsurerProduct
    description: ''
  -
    name: InsurerTariffConstructionCost
    description: ''
  -
    name: Journal
    description: ''
  -
    name: Mandate
    description: ''
  -
    name: Module
    description: ''
  -
    name: ModuleObject
    description: ''
  -
    name: ModuleProduct
    description: ''
  -
    name: ModuleWorkspaces
    description: ''
  -
    name: Policy
    description: ''
  -
    name: Propbase
    description: ''
  -
    name: Role
    description: ''
  -
    name: Search
    description: ''
  -
    name: Source
    description: ''
  -
    name: Template
    description: ''
  -
    name: User
    description: ''
  -
    name: Version
    description: ''
  -
    name: Workspace
    description: ''
  -
    name: Zefix
    description: ''
components:
  securitySchemes:
    default:
      type: http
      scheme: bearer
      description: null
security:
  -
    default: []
paths:
  '/api/address/{address}':
    get:
      summary: 'Retrieve a list of addresses or a single address.'
      operationId: retrieveAListOfAddressesOrASingleAddress
      description: 'Returns either all addresses for the current workspace or a specific address with its relations.'
      parameters:
        -
          in: query
          name: per_page
          description: 'optional Number of results per page.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional Number of results per page.'
            example: 10
            nullable: false
        -
          in: query
          name: page
          description: 'optional Page number.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'optional Page number.'
            example: 1
            nullable: false
        -
          in: query
          name: with
          description: 'optional Relations to load.'
          example:
            - contacts
          required: false
          schema:
            type: array
            description: 'optional Relations to load.'
            example:
              - contacts
            items:
              type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"data\": [\n    {\n      \"id\": 1,\n      \"street\": \"Main St\",\n      \"housenumber\": \"123\",\n      \"zip\": \"12345\",\n      \"city\": \"Sample City\",\n      \"region\": \"Sample Region\",\n      \"country\": \"Sample Country\",\n      \"lat\": 52.52,\n      \"lng\": 13.405,\n      \"attributes\": [],\n      // ...other fields...\n    }\n  ]\n}"
      tags:
        - Address
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                per_page:
                  type: integer
                  description: ''
                  example: 16
                  nullable: true
                page:
                  type: integer
                  description: ''
                  example: 16
                  nullable: true
                with:
                  type: array
                  description: ''
                  example:
                    - architecto
                  items:
                    type: string
                    nullable: true
    parameters:
      -
        in: path
        name: address
        description: 'Optional parameter. optional The ID of the address.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/address:
    post:
      summary: 'Create a new address.'
      operationId: createANewAddress
      description: 'Validates the request data and creates a new address record.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"success\": true,\n  \"message\": \"address created successfully\",\n  \"data\": {\n    \"data\": {\n      \"id\": 1,\n      \"street\": \"Main St\",\n      // ...other fields...\n    }\n  }\n}"
      tags:
        - Address
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                street:
                  type: string
                  description: 'The street name.'
                  example: '"Main St"'
                  nullable: false
                housenumber:
                  type: string
                  description: 'The house number.'
                  example: '"123"'
                  nullable: false
                zip:
                  type: string
                  description: 'The postal code.'
                  example: '"12345"'
                  nullable: false
                city:
                  type: string
                  description: 'The city name.'
                  example: '"Sample City"'
                  nullable: false
                region:
                  type: string
                  description: 'optional The region name.'
                  example: '"Sample Region"'
                  nullable: true
                country:
                  type: string
                  description: 'The country name.'
                  example: '"Sample Country"'
                  nullable: false
                lat:
                  type: number
                  description: 'optional Latitude.'
                  example: 52.52
                  nullable: true
                lng:
                  type: number
                  description: 'optional Longitude.'
                  example: 13.405
                  nullable: true
                attributes:
                  type: array
                  description: 'optional Additional attributes.'
                  example:
                    - architecto
                  items:
                    type: string
                    nullable: true
                object_id:
                  type: integer
                  description: 'optional ID of the related object.'
                  example: 16
                  nullable: true
                object_type:
                  type: string
                  description: 'optional Type of the related object.'
                  example: architecto
                  nullable: true
                connection_type:
                  type: string
                  description: 'optional Type of the connection.'
                  example: architecto
                  nullable: true
                connection_data:
                  type: array
                  description: 'optional Additional connection data.'
                  example:
                    - architecto
                  items:
                    type: string
                    nullable: true
              required:
                - street
                - housenumber
                - zip
                - city
                - country
  '/api/address/{address_id}':
    post:
      summary: 'Update an existing address.'
      operationId: updateAnExistingAddress
      description: 'Validates the request data and updates the specified address record.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'address updated successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'address updated successfully'
      tags:
        - Address
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                street:
                  type: string
                  description: 'The street name.'
                  example: '"Main St"'
                  nullable: false
                housenumber:
                  type: string
                  description: 'The house number.'
                  example: '"123"'
                  nullable: false
                zip:
                  type: string
                  description: 'The postal code.'
                  example: '"12345"'
                  nullable: false
                city:
                  type: string
                  description: 'The city name.'
                  example: '"Sample City"'
                  nullable: false
                region:
                  type: string
                  description: 'optional The region name.'
                  example: '"Sample Region"'
                  nullable: true
                country:
                  type: string
                  description: 'The country name.'
                  example: '"Sample Country"'
                  nullable: false
                lat:
                  type: number
                  description: 'optional Latitude.'
                  example: 52.52
                  nullable: true
                lng:
                  type: number
                  description: 'optional Longitude.'
                  example: 13.405
                  nullable: true
                attributes:
                  type: array
                  description: 'optional Additional attributes.'
                  example:
                    - architecto
                  items:
                    type: string
                    nullable: true
              required:
                - street
                - housenumber
                - zip
                - city
                - country
    delete:
      summary: 'Delete an address.'
      operationId: deleteAnAddress
      description: 'Removes the specified address from the database.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'address deletion successful'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'address deletion successful'
      tags:
        - Address
    parameters:
      -
        in: path
        name: address_id
        description: 'The ID of the address.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: address
        description: 'The ID of the address to update.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/address/{address_id}/connect':
    post:
      summary: 'Connect an address to another object.'
      operationId: connectAnAddressToAnotherObject
      description: 'Validates the request data and connects the address to the specified object.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'address connected to object'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'address connected to object'
      tags:
        - Address
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                object_id:
                  type: integer
                  description: 'The ID of the object to connect.'
                  example: 2
                  nullable: false
                object_type:
                  type: string
                  description: 'The type of the object to connect.'
                  example: '"App\\Models\\Contact"'
                  nullable: false
                connection_type:
                  type: string
                  description: 'optional The type of the connection.'
                  example: '"primary"'
                  nullable: true
              required:
                - object_id
                - object_type
    parameters:
      -
        in: path
        name: address_id
        description: 'The ID of the address.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: address
        description: 'The ID of the address to connect.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/address/{address_id}/disconnect':
    post:
      summary: 'Disconnect an address from another object.'
      operationId: disconnectAnAddressFromAnotherObject
      description: 'Validates the request data and disconnects the address from the specified object.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'address disconnected from object'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'address disconnected from object'
      tags:
        - Address
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                object_id:
                  type: integer
                  description: 'The ID of the object to disconnect.'
                  example: 2
                  nullable: false
                object_type:
                  type: string
                  description: 'The type of the object to disconnect.'
                  example: '"App\\Models\\Contact"'
                  nullable: false
                connection_type:
                  type: string
                  description: 'optional The type of the connection.'
                  example: '"primary"'
                  nullable: true
              required:
                - object_id
                - object_type
    parameters:
      -
        in: path
        name: address_id
        description: 'The ID of the address.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: address
        description: 'The ID of the address to disconnect.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/address/{address_id}/update-connection':
    post:
      summary: 'Update the connection data between an address and another object.'
      operationId: updateTheConnectionDataBetweenAnAddressAndAnotherObject
      description: 'Validates the request data and updates the connection information.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'address connection updated successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'address connection updated successfully'
      tags:
        - Address
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                object_id:
                  type: integer
                  description: 'The ID of the object.'
                  example: 2
                  nullable: false
                object_type:
                  type: string
                  description: 'The type of the object.'
                  example: '"App\\Models\\Contact"'
                  nullable: false
                connection_type:
                  type: string
                  description: 'optional The type of the connection.'
                  example: '"primary"'
                  nullable: true
                data:
                  type: object
                  description: 'The connection data.'
                  example: []
                  nullable: false
                  properties:
                    type:
                      type: string
                      description: 'optional The type of the address connection.'
                      example: '"secondary"'
                      nullable: true
                    data:
                      type: array
                      description: 'optional Additional connection data.'
                      example:
                        - architecto
                      items:
                        type: string
                        nullable: true
              required:
                - object_id
                - object_type
                - data
    parameters:
      -
        in: path
        name: address_id
        description: 'The ID of the address.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: address
        description: 'The ID of the address.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/address/{address_id}/weather':
    get:
      summary: 'Get weather data for an address.'
      operationId: getWeatherDataForAnAddress
      description: 'Returns weather information for the specified address.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"success\": true,\n  \"message\": \"weather data\",\n  \"data\": {\n    // weather data fields\n  }\n}"
      tags:
        - Address
    parameters:
      -
        in: path
        name: address_id
        description: 'The ID of the address.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: address
        description: 'The ID of the address.'
        example: 1
        required: true
        schema:
          type: integer
  /api/auth/register:
    post:
      summary: 'Register a new user and send activation mail.'
      operationId: registerANewUserAndSendActivationMail
      description: 'Creates a new user for the specified workspace, assigns a role and group, and sends an activation email.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'user created successfully'
                  data:
                    id: 1
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'user created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
        400:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  status: false
                  message: 'user already exists'
                properties:
                  status:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'user already exists'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'workspace does not exist'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'workspace does not exist'
      tags:
        - Auth
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  description: "The user's email address."
                  example: '"user@example.com"'
                  nullable: false
                password:
                  type: string
                  description: "The user's password."
                  example: '|]|{+-'
                  nullable: false
                tfatype:
                  type: string
                  description: 'The type of two-factor authentication.'
                  example: '"email"'
                  nullable: false
                firstname:
                  type: string
                  description: "The user's first name."
                  example: '"John"'
                  nullable: false
                lastname:
                  type: string
                  description: "The user's last name."
                  example: '"Doe"'
                  nullable: false
                salutation:
                  type: string
                  description: 'Salutation, one character.'
                  example: '"M"'
                  nullable: false
                type:
                  type: string
                  description: 'The user type.'
                  example: '"customer"'
                  nullable: false
                subtype:
                  type: string
                  description: ''
                  example: architecto
                  nullable: false
                workspace:
                  type: integer
                  description: 'Workspace ID.'
                  example: 1
                  nullable: false
                google2fa_secret:
                  type: string
                  description: 'optional Google 2FA secret, required if tfatype is not "email".'
                  example: architecto
                  nullable: false
                group_id:
                  type: integer
                  description: 'optional Group ID.'
                  example: 2
                  nullable: true
                active_language:
                  type: string
                  description: 'optional Language code.'
                  example: '"en"'
                  nullable: true
                company:
                  type: string
                  description: 'optional Company name for group assignment.'
                  example: architecto
                  nullable: false
              required:
                - email
                - password
                - tfatype
                - firstname
                - lastname
                - salutation
                - type
                - subtype
                - workspace
      security: []
  /api/auth/login:
    post:
      summary: 'Authenticate user and send two-factor information.'
      operationId: authenticateUserAndSendTwoFactorInformation
      description: 'Checks email and password, sends two-factor authentication info if required, and returns user data.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'login successful, user exists'
                  data:
                    user:
                      id: 1
                      tfatype: email
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'login successful, user exists'
                  data:
                    type: object
                    properties:
                      user:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 1
                          tfatype:
                            type: string
                            example: email
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'invalid username or password'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'invalid username or password'
        429:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'too many login attempts, please try again in X minutes'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'too many login attempts, please try again in X minutes'
      tags:
        - Auth
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace:
                  type: integer
                  description: 'Workspace ID.'
                  example: 1
                  nullable: false
                email:
                  type: string
                  description: "The user's email address."
                  example: '"user@example.com"'
                  nullable: false
                password:
                  type: string
                  description: "The user's password."
                  example: '|]|{+-'
                  nullable: false
                group_id:
                  type: integer
                  description: 'optional Group ID.'
                  example: 2
                  nullable: true
                uuid1:
                  type: string
                  description: 'Device UUID1.'
                  example: architecto
                  nullable: false
                uuid2:
                  type: string
                  description: 'Device UUID2.'
                  example: architecto
                  nullable: false
              required:
                - workspace
                - email
                - password
                - uuid1
                - uuid2
      security: []
  /api/auth/forgotpassword:
    post:
      summary: 'Send password reset email.'
      operationId: sendPasswordResetEmail
      description: 'Sends an email to the user with instructions to reset their password.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'email to reset password successfully sent'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'email to reset password successfully sent'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'user does not exist'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'user does not exist'
      tags:
        - Auth
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  description: "The user's email address."
                  example: '"user@example.com"'
                  nullable: false
              required:
                - email
      security: []
  /api/auth/tfalogin:
    post:
      summary: 'Verify two-factor token and log in the user.'
      operationId: verifyTwoFactorTokenAndLogInTheUser
      description: 'Validates the provided one-time password for two-factor authentication and logs in the user.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'two-factor authentication successful'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'two-factor authentication successful'
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'invalid or expired two-factor token'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'invalid or expired two-factor token'
      tags:
        - Auth
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                user_id:
                  type: integer
                  description: "The user's ID."
                  example: 1
                  nullable: false
                one_time_password:
                  type: string
                  description: 'The one-time password for 2FA.'
                  example: architecto
                  nullable: false
                uuid1:
                  type: string
                  description: 'Device UUID1.'
                  example: architecto
                  nullable: false
                uuid2:
                  type: string
                  description: 'Device UUID2.'
                  example: architecto
                  nullable: false
              required:
                - user_id
                - one_time_password
                - uuid1
                - uuid2
      security: []
  /api/auth/token:
    post:
      summary: 'Log in using a token.'
      operationId: logInUsingAToken
      description: 'Authenticates the user using a previously issued token.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'login successful'
                  data:
                    user_id: 1
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'login successful'
                  data:
                    type: object
                    properties:
                      user_id:
                        type: integer
                        example: 1
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'invalid token'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'invalid token'
        429:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'too many login attempts, please try again in X minutes'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'too many login attempts, please try again in X minutes'
      tags:
        - Auth
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                token:
                  type: string
                  description: 'The login token.'
                  example: architecto
                  nullable: false
              required:
                - token
      security: []
  /api/auth/group:
    post:
      summary: 'Change the active group of the authenticated user.'
      operationId: changeTheActiveGroupOfTheAuthenticatedUser
      description: "Sets the user's active group to the specified group if the user has access."
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'group changed successfully'
                  data:
                    user: {  }
                    group: {  }
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'group changed successfully'
                  data:
                    type: object
                    properties:
                      user:
                        type: object
                        properties: {  }
                      group:
                        type: object
                        properties: {  }
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'user does not have access to this group'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'user does not have access to this group'
      tags:
        - Auth
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                group_id:
                  type: integer
                  description: 'The ID of the group to activate.'
                  example: 2
                  nullable: false
              required:
                - group_id
  /api/auth/refresh:
    post:
      summary: 'Refresh the access token for the authenticated user.'
      operationId: refreshTheAccessTokenForTheAuthenticatedUser
      description: 'Returns a new access token for the currently authenticated user.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'access token refreshed successfully'
                  data:
                    user: {  }
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'access token refreshed successfully'
                  data:
                    type: object
                    properties:
                      user:
                        type: object
                        properties: {  }
      tags:
        - Auth
  /api/auth/logout:
    post:
      summary: 'Log out the current user and invalidate the token.'
      operationId: logOutTheCurrentUserAndInvalidateTheToken
      description: "Invalidates the current user's authentication token and logs them out."
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'logout successful'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'logout successful'
      tags:
        - Auth
  /api/benchmark/compare:
    get:
      summary: 'Compare a policy with a benchmark.'
      operationId: compareAPolicyWithABenchmark
      description: 'Compares the specified policy with the benchmark based on insurance sum, building type, gustavo, and group.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"success\": true,\n  \"message\": \"benchmark compared successfully\",\n  \"data\": {\n    // comparison result data\n  }\n}"
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'no benchmark found'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'no benchmark found'
      tags:
        - Benchmark
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                insurance_sum:
                  type: number
                  description: 'The insurance sum to compare.'
                  example: 200000.0
                  nullable: false
                building_type:
                  type: string
                  description: 'The building type.'
                  example: '"house"'
                  nullable: false
                gustavo:
                  type: boolean
                  description: 'Gustavo flag.'
                  example: true
                  nullable: false
                group_id:
                  type: integer
                  description: 'The group ID.'
                  example: 2
                  nullable: false
                policy_id:
                  type: integer
                  description: 'The policy ID to compare.'
                  example: 5
                  nullable: false
                workspace_id:
                  type: integer
                  description: 'The workspace ID.'
                  example: 1
                  nullable: false
              required:
                - insurance_sum
                - building_type
                - gustavo
                - group_id
                - policy_id
                - workspace_id
  '/api/benchmark/{benchmark}':
    get:
      summary: 'Retrieve a list of all benchmarks or a single benchmark.'
      operationId: retrieveAListOfAllBenchmarksOrASingleBenchmark
      description: 'Returns either all benchmarks for the current workspace or a specific benchmark with its relations.'
      parameters:
        -
          in: query
          name: per_page
          description: 'optional Number of results per page.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional Number of results per page.'
            example: 10
            nullable: false
        -
          in: query
          name: page
          description: 'optional Page number.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'optional Page number.'
            example: 1
            nullable: false
        -
          in: query
          name: with
          description: 'optional Relations to load.'
          example:
            - benchmarkProducts
            - group
          required: false
          schema:
            type: array
            description: 'optional Relations to load.'
            example:
              - benchmarkProducts
              - group
            items:
              type: string
        -
          in: query
          name: paged
          description: 'optional Whether to paginate results.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Whether to paginate results.'
            example: true
            nullable: false
        -
          in: query
          name: shortresult
          description: 'optional If true, returns only basic data.'
          example: false
          required: false
          schema:
            type: boolean
            description: 'optional If true, returns only basic data.'
            example: false
            nullable: false
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      id: 1
                      name: 'Sample Benchmark'
                      group_id: 2
                      active: true
                      insurance_sum_from: 100000
                      insurance_sum_to: 500000
                      building_type:
                        - house
                      gustavo: true
                      global: false
                      benchmarkProducts: []
                      group: {  }
                properties:
                  data:
                    type: array
                    example:
                      -
                        id: 1
                        name: 'Sample Benchmark'
                        group_id: 2
                        active: true
                        insurance_sum_from: 100000
                        insurance_sum_to: 500000
                        building_type:
                          - house
                        gustavo: true
                        global: false
                        benchmarkProducts: []
                        group: []
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        name:
                          type: string
                          example: 'Sample Benchmark'
                        group_id:
                          type: integer
                          example: 2
                        active:
                          type: boolean
                          example: true
                        insurance_sum_from:
                          type: integer
                          example: 100000
                        insurance_sum_to:
                          type: integer
                          example: 500000
                        building_type:
                          type: array
                          example:
                            - house
                          items:
                            type: string
                        gustavo:
                          type: boolean
                          example: true
                        global:
                          type: boolean
                          example: false
                        benchmarkProducts:
                          type: array
                          example: []
                        group:
                          type: object
                          properties: {  }
      tags:
        - Benchmark
    parameters:
      -
        in: path
        name: benchmark
        description: 'Optional parameter. optional The ID of the benchmark.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/benchmark:
    post:
      summary: 'Create a new benchmark.'
      operationId: createANewBenchmark
      description: 'Validates the request data and creates a new benchmark record with associated products.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"success\": true,\n  \"message\": \"benchmark created successfully\",\n  \"data\": {\n    \"data\": {\n      \"id\": 1,\n      \"name\": \"Sample Benchmark\",\n      // ...other fields...\n    }\n  }\n}"
      tags:
        - Benchmark
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The name of the benchmark.'
                  example: '"Sample Benchmark"'
                  nullable: false
                group_id:
                  type: integer
                  description: 'required_without:global The group ID.'
                  example: 2
                  nullable: false
                active:
                  type: boolean
                  description: 'Whether the benchmark is active.'
                  example: true
                  nullable: false
                insurance_sum_from:
                  type: number
                  description: 'Minimum insurance sum.'
                  example: 100000.0
                  nullable: false
                insurance_sum_to:
                  type: number
                  description: 'Maximum insurance sum.'
                  example: 500000.0
                  nullable: false
                building_type:
                  type: array
                  description: 'Building types.'
                  example:
                    - house
                  items:
                    type: string
                gustavo:
                  type: boolean
                  description: 'Gustavo flag.'
                  example: true
                  nullable: false
                global:
                  type: boolean
                  description: 'required_without:group_id Global flag.'
                  example: false
                  nullable: false
                benchmark_products:
                  type: array
                  description: 'List of benchmark products.'
                  example:
                    - architecto
                  items:
                    type: string
              required:
                - name
                - active
                - insurance_sum_from
                - insurance_sum_to
                - building_type
                - gustavo
                - benchmark_products
  '/api/benchmark/{benchmark_id}':
    post:
      summary: 'Update an existing benchmark.'
      operationId: updateAnExistingBenchmark
      description: 'Validates the request data and updates the specified benchmark record and its products.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"success\": true,\n  \"message\": \"benchmark updated successfully\",\n  \"data\": {\n    \"data\": {\n      \"id\": 1,\n      \"name\": \"Updated Benchmark\",\n      // ...other fields...\n    }\n  }\n}"
      tags:
        - Benchmark
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The name of the benchmark.'
                  example: '"Updated Benchmark"'
                  nullable: false
                group_id:
                  type: integer
                  description: 'required_without:global The group ID.'
                  example: 2
                  nullable: false
                active:
                  type: boolean
                  description: 'Whether the benchmark is active.'
                  example: true
                  nullable: false
                insurance_sum_from:
                  type: number
                  description: 'Minimum insurance sum.'
                  example: 100000.0
                  nullable: false
                insurance_sum_to:
                  type: number
                  description: 'Maximum insurance sum.'
                  example: 500000.0
                  nullable: false
                building_type:
                  type: array
                  description: 'Building types.'
                  example:
                    - house
                  items:
                    type: string
                gustavo:
                  type: boolean
                  description: 'Gustavo flag.'
                  example: true
                  nullable: false
                global:
                  type: boolean
                  description: 'required_without:group_id Global flag.'
                  example: false
                  nullable: false
                benchmark_products:
                  type: array
                  description: 'List of benchmark products.'
                  example:
                    - architecto
                  items:
                    type: string
              required:
                - name
                - active
                - insurance_sum_from
                - insurance_sum_to
                - building_type
                - gustavo
                - benchmark_products
    delete:
      summary: 'Delete a benchmark.'
      operationId: deleteABenchmark
      description: 'Removes the specified benchmark from the database.'
      parameters: []
      responses:
        204:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'benchmark deleted successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'benchmark deleted successfully'
      tags:
        - Benchmark
    parameters:
      -
        in: path
        name: benchmark_id
        description: 'The ID of the benchmark.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: benchmark
        description: 'The ID of the benchmark to update.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/canton/{canton}':
    get:
      summary: 'Retrieve a list of all cantons or a single canton.'
      operationId: retrieveAListOfAllCantonsOrASingleCanton
      description: 'Returns all cantons ordered by name, or a specific canton by name, short, or ID, including related canton indexes.'
      parameters:
        -
          in: query
          name: name
          description: 'optional The name of the canton.'
          example: '"Zürich"'
          required: false
          schema:
            type: string
            description: 'optional The name of the canton.'
            example: '"Zürich"'
            nullable: false
        -
          in: query
          name: short
          description: 'optional The short code of the canton.'
          example: '"ZH"'
          required: false
          schema:
            type: string
            description: 'optional The short code of the canton.'
            example: '"ZH"'
            nullable: false
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  id: 1
                  name: Zürich
                  short: ZH
                  cantonIndexes: []
                properties:
                  id:
                    type: integer
                    example: 1
                  name:
                    type: string
                    example: Zürich
                  short:
                    type: string
                    example: ZH
                  cantonIndexes:
                    type: array
                    example: []
      tags:
        - Canton
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: ''
                  example: architecto
                  nullable: false
                short:
                  type: string
                  description: ''
                  example: architecto
                  nullable: false
    parameters:
      -
        in: path
        name: canton
        description: 'Optional parameter. optional The ID of the canton.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/canton:
    post:
      summary: 'Create a new canton.'
      operationId: createANewCanton
      description: 'Validates the request data and creates a new canton record.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'canton created successfully'
                  data:
                    id: 1
                    name: Zürich
                    short: ZH
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'canton created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: Zürich
                      short:
                        type: string
                        example: ZH
      tags:
        - Canton
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The name of the canton.'
                  example: '"Zürich"'
                  nullable: false
                short:
                  type: string
                  description: 'The short code of the canton.'
                  example: '"ZH"'
                  nullable: false
              required:
                - name
                - short
  '/api/canton/{canton_id}':
    post:
      summary: 'Update an existing canton.'
      operationId: updateAnExistingCanton
      description: 'Validates the request data and updates the specified canton record.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'canton updated successfully'
                  data:
                    id: 1
                    name: Bern
                    short: BE
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'canton updated successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: Bern
                      short:
                        type: string
                        example: BE
      tags:
        - Canton
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'optional The new name of the canton.'
                  example: '"Bern"'
                  nullable: true
                short:
                  type: string
                  description: 'optional The new short code of the canton.'
                  example: '"BE"'
                  nullable: true
    delete:
      summary: 'Delete a canton.'
      operationId: deleteACanton
      description: 'Removes the specified canton from the database.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'canton deleted successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'canton deleted successfully'
      tags:
        - Canton
    parameters:
      -
        in: path
        name: canton_id
        description: 'The ID of the canton.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: canton
        description: 'The ID of the canton to update.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/canton/{canton_id}/index/{index}':
    get:
      summary: 'Retrieve a list of all canton indexes for a canton or a single index.'
      operationId: retrieveAListOfAllCantonIndexesForACantonOrASingleIndex
      description: 'Returns all indexes for the specified canton or a specific index with its related canton.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  id: 5
                  year: 2023
                  index: 102
                  canton_id: 1
                  canton:
                    id: 1
                    name: Zürich
                    short: ZH
                properties:
                  id:
                    type: integer
                    example: 5
                  year:
                    type: integer
                    example: 2023
                  index:
                    type: integer
                    example: 102
                  canton_id:
                    type: integer
                    example: 1
                  canton:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: Zürich
                      short:
                        type: string
                        example: ZH
      tags:
        - 'Canton Index'
    parameters:
      -
        in: path
        name: canton_id
        description: 'The ID of the canton.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: index
        description: 'Optional parameter. optional The ID of the canton index.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 5
      -
        in: path
        name: canton
        description: 'The ID of the canton.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/canton/{canton_id}/index':
    post:
      summary: 'Create a new canton index for a canton.'
      operationId: createANewCantonIndexForACanton
      description: 'Validates the request data and creates a new index for the specified canton.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'canton index created successfully'
                  data:
                    data:
                      id: 5
                      year: 2023
                      index: 102
                      canton_id: 1
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'canton index created successfully'
                  data:
                    type: object
                    properties:
                      data:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 5
                          year:
                            type: integer
                            example: 2023
                          index:
                            type: integer
                            example: 102
                          canton_id:
                            type: integer
                            example: 1
      tags:
        - 'Canton Index'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                year:
                  type: integer
                  description: 'The year of the index.'
                  example: 2023
                  nullable: false
                index:
                  type: integer
                  description: 'The value of the index.'
                  example: 102
                  nullable: false
              required:
                - year
                - index
    parameters:
      -
        in: path
        name: canton_id
        description: 'The ID of the canton.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: canton
        description: 'The ID of the canton.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/canton/{canton_id}/index/{index_id}':
    post:
      summary: 'Update an existing canton index.'
      operationId: updateAnExistingCantonIndex
      description: 'Validates the request data and updates the specified canton index.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'canton index updated successfully'
                  data:
                    data:
                      id: 5
                      year: 2024
                      index: 105
                      canton_id: 1
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'canton index updated successfully'
                  data:
                    type: object
                    properties:
                      data:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 5
                          year:
                            type: integer
                            example: 2024
                          index:
                            type: integer
                            example: 105
                          canton_id:
                            type: integer
                            example: 1
      tags:
        - 'Canton Index'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                year:
                  type: integer
                  description: 'optional The new year of the index.'
                  example: 2024
                  nullable: true
                index:
                  type: integer
                  description: 'optional The new value of the index.'
                  example: 105
                  nullable: true
    delete:
      summary: 'Delete a canton index.'
      operationId: deleteACantonIndex
      description: 'Removes the specified canton index from the database.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'canton index deleted successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'canton index deleted successfully'
      tags:
        - 'Canton Index'
    parameters:
      -
        in: path
        name: canton_id
        description: 'The ID of the canton.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: index_id
        description: 'The ID of the index.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: canton
        description: 'The ID of the canton.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: index
        description: 'The ID of the canton index to update.'
        example: 5
        required: true
        schema:
          type: integer
  '/api/collection/user/{user}':
    get:
      summary: 'Retrieve collections for a specific user.'
      operationId: retrieveCollectionsForASpecificUser
      description: 'Returns all collections associated with the specified user, paginated.'
      parameters:
        -
          in: query
          name: per_page
          description: 'optional Number of results per page.'
          example: 15
          required: false
          schema:
            type: integer
            description: 'optional Number of results per page.'
            example: 15
            nullable: false
        -
          in: query
          name: page
          description: 'optional Page number.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'optional Page number.'
            example: 1
            nullable: false
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      id: 1
                      name: 'Sample Collection'
                      group_id: 2
                properties:
                  data:
                    type: array
                    example:
                      -
                        id: 1
                        name: 'Sample Collection'
                        group_id: 2
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        name:
                          type: string
                          example: 'Sample Collection'
                        group_id:
                          type: integer
                          example: 2
      tags:
        - Collection
    parameters:
      -
        in: path
        name: user
        description: 'Optional parameter. optional The ID of the user.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  '/api/collection/{collection_id}':
    post:
      summary: 'Update an existing collection.'
      operationId: updateAnExistingCollection
      description: 'Validates the request data and updates the specified collection.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'collection updated successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'collection updated successfully'
      tags:
        - Collection
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'optional The new name of the collection.'
                  example: '"Updated Collection"'
                  nullable: true
                group_id:
                  type: integer
                  description: 'optional The new group ID.'
                  example: 3
                  nullable: true
    delete:
      summary: 'Delete a collection.'
      operationId: deleteACollection
      description: 'Removes the specified collection from the database.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'collection deleted successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'collection deleted successfully'
      tags:
        - Collection
    parameters:
      -
        in: path
        name: collection_id
        description: 'The ID of the collection.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: collection
        description: 'The ID of the collection to update.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/collection/{collection}':
    get:
      summary: 'Retrieve a list of all collections or a single collection.'
      operationId: retrieveAListOfAllCollectionsOrASingleCollection
      description: 'Returns all collections for the current workspace, optionally paginated, or a specific collection with its files.'
      parameters:
        -
          in: query
          name: paged
          description: 'optional Whether to paginate results.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Whether to paginate results.'
            example: true
            nullable: false
        -
          in: query
          name: per_page
          description: 'optional Number of results per page.'
          example: 15
          required: false
          schema:
            type: integer
            description: 'optional Number of results per page.'
            example: 15
            nullable: false
        -
          in: query
          name: page
          description: 'optional Page number.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'optional Page number.'
            example: 1
            nullable: false
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  id: 1
                  name: 'Sample Collection'
                  group_id: 2
                  files: []
                properties:
                  id:
                    type: integer
                    example: 1
                  name:
                    type: string
                    example: 'Sample Collection'
                  group_id:
                    type: integer
                    example: 2
                  files:
                    type: array
                    example: []
      tags:
        - Collection
    parameters:
      -
        in: path
        name: collection
        description: 'Optional parameter. optional The ID of the collection.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  '/api/collection/{collection_id}/object':
    post:
      summary: 'Attach objects to a collection.'
      operationId: attachObjectsToACollection
      description: 'Validates the request data and attaches the specified objects to the collection.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'objects successfully added to collection'
                  errors: []
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'objects successfully added to collection'
                  errors:
                    type: array
                    example: []
      tags:
        - Collection
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                objects:
                  type: array
                  description: 'List of objects to attach.'
                  example:
                    - architecto
                  items:
                    type: string
              required:
                - objects
    delete:
      summary: 'Detach objects from a collection.'
      operationId: detachObjectsFromACollection
      description: 'Validates the request data and detaches the specified objects from the collection.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'objects successfully removed from collection'
                  errors: []
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'objects successfully removed from collection'
                  errors:
                    type: array
                    example: []
      tags:
        - Collection
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                objects:
                  type: array
                  description: 'List of objects to detach.'
                  example:
                    - architecto
                  items:
                    type: string
              required:
                - objects
    parameters:
      -
        in: path
        name: collection_id
        description: 'The ID of the collection.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: collection
        description: 'The ID of the collection.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/collection/{collection_id}/user':
    post:
      summary: 'Add users to a collection.'
      operationId: addUsersToACollection
      description: 'Validates the request data and adds the specified users to the collection.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'users successfully added to collection'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'users successfully added to collection'
      tags:
        - Collection
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                users:
                  type: array
                  description: 'List of user IDs to add.'
                  example:
                    - 2
                    - 3
                  items:
                    type: string
              required:
                - users
    delete:
      summary: 'Remove users from a collection.'
      operationId: removeUsersFromACollection
      description: 'Validates the request data and removes the specified users from the collection.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'users successfully removed from collection'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'users successfully removed from collection'
      tags:
        - Collection
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                users:
                  type: array
                  description: 'List of user IDs to remove.'
                  example:
                    - 2
                    - 3
                  items:
                    type: string
              required:
                - users
    parameters:
      -
        in: path
        name: collection_id
        description: 'The ID of the collection.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: collection
        description: 'The ID of the collection.'
        example: 1
        required: true
        schema:
          type: integer
  /api/collection:
    post:
      summary: 'Create a new collection.'
      operationId: createANewCollection
      description: 'Validates the request data and creates a new collection for the specified group.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'collection created successfully'
                  data:
                    id: 1
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'collection created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
      tags:
        - Collection
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The name of the collection.'
                  example: '"Sample Collection"'
                  nullable: false
                group_id:
                  type: integer
                  description: 'The group ID.'
                  example: 2
                  nullable: false
              required:
                - name
                - group_id
  '/api/collection/{collection_id}/invite':
    post:
      summary: 'Invite a user to a collection via email.'
      operationId: inviteAUserToACollectionViaEmail
      description: 'Sends an invitation email to the specified address to join the collection.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'invite sent successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'invite sent successfully'
      tags:
        - Collection
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  description: 'The email address to invite.'
                  example: '"invitee@example.com"'
                  nullable: false
                salutation:
                  type: string
                  description: 'The salutation for the invitee.'
                  example: '"Mr"'
                  nullable: false
                firstname:
                  type: string
                  description: 'The first name of the invitee.'
                  example: '"John"'
                  nullable: false
                lastname:
                  type: string
                  description: 'The last name of the invitee.'
                  example: '"Doe"'
                  nullable: false
              required:
                - email
                - salutation
                - firstname
                - lastname
    parameters:
      -
        in: path
        name: collection_id
        description: 'The ID of the collection.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: collection
        description: 'The ID of the collection.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/collection/{collection_id}/authorize':
    post:
      summary: 'Authorize a collection invite using a code.'
      operationId: authorizeACollectionInviteUsingACode
      description: 'Validates the invite code and adds the user to the collection.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'user successfully added to collection'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'user successfully added to collection'
        400:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'invalid code'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'invalid code'
      tags:
        - Collection
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                code:
                  type: string
                  description: 'The invite code.'
                  example: '"ABC123"'
                  nullable: false
              required:
                - code
    parameters:
      -
        in: path
        name: collection_id
        description: 'The ID of the collection.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: collection
        description: 'The ID of the collection.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/collection/{collection_id}/addGroupManagers':
    post:
      summary: 'Add group managers to a collection.'
      operationId: addGroupManagersToACollection
      description: 'Validates the request data and adds all managers of the specified group to the collection.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'Group managers successfully added to collection'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Group managers successfully added to collection'
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'You are not allowed to add group managers to this collection'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'You are not allowed to add group managers to this collection'
      tags:
        - Collection
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                group_id:
                  type: integer
                  description: 'The group ID whose managers should be added.'
                  example: 2
                  nullable: false
              required:
                - group_id
    parameters:
      -
        in: path
        name: collection_id
        description: 'The ID of the collection.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: collection
        description: 'The ID of the collection.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/collection/rejectInvite/{collectionInvite_id}':
    post:
      summary: 'Reject a collection invite.'
      operationId: rejectACollectionInvite
      description: 'Notifies the inviting user and deletes the invite.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'invite rejected successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'invite rejected successfully'
      tags:
        - Collection
    parameters:
      -
        in: path
        name: collectionInvite_id
        description: 'The ID of the collectionInvite.'
        example: 2
        required: true
        schema:
          type: integer
      -
        in: path
        name: collectionInvite
        description: 'The ID of the collection invite to reject.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/contact/{contact}':
    get:
      summary: 'Retrieve a list of contacts or a single contact.'
      operationId: retrieveAListOfContactsOrASingleContact
      description: 'Returns all contacts for the current workspace or group, or a specific contact with its relations.'
      parameters:
        -
          in: query
          name: per_page
          description: 'optional Number of results per page.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional Number of results per page.'
            example: 10
            nullable: false
        -
          in: query
          name: page
          description: 'optional Page number.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'optional Page number.'
            example: 1
            nullable: false
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"data\": [\n    {\n      \"id\": 1,\n      \"firstname\": \"John\",\n      \"lastname\": \"Doe\",\n      \"email\": \"john.doe@example.com\",\n      // ...other fields...\n    }\n  ]\n}"
      tags:
        - Contact
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                per_page:
                  type: integer
                  description: ''
                  example: 16
                  nullable: true
                page:
                  type: integer
                  description: ''
                  example: 16
                  nullable: true
    parameters:
      -
        in: path
        name: contact
        description: 'Optional parameter. optional The ID of the contact.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/contact:
    post:
      summary: 'Create a new contact.'
      operationId: createANewContact
      description: 'Validates the request data and creates a new contact record. Optionally connects the contact to an object.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"success\": true,\n  \"message\": \"contact created successfully\",\n  \"data\": {\n    \"data\": {\n      \"id\": 1,\n      \"firstname\": \"John\",\n      // ...other fields...\n    },\n    \"newGroup\": false\n  }\n}"
      tags:
        - Contact
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                salutation:
                  type: string
                  description: 'optional Salutation.'
                  example: '"Mr"'
                  nullable: true
                firstname:
                  type: string
                  description: 'optional First name.'
                  example: '"John"'
                  nullable: true
                lastname:
                  type: string
                  description: 'optional Last name.'
                  example: '"Doe"'
                  nullable: true
                company:
                  type: string
                  description: 'optional Company name.'
                  example: '"Acme Inc."'
                  nullable: true
                email:
                  type: string
                  description: 'optional Email address.'
                  example: '"john.doe@example.com"'
                  nullable: true
                phone:
                  type: string
                  description: 'optional Phone number.'
                  example: '"+123456789"'
                  nullable: true
                mobile:
                  type: string
                  description: 'optional Mobile number.'
                  example: '"+987654321"'
                  nullable: true
                fax:
                  type: string
                  description: 'optional Fax number.'
                  example: '"+1122334455"'
                  nullable: true
                homepage:
                  type: string
                  description: 'optional Homepage URL.'
                  example: '"https://acme.com"'
                  nullable: true
                address_id:
                  type: integer
                  description: 'optional Address ID.'
                  example: 2
                  nullable: true
                street:
                  type: string
                  description: 'optional Street name.'
                  example: '"Main St"'
                  nullable: true
                housenumber:
                  type: string
                  description: 'optional House number.'
                  example: '"42"'
                  nullable: true
                zip:
                  type: string
                  description: 'optional Zip code.'
                  example: '"12345"'
                  nullable: true
                city:
                  type: string
                  description: 'optional City name.'
                  example: '"Sample City"'
                  nullable: true
                region:
                  type: string
                  description: 'optional Region name.'
                  example: '"Sample Region"'
                  nullable: true
                country:
                  type: string
                  description: 'optional Country name.'
                  example: '"Sample Country"'
                  nullable: true
                lat:
                  type: string
                  description: 'optional Latitude.'
                  example: '"52.52"'
                  nullable: true
                lng:
                  type: string
                  description: 'optional Longitude.'
                  example: '"13.405"'
                  nullable: true
                object_id:
                  type: integer
                  description: 'optional ID of the related object.'
                  example: 16
                  nullable: true
                object_type:
                  type: string
                  description: 'optional Type of the related object.'
                  example: architecto
                  nullable: true
                connection_type:
                  type: string
                  description: 'optional Type of the connection.'
                  example: architecto
                  nullable: true
                connection_subtype:
                  type: string
                  description: 'optional Subtype of the connection.'
                  example: architecto
                  nullable: true
                connection_data:
                  type: array
                  description: 'optional Additional connection data.'
                  example:
                    - architecto
                  items:
                    type: string
                    nullable: true
                attributes:
                  type: array
                  description: 'optional Additional attributes.'
                  example:
                    - architecto
                  items:
                    type: string
                    nullable: true
                workspace_id:
                  type: integer
                  description: 'Workspace ID.'
                  example: 1
                  nullable: false
              required:
                - workspace_id
  '/api/contact/{contact_id}':
    post:
      summary: 'Update an existing contact.'
      operationId: updateAnExistingContact
      description: 'Validates the request data and updates the specified contact record.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'contact updated successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'contact updated successfully'
      tags:
        - Contact
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                salutation:
                  type: string
                  description: 'optional Salutation.'
                  example: '"Ms"'
                  nullable: true
                firstname:
                  type: string
                  description: 'optional First name.'
                  example: '"Jane"'
                  nullable: true
                lastname:
                  type: string
                  description: 'optional Last name.'
                  example: '"Doe"'
                  nullable: true
                company:
                  type: string
                  description: 'optional Company name.'
                  example: '"Acme Inc."'
                  nullable: true
                email:
                  type: string
                  description: 'optional Email address.'
                  example: '"jane.doe@example.com"'
                  nullable: true
                phone:
                  type: string
                  description: 'optional Phone number.'
                  example: '"+123456789"'
                  nullable: true
                mobile:
                  type: string
                  description: 'optional Mobile number.'
                  example: '"+987654321"'
                  nullable: true
                fax:
                  type: string
                  description: 'optional Fax number.'
                  example: '"+1122334455"'
                  nullable: true
                homepage:
                  type: string
                  description: 'optional Homepage URL.'
                  example: '"https://acme.com"'
                  nullable: true
                address_id:
                  type: integer
                  description: 'optional Address ID.'
                  example: 2
                  nullable: true
                street:
                  type: string
                  description: 'optional Street name.'
                  example: '"Main St"'
                  nullable: true
                housenumber:
                  type: string
                  description: 'optional House number.'
                  example: '"42"'
                  nullable: true
                zip:
                  type: string
                  description: 'optional Zip code.'
                  example: '"12345"'
                  nullable: true
                city:
                  type: string
                  description: 'optional City name.'
                  example: '"Sample City"'
                  nullable: true
                region:
                  type: string
                  description: 'optional Region name.'
                  example: '"Sample Region"'
                  nullable: true
                country:
                  type: string
                  description: 'optional Country name.'
                  example: '"Sample Country"'
                  nullable: true
                lat:
                  type: string
                  description: 'optional Latitude.'
                  example: '"52.52"'
                  nullable: true
                lng:
                  type: string
                  description: 'optional Longitude.'
                  example: '"13.405"'
                  nullable: true
                attributes:
                  type: array
                  description: 'optional Additional attributes.'
                  example:
                    - architecto
                  items:
                    type: string
                    nullable: true
                workspace_id:
                  type: integer
                  description: 'optional Workspace ID.'
                  example: 1
                  nullable: true
    delete:
      summary: 'Delete a contact.'
      operationId: deleteAContact
      description: 'Removes the specified contact from the database.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'contact deletion successful'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'contact deletion successful'
      tags:
        - Contact
    parameters:
      -
        in: path
        name: contact_id
        description: 'The ID of the contact.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: contact
        description: 'The ID of the contact to update.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/contact/{contact_id}/connect':
    post:
      summary: 'Connect a contact to another object.'
      operationId: connectAContactToAnotherObject
      description: 'Validates the request data and connects the contact to the specified object.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'contact connected to object'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'contact connected to object'
      tags:
        - Contact
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                object_id:
                  type: integer
                  description: 'The ID of the object to connect.'
                  example: 2
                  nullable: false
                object_type:
                  type: string
                  description: 'The type of the object to connect.'
                  example: '"App\\Models\\User"'
                  nullable: false
                connection_type:
                  type: string
                  description: 'optional Type of the connection.'
                  example: '"primary"'
                  nullable: true
                connection_subtype:
                  type: string
                  description: 'optional Subtype of the connection.'
                  example: '"manager"'
                  nullable: true
                connection_data:
                  type: array
                  description: 'optional Additional connection data.'
                  example:
                    - architecto
                  items:
                    type: string
                    nullable: true
              required:
                - object_id
                - object_type
    parameters:
      -
        in: path
        name: contact_id
        description: 'The ID of the contact.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: contact
        description: 'The ID of the contact to connect.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/contact/{contact_id}/disconnect':
    post:
      summary: 'Disconnect a contact from one or more objects.'
      operationId: disconnectAContactFromOneOrMoreObjects
      description: 'Validates the request data and disconnects the contact from the specified object(s).'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'contact disconnected from object'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'contact disconnected from object'
      tags:
        - Contact
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                object_id:
                  type: integer
                  description: 'required_without:object_ids The ID of the object to disconnect.'
                  example: 2
                  nullable: false
                object_ids:
                  type: array
                  description: 'required_without:object_id List of object IDs to disconnect.'
                  example:
                    - 2
                    - 3
                  items:
                    type: string
                object_type:
                  type: string
                  description: 'The type of the object to disconnect.'
                  example: '"App\\Models\\User"'
                  nullable: false
                connection_type:
                  type: string
                  description: 'optional Type of the connection.'
                  example: '"primary"'
                  nullable: true
                connection_subtype:
                  type: string
                  description: 'optional Subtype of the connection.'
                  example: '"manager"'
                  nullable: true
              required:
                - object_type
    parameters:
      -
        in: path
        name: contact_id
        description: 'The ID of the contact.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: contact
        description: 'The ID of the contact to disconnect.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/contact/{contact_id}/update-connection':
    post:
      summary: 'Update the connection data between a contact and another object.'
      operationId: updateTheConnectionDataBetweenAContactAndAnotherObject
      description: 'Validates the request data and updates the connection information.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'contact connection updated successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'contact connection updated successfully'
      tags:
        - Contact
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                object_id:
                  type: integer
                  description: 'The ID of the object.'
                  example: 2
                  nullable: false
                object_type:
                  type: string
                  description: 'The type of the object.'
                  example: '"App\\Models\\User"'
                  nullable: false
                connection_type:
                  type: string
                  description: 'optional Type of the connection.'
                  example: '"primary"'
                  nullable: true
                connection_subtype:
                  type: string
                  description: 'optional Subtype of the connection.'
                  example: '"manager"'
                  nullable: true
                data:
                  type: object
                  description: 'The connection data.'
                  example: []
                  nullable: false
                  properties:
                    type:
                      type: string
                      description: 'optional The type of the contact connection.'
                      example: '"secondary"'
                      nullable: true
                    subtype:
                      type: string
                      description: 'optional The subtype of the contact connection.'
                      example: '"assistant"'
                      nullable: true
                    data:
                      type: array
                      description: 'optional Additional connection data.'
                      example:
                        - architecto
                      items:
                        type: string
                        nullable: true
              required:
                - object_id
                - object_type
                - data
    parameters:
      -
        in: path
        name: contact_id
        description: 'The ID of the contact.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: contact
        description: 'The ID of the contact.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/damagereport/{damagereport_id}/download':
    get:
      summary: 'Download the damage report PDF file.'
      operationId: downloadTheDamageReportPDFFile
      description: 'Downloads the generated PDF file for the specified damage report, or returns an error if not available.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: 'PDF file download.'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'damage report pdf not yet generated'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'damage report pdf not yet generated'
      tags:
        - DamageReport
    parameters:
      -
        in: path
        name: damagereport_id
        description: 'The ID of the damagereport.'
        example: 205
        required: true
        schema:
          type: integer
      -
        in: path
        name: damagereport
        description: 'The ID of the damage report.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/damagereport/{damagereport_id}/sendzipemail':
    post:
      summary: 'Send a damage report document package link by email.'
      operationId: sendADamageReportDocumentPackageLinkByEmail
      description: 'Queues a job to send a document package link for the specified damage report to the given email address.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'damage report document package queued successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'damage report document package queued successfully'
      tags:
        - DamageReport
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                file_ids:
                  type: array
                  description: 'optional List of file IDs to include.'
                  example:
                    - 10
                    - 11
                  items:
                    type: string
                    nullable: true
                email:
                  type: string
                  description: 'optional The email address to send the package to.'
                  example: '"recipient@example.com"'
                  nullable: true
    parameters:
      -
        in: path
        name: damagereport_id
        description: 'The ID of the damagereport.'
        example: 205
        required: true
        schema:
          type: integer
      -
        in: path
        name: damagereport
        description: 'The ID of the damage report.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/damagereport/{damagereport_id}/invite-upload-center':
    post:
      summary: 'Invite a user to the documents section of a damage report.'
      operationId: inviteAUserToTheDocumentsSectionOfADamageReport
      description: 'Creates a guest user and sends an invitation to access the documents section of the specified damage report.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'guest invite successfully created'
                  user:
                    id: 5
                    email: john.doe@example.com
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'guest invite successfully created'
                  user:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 5
                      email:
                        type: string
                        example: john.doe@example.com
      tags:
        - DamageReport
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                salutation:
                  type: string
                  description: 'Salutation of the invitee.'
                  example: '"Mr"'
                  nullable: false
                firstname:
                  type: string
                  description: 'First name of the invitee.'
                  example: '"John"'
                  nullable: false
                lastname:
                  type: string
                  description: 'Last name of the invitee.'
                  example: '"Doe"'
                  nullable: false
                email:
                  type: string
                  description: 'Email address of the invitee.'
                  example: '"john.doe@example.com"'
                  nullable: false
                folders:
                  type: array
                  description: 'List of folder IDs to grant access.'
                  example:
                    - 1
                    - 2
                  items:
                    type: string
              required:
                - salutation
                - firstname
                - lastname
                - email
                - folders
    parameters:
      -
        in: path
        name: damagereport_id
        description: 'The ID of the damagereport.'
        example: 205
        required: true
        schema:
          type: integer
      -
        in: path
        name: damagereport
        description: 'The ID of the damage report.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/damagereport/{damagereport_id}':
    get:
      summary: 'Retrieve a list of damage reports or a single damage report.'
      operationId: retrieveAListOfDamageReportsOrASingleDamageReport
      description: 'Returns all damage reports for the current workspace, optionally paginated, or a specific damage report with its relations.'
      parameters:
        -
          in: query
          name: per_page
          description: 'optional Number of results per page.'
          example: 15
          required: false
          schema:
            type: integer
            description: 'optional Number of results per page.'
            example: 15
            nullable: false
        -
          in: query
          name: page
          description: 'optional Page number.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'optional Page number.'
            example: 1
            nullable: false
        -
          in: query
          name: with
          description: 'optional Relations to load.'
          example:
            - moduleObject
            - user
            - journals
            - files
            - policy
            - contacts
            - addresses
          required: false
          schema:
            type: array
            description: 'optional Relations to load.'
            example:
              - moduleObject
              - user
              - journals
              - files
              - policy
              - contacts
              - addresses
            items:
              type: string
        -
          in: query
          name: paged
          description: 'optional Whether to paginate results.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Whether to paginate results.'
            example: true
            nullable: false
        -
          in: query
          name: shortresult
          description: 'optional If true, returns only basic data.'
          example: false
          required: false
          schema:
            type: boolean
            description: 'optional If true, returns only basic data.'
            example: false
            nullable: false
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"id\": 1,\n  \"name\": \"Storm Damage\",\n  \"user_id\": 2,\n  \"policy_id\": 3,\n  \"module_object_id\": 4,\n  \"contacts\": [],\n  \"addresses\": [],\n  // ...other fields...\n}"
      tags:
        - DamageReport
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                per_page:
                  type: integer
                  description: ''
                  example: 16
                  nullable: true
                page:
                  type: integer
                  description: ''
                  example: 16
                  nullable: true
                with:
                  type: array
                  description: ''
                  example:
                    - files
                  items:
                    type: string
                    enum:
                      - moduleObject
                      - user
                      - journals
                      - files
                      - policy
                      - damageReportAttributes
                    nullable: true
                paged:
                  type: boolean
                  description: ''
                  example: true
                  nullable: true
                shortresult:
                  type: boolean
                  description: ''
                  example: false
                  nullable: true
    delete:
      summary: 'Delete a damage report.'
      operationId: deleteADamageReport
      description: 'Removes the specified damage report from the database.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'damagereport deleted'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'damagereport deleted'
      tags:
        - DamageReport
    parameters:
      -
        in: path
        name: damagereport_id
        description: 'The ID of the damagereport.'
        example: 205
        required: true
        schema:
          type: integer
      -
        in: path
        name: damagereport
        description: 'Optional parameter. optional The ID of the damage report.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/damagereport:
    get:
      summary: 'Retrieve a list of damage reports or a single damage report.'
      operationId: retrieveAListOfDamageReportsOrASingleDamageReport
      description: 'Returns all damage reports for the current workspace, optionally paginated, or a specific damage report with its relations.'
      parameters:
        -
          in: query
          name: per_page
          description: 'optional Number of results per page.'
          example: 15
          required: false
          schema:
            type: integer
            description: 'optional Number of results per page.'
            example: 15
            nullable: false
        -
          in: query
          name: page
          description: 'optional Page number.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'optional Page number.'
            example: 1
            nullable: false
        -
          in: query
          name: with
          description: 'optional Relations to load.'
          example:
            - moduleObject
            - user
            - journals
            - files
            - policy
            - contacts
            - addresses
          required: false
          schema:
            type: array
            description: 'optional Relations to load.'
            example:
              - moduleObject
              - user
              - journals
              - files
              - policy
              - contacts
              - addresses
            items:
              type: string
        -
          in: query
          name: paged
          description: 'optional Whether to paginate results.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Whether to paginate results.'
            example: true
            nullable: false
        -
          in: query
          name: shortresult
          description: 'optional If true, returns only basic data.'
          example: false
          required: false
          schema:
            type: boolean
            description: 'optional If true, returns only basic data.'
            example: false
            nullable: false
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"id\": 1,\n  \"name\": \"Storm Damage\",\n  \"user_id\": 2,\n  \"policy_id\": 3,\n  \"module_object_id\": 4,\n  \"contacts\": [],\n  \"addresses\": [],\n  // ...other fields...\n}"
      tags:
        - DamageReport
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                per_page:
                  type: integer
                  description: ''
                  example: 16
                  nullable: true
                page:
                  type: integer
                  description: ''
                  example: 16
                  nullable: true
                with:
                  type: array
                  description: ''
                  example:
                    - files
                  items:
                    type: string
                    enum:
                      - moduleObject
                      - user
                      - journals
                      - files
                      - policy
                      - damageReportAttributes
                    nullable: true
                paged:
                  type: boolean
                  description: ''
                  example: true
                  nullable: true
                shortresult:
                  type: boolean
                  description: ''
                  example: false
                  nullable: true
    post:
      summary: 'Create a new damage report.'
      operationId: createANewDamageReport
      description: 'Validates the request data and creates a new damage report record. Optionally connects contacts and triggers jobs.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'damagereport created'
                  data:
                    data:
                      id: 1
                      name: 'Storm Damage'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'damagereport created'
                  data:
                    type: object
                    properties:
                      data:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 1
                          name:
                            type: string
                            example: 'Storm Damage'
      tags:
        - DamageReport
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The name of the damage report.'
                  example: '"Storm Damage"'
                  nullable: false
                module_object_id:
                  type: integer
                  description: 'The module object ID.'
                  example: 4
                  nullable: false
                policy_id:
                  type: integer
                  description: 'optional The policy ID.'
                  example: 3
                  nullable: true
                contacts:
                  type: array
                  description: 'optional List of contacts to associate.'
                  example:
                    - architecto
                  items:
                    type: string
                    nullable: true
              required:
                - name
                - module_object_id
    parameters:
      -
        in: path
        name: damagereport
        description: 'Optional parameter. optional The ID of the damage report.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  '/api/damagereport/{damageReport_id}':
    post:
      summary: 'Update an existing damage report.'
      operationId: updateAnExistingDamageReport
      description: 'Validates the request data and updates the specified damage report record. Optionally connects contacts and triggers jobs.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'damagereport updated'
                  data:
                    data:
                      id: 1
                      name: 'Updated Damage'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'damagereport updated'
                  data:
                    type: object
                    properties:
                      data:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 1
                          name:
                            type: string
                            example: 'Updated Damage'
      tags:
        - DamageReport
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'optional The new name of the damage report.'
                  example: '"Updated Damage"'
                  nullable: true
                module_object_id:
                  type: integer
                  description: 'optional The new module object ID.'
                  example: 5
                  nullable: true
                policy_id:
                  type: integer
                  description: 'optional The new policy ID.'
                  example: 4
                  nullable: true
                contacts:
                  type: array
                  description: 'optional List of contacts to associate.'
                  example:
                    - architecto
                  items:
                    type: string
    parameters:
      -
        in: path
        name: damageReport_id
        description: 'The ID of the damageReport.'
        example: 205
        required: true
        schema:
          type: integer
      -
        in: path
        name: damageReport
        description: 'The ID of the damage report to update.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/damagetypemoduleproduct/{damagetypemoduleproduct}':
    get:
      summary: 'Retrieve a list of all damage type module products or a single damage type module product.'
      operationId: retrieveAListOfAllDamageTypeModuleProductsOrASingleDamageTypeModuleProduct
      description: 'Returns all damage type module products for the current workspace, optionally paginated, or a specific damage type module product with its related module product.'
      parameters:
        -
          in: query
          name: per_page
          description: 'optional Number of results per page.'
          example: 15
          required: false
          schema:
            type: integer
            description: 'optional Number of results per page.'
            example: 15
            nullable: false
        -
          in: query
          name: page
          description: 'optional Page number.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'optional Page number.'
            example: 1
            nullable: false
        -
          in: query
          name: with
          description: 'optional Relations to load.'
          example:
            - moduleProduct
          required: false
          schema:
            type: array
            description: 'optional Relations to load.'
            example:
              - moduleProduct
            items:
              type: string
        -
          in: query
          name: paged
          description: 'optional Whether to paginate results.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Whether to paginate results.'
            example: true
            nullable: false
        -
          in: query
          name: shortresult
          description: 'optional If true, returns only basic data.'
          example: false
          required: false
          schema:
            type: boolean
            description: 'optional If true, returns only basic data.'
            example: false
            nullable: false
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  id: 1
                  type: fire
                  module_product_id: 2
                  moduleProduct: {  }
                properties:
                  id:
                    type: integer
                    example: 1
                  type:
                    type: string
                    example: fire
                  module_product_id:
                    type: integer
                    example: 2
                  moduleProduct:
                    type: object
                    properties: {  }
      tags:
        - DamageTypeModuleProduct
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                per_page:
                  type: integer
                  description: ''
                  example: 16
                  nullable: true
                page:
                  type: integer
                  description: ''
                  example: 16
                  nullable: true
                with:
                  type: array
                  description: ''
                  example:
                    - moduleProduct
                  items:
                    type: string
                    enum:
                      - moduleProduct
                    nullable: true
                paged:
                  type: boolean
                  description: ''
                  example: true
                  nullable: true
                shortresult:
                  type: boolean
                  description: ''
                  example: false
                  nullable: true
    parameters:
      -
        in: path
        name: damagetypemoduleproduct
        description: 'Optional parameter. optional The ID of the damage type module product.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  '/api/damagetypemoduleproduct/{damagetypemoduleproduct_id}':
    post:
      summary: 'Update an existing damage type module product.'
      operationId: updateAnExistingDamageTypeModuleProduct
      description: 'Validates the request data and updates the specified damage type module product record.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'damage type module product updated'
                  data:
                    data:
                      id: 1
                      type: water
                      module_product_id: 3
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'damage type module product updated'
                  data:
                    type: object
                    properties:
                      data:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 1
                          type:
                            type: string
                            example: water
                          module_product_id:
                            type: integer
                            example: 3
      tags:
        - DamageTypeModuleProduct
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  description: 'optional The new type of damage.'
                  example: '"water"'
                  nullable: true
                module_product_id:
                  type: integer
                  description: 'optional The new module product ID.'
                  example: 3
                  nullable: true
    delete:
      summary: 'Delete a damage type module product.'
      operationId: deleteADamageTypeModuleProduct
      description: 'Removes the specified damage type module product from the database.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'damage type module product deleted'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'damage type module product deleted'
      tags:
        - DamageTypeModuleProduct
    parameters:
      -
        in: path
        name: damagetypemoduleproduct_id
        description: 'The ID of the damagetypemoduleproduct.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: damagetypemoduleproduct
        description: 'The ID of the damage type module product to update.'
        example: 1
        required: true
        schema:
          type: integer
  /api/damagetypemoduleproduct:
    post:
      summary: 'Create a new damage type module product.'
      operationId: createANewDamageTypeModuleProduct
      description: 'Validates the request data and creates a new damage type module product record.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'damage type module product created'
                  data:
                    data:
                      id: 1
                      type: fire
                      module_product_id: 2
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'damage type module product created'
                  data:
                    type: object
                    properties:
                      data:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 1
                          type:
                            type: string
                            example: fire
                          module_product_id:
                            type: integer
                            example: 2
      tags:
        - DamageTypeModuleProduct
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  description: 'The type of damage.'
                  example: '"fire"'
                  nullable: false
                module_product_id:
                  type: integer
                  description: 'The module product ID.'
                  example: 2
                  nullable: false
              required:
                - type
                - module_product_id
  /api/dashboard:
    get:
      summary: 'Get dashboard data for the authenticated user.'
      operationId: getDashboardDataForTheAuthenticatedUser
      description: 'Returns dashboard statistics and information for the current user, including leads, buildings, policies, and more.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'Dashboard data'
                  data:
                    last_login: '2024-06-01 12:00:00'
                    leads: 10
                    leadVolume: 500000
                    pendingLeads: 2
                    buildingsCount: 5
                    insuranceSum: 1200000
                    policyCount: 4
                    policyTotal: 3500
                    openDamages: 1
                    openTasks: 0
                    buildings: []
                    careByAic: 3
                    notCareByAic: 2
                    objectGustavo: 4
                    objectNotGustavo: 1
                    gustavoPercentage: 80
                    notGustavoPercentage: 20
                    ownerTypeStwegCount: 2
                    ownerTypeStwegPercentage: 40
                    ownerTypeMegCount: 1
                    ownerTypeMegPercentage: 20
                    ownerTypeInvestorCount: 1
                    ownerTypeInvestorPercentage: 20
                    ownerTypeErbengemeinschaftCount: 1
                    ownerTypeErbengemeinschaftPercentage: 20
                    objectTypeWohnenCount: 3
                    objectTypeWohnenPercentage: 60
                    objectTypeGewerbeCount: 2
                    objectTypeGewerbePercentage: 40
                    groupLocations: []
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Dashboard data'
                  data:
                    type: object
                    properties:
                      last_login:
                        type: string
                        example: '2024-06-01 12:00:00'
                      leads:
                        type: integer
                        example: 10
                      leadVolume:
                        type: integer
                        example: 500000
                      pendingLeads:
                        type: integer
                        example: 2
                      buildingsCount:
                        type: integer
                        example: 5
                      insuranceSum:
                        type: integer
                        example: 1200000
                      policyCount:
                        type: integer
                        example: 4
                      policyTotal:
                        type: integer
                        example: 3500
                      openDamages:
                        type: integer
                        example: 1
                      openTasks:
                        type: integer
                        example: 0
                      buildings:
                        type: array
                        example: []
                      careByAic:
                        type: integer
                        example: 3
                      notCareByAic:
                        type: integer
                        example: 2
                      objectGustavo:
                        type: integer
                        example: 4
                      objectNotGustavo:
                        type: integer
                        example: 1
                      gustavoPercentage:
                        type: integer
                        example: 80
                      notGustavoPercentage:
                        type: integer
                        example: 20
                      ownerTypeStwegCount:
                        type: integer
                        example: 2
                      ownerTypeStwegPercentage:
                        type: integer
                        example: 40
                      ownerTypeMegCount:
                        type: integer
                        example: 1
                      ownerTypeMegPercentage:
                        type: integer
                        example: 20
                      ownerTypeInvestorCount:
                        type: integer
                        example: 1
                      ownerTypeInvestorPercentage:
                        type: integer
                        example: 20
                      ownerTypeErbengemeinschaftCount:
                        type: integer
                        example: 1
                      ownerTypeErbengemeinschaftPercentage:
                        type: integer
                        example: 20
                      objectTypeWohnenCount:
                        type: integer
                        example: 3
                      objectTypeWohnenPercentage:
                        type: integer
                        example: 60
                      objectTypeGewerbeCount:
                        type: integer
                        example: 2
                      objectTypeGewerbePercentage:
                        type: integer
                        example: 40
                      groupLocations:
                        type: array
                        example: []
        400:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'No data found'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'No data found'
      tags:
        - Dashboard
  '/api/declaration/{declaration}':
    get:
      summary: 'Retrieve a list of declarations or a single declaration.'
      operationId: retrieveAListOfDeclarationsOrASingleDeclaration
      description: 'Returns all declarations for the current workspace, optionally paginated, or a specific declaration with its relations.'
      parameters:
        -
          in: query
          name: per_page
          description: 'optional Number of results per page.'
          example: 15
          required: false
          schema:
            type: integer
            description: 'optional Number of results per page.'
            example: 15
            nullable: false
        -
          in: query
          name: page
          description: 'optional Page number.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'optional Page number.'
            example: 1
            nullable: false
        -
          in: query
          name: with
          description: 'optional Relations to load.'
          example:
            - formLead
            - file
          required: false
          schema:
            type: array
            description: 'optional Relations to load.'
            example:
              - formLead
              - file
            items:
              type: string
        -
          in: query
          name: paged
          description: 'optional Whether to paginate results.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Whether to paginate results.'
            example: true
            nullable: false
        -
          in: query
          name: shortresult
          description: 'optional If true, returns only basic data.'
          example: false
          required: false
          schema:
            type: boolean
            description: 'optional If true, returns only basic data.'
            example: false
            nullable: false
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  id: 1
                  form_lead_id: 2
                  file_id: 3
                  bkp1: 1000
                  bkp2: 2000
                  bkp3: 3000
                  bkp4: 4000
                  preparatory_work: 500
                  operational_equipment: 600
                  damages: 'Some damages'
                  account_holder: 'John Doe'
                  account_bank: 'Bank AG'
                  iban: CH9300762011623852957
                  filler_name: John
                  filler_firstname: Doe
                  filler_email: john.doe@example.com
                  filler_phone: '+41791234567'
                  formLead: {  }
                  file: {  }
                properties:
                  id:
                    type: integer
                    example: 1
                  form_lead_id:
                    type: integer
                    example: 2
                  file_id:
                    type: integer
                    example: 3
                  bkp1:
                    type: integer
                    example: 1000
                  bkp2:
                    type: integer
                    example: 2000
                  bkp3:
                    type: integer
                    example: 3000
                  bkp4:
                    type: integer
                    example: 4000
                  preparatory_work:
                    type: integer
                    example: 500
                  operational_equipment:
                    type: integer
                    example: 600
                  damages:
                    type: string
                    example: 'Some damages'
                  account_holder:
                    type: string
                    example: 'John Doe'
                  account_bank:
                    type: string
                    example: 'Bank AG'
                  iban:
                    type: string
                    example: CH9300762011623852957
                  filler_name:
                    type: string
                    example: John
                  filler_firstname:
                    type: string
                    example: Doe
                  filler_email:
                    type: string
                    example: john.doe@example.com
                  filler_phone:
                    type: string
                    example: '+41791234567'
                  formLead:
                    type: object
                    properties: {  }
                  file:
                    type: object
                    properties: {  }
      tags:
        - Declaration
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                per_page:
                  type: integer
                  description: ''
                  example: 16
                  nullable: true
                page:
                  type: integer
                  description: ''
                  example: 16
                  nullable: true
                with:
                  type: array
                  description: ''
                  example:
                    - file
                  items:
                    type: string
                    enum:
                      - formLead
                      - file
                    nullable: true
                paged:
                  type: boolean
                  description: ''
                  example: true
                  nullable: true
                shortresult:
                  type: boolean
                  description: ''
                  example: false
                  nullable: true
    parameters:
      -
        in: path
        name: declaration
        description: 'Optional parameter. optional The ID of the declaration.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  '/api/declaration/{declaration_id}':
    post:
      summary: 'Update an existing declaration.'
      operationId: updateAnExistingDeclaration
      description: "Validates the request data and updates the specified declaration record.\nOptionally sends an email to the insurer if requested."
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"success\": true,\n  \"message\": \"declaration updated\",\n  \"data\": {\n    \"data\": {\n      \"id\": 1,\n      \"form_lead_id\": 2,\n      // ...other fields...\n    }\n  }\n}"
      tags:
        - Declaration
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                form_lead_id:
                  type: integer
                  description: 'optional The form lead ID.'
                  example: 2
                  nullable: true
                file_id:
                  type: integer
                  description: 'optional The file ID.'
                  example: 3
                  nullable: true
                bkp1:
                  type: number
                  description: 'optional BKP1 value.'
                  example: 1000.0
                  nullable: true
                bkp2:
                  type: number
                  description: 'optional BKP2 value.'
                  example: 2000.0
                  nullable: true
                bkp3:
                  type: number
                  description: 'optional BKP3 value.'
                  example: 3000.0
                  nullable: true
                bkp4:
                  type: number
                  description: 'optional BKP4 value.'
                  example: 4000.0
                  nullable: true
                preparatory_work:
                  type: number
                  description: 'optional Preparatory work value.'
                  example: 500.0
                  nullable: true
                operational_equipment:
                  type: number
                  description: 'optional Operational equipment value.'
                  example: 600.0
                  nullable: true
                damages:
                  type: string
                  description: 'optional Description of damages.'
                  example: '"Some damages"'
                  nullable: true
                account_holder:
                  type: string
                  description: 'optional Account holder name.'
                  example: '"John Doe"'
                  nullable: true
                account_bank:
                  type: string
                  description: 'optional Account bank name.'
                  example: '"Bank AG"'
                  nullable: true
                iban:
                  type: string
                  description: 'optional IBAN.'
                  example: '"CH9300762011623852957"'
                  nullable: true
                filler_name:
                  type: string
                  description: 'optional Filler name.'
                  example: '"John"'
                  nullable: true
                filler_firstname:
                  type: string
                  description: 'optional Filler firstname.'
                  example: '"Doe"'
                  nullable: true
                filler_email:
                  type: string
                  description: 'optional Filler email.'
                  example: '"john.doe@example.com"'
                  nullable: true
                filler_phone:
                  type: string
                  description: 'optional Filler phone.'
                  example: '"+41791234567"'
                  nullable: true
                send_email:
                  type: boolean
                  description: 'optional If true, sends an email to the insurer.'
                  example: true
                  nullable: false
    delete:
      summary: 'Delete a declaration.'
      operationId: deleteADeclaration
      description: 'Removes the specified declaration from the database.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'declaration deleted'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'declaration deleted'
      tags:
        - Declaration
    parameters:
      -
        in: path
        name: declaration_id
        description: 'The ID of the declaration.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: declaration
        description: 'The ID of the declaration to update.'
        example: 1
        required: true
        schema:
          type: integer
  /api/declaration:
    post:
      summary: 'Create a new declaration.'
      operationId: createANewDeclaration
      description: "Validates the request data and creates a new declaration record.\nOptionally sends an email to the insurer if requested."
      parameters: []
      responses:
        201:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"success\": true,\n  \"message\": \"declaration created\",\n  \"data\": {\n    \"data\": {\n      \"id\": 1,\n      \"form_lead_id\": 2,\n      // ...other fields...\n    }\n  }\n}"
      tags:
        - Declaration
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                form_lead_id:
                  type: integer
                  description: 'The form lead ID.'
                  example: 2
                  nullable: false
                file_id:
                  type: integer
                  description: 'optional The file ID.'
                  example: 3
                  nullable: true
                bkp1:
                  type: number
                  description: 'optional BKP1 value.'
                  example: 1000.0
                  nullable: true
                bkp2:
                  type: number
                  description: 'optional BKP2 value.'
                  example: 2000.0
                  nullable: true
                bkp3:
                  type: number
                  description: 'optional BKP3 value.'
                  example: 3000.0
                  nullable: true
                bkp4:
                  type: number
                  description: 'optional BKP4 value.'
                  example: 4000.0
                  nullable: true
                preparatory_work:
                  type: number
                  description: 'optional Preparatory work value.'
                  example: 500.0
                  nullable: true
                operational_equipment:
                  type: number
                  description: 'optional Operational equipment value.'
                  example: 600.0
                  nullable: true
                damages:
                  type: string
                  description: 'optional Description of damages.'
                  example: '"Some damages"'
                  nullable: true
                account_holder:
                  type: string
                  description: 'optional Account holder name.'
                  example: '"John Doe"'
                  nullable: true
                account_bank:
                  type: string
                  description: 'optional Account bank name.'
                  example: '"Bank AG"'
                  nullable: true
                iban:
                  type: string
                  description: 'optional IBAN.'
                  example: '"CH9300762011623852957"'
                  nullable: true
                filler_name:
                  type: string
                  description: 'Filler name.'
                  example: '"John"'
                  nullable: false
                filler_firstname:
                  type: string
                  description: 'Filler firstname.'
                  example: '"Doe"'
                  nullable: false
                filler_email:
                  type: string
                  description: 'Filler email.'
                  example: '"john.doe@example.com"'
                  nullable: false
                filler_phone:
                  type: string
                  description: 'Filler phone.'
                  example: '"+41791234567"'
                  nullable: false
                send_email:
                  type: boolean
                  description: 'optional If true, sends an email to the insurer.'
                  example: true
                  nullable: false
              required:
                - form_lead_id
                - filler_name
                - filler_firstname
                - filler_email
                - filler_phone
  '/api/formlead/{formlead_id}':
    post:
      summary: 'Edit Form Lead'
      operationId: editFormLead
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                template_id:
                  type: string
                  description: 'The <code>id</code> of an existing record in the templates table.'
                  example: null
                  nullable: true
                module_object_id:
                  type: string
                  description: 'The <code>id</code> of an existing record in the module_objects table.'
                  example: null
                  nullable: true
                workspace_insurer_product_id:
                  type: string
                  description: 'The <code>id</code> of an existing record in the workspace_insurer_products table.'
                  example: null
                  nullable: true
                module_workspace_id:
                  type: string
                  description: 'The <code>id</code> of an existing record in the module_workspaces table.'
                  example: null
                  nullable: true
    delete:
      summary: 'Delete Form Lead.'
      operationId: deleteFormLead
      description: 'Deletes the specified form lead and logs the deletion.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'form lead deleted successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'form lead deleted successfully'
                  refreshToken:
                    type: boolean
                    example: true
      tags:
        - FormLead
    parameters:
      -
        in: path
        name: formlead_id
        description: 'The ID of the formlead.'
        example: 26
        required: true
        schema:
          type: integer
  '/api/formlead/{formlead_id}/constructionchange/{constructionChange}':
    get:
      summary: 'Get Form Lead Construction Change'
      operationId: getFormLeadConstructionChange
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Endpoints
    parameters:
      -
        in: path
        name: formlead_id
        description: 'The ID of the formlead.'
        example: 26
        required: true
        schema:
          type: integer
      -
        in: path
        name: constructionChange
        description: 'Optional parameter.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 16
  '/api/formlead/{formlead_id}/constructionchange':
    post:
      summary: 'Create Form Lead Construction Change'
      operationId: createFormLeadConstructionChange
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
    parameters:
      -
        in: path
        name: formlead_id
        description: 'The ID of the formlead.'
        example: 26
        required: true
        schema:
          type: integer
  '/api/formlead/{formlead_id}/constructionchange/{constructionChange_id}':
    post:
      summary: 'Edit Form Lead Construction Change'
      operationId: editFormLeadConstructionChange
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
    delete:
      summary: 'Delete Form Lead Construction Change'
      operationId: deleteFormLeadConstructionChange
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
    parameters:
      -
        in: path
        name: formlead_id
        description: 'The ID of the formlead.'
        example: 26
        required: true
        schema:
          type: integer
      -
        in: path
        name: constructionChange_id
        description: 'The ID of the constructionChange.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/policy/{policy_id}/extension':
    post:
      summary: 'extend a policy with invoice and send invoice to invoiceReceiver'
      operationId: extendAPolicyWithInvoiceAndSendInvoiceToInvoiceReceiver
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
    parameters:
      -
        in: path
        name: policy_id
        description: 'The ID of the policy.'
        example: 28
        required: true
        schema:
          type: integer
  '/api/contact/{contact}/listing':
    get:
      summary: ''
      operationId: getApiContactContactListing
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Endpoints
    parameters:
      -
        in: path
        name: contact
        description: 'Optional parameter.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/login:
    get:
      summary: ''
      operationId: getApiLogin
      description: ''
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  status: 'false'
                  message: 'please login'
                properties:
                  status:
                    type: string
                    example: 'false'
                  message:
                    type: string
                    example: 'please login'
      tags:
        - Endpoints
  /api/file:
    post:
      summary: 'Create a new file or folder.'
      operationId: createANewFileOrFolder
      description: 'Validates and creates a new file or folder. Optionally links to form lead, user, or another model.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'file created successfully'
                  data:
                    file_id: 1
                    uploadCenter_id: 2
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'file created successfully'
                  data:
                    type: object
                    properties:
                      file_id:
                        type: integer
                        example: 1
                      uploadCenter_id:
                        type: integer
                        example: 2
      tags:
        - File
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                parent_id:
                  type: integer
                  description: 'required_unless:mime,folder The parent folder ID.'
                  example: 2
                  nullable: false
                name:
                  type: string
                  description: 'The name of the file or folder.'
                  example: '"Document.pdf"'
                  nullable: false
                data:
                  type: string
                  format: binary
                  description: 'required_unless:mime,folder The file to upload.'
                  nullable: false
                form_lead_id:
                  type: integer
                  description: 'optional The form lead ID.'
                  example: 3
                  nullable: true
                user_id:
                  type: integer
                  description: 'The user ID.'
                  example: 4
                  nullable: false
                link_model:
                  type: string
                  description: 'optional The model name to link.'
                  example: '"Policy"'
                  nullable: true
                link_id:
                  type: integer
                  description: 'optional The model ID to link.'
                  example: 5
                  nullable: true
                mime:
                  type: string
                  description: 'optional The mime type.'
                  example: '"application/pdf"'
                  nullable: false
              required:
                - name
                - user_id
  '/api/file/{file_id}/user':
    post:
      summary: 'Add a specific user to a file (for upload center).'
      operationId: addASpecificUserToAFileforUploadCenter
      description: 'Grants access to a user for a file in the upload center.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'user access to file added successfully'
                  data:
                    uploadCenter_id: 2
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'user access to file added successfully'
                  data:
                    type: object
                    properties:
                      uploadCenter_id:
                        type: integer
                        example: 2
      tags:
        - File
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                form_lead_id:
                  type: integer
                  description: 'The form lead ID.'
                  example: 3
                  nullable: false
                user_id:
                  type: integer
                  description: 'The user ID.'
                  example: 4
                  nullable: false
              required:
                - form_lead_id
                - user_id
    delete:
      summary: 'Remove a specific user from a file (for upload center).'
      operationId: removeASpecificUserFromAFileforUploadCenter
      description: 'Revokes access for a user to a file in the upload center.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'user access to file removed successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'user access to file removed successfully'
        400:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'given user or form lead not found.'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'given user or form lead not found.'
      tags:
        - File
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                form_lead_id:
                  type: integer
                  description: 'The form lead ID.'
                  example: 3
                  nullable: false
                user_id:
                  type: integer
                  description: 'The user ID.'
                  example: 4
                  nullable: false
              required:
                - form_lead_id
                - user_id
    parameters:
      -
        in: path
        name: file_id
        description: 'The ID of the file.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: file
        description: 'The ID of the file.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/file/{file}':
    get:
      summary: 'Retrieve a list of files or a single file.'
      operationId: retrieveAListOfFilesOrASingleFile
      description: 'Returns all folders with their content, or a specific file with its users and folder content.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  id: 1
                  name: Document.pdf
                  mime: application/pdf
                  users: []
                  folderContent: []
                properties:
                  id:
                    type: integer
                    example: 1
                  name:
                    type: string
                    example: Document.pdf
                  mime:
                    type: string
                    example: application/pdf
                  users:
                    type: array
                    example: []
                  folderContent:
                    type: array
                    example: []
      tags:
        - File
    parameters:
      -
        in: path
        name: file
        description: 'Optional parameter. optional The ID of the file.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  '/api/file/{file_id}':
    post:
      summary: 'Update file name or parent folder.'
      operationId: updateFileNameOrParentFolder
      description: 'Updates the name or parent folder of the specified file.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'file updated successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'file updated successfully'
      tags:
        - File
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                parent_id:
                  type: integer
                  description: 'optional The new parent folder ID.'
                  example: 2
                  nullable: false
                name:
                  type: string
                  description: 'optional The new name of the file.'
                  example: '"UpdatedDocument.pdf"'
                  nullable: false
    delete:
      summary: 'Delete a file.'
      operationId: deleteAFile
      description: 'Deletes the specified file from the database.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'file deleted successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'file deleted successfully'
      tags:
        - File
    parameters:
      -
        in: path
        name: file_id
        description: 'The ID of the file.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: file
        description: 'The ID of the file to update.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/file/{file}/download':
    get:
      summary: 'Download a file.'
      operationId: downloadAFile
      description: "Downloads the specified file. Returns an error if the file is a folder.\nFor S3 storage, returns a temporary download link."
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: 'File download stream or redirect.'
        400:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'downloading folder is not possible'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'downloading folder is not possible'
      tags:
        - File
    parameters:
      -
        in: path
        name: file
        description: 'The ID of the file to download.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/file/{file}/link':
    get:
      summary: 'Create a download link for a file, valid for 30 minutes.'
      operationId: createADownloadLinkForAFileValidFor30Minutes
      description: 'Returns a temporary download link for the specified file. Only available for S3 storage.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'download link is valid for 30 minutes.'
                  data:
                    link: 'https://s3.amazonaws.com/bucket/file.pdf?...'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'download link is valid for 30 minutes.'
                  data:
                    type: object
                    properties:
                      link:
                        type: string
                        example: 'https://s3.amazonaws.com/bucket/file.pdf?...'
        400:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      success: false
                      message: 'creating download link for a folder is not possible'
                    properties:
                      success:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'creating download link for a folder is not possible'
                  -
                    description: ''
                    type: object
                    example:
                      success: false
                      message: 'creating download link for local storage is not possible'
                    properties:
                      success:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'creating download link for local storage is not possible'
      tags:
        - File
    parameters:
      -
        in: path
        name: file
        description: 'The ID of the file.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/file/{file_id}/link':
    post:
      summary: 'Link a model to a file.'
      operationId: linkAModelToAFile
      description: 'Attaches a model (by type and ID) to the specified file.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'file linked successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'file linked successfully'
        400:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'could not attach file to model: ...'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'could not attach file to model: ...'
      tags:
        - File
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                link_model:
                  type: string
                  description: 'The model name to link.'
                  example: '"Policy"'
                  nullable: false
                link_id:
                  type: integer
                  description: 'The model ID to link.'
                  example: 5
                  nullable: false
              required:
                - link_model
                - link_id
    parameters:
      -
        in: path
        name: file_id
        description: 'The ID of the file.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: file
        description: 'The ID of the file.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/template/{template_id}/formhint/{formhint}':
    get:
      summary: 'Retrieve form hints for a template or a single form hint.'
      operationId: retrieveFormHintsForATemplateOrASingleFormHint
      description: 'Returns all form hints for the specified template, or a specific form hint.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: array
                    items:
                      type: object
                    example:
                      -
                        id: 2
                        template_id: 1
                        name: hint_name
                        content: 'This is a hint.'
                        label: 'Hint Label'
                  -
                    description: ''
                    type: object
                    example:
                      id: 2
                      template_id: 1
                      name: hint_name
                      content: 'This is a hint.'
                      label: 'Hint Label'
                    properties:
                      id:
                        type: integer
                        example: 2
                      template_id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: hint_name
                      content:
                        type: string
                        example: 'This is a hint.'
                      label:
                        type: string
                        example: 'Hint Label'
      tags:
        - FormHint
      security: []
    parameters:
      -
        in: path
        name: template_id
        description: 'The ID of the template.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: formhint
        description: 'Optional parameter. optional The ID of the form hint.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 2
      -
        in: path
        name: template
        description: 'The ID of the template.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/template/{template_id}/formhint':
    post:
      summary: 'Create a new form hint for a template.'
      operationId: createANewFormHintForATemplate
      description: 'Validates the request data and creates a new form hint for the specified template.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'form hint created successfully'
                  data:
                    id: 2
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'form hint created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 2
      tags:
        - FormHint
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The name of the form hint.'
                  example: '"hint_name"'
                  nullable: false
                content:
                  type: string
                  description: 'The content of the form hint.'
                  example: '"This is a hint."'
                  nullable: false
                label:
                  type: string
                  description: 'optional The label for the form hint.'
                  example: '"Hint Label"'
                  nullable: true
              required:
                - name
                - content
    parameters:
      -
        in: path
        name: template_id
        description: 'The ID of the template.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: template
        description: 'The ID of the template.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/template/{template_id}/formhint/{formhint_id}':
    post:
      summary: 'Update an existing form hint.'
      operationId: updateAnExistingFormHint
      description: 'Validates the request data and updates the specified form hint.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'form hint updated successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'form hint updated successfully'
      tags:
        - FormHint
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'optional The new name of the form hint.'
                  example: '"updated_hint"'
                  nullable: true
                content:
                  type: string
                  description: 'optional The new content of the form hint.'
                  example: '"Updated hint content."'
                  nullable: true
                label:
                  type: string
                  description: 'optional The new label for the form hint.'
                  example: '"Updated Label"'
                  nullable: true
    delete:
      summary: 'Delete a form hint.'
      operationId: deleteAFormHint
      description: 'Removes the specified form hint from the database.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'form hint deleted successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'form hint deleted successfully'
      tags:
        - FormHint
    parameters:
      -
        in: path
        name: template_id
        description: 'The ID of the template.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: formhint_id
        description: 'The ID of the formhint.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: template
        description: 'The ID of the template.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: formhint
        description: 'The ID of the form hint to update.'
        example: 2
        required: true
        schema:
          type: integer
  /api/formlead/withoutaccount:
    post:
      summary: 'Create Form Lead without an account.'
      operationId: createFormLeadWithoutAnAccount
      description: 'Creates a new form lead for a user without an account. Generates contacts, attributes, and logs the creation.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'form lead created successfully'
                  data:
                    id: 1
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'form lead created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    template_id:
                      - 'The template_id field is required.'
                    workspace_insurer_product_id:
                      - 'The workspace_insurer_product_id field is required.'
                    module_workspace_id:
                      - 'The module_workspace_id field is required.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      template_id:
                        type: array
                        example:
                          - 'The template_id field is required.'
                        items:
                          type: string
                      workspace_insurer_product_id:
                        type: array
                        example:
                          - 'The workspace_insurer_product_id field is required.'
                        items:
                          type: string
                      module_workspace_id:
                        type: array
                        example:
                          - 'The module_workspace_id field is required.'
                        items:
                          type: string
      tags:
        - FormLead
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                template_id:
                  type: integer
                  description: 'The template ID for the form lead.'
                  example: 2
                  nullable: false
                module_object_id:
                  type: integer
                  description: 'optional The module object ID.'
                  example: 10
                  nullable: true
                workspace_insurer_product_id:
                  type: integer
                  description: 'The workspace insurer product ID.'
                  example: 5
                  nullable: false
                module_workspace_id:
                  type: integer
                  description: 'The module workspace ID.'
                  example: 3
                  nullable: false
                formStartSalutation:
                  type: string
                  description: 'required_without:isFastlane Salutation for the contact.'
                  example: '"Mr"'
                  nullable: false
                formStartFirstname:
                  type: string
                  description: 'required_without:isFastlane First name for the contact.'
                  example: '"John"'
                  nullable: false
                formStartName:
                  type: string
                  description: 'required_without:isFastlane Last name for the contact.'
                  example: '"Doe"'
                  nullable: false
                isFastlane:
                  type: boolean
                  description: 'optional Fastlane flag.'
                  example: true
                  nullable: true
              required:
                - template_id
                - workspace_insurer_product_id
                - module_workspace_id
      security: []
  '/api/formlead/{formlead}':
    get:
      summary: 'Get Form Lead(s).'
      operationId: getFormLeads
      description: 'Retrieves a single form lead or a paginated list of form leads. Supports filtering, sorting, and eager loading of relations.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"id\": 1,\n  \"template_id\": 2,\n  \"workspace_insurer_product_id\": 5,\n  \"formLeadAttributes\": {...},\n  \"contacts\": [...],\n  \"addresses\": [...],\n  \"...other relations...\"\n}"
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: Unauthorized
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Unauthorized
      tags:
        - FormLead
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                per_page:
                  type: integer
                  description: 'optional Number of results per page.'
                  example: 15
                  nullable: false
                page:
                  type: integer
                  description: 'optional Page number.'
                  example: 1
                  nullable: false
                template_id:
                  type: integer
                  description: 'optional Filter by template ID.'
                  example: 2
                  nullable: false
                filter:
                  type: string
                  description: 'optional Filter by status. Allowed: active, inactive, cancelled.'
                  example: '"active"'
                  nullable: false
                group_id:
                  type: integer
                  description: 'optional Filter by group ID.'
                  example: 5
                  nullable: false
                with:
                  type: array
                  description: 'optional Relations to include. Allowed: formLeadAttributes,workspaceInsurerProduct,moduleObject,constructionChanges,mandates,uploads,insuranceAnnouncements,insuranceOffers,moduleWorkspace,declarations,journal,versions,contacts,addresses.'
                  example:
                    - formLeadAttributes
                  items:
                    type: string
                paged:
                  type: boolean
                  description: 'optional Whether to paginate results.'
                  example: true
                  nullable: false
                shortresult:
                  type: boolean
                  description: 'optional If true, returns a short result without relations.'
                  example: false
                  nullable: false
    parameters:
      -
        in: path
        name: formlead
        description: 'Optional parameter.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 26
  /api/formlead:
    post:
      summary: 'Create a new Form Lead.'
      operationId: createANewFormLead
      description: 'Creates a new form lead and assigns the user as formfiller. Also creates contacts and attributes, triggers jobs and logs the creation.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'form lead created successfully'
                  data:
                    id: 1
                    lead_user_role_id: 2
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'form lead created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      lead_user_role_id:
                        type: integer
                        example: 2
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    template_id:
                      - 'The template_id field is required.'
                    workspace_insurer_product_id:
                      - 'The workspace_insurer_product_id field is required.'
                    module_workspace_id:
                      - 'The module_workspace_id field is required.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      template_id:
                        type: array
                        example:
                          - 'The template_id field is required.'
                        items:
                          type: string
                      workspace_insurer_product_id:
                        type: array
                        example:
                          - 'The workspace_insurer_product_id field is required.'
                        items:
                          type: string
                      module_workspace_id:
                        type: array
                        example:
                          - 'The module_workspace_id field is required.'
                        items:
                          type: string
      tags:
        - FormLead
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                template_id:
                  type: integer
                  description: 'The template ID for the form lead.'
                  example: 2
                  nullable: false
                module_object_id:
                  type: integer
                  description: 'optional The module object ID.'
                  example: 10
                  nullable: true
                workspace_insurer_product_id:
                  type: integer
                  description: 'The workspace insurer product ID.'
                  example: 5
                  nullable: false
                user_id:
                  type: integer
                  description: 'optional The user ID to assign as formfiller.'
                  example: 7
                  nullable: true
                module_workspace_id:
                  type: integer
                  description: 'The module workspace ID.'
                  example: 3
                  nullable: false
                attributes:
                  type: mixed
                  description: 'optional Any additional attributes for the form lead (ex "foo", "bar").'
                  example: architecto
                  nullable: false
              required:
                - template_id
                - workspace_insurer_product_id
                - module_workspace_id
  '/api/formlead/{formlead_id}/continue-chapter-two':
    post:
      summary: 'Continue fill up form lead chapter two.'
      operationId: continueFillUpFormLeadChapterTwo
      description: 'Sends an email to the formfiller to continue chapter two of the form lead and logs the action.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      success: true
                      message: 'form lead chapter two continued successfully'
                      refreshToken: true
                    properties:
                      success:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'form lead chapter two continued successfully'
                      refreshToken:
                        type: boolean
                        example: true
                  -
                    description: ''
                    type: object
                    example:
                      success: false
                      message: 'form lead chapter two fillup already continued'
                      refreshToken: true
                    properties:
                      success:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'form lead chapter two fillup already continued'
                      refreshToken:
                        type: boolean
                        example: true
      tags:
        - FormLead
    parameters:
      -
        in: path
        name: formlead_id
        description: 'The ID of the formlead.'
        example: 26
        required: true
        schema:
          type: integer
  '/api/formlead/{formlead_id}/sendzipemail':
    post:
      summary: 'Send form lead zip link by email.'
      operationId: sendFormLeadZipLinkByEmail
      description: 'Sends a document package for the form lead to the specified email address.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'form lead document package queued successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'form lead document package queued successfully'
                  refreshToken:
                    type: boolean
                    example: true
      tags:
        - FormLead
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                file_ids:
                  type: array
                  description: 'optional Array of file IDs to include.'
                  example:
                    - 1
                    - 2
                    - 3
                  items:
                    type: string
                    nullable: true
                email:
                  type: string
                  description: 'optional Email address to send the package to.'
                  example: '"john.doe@example.com"'
                  nullable: true
    parameters:
      -
        in: path
        name: formlead_id
        description: 'The ID of the formlead.'
        example: 26
        required: true
        schema:
          type: integer
  '/api/formlead/{formlead_id}/react':
    post:
      summary: 'Set reaction to Bindexis emails.'
      operationId: setReactionToBindexisEmails
      description: "Sets the user's reaction to Bindexis emails for the form lead, updates attributes, triggers Asana actions, and logs the action."
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'Reaction set successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Reaction set successfully'
                  refreshToken:
                    type: boolean
                    example: true
        400:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'Invalid reaction'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Invalid reaction'
      tags:
        - FormLead
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                user_id:
                  type: integer
                  description: 'The user ID setting the reaction.'
                  example: 7
                  nullable: false
                reaction:
                  type: string
                  description: 'The reaction type. Allowed: abortLead, contactMe, remindMe1, remindMe2, remindMe6.'
                  example: '"contactMe"'
                  nullable: false
                contact_email:
                  type: string
                  description: 'optional Contact email address.'
                  example: '"john.doe@example.com"'
                  nullable: true
                contact_firstname:
                  type: string
                  description: 'optional Contact first name.'
                  example: '"John"'
                  nullable: true
                contact_name:
                  type: string
                  description: 'optional Contact last name.'
                  example: '"Doe"'
                  nullable: true
              required:
                - user_id
                - reaction
    parameters:
      -
        in: path
        name: formlead_id
        description: 'The ID of the formlead.'
        example: 26
        required: true
        schema:
          type: integer
  '/api/formlead/{formlead_id}/attribute/{attribute}':
    get:
      summary: 'Retrieve form lead attributes or a single attribute.'
      operationId: retrieveFormLeadAttributesOrASingleAttribute
      description: 'Returns all attributes for the specified form lead, or a specific attribute with its relations.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: array
                    items:
                      type: object
                    example:
                      -
                        id: 2
                        form_lead_id: 1
                        name: attribute_name
                        type: string
                        value: 'example value'
                        category: general
                        parent_id: null
                        formLead: {  }
                        childAttributes: []
                  -
                    description: ''
                    type: object
                    example:
                      id: 2
                      form_lead_id: 1
                      name: attribute_name
                      type: string
                      value: 'example value'
                      category: general
                      parent_id: null
                      formLead: {  }
                      childAttributes: []
                    properties:
                      id:
                        type: integer
                        example: 2
                      form_lead_id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: attribute_name
                      type:
                        type: string
                        example: string
                      value:
                        type: string
                        example: 'example value'
                      category:
                        type: string
                        example: general
                      parent_id:
                        type: string
                        example: null
                      formLead:
                        type: object
                        properties: {  }
                      childAttributes:
                        type: array
                        example: []
      tags:
        - FormLeadAttribute
    parameters:
      -
        in: path
        name: formlead_id
        description: 'The ID of the formlead.'
        example: 26
        required: true
        schema:
          type: integer
      -
        in: path
        name: attribute
        description: 'Optional parameter. optional The ID of the attribute.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 2
      -
        in: path
        name: formlead
        description: 'The ID of the form lead.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/formlead/{formlead_id}/attribute':
    post:
      summary: 'Create a new form lead attribute.'
      operationId: createANewFormLeadAttribute
      description: "Validates the request data and creates a new attribute for the specified form lead.\nTriggers PDF generation and logs the creation."
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'form lead attribute created successfully'
                  data:
                    id: 3
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'form lead attribute created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 3
      tags:
        - FormLeadAttribute
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The name of the attribute.'
                  example: '"attribute_name"'
                  nullable: false
                type:
                  type: string
                  description: 'The type of the attribute. Allowed: bool, string, text, int, float, datetime.'
                  example: '"string"'
                  nullable: false
                value:
                  type: string
                  description: 'The value of the attribute.'
                  example: '"example value"'
                  nullable: false
                category:
                  type: string
                  description: 'optional The category of the attribute.'
                  example: '"general"'
                  nullable: true
                parent_id:
                  type: integer
                  description: 'optional The parent attribute ID.'
                  example: 2
                  nullable: true
              required:
                - name
                - type
                - value
    parameters:
      -
        in: path
        name: formlead_id
        description: 'The ID of the formlead.'
        example: 26
        required: true
        schema:
          type: integer
      -
        in: path
        name: formlead
        description: 'The ID of the form lead.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/formlead/{formlead_id}/attribute/{attribute_id}':
    post:
      summary: 'Update an existing form lead attribute.'
      operationId: updateAnExistingFormLeadAttribute
      description: "Validates the request data and updates the specified attribute.\nTriggers PDF generation and logs the update."
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'form lead attribute updated successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'form lead attribute updated successfully'
      tags:
        - FormLeadAttribute
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'optional The new name of the attribute.'
                  example: '"updated_name"'
                  nullable: true
                type:
                  type: string
                  description: 'optional The new type of the attribute. Allowed: bool, string, text, int, float, datetime.'
                  example: '"int"'
                  nullable: true
                value:
                  type: mixed
                  description: 'The new value of the attribute.'
                  example: '42'
                  nullable: false
                category:
                  type: string
                  description: 'optional The new category of the attribute.'
                  example: '"details"'
                  nullable: true
                parent_id:
                  type: integer
                  description: 'optional The new parent attribute ID.'
                  example: 3
                  nullable: true
              required:
                - value
    delete:
      summary: 'Delete a form lead attribute.'
      operationId: deleteAFormLeadAttribute
      description: 'Removes the specified attribute from the database.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'form lead attribute deleted successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'form lead attribute deleted successfully'
      tags:
        - FormLeadAttribute
    parameters:
      -
        in: path
        name: formlead_id
        description: 'The ID of the formlead.'
        example: 26
        required: true
        schema:
          type: integer
      -
        in: path
        name: attribute_id
        description: 'The ID of the attribute.'
        example: 2482
        required: true
        schema:
          type: integer
      -
        in: path
        name: formlead
        description: 'The ID of the form lead.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: attribute
        description: 'The ID of the attribute to update.'
        example: 2
        required: true
        schema:
          type: integer
  '/api/formlead/{formLead_id}/user/{user}':
    get:
      summary: 'Retrieve form lead users or a single user.'
      operationId: retrieveFormLeadUsersOrASingleUser
      description: 'Returns either a specific user with their roles and contacts, or all user roles for the form lead, optionally paginated and with relations.'
      parameters:
        -
          in: query
          name: per_page
          description: 'optional Number of results per page.'
          example: 15
          required: false
          schema:
            type: integer
            description: 'optional Number of results per page.'
            example: 15
            nullable: false
        -
          in: query
          name: page
          description: 'optional Page number.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'optional Page number.'
            example: 1
            nullable: false
        -
          in: query
          name: with
          description: 'optional Relations to load.'
          example:
            - user
            - role
            - formLead
          required: false
          schema:
            type: array
            description: 'optional Relations to load.'
            example:
              - user
              - role
              - formLead
            items:
              type: string
        -
          in: query
          name: paged
          description: 'optional Whether to paginate results.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Whether to paginate results.'
            example: true
            nullable: false
        -
          in: query
          name: shortresult
          description: 'optional If true, returns only basic data.'
          example: false
          required: false
          schema:
            type: boolean
            description: 'optional If true, returns only basic data.'
            example: false
            nullable: false
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  id: 2
                  user: {  }
                  role: {  }
                  formLead: {  }
                properties:
                  id:
                    type: integer
                    example: 2
                  user:
                    type: object
                    properties: {  }
                  role:
                    type: object
                    properties: {  }
                  formLead:
                    type: object
                    properties: {  }
      tags:
        - FormLeadUser
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                per_page:
                  type: integer
                  description: ''
                  example: 16
                  nullable: true
                page:
                  type: integer
                  description: ''
                  example: 16
                  nullable: true
                with:
                  type: array
                  description: ''
                  example:
                    - user
                  items:
                    type: string
                    enum:
                      - user
                      - role
                      - formLead
                    nullable: true
                paged:
                  type: boolean
                  description: ''
                  example: true
                  nullable: true
                shortresult:
                  type: boolean
                  description: ''
                  example: false
                  nullable: true
    parameters:
      -
        in: path
        name: formLead_id
        description: 'The ID of the formLead.'
        example: 26
        required: true
        schema:
          type: integer
      -
        in: path
        name: user
        description: 'Optional parameter. optional The ID of the user.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 2
      -
        in: path
        name: formLead
        description: 'The ID of the form lead.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/formlead/{formLead_id}/user/{user_id}':
    post:
      summary: 'Add a user role to a form lead.'
      operationId: addAUserRoleToAFormLead
      description: 'Assigns a role to the specified user for the given form lead and logs the action.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'role for user on form added successfully'
                  data:
                    id: 5
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'role for user on form added successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 5
      tags:
        - FormLeadUser
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                role_id:
                  type: integer
                  description: 'The role ID to assign.'
                  example: 3
                  nullable: false
              required:
                - role_id
    parameters:
      -
        in: path
        name: formLead_id
        description: 'The ID of the formLead.'
        example: 26
        required: true
        schema:
          type: integer
      -
        in: path
        name: user_id
        description: 'The ID of the user.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: formLead
        description: 'The ID of the form lead.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: user
        description: 'The ID of the user.'
        example: 2
        required: true
        schema:
          type: integer
  '/api/formlead/{formLead_id}/guest':
    post:
      summary: 'Create a guest user for a form lead.'
      operationId: createAGuestUserForAFormLead
      description: 'Creates a guest user for the specified form lead, assigns a role, creates a contact, sends an invite email, and logs the action.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'guest user for form lead created successfully'
                  data:
                    user_id: 7
                    id: 8
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'guest user for form lead created successfully'
                  data:
                    type: object
                    properties:
                      user_id:
                        type: integer
                        example: 7
                      id:
                        type: integer
                        example: 8
      tags:
        - FormLeadUser
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  description: 'The email address of the guest user.'
                  example: '"guest@example.com"'
                  nullable: false
                firstname:
                  type: string
                  description: 'First name of the guest user.'
                  example: '"John"'
                  nullable: false
                lastname:
                  type: string
                  description: 'Last name of the guest user.'
                  example: '"Doe"'
                  nullable: false
                salutation:
                  type: string
                  description: 'Salutation (one character).'
                  example: '"M"'
                  nullable: false
                role_id:
                  type: integer
                  description: 'The role ID to assign.'
                  example: 3
                  nullable: false
              required:
                - email
                - firstname
                - lastname
                - salutation
                - role_id
    parameters:
      -
        in: path
        name: formLead_id
        description: 'The ID of the formLead.'
        example: 26
        required: true
        schema:
          type: integer
      -
        in: path
        name: formLead
        description: 'The ID of the form lead.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/formlead/{formLead_id}/guest/{user_id}':
    post:
      summary: 'Update a guest user for a form lead.'
      operationId: updateAGuestUserForAFormLead
      description: 'Updates the contact information for the specified guest user and logs the action.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'guest user for form lead updated successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'guest user for form lead updated successfully'
      tags:
        - FormLeadUser
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  description: 'optional The new email address.'
                  example: '"newguest@example.com"'
                  nullable: true
                firstname:
                  type: string
                  description: 'optional The new first name.'
                  example: '"Jane"'
                  nullable: true
                lastname:
                  type: string
                  description: 'optional The new last name.'
                  example: '"Smith"'
                  nullable: true
                salutation:
                  type: string
                  description: 'optional The new salutation (one character).'
                  example: '"F"'
                  nullable: true
    delete:
      summary: 'Delete a guest user from a form lead.'
      operationId: deleteAGuestUserFromAFormLead
      description: 'Deletes the specified guest user from the form lead and logs the action.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'guest user deleted successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'guest user deleted successfully'
        400:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'user is not a guest user'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'user is not a guest user'
      tags:
        - FormLeadUser
    parameters:
      -
        in: path
        name: formLead_id
        description: 'The ID of the formLead.'
        example: 26
        required: true
        schema:
          type: integer
      -
        in: path
        name: user_id
        description: 'The ID of the user.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: formLead
        description: 'The ID of the form lead.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: user
        description: 'The ID of the guest user.'
        example: 2
        required: true
        schema:
          type: integer
  '/api/formlead/{formLead_id}/role/{leaduserrole}':
    post:
      summary: 'Update a user role for a form lead.'
      operationId: updateAUserRoleForAFormLead
      description: 'Updates the role for the specified user on the form lead and logs the action.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'role for form lead updated successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'role for form lead updated successfully'
      tags:
        - FormLeadUser
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                role_id:
                  type: integer
                  description: 'The new role ID.'
                  example: 4
                  nullable: false
              required:
                - role_id
    delete:
      summary: 'Delete a user role from a form lead.'
      operationId: deleteAUserRoleFromAFormLead
      description: 'Deletes the specified user role from the form lead and logs the action.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'role for form lead deleted successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'role for form lead deleted successfully'
      tags:
        - FormLeadUser
    parameters:
      -
        in: path
        name: formLead_id
        description: 'The ID of the formLead.'
        example: 26
        required: true
        schema:
          type: integer
      -
        in: path
        name: leaduserrole
        description: 'The ID of the lead user role.'
        example: 5
        required: true
        schema:
          type: integer
      -
        in: path
        name: formLead
        description: 'The ID of the form lead.'
        example: 1
        required: true
        schema:
          type: integer
  /api/geo/coordinates:
    get:
      summary: 'Get geographic coordinates for a given address.'
      operationId: getGeographicCoordinatesForAGivenAddress
      description: 'Returns the latitude and longitude for the specified address using the Google Geocoding API.'
      parameters:
        -
          in: query
          name: address
          description: 'The address to geocode.'
          example: '"1600 Amphitheatre Parkway, Mountain View, CA"'
          required: true
          schema:
            type: string
            description: 'The address to geocode.'
            example: '"1600 Amphitheatre Parkway, Mountain View, CA"'
            nullable: false
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'Coordinates fetched successfully'
                  data:
                    lat: 37.4224764
                    lng: -122.0842499
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Coordinates fetched successfully'
                  data:
                    type: object
                    properties:
                      lat:
                        type: number
                        example: 37.4224764
                      lng:
                        type: number
                        example: -122.0842499
        400:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'Failed to fetch coordinates'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Failed to fetch coordinates'
      tags:
        - Geo
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                address:
                  type: string
                  description: ''
                  example: architecto
                  nullable: false
              required:
                - address
  '/api/group/{group}':
    get:
      summary: 'Retrieve a list of groups or a single group.'
      operationId: retrieveAListOfGroupsOrASingleGroup
      description: 'Returns all groups for the current workspace, optionally paginated, or a specific group with its relations.'
      parameters:
        -
          in: query
          name: per_page
          description: 'optional Number of results per page.'
          example: 15
          required: false
          schema:
            type: integer
            description: 'optional Number of results per page.'
            example: 15
            nullable: false
        -
          in: query
          name: page
          description: 'optional Page number.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'optional Page number.'
            example: 1
            nullable: false
        -
          in: query
          name: with
          description: 'optional Relations to load.'
          example:
            - groupAttributes
            - collections
            - files
          required: false
          schema:
            type: array
            description: 'optional Relations to load.'
            example:
              - groupAttributes
              - collections
              - files
            items:
              type: string
        -
          in: query
          name: paged
          description: 'optional Whether to paginate results.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Whether to paginate results.'
            example: true
            nullable: false
        -
          in: query
          name: shortresult
          description: 'optional If true, returns only basic data.'
          example: false
          required: false
          schema:
            type: boolean
            description: 'optional If true, returns only basic data.'
            example: false
            nullable: false
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  id: 1
                  name: 'Sample Group'
                  type: customer
                  groupAttributes: []
                  collections: []
                  files: []
                properties:
                  id:
                    type: integer
                    example: 1
                  name:
                    type: string
                    example: 'Sample Group'
                  type:
                    type: string
                    example: customer
                  groupAttributes:
                    type: array
                    example: []
                  collections:
                    type: array
                    example: []
                  files:
                    type: array
                    example: []
      tags:
        - Group
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                per_page:
                  type: integer
                  description: ''
                  example: 16
                  nullable: true
                page:
                  type: integer
                  description: ''
                  example: 16
                  nullable: true
                paged:
                  type: boolean
                  description: ''
                  example: false
                  nullable: true
                shortresult:
                  type: boolean
                  description: ''
                  example: true
                  nullable: true
                with:
                  type: array
                  description: ''
                  example:
                    - architecto
                  items:
                    type: string
                    nullable: true
    parameters:
      -
        in: path
        name: group
        description: 'Optional parameter. optional The ID of the group.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/group:
    post:
      summary: 'Create a new group.'
      operationId: createANewGroup
      description: 'Validates the request data and creates a new group record, assigns the current user as a member, and sets attributes.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'group created successfully'
                  data:
                    data:
                      id: 1
                      name: 'Sample Group'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'group created successfully'
                  data:
                    type: object
                    properties:
                      data:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 1
                          name:
                            type: string
                            example: 'Sample Group'
      tags:
        - Group
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The name of the group.'
                  example: '"Sample Group"'
                  nullable: false
                user_id:
                  type: integer
                  description: 'optional The user ID to assign.'
                  example: 2
                  nullable: true
                type:
                  type: string
                  description: 'The type of the group.'
                  example: '"company", "personal", "stweg", "meg" or "heirs"'
                  nullable: false
                logo:
                  type: string
                  format: binary
                  description: 'optional The logo image file.'
                  nullable: true
              required:
                - name
                - type
  '/api/group/{group_id}':
    post:
      summary: 'Update an existing group.'
      operationId: updateAnExistingGroup
      description: 'Validates the request data and updates the specified group record and its attributes.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'group updated successfully'
                  data:
                    data:
                      id: 1
                      name: 'Updated Group'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'group updated successfully'
                  data:
                    type: object
                    properties:
                      data:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 1
                          name:
                            type: string
                            example: 'Updated Group'
      tags:
        - Group
      requestBody:
        required: false
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'optional The new name of the group.'
                  example: '"Updated Group"'
                  nullable: true
                type:
                  type: string
                  description: 'optional The new type of the group.'
                  example: '"customer"'
                  nullable: true
                logo:
                  type: string
                  format: binary
                  description: 'optional The new logo image file.'
                  nullable: true
    delete:
      summary: 'Delete a group.'
      operationId: deleteAGroup
      description: 'Removes the specified group from the database.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'group deleted successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'group deleted successfully'
      tags:
        - Group
    parameters:
      -
        in: path
        name: group_id
        description: 'The ID of the group.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: group
        description: 'The ID of the group to update.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/group/{group_id}/request':
    post:
      summary: 'Send a group request to the superadmin of the group.'
      operationId: sendAGroupRequestToTheSuperadminOfTheGroup
      description: 'Creates a group request and sends an email to the superadmin of the group.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'request sent successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'request sent successfully'
        400:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'no superadmin found for this group'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'no superadmin found for this group'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'no user found'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'no user found'
      tags:
        - Group
    parameters:
      -
        in: path
        name: group_id
        description: 'The ID of the group.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: group
        description: 'The ID of the group.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/group/{group_id}/contactInfo':
    get:
      summary: 'Get contact info statistics for a group.'
      operationId: getContactInfoStatisticsForAGroup
      description: 'Returns statistics about active policies, project insurances, building count, insurance sum, and total premium per year for the group.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  activePolicies: 5
                  projectInsurances: 2
                  buildingCount: 10
                  buildingInsuranceSum: 1000000
                  totalPremiumPerYear: 50000
                  damageBurden: 0
                properties:
                  activePolicies:
                    type: integer
                    example: 5
                  projectInsurances:
                    type: integer
                    example: 2
                  buildingCount:
                    type: integer
                    example: 10
                  buildingInsuranceSum:
                    type: integer
                    example: 1000000
                  totalPremiumPerYear:
                    type: integer
                    example: 50000
                  damageBurden:
                    type: integer
                    example: 0
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'no collection found'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'no collection found'
      tags:
        - Group
    parameters:
      -
        in: path
        name: group_id
        description: 'The ID of the group.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: group
        description: 'The ID of the group.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/group/authorize/{groupRequest_id}':
    post:
      summary: 'Authorize a group request using a code.'
      operationId: authorizeAGroupRequestUsingACode
      description: 'Validates the code and completes the group request if correct.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'group request accepted successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'group request accepted successfully'
        400:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'code is incorrect'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'code is incorrect'
      tags:
        - Group
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                code:
                  type: string
                  description: 'The authorization code.'
                  example: '"ABC123"'
                  nullable: false
              required:
                - code
    parameters:
      -
        in: path
        name: groupRequest_id
        description: 'The ID of the groupRequest.'
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: groupRequest
        description: 'The ID of the group request.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/group/reject/{groupRequest_id}':
    post:
      summary: 'Reject a group request and notify the requesting user.'
      operationId: rejectAGroupRequestAndNotifyTheRequestingUser
      description: 'Sends a rejection email to the requesting user and deletes the user.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'groupRequest rejected successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'groupRequest rejected successfully'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'groupRequest entry not found'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'groupRequest entry not found'
      tags:
        - Group
    parameters:
      -
        in: path
        name: groupRequest_id
        description: 'The ID of the groupRequest.'
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: groupRequest
        description: 'The ID of the group request.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/group/{group_id}/attribute/{attribute}':
    get:
      summary: 'Retrieve group attributes or a single attribute.'
      operationId: retrieveGroupAttributesOrASingleAttribute
      description: 'Returns all attributes for the specified group, or a specific attribute with its relations.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: array
                    items:
                      type: object
                    example:
                      -
                        id: 2
                        group_id: 1
                        name: attribute_name
                        type: string
                        value: 'example value'
                        category: general
                        group: {  }
                  -
                    description: ''
                    type: object
                    example:
                      id: 2
                      group_id: 1
                      name: attribute_name
                      type: string
                      value: 'example value'
                      category: general
                      group: {  }
                    properties:
                      id:
                        type: integer
                        example: 2
                      group_id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: attribute_name
                      type:
                        type: string
                        example: string
                      value:
                        type: string
                        example: 'example value'
                      category:
                        type: string
                        example: general
                      group:
                        type: object
                        properties: {  }
      tags:
        - GroupAttribute
    parameters:
      -
        in: path
        name: group_id
        description: 'The ID of the group.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: attribute
        description: 'Optional parameter. optional The ID of the attribute.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 2
      -
        in: path
        name: group
        description: 'The ID of the group.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/group/{group_id}/attribute':
    post:
      summary: 'Create a new group attribute.'
      operationId: createANewGroupAttribute
      description: 'Validates the request data and creates a new attribute for the specified group.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'group attribute created successfully'
                  data:
                    id: 3
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'group attribute created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 3
      tags:
        - GroupAttribute
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The name of the attribute.'
                  example: '"attribute_name"'
                  nullable: false
                type:
                  type: string
                  description: 'The type of the attribute. Allowed: bool, string, text, int, float, datetime.'
                  example: '"string"'
                  nullable: false
                value:
                  type: string
                  description: 'The value of the attribute.'
                  example: '"example value"'
                  nullable: false
                category:
                  type: string
                  description: 'optional The category of the attribute.'
                  example: '"general"'
                  nullable: true
              required:
                - name
                - type
                - value
    parameters:
      -
        in: path
        name: group_id
        description: 'The ID of the group.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: group
        description: 'The ID of the group.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/group/{group_id}/attribute/{attribute_id}':
    post:
      summary: 'Update an existing group attribute.'
      operationId: updateAnExistingGroupAttribute
      description: 'Validates the request data and updates the specified attribute.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'group attribute updated successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'group attribute updated successfully'
      tags:
        - GroupAttribute
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'optional The new name of the attribute.'
                  example: '"updated_name"'
                  nullable: true
                type:
                  type: string
                  description: 'optional The new type of the attribute. Allowed: bool, string, text, int, float, datetime.'
                  example: '"int"'
                  nullable: true
                value:
                  type: mixed
                  description: 'The new value of the attribute.'
                  example: '42'
                  nullable: false
                category:
                  type: string
                  description: 'optional The new category of the attribute.'
                  example: '"details"'
                  nullable: true
              required:
                - value
    delete:
      summary: 'Delete a group attribute.'
      operationId: deleteAGroupAttribute
      description: 'Removes the specified attribute from the database.'
      parameters: []
      responses:
        204:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'group attribute deleted successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'group attribute deleted successfully'
      tags:
        - GroupAttribute
    parameters:
      -
        in: path
        name: group_id
        description: 'The ID of the group.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: attribute_id
        description: 'The ID of the attribute.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: group
        description: 'The ID of the group.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: attribute
        description: 'The ID of the attribute to update.'
        example: 2
        required: true
        schema:
          type: integer
  /api/guest/invite-upload-center:
    post:
      summary: 'Invite a guest user to the upload center for a form lead.'
      operationId: inviteAGuestUserToTheUploadCenterForAFormLead
      description: 'Creates a guest user if not existing, assigns the upload center role, creates a contact, links folders, sends an invite email, and logs the action.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'Guest Invite successfully created'
                  data:
                    user:
                      id: 5
                      email: john.doe@example.com
                    id: 10
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Guest Invite successfully created'
                  data:
                    type: object
                    properties:
                      user:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 5
                          email:
                            type: string
                            example: john.doe@example.com
                      id:
                        type: integer
                        example: 10
      tags:
        - GuestInvite
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                form_lead_id:
                  type: integer
                  description: 'The ID of the form lead.'
                  example: 1
                  nullable: false
                salutation:
                  type: string
                  description: 'Salutation of the invitee.'
                  example: '"Mr"'
                  nullable: false
                firstname:
                  type: string
                  description: 'First name of the invitee.'
                  example: '"John"'
                  nullable: false
                lastname:
                  type: string
                  description: 'Last name of the invitee.'
                  example: '"Doe"'
                  nullable: false
                email:
                  type: string
                  description: 'Email address of the invitee.'
                  example: '"john.doe@example.com"'
                  nullable: false
                folders:
                  type: array
                  description: 'List of folder IDs to grant access.'
                  example:
                    - 1
                    - 2
                  items:
                    type: string
              required:
                - form_lead_id
                - salutation
                - firstname
                - lastname
                - email
                - folders
  '/api/guest/{token}':
    get:
      summary: 'Retrieve a guest user by token.'
      operationId: retrieveAGuestUserByToken
      description: 'Returns the guest user and their contacts for the given token.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'Guest User found'
                  data:
                    guestUser:
                      id: 5
                      email: john.doe@example.com
                      contacts: []
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Guest User found'
                  data:
                    type: object
                    properties:
                      guestUser:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 5
                          email:
                            type: string
                            example: john.doe@example.com
                          contacts:
                            type: array
                            example: []
      tags:
        - GuestInvite
    parameters:
      -
        in: path
        name: token
        description: 'The token of the guest user.'
        example: '"123e4567-e89b-12d3-a456-426614174000"'
        required: true
        schema:
          type: string
  /api/gustavozip:
    get:
      summary: 'Retrieve GustavoZip locations by zip, city, or area.'
      operationId: retrieveGustavoZipLocationsByZipCityOrArea
      description: 'Returns a list of GustavoZip locations filtered by zip, city, or area.'
      parameters:
        -
          in: query
          name: zip
          description: 'required_without:city The zip code to filter by.'
          example: '"8001"'
          required: false
          schema:
            type: string
            description: 'required_without:city The zip code to filter by.'
            example: '"8001"'
            nullable: false
        -
          in: query
          name: city
          description: 'required_without:zip The city name to filter by.'
          example: '"Zurich"'
          required: false
          schema:
            type: string
            description: 'required_without:zip The city name to filter by.'
            example: '"Zurich"'
            nullable: false
        -
          in: query
          name: area
          description: 'optional The area name to filter by.'
          example: '"Downtown"'
          required: false
          schema:
            type: string
            description: 'optional The area name to filter by.'
            example: '"Downtown"'
            nullable: false
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                example:
                  -
                    id: 1
                    zip: '8001'
                    city: Zurich
                    region: Zurich
                    short: ZH
                    country: Switzerland
                    gustavo: true
                    area: Downtown
      tags:
        - GustavoZip
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                zip:
                  type: string
                  description: 'This field is required when <code>city</code> is not present.'
                  example: architecto
                  nullable: false
                city:
                  type: string
                  description: 'This field is required when <code>zip</code> is not present.'
                  example: architecto
                  nullable: false
                area:
                  type: string
                  description: ''
                  example: architecto
                  nullable: false
      security: []
    post:
      summary: 'Create a new GustavoZip location.'
      operationId: createANewGustavoZipLocation
      description: 'Validates the request data and creates a new GustavoZip location.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'location for GUSTAVO created successfully'
                  data:
                    id: 1
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'location for GUSTAVO created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
      tags:
        - GustavoZip
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                zip:
                  type: string
                  description: 'The zip code.'
                  example: '"8001"'
                  nullable: false
                city:
                  type: string
                  description: 'The city name.'
                  example: '"Zurich"'
                  nullable: false
                region:
                  type: string
                  description: 'The region name.'
                  example: '"Zurich"'
                  nullable: false
                short:
                  type: string
                  description: 'The short code for the region.'
                  example: '"ZH"'
                  nullable: false
                country:
                  type: string
                  description: 'The country name.'
                  example: '"Switzerland"'
                  nullable: false
                gustavo:
                  type: boolean
                  description: 'Whether the location is a Gustavo location.'
                  example: true
                  nullable: false
                area:
                  type: string
                  description: 'The area name.'
                  example: '"Downtown"'
                  nullable: false
              required:
                - zip
                - city
                - region
                - short
                - country
                - gustavo
                - area
  '/api/gustavozip/{city_id}':
    post:
      summary: 'Update an existing GustavoZip location.'
      operationId: updateAnExistingGustavoZipLocation
      description: 'Validates the request data and updates the specified GustavoZip location.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'location for GUSTAVO updated successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'location for GUSTAVO updated successfully'
      tags:
        - GustavoZip
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                zip:
                  type: string
                  description: 'optional The zip code.'
                  example: '"8002"'
                  nullable: true
                city:
                  type: string
                  description: 'optional The city name.'
                  example: '"Zurich"'
                  nullable: true
                region:
                  type: string
                  description: 'optional The region name.'
                  example: '"Zurich"'
                  nullable: true
                short:
                  type: string
                  description: 'optional The short code for the region.'
                  example: '"ZH"'
                  nullable: true
                country:
                  type: string
                  description: 'optional The country name.'
                  example: '"Switzerland"'
                  nullable: true
                gustavo:
                  type: boolean
                  description: 'optional Whether the location is a Gustavo location.'
                  example: false
                  nullable: true
                area:
                  type: string
                  description: 'optional The area name.'
                  example: '"Uptown"'
                  nullable: true
    delete:
      summary: 'Delete a GustavoZip location.'
      operationId: deleteAGustavoZipLocation
      description: 'Removes the specified GustavoZip location from the database.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'location for GUSTAVO deleted successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'location for GUSTAVO deleted successfully'
      tags:
        - GustavoZip
    parameters:
      -
        in: path
        name: city_id
        description: 'The ID of the city.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: city
        description: 'The ID of the GustavoZip location to update.'
        example: 1
        required: true
        schema:
          type: integer
  /api/import/properties:
    post:
      summary: 'Import properties from a CSV file.'
      operationId: importPropertiesFromACSVFile
      description: 'Validates the uploaded CSV file and field mappings, then queues a job to import properties for the specified module category.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'Property import queued.'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Property import queued.'
        400:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'objectName is required.'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'objectName is required.'
      tags:
        - Import
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: 'The CSV file to import. Must be of type csv or txt.'
                  nullable: false
                module_category_id:
                  type: integer
                  description: 'The ID of the module category.'
                  example: 1
                  nullable: false
                fields:
                  type: array
                  description: 'List of field mappings.'
                  example:
                    - architecto
                  items:
                    type: string
                separator:
                  type: string
                  description: 'optional The separator used in the CSV file. Default: ",".'
                  example: '";"'
                  nullable: true
              required:
                - file
                - module_category_id
                - fields
  '/api/insurance/announcement/object/{object_id}/coverage':
    get:
      summary: 'Get current coverage for a module object.'
      operationId: getCurrentCoverageForAModuleObject
      description: 'Returns benchmark and policy product data for the specified module object.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'Object Benchmark and policy'
                  data:
                    benchmark: {  }
                    policy: {  }
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Object Benchmark and policy'
                  data:
                    type: object
                    properties:
                      benchmark:
                        type: object
                        properties: {  }
                      policy:
                        type: object
                        properties: {  }
        400:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      success: false
                      message: 'Object has no group'
                    properties:
                      success:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Object has no group'
                  -
                    description: ''
                    type: object
                    example:
                      success: false
                      message: 'Object attributes are missing'
                    properties:
                      success:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Object attributes are missing'
      tags:
        - InsuranceAnnouncement
    parameters:
      -
        in: path
        name: object_id
        description: 'The ID of the object.'
        example: 44
        required: true
        schema:
          type: integer
      -
        in: path
        name: object
        description: 'The ID of the module object.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/insurance/announcement/object/{object_id}':
    post:
      summary: 'Create an insurance announcement for a module object.'
      operationId: createAnInsuranceAnnouncementForAModuleObject
      description: 'Validates the request data and creates an insurance announcement for the specified module object, attaches products, receivers, and files, and sends emails.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'Insurance announcement created successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Insurance announcement created successfully'
      tags:
        - InsuranceAnnouncement
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                module_product_items:
                  type: array
                  description: 'List of product items with values.'
                  example:
                    - architecto
                  items:
                    type: string
                announcementReceivers:
                  type: array
                  description: 'List of insurer product user IDs.'
                  example:
                    - 3
                    - 4
                  items:
                    type: string
                changeTo:
                  type: date
                  description: 'The date of change.'
                  example: '"2024-07-01"'
                  nullable: false
                changeReason:
                  type: string
                  description: 'The reason for the change.'
                  example: '"Renewal"'
                  nullable: false
                changeInfo:
                  type: string
                  description: 'optional Additional info for the change.'
                  example: '"Some info"'
                  nullable: true
                offerDeadline:
                  type: date
                  description: 'The offer deadline.'
                  example: '"2024-07-15"'
                  nullable: false
                damageDocuments:
                  type: array
                  description: 'optional List of file IDs for damage documents.'
                  example:
                    - 10
                    - 11
                  items:
                    type: string
                    nullable: true
                requestDocuments:
                  type: array
                  description: 'optional List of request documents.'
                  example:
                    - architecto
                  items:
                    type: string
                    nullable: true
                announcementDraft:
                  type: boolean
                  description: 'optional Whether the announcement is a draft.'
                  example: true
                  nullable: true
                form_lead_id:
                  type: integer
                  description: 'optional The form lead ID.'
                  example: 4
                  nullable: true
              required:
                - module_product_items
                - announcementReceivers
                - changeTo
                - changeReason
                - offerDeadline
    parameters:
      -
        in: path
        name: object_id
        description: 'The ID of the object.'
        example: 44
        required: true
        schema:
          type: integer
      -
        in: path
        name: object
        description: 'The ID of the module object.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/insurance/announcement/{announcement}':
    get:
      summary: 'Retrieve insurance announcements or a single announcement.'
      operationId: retrieveInsuranceAnnouncementsOrASingleAnnouncement
      description: 'Returns all insurance announcements for the current user, optionally paginated, or a specific announcement with its relations.'
      parameters:
        -
          in: query
          name: per_page
          description: 'optional Number of results per page.'
          example: 15
          required: false
          schema:
            type: integer
            description: 'optional Number of results per page.'
            example: 15
            nullable: false
        -
          in: query
          name: page
          description: 'optional Page number.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'optional Page number.'
            example: 1
            nullable: false
        -
          in: query
          name: with
          description: 'optional Relations to load.'
          example:
            - insurerProductUser.user.contacts
            - insurerProductUser.user.workspace
            - announcementAttributes
            - products
          required: false
          schema:
            type: array
            description: 'optional Relations to load.'
            example:
              - insurerProductUser.user.contacts
              - insurerProductUser.user.workspace
              - announcementAttributes
              - products
            items:
              type: string
        -
          in: query
          name: paged
          description: 'optional Whether to paginate results.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Whether to paginate results.'
            example: true
            nullable: false
        -
          in: query
          name: shortresult
          description: 'optional If true, returns only basic data.'
          example: false
          required: false
          schema:
            type: boolean
            description: 'optional If true, returns only basic data.'
            example: false
            nullable: false
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  id: 1
                  workspace_insurer_product_id: 2
                  insurer_product_user_id: 3
                  form_lead_id: 4
                  user_id: 5
                  info: 'Some info'
                  announcementAttributes: []
                  products: []
                properties:
                  id:
                    type: integer
                    example: 1
                  workspace_insurer_product_id:
                    type: integer
                    example: 2
                  insurer_product_user_id:
                    type: integer
                    example: 3
                  form_lead_id:
                    type: integer
                    example: 4
                  user_id:
                    type: integer
                    example: 5
                  info:
                    type: string
                    example: 'Some info'
                  announcementAttributes:
                    type: array
                    example: []
                  products:
                    type: array
                    example: []
      tags:
        - InsuranceAnnouncement
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                per_page:
                  type: integer
                  description: ''
                  example: 16
                  nullable: true
                page:
                  type: integer
                  description: ''
                  example: 16
                  nullable: true
                with:
                  type: array
                  description: ''
                  example:
                    - products
                  items:
                    type: string
                    enum:
                      - insurerProductUser.user.contacts
                      - insurerProductUser.user.workspace
                      - announcementAttributes
                      - products
                    nullable: true
                paged:
                  type: boolean
                  description: ''
                  example: true
                  nullable: true
                shortresult:
                  type: boolean
                  description: ''
                  example: false
                  nullable: true
    parameters:
      -
        in: path
        name: announcement
        description: 'Optional parameter. optional The ID of the insurance announcement.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/insurance/announcement:
    post:
      summary: 'Create one or multiple insurance announcements.'
      operationId: createOneOrMultipleInsuranceAnnouncements
      description: 'Validates the request data and creates insurance announcements for the specified insurer product users and workspace insurer products.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'insurance announcements created successfully'
                  data:
                    ids: '[1,2,3]'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'insurance announcements created successfully'
                  data:
                    type: object
                    properties:
                      ids:
                        type: string
                        example: '[1,2,3]'
        400:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'insurance announcement not created because no insurer product user could be determined'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'insurance announcement not created because no insurer product user could be determined'
      tags:
        - InsuranceAnnouncement
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace_insurer_products:
                  type: json
                  description: 'required_without:workspace_insurer_product_id List of workspace insurer products and their insurer product users.'
                  example: architecto
                  nullable: false
                workspace_insurer_product_id:
                  type: integer
                  description: 'required_without:workspace_insurer_products The workspace insurer product ID.'
                  example: 2
                  nullable: false
                insurer_product_user_ids:
                  type: array
                  description: 'required_without:workspace_insurer_products List of insurer product user IDs.'
                  example:
                    - 3
                    - 4
                  items:
                    type: string
                form_lead_id:
                  type: integer
                  description: 'The form lead ID.'
                  example: 4
                  nullable: false
                info:
                  type: string
                  description: 'optional Additional info for the announcement.'
                  example: '"Some info"'
                  nullable: true
              required:
                - form_lead_id
  '/api/insurance/announcement/{announcement_id}/send':
    post:
      summary: 'Send a draft insurance announcement.'
      operationId: sendADraftInsuranceAnnouncement
      description: 'Sends the insurance announcement draft to all receivers and marks it as not a draft.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'Insurance announcement draft sent successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Insurance announcement draft sent successfully'
        400:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'Insurance announcement is not a draft'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Insurance announcement is not a draft'
      tags:
        - InsuranceAnnouncement
    parameters:
      -
        in: path
        name: announcement_id
        description: 'The ID of the announcement.'
        example: 11
        required: true
        schema:
          type: integer
      -
        in: path
        name: announcement
        description: 'The ID of the insurance announcement draft.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/insurance/announcement/{announcement_id}':
    post:
      summary: 'Update an existing insurance announcement.'
      operationId: updateAnExistingInsuranceAnnouncement
      description: 'Validates the request data and updates the specified insurance announcement.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'insurance announcement updated successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'insurance announcement updated successfully'
      tags:
        - InsuranceAnnouncement
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace_insurer_product_id:
                  type: integer
                  description: 'optional The workspace insurer product ID.'
                  example: 2
                  nullable: true
                insurer_product_user_id:
                  type: integer
                  description: 'optional The insurer product user ID.'
                  example: 3
                  nullable: true
                form_lead_id:
                  type: integer
                  description: 'optional The form lead ID.'
                  example: 4
                  nullable: true
                info:
                  type: string
                  description: 'optional Additional info for the announcement.'
                  example: '"Some info"'
                  nullable: true
    delete:
      summary: 'Delete an insurance announcement.'
      operationId: deleteAnInsuranceAnnouncement
      description: 'Removes the specified insurance announcement from the database.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'insurance announcement deleted successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'insurance announcement deleted successfully'
      tags:
        - InsuranceAnnouncement
    parameters:
      -
        in: path
        name: announcement_id
        description: 'The ID of the announcement.'
        example: 11
        required: true
        schema:
          type: integer
      -
        in: path
        name: announcement
        description: 'The ID of the insurance announcement to update.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/insurance/covergrade/{covergrade}':
    get:
      summary: 'Retrieve insurance cover grades or a single insurance cover grade.'
      operationId: retrieveInsuranceCoverGradesOrASingleInsuranceCoverGrade
      description: 'Returns all insurance cover grades for the current user, optionally paginated, or a specific insurance cover grade with its relations.'
      parameters:
        -
          in: query
          name: per_page
          description: 'optional Number of results per page.'
          example: 15
          required: false
          schema:
            type: integer
            description: 'optional Number of results per page.'
            example: 15
            nullable: false
        -
          in: query
          name: page
          description: 'optional Page number.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'optional Page number.'
            example: 1
            nullable: false
        -
          in: query
          name: with
          description: 'optional Relations to load.'
          example:
            - workspaceInsurerProduct
            - formLead
            - user
            - insuranceCoverGradeContacts
          required: false
          schema:
            type: array
            description: 'optional Relations to load.'
            example:
              - workspaceInsurerProduct
              - formLead
              - user
              - insuranceCoverGradeContacts
            items:
              type: string
        -
          in: query
          name: paged
          description: 'optional Whether to paginate results.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Whether to paginate results.'
            example: true
            nullable: false
        -
          in: query
          name: shortresult
          description: 'optional If true, returns only basic data.'
          example: false
          required: false
          schema:
            type: boolean
            description: 'optional If true, returns only basic data.'
            example: false
            nullable: false
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  id: 1
                  workspace_insurer_product_id: 2
                  form_lead_id: 3
                  user_id: 4
                  info: 'Some info'
                  offer: 100000
                  construction_start: '2024-07-01'
                  construction_end: '2024-08-01'
                  workspaceInsurerProduct: {  }
                  formLead: {  }
                  user: {  }
                  insuranceCoverGradeContacts: []
                properties:
                  id:
                    type: integer
                    example: 1
                  workspace_insurer_product_id:
                    type: integer
                    example: 2
                  form_lead_id:
                    type: integer
                    example: 3
                  user_id:
                    type: integer
                    example: 4
                  info:
                    type: string
                    example: 'Some info'
                  offer:
                    type: integer
                    example: 100000
                  construction_start:
                    type: string
                    example: '2024-07-01'
                  construction_end:
                    type: string
                    example: '2024-08-01'
                  workspaceInsurerProduct:
                    type: object
                    properties: {  }
                  formLead:
                    type: object
                    properties: {  }
                  user:
                    type: object
                    properties: {  }
                  insuranceCoverGradeContacts:
                    type: array
                    example: []
      tags:
        - InsuranceCoverGrade
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                per_page:
                  type: integer
                  description: ''
                  example: 16
                  nullable: true
                page:
                  type: integer
                  description: ''
                  example: 16
                  nullable: true
                with:
                  type: array
                  description: ''
                  example:
                    - insuranceCoverGradeContacts
                  items:
                    type: string
                    enum:
                      - workspaceInsurerProduct
                      - formLead
                      - user
                      - insuranceCoverGradeContacts
                    nullable: true
                paged:
                  type: boolean
                  description: ''
                  example: true
                  nullable: true
                shortresult:
                  type: boolean
                  description: ''
                  example: false
                  nullable: true
    parameters:
      -
        in: path
        name: covergrade
        description: 'Optional parameter. optional The ID of the insurance cover grade.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/insurance/covergrade:
    post:
      summary: 'Create a new insurance cover grade.'
      operationId: createANewInsuranceCoverGrade
      description: 'Validates the request data and creates a new insurance cover grade record, logs the creation, and sends emails to insurer product users.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'insurance cover grade created successfully'
                  data:
                    id: 1
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'insurance cover grade created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
      tags:
        - InsuranceCoverGrade
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace_insurer_product_id:
                  type: integer
                  description: 'The workspace insurer product ID.'
                  example: 2
                  nullable: false
                form_lead_id:
                  type: integer
                  description: 'The form lead ID.'
                  example: 3
                  nullable: false
                info:
                  type: string
                  description: 'optional Additional info for the cover grade.'
                  example: '"Some info"'
                  nullable: true
                offer:
                  type: number
                  description: 'The offer amount.'
                  example: 100000.0
                  nullable: false
                construction_start:
                  type: date
                  description: 'Construction start date (Y-m-d).'
                  example: '"2024-07-01"'
                  nullable: false
                construction_end:
                  type: date
                  description: 'Construction end date (Y-m-d).'
                  example: '"2024-08-01"'
                  nullable: false
                insurer_product_user_ids:
                  type: array
                  description: 'List of insurer product user IDs.'
                  example:
                    - 5
                    - 6
                  items:
                    type: string
              required:
                - workspace_insurer_product_id
                - form_lead_id
                - offer
                - construction_start
                - construction_end
                - insurer_product_user_ids
  '/api/insurance/covergrade/{covergrade_id}':
    post:
      summary: 'Update an existing insurance cover grade.'
      operationId: updateAnExistingInsuranceCoverGrade
      description: 'Validates the request data and updates the specified insurance cover grade record, logs the update.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'insurance cover grade updated successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'insurance cover grade updated successfully'
      tags:
        - InsuranceCoverGrade
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace_insurer_product_id:
                  type: integer
                  description: 'optional The workspace insurer product ID.'
                  example: 2
                  nullable: true
                form_lead_id:
                  type: integer
                  description: 'optional The form lead ID.'
                  example: 3
                  nullable: true
                info:
                  type: string
                  description: 'optional Additional info for the cover grade.'
                  example: '"Updated info"'
                  nullable: true
                offer:
                  type: number
                  description: 'optional The offer amount.'
                  example: 120000.0
                  nullable: true
                construction_start:
                  type: date
                  description: 'optional Construction start date (Y-m-d).'
                  example: '"2024-07-10"'
                  nullable: true
                construction_end:
                  type: date
                  description: 'optional Construction end date (Y-m-d).'
                  example: '"2024-08-10"'
                  nullable: true
    delete:
      summary: 'Delete an insurance cover grade.'
      operationId: deleteAnInsuranceCoverGrade
      description: 'Removes the specified insurance cover grade from the database and logs the deletion.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'insurance cover grade deleted successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'insurance cover grade deleted successfully'
      tags:
        - InsuranceCoverGrade
    parameters:
      -
        in: path
        name: covergrade_id
        description: 'The ID of the covergrade.'
        example: 10
        required: true
        schema:
          type: integer
      -
        in: path
        name: covergrade
        description: 'The ID of the insurance cover grade to update.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/insurance/offer/{offer}':
    get:
      summary: 'Retrieve insurance offers or a single insurance offer.'
      operationId: retrieveInsuranceOffersOrASingleInsuranceOffer
      description: 'Returns all insurance offers visible to the current user, optionally paginated, or a specific insurance offer with its relations.'
      parameters:
        -
          in: query
          name: per_page
          description: 'optional Number of results per page.'
          example: 15
          required: false
          schema:
            type: integer
            description: 'optional Number of results per page.'
            example: 15
            nullable: false
        -
          in: query
          name: page
          description: 'optional Page number.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'optional Page number.'
            example: 1
            nullable: false
        -
          in: query
          name: with
          description: 'optional Relations to load.'
          example:
            - workspaceInsurerProduct
            - formLead
            - insuranceOfferAttributes
            - files
            - products
            - user
            - policy
          required: false
          schema:
            type: array
            description: 'optional Relations to load.'
            example:
              - workspaceInsurerProduct
              - formLead
              - insuranceOfferAttributes
              - files
              - products
              - user
              - policy
            items:
              type: string
        -
          in: query
          name: paged
          description: 'optional Whether to paginate results.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Whether to paginate results.'
            example: true
            nullable: false
        -
          in: query
          name: shortresult
          description: 'optional If true, returns only basic data.'
          example: false
          required: false
          schema:
            type: boolean
            description: 'optional If true, returns only basic data.'
            example: false
            nullable: false
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  id: 1
                  workspace_insurer_product_id: 2
                  form_lead_id: 3
                  module_object_id: 4
                  user_id: 5
                  insuranceOfferAttributes: []
                  files: []
                  products: []
                  user: {  }
                  policy: {  }
                properties:
                  id:
                    type: integer
                    example: 1
                  workspace_insurer_product_id:
                    type: integer
                    example: 2
                  form_lead_id:
                    type: integer
                    example: 3
                  module_object_id:
                    type: integer
                    example: 4
                  user_id:
                    type: integer
                    example: 5
                  insuranceOfferAttributes:
                    type: array
                    example: []
                  files:
                    type: array
                    example: []
                  products:
                    type: array
                    example: []
                  user:
                    type: object
                    properties: {  }
                  policy:
                    type: object
                    properties: {  }
      tags:
        - InsuranceOffer
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                per_page:
                  type: integer
                  description: ''
                  example: 16
                  nullable: true
                page:
                  type: integer
                  description: ''
                  example: 16
                  nullable: true
                with:
                  type: array
                  description: ''
                  example:
                    - products
                  items:
                    type: string
                    enum:
                      - workspaceInsurerProduct
                      - formLead
                      - insuranceOfferAttributes
                      - files
                      - products
                      - user
                      - policy
                    nullable: true
                paged:
                  type: boolean
                  description: ''
                  example: true
                  nullable: true
                shortresult:
                  type: boolean
                  description: ''
                  example: false
                  nullable: true
    parameters:
      -
        in: path
        name: offer
        description: 'Optional parameter. optional The ID of the insurance offer.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/insurance/offer:
    post:
      summary: 'Create a new insurance offer.'
      operationId: createANewInsuranceOffer
      description: 'Validates the request data and creates a new insurance offer record, including offer products and attributes.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'insurance offer created successfully'
                  data:
                    id: 1
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'insurance offer created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
      tags:
        - InsuranceOffer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace_insurer_product_id:
                  type: integer
                  description: 'The workspace insurer product ID.'
                  example: 2
                  nullable: false
                form_lead_id:
                  type: integer
                  description: 'required_without:module_object_id The form lead ID.'
                  example: 3
                  nullable: false
                module_object_id:
                  type: integer
                  description: 'required_without:form_lead_id The module object ID.'
                  example: 4
                  nullable: false
                replaceProduct:
                  type: boolean
                  description: 'optional Whether to replace the product.'
                  example: false
                  nullable: true
                items:
                  type: array
                  description: 'optional List of offer items.'
                  example:
                    - architecto
                  items:
                    type: string
                    nullable: true
              required:
                - workspace_insurer_product_id
  '/api/insurance/offer/{offer_id}':
    post:
      summary: 'Update an existing insurance offer.'
      operationId: updateAnExistingInsuranceOffer
      description: 'Validates the request data and updates the specified insurance offer record, including offer products and attributes.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'insurance offer updated successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'insurance offer updated successfully'
      tags:
        - InsuranceOffer
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace_insurer_product_id:
                  type: integer
                  description: 'optional The workspace insurer product ID.'
                  example: 2
                  nullable: true
                form_lead_id:
                  type: integer
                  description: 'optional The form lead ID.'
                  example: 3
                  nullable: true
                module_object_id:
                  type: integer
                  description: 'optional The module object ID.'
                  example: 4
                  nullable: true
                replaceProduct:
                  type: boolean
                  description: 'optional Whether to replace the product.'
                  example: false
                  nullable: true
                items:
                  type: array
                  description: 'optional List of offer items.'
                  example:
                    - architecto
                  items:
                    type: string
                    nullable: true
    delete:
      summary: 'Delete an insurance offer.'
      operationId: deleteAnInsuranceOffer
      description: 'Removes the specified insurance offer from the database and logs the deletion.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'insurance offer deleted successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'insurance offer deleted successfully'
      tags:
        - InsuranceOffer
    parameters:
      -
        in: path
        name: offer_id
        description: 'The ID of the offer.'
        example: 30
        required: true
        schema:
          type: integer
      -
        in: path
        name: offer
        description: 'The ID of the insurance offer to update.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/insurance/offer/{offer_id}/accept':
    post:
      summary: 'Accept an insurance offer using a token.'
      operationId: acceptAnInsuranceOfferUsingAToken
      description: 'Validates the token and user ID, logs the acceptance, and dispatches jobs for further processing.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'insurance offer accepted successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'insurance offer accepted successfully'
        400:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'offer token mismatch'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'offer token mismatch'
      tags:
        - InsuranceOffer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                token:
                  type: string
                  description: 'The acceptance token.'
                  example: architecto
                  nullable: false
                user_id:
                  type: integer
                  description: 'The user ID accepting the offer.'
                  example: 5
                  nullable: false
                portalAccept:
                  type: boolean
                  description: 'optional Accept via portal.'
                  example: true
                  nullable: false
              required:
                - token
                - user_id
      security: []
    parameters:
      -
        in: path
        name: offer_id
        description: 'The ID of the offer.'
        example: 30
        required: true
        schema:
          type: integer
      -
        in: path
        name: offer
        description: 'The ID of the insurance offer to accept.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/insurance/offer/{offer_id}/checkAcceptCode':
    post:
      summary: 'Check acceptance code for insurance offer.'
      operationId: checkAcceptanceCodeForInsuranceOffer
      description: 'Validates the code and acceptance status, logs the result, and completes the offer acceptance if accepted.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      success: true
                      message: 'insurance offer accepted successfully'
                    properties:
                      success:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'insurance offer accepted successfully'
                  -
                    description: ''
                    type: object
                    example:
                      success: true
                      message: 'insurance offer declined'
                    properties:
                      success:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'insurance offer declined'
        400:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'code is incorrect'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'code is incorrect'
      tags:
        - InsuranceOffer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                code:
                  type: string
                  description: 'The acceptance code.'
                  example: architecto
                  nullable: false
                accept:
                  type: boolean
                  description: 'Whether the offer is accepted.'
                  example: true
                  nullable: false
                reason:
                  type: string
                  description: 'required_if:accept,false Reason for declining the offer.'
                  example: '"Not interested"'
                  nullable: false
              required:
                - code
                - accept
    parameters:
      -
        in: path
        name: offer_id
        description: 'The ID of the offer.'
        example: 30
        required: true
        schema:
          type: integer
      -
        in: path
        name: offer
        description: 'The ID of the insurance offer.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/insurance/offer/{offer_id}/file/{file}':
    get:
      summary: 'Retrieve insurance offer files or a single insurance offer file.'
      operationId: retrieveInsuranceOfferFilesOrASingleInsuranceOfferFile
      description: 'Returns all files for the specified insurance offer, or a specific file with its relations.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: array
                    items:
                      type: object
                    example:
                      -
                        id: 2
                        insurance_offer_id: 1
                        insurer_avb_id: 3
                        file_id: 4
                        type: contract
                        insuranceOffer: {  }
                        insurerAvb: {  }
                        file: {  }
                  -
                    description: ''
                    type: object
                    example:
                      id: 2
                      insurance_offer_id: 1
                      insurer_avb_id: 3
                      file_id: 4
                      type: contract
                      insuranceOffer: {  }
                      insurerAvb: {  }
                      file: {  }
                    properties:
                      id:
                        type: integer
                        example: 2
                      insurance_offer_id:
                        type: integer
                        example: 1
                      insurer_avb_id:
                        type: integer
                        example: 3
                      file_id:
                        type: integer
                        example: 4
                      type:
                        type: string
                        example: contract
                      insuranceOffer:
                        type: object
                        properties: {  }
                      insurerAvb:
                        type: object
                        properties: {  }
                      file:
                        type: object
                        properties: {  }
      tags:
        - InsuranceOffer
    parameters:
      -
        in: path
        name: offer_id
        description: 'The ID of the offer.'
        example: 30
        required: true
        schema:
          type: integer
      -
        in: path
        name: file
        description: 'Optional parameter. optional The ID of the insurance offer file.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 2
      -
        in: path
        name: offer
        description: 'The ID of the insurance offer.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/insurance/offer/{offer_id}/file':
    post:
      summary: 'Create a new insurance offer file.'
      operationId: createANewInsuranceOfferFile
      description: 'Validates the request data and creates a new file for the specified insurance offer.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'insurance offer file created successfully'
                  data:
                    id: 2
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'insurance offer file created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 2
      tags:
        - InsuranceOffer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                insurer_avb_id:
                  type: integer
                  description: 'optional The ID of the insurer AVB.'
                  example: 3
                  nullable: true
                file_id:
                  type: integer
                  description: 'The ID of the file.'
                  example: 4
                  nullable: false
                type:
                  type: string
                  description: 'The type of the file. Allowed: contract, avb, zb.'
                  example: '"contract"'
                  nullable: false
              required:
                - file_id
                - type
    parameters:
      -
        in: path
        name: offer_id
        description: 'The ID of the offer.'
        example: 30
        required: true
        schema:
          type: integer
      -
        in: path
        name: offer
        description: 'The ID of the insurance offer.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/insurance/offer/{offer_id}/file/{file_id}':
    post:
      summary: 'Update an existing insurance offer file.'
      operationId: updateAnExistingInsuranceOfferFile
      description: 'Validates the request data and updates the specified insurance offer file.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'insurance offer file updated successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'insurance offer file updated successfully'
      tags:
        - InsuranceOffer
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                insurer_avb_id:
                  type: integer
                  description: 'optional The ID of the insurer AVB.'
                  example: 3
                  nullable: true
                file_id:
                  type: integer
                  description: 'optional The ID of the file.'
                  example: 4
                  nullable: true
                type:
                  type: string
                  description: 'optional The type of the file. Allowed: contract, avb, zb.'
                  example: '"avb"'
                  nullable: true
    delete:
      summary: 'Delete an insurance offer file.'
      operationId: deleteAnInsuranceOfferFile
      description: 'Removes the specified insurance offer file from the database.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'insurance offer file deleted successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'insurance offer file deleted successfully'
      tags:
        - InsuranceOffer
    parameters:
      -
        in: path
        name: offer_id
        description: 'The ID of the offer.'
        example: 30
        required: true
        schema:
          type: integer
      -
        in: path
        name: file_id
        description: 'The ID of the file.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: offer
        description: 'The ID of the insurance offer.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: file
        description: 'The ID of the insurance offer file to update.'
        example: 2
        required: true
        schema:
          type: integer
  '/api/insurance/offer/{offer_id}/product/{product}':
    get:
      summary: 'Retrieve insurance offer products or a single insurance offer product.'
      operationId: retrieveInsuranceOfferProductsOrASingleInsuranceOfferProduct
      description: 'Returns all products for the specified insurance offer, or a specific product with its relations.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: array
                    items:
                      type: object
                    example:
                      -
                        id: 2
                        insurance_offer_id: 1
                        insurer_product_item_id: 3
                        difference: 'Coverage difference'
                        approved: true
                        insuranceOffer: {  }
                        insurerProductItem: {  }
                  -
                    description: ''
                    type: object
                    example:
                      id: 2
                      insurance_offer_id: 1
                      insurer_product_item_id: 3
                      difference: 'Coverage difference'
                      approved: true
                      insuranceOffer: {  }
                      insurerProductItem: {  }
                    properties:
                      id:
                        type: integer
                        example: 2
                      insurance_offer_id:
                        type: integer
                        example: 1
                      insurer_product_item_id:
                        type: integer
                        example: 3
                      difference:
                        type: string
                        example: 'Coverage difference'
                      approved:
                        type: boolean
                        example: true
                      insuranceOffer:
                        type: object
                        properties: {  }
                      insurerProductItem:
                        type: object
                        properties: {  }
      tags:
        - InsuranceOffer
    parameters:
      -
        in: path
        name: offer_id
        description: 'The ID of the offer.'
        example: 30
        required: true
        schema:
          type: integer
      -
        in: path
        name: product
        description: 'Optional parameter. optional The ID of the insurance offer product.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 2
      -
        in: path
        name: offer
        description: 'The ID of the insurance offer.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/insurance/offer/{offer_id}/product':
    post:
      summary: 'Create a new insurance offer product.'
      operationId: createANewInsuranceOfferProduct
      description: 'Validates the request data and creates a new product for the specified insurance offer.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'insurance offer product created successfully'
                  data:
                    id: 2
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'insurance offer product created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 2
      tags:
        - InsuranceOffer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                insurer_product_item_id:
                  type: integer
                  description: 'The ID of the insurer product item.'
                  example: 3
                  nullable: false
                difference:
                  type: string
                  description: 'required_without:approved Coverage difference description.'
                  example: '"Coverage difference"'
                  nullable: false
                approved:
                  type: boolean
                  description: 'required_without:difference Approval status.'
                  example: true
                  nullable: false
              required:
                - insurer_product_item_id
    parameters:
      -
        in: path
        name: offer_id
        description: 'The ID of the offer.'
        example: 30
        required: true
        schema:
          type: integer
      -
        in: path
        name: offer
        description: 'The ID of the insurance offer.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/insurance/offer/{offer_id}/product/{product_id}':
    post:
      summary: 'Update an existing insurance offer product.'
      operationId: updateAnExistingInsuranceOfferProduct
      description: 'Validates the request data and updates the specified insurance offer product.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'insurance offer product updated successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'insurance offer product updated successfully'
      tags:
        - InsuranceOffer
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                insurer_product_item_id:
                  type: integer
                  description: 'optional The ID of the insurer product item.'
                  example: 3
                  nullable: true
                difference:
                  type: string
                  description: 'optional Coverage difference description.'
                  example: '"Updated difference"'
                  nullable: true
                approved:
                  type: boolean
                  description: 'optional Approval status.'
                  example: false
                  nullable: true
    delete:
      summary: 'Delete an insurance offer product.'
      operationId: deleteAnInsuranceOfferProduct
      description: 'Removes the specified insurance offer product from the database.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'insurance offer product deleted successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'insurance offer product deleted successfully'
      tags:
        - InsuranceOffer
    parameters:
      -
        in: path
        name: offer_id
        description: 'The ID of the offer.'
        example: 30
        required: true
        schema:
          type: integer
      -
        in: path
        name: product_id
        description: 'The ID of the product.'
        example: 1123
        required: true
        schema:
          type: integer
      -
        in: path
        name: offer
        description: 'The ID of the insurance offer.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: product
        description: 'The ID of the insurance offer product to update.'
        example: 2
        required: true
        schema:
          type: integer
  '/api/insurer/avb/{avb}':
    get:
      summary: 'Returns a list of all Insurer AVBs or a single AVB.'
      operationId: returnsAListOfAllInsurerAVBsOrASingleAVB
      description: 'Returns either all AVBs of the current workspace or a specific AVB with related models.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  id: 1
                  workspace_insurer_product_id: 2
                  file_id: 3
                  info: 'Example info'
                  type: 'Example type'
                properties:
                  id:
                    type: integer
                    example: 1
                  workspace_insurer_product_id:
                    type: integer
                    example: 2
                  file_id:
                    type: integer
                    example: 3
                  info:
                    type: string
                    example: 'Example info'
                  type:
                    type: string
                    example: 'Example type'
      tags:
        - 'Insurer AVB'
    parameters:
      -
        in: path
        name: avb
        description: 'Optional parameter. optional The ID of the AVB.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/insurer/avb:
    post:
      summary: 'Creates a new Insurer AVB.'
      operationId: createsANewInsurerAVB
      description: 'Validates the input data and creates a new AVB.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'insurer avb created successfully'
                  data:
                    id: 1
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'insurer avb created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
      tags:
        - 'Insurer AVB'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace_insurer_product_id:
                  type: integer
                  description: 'The workspace insurer product ID.'
                  example: 2
                  nullable: false
                file_id:
                  type: integer
                  description: 'The file ID of the AVB document.'
                  example: 3
                  nullable: false
                info:
                  type: string
                  description: 'optional Additional info for the AVB.'
                  example: '"Example info"'
                  nullable: true
                type:
                  type: string
                  description: 'optional Type of the AVB.'
                  example: '"Example type"'
                  nullable: true
              required:
                - workspace_insurer_product_id
                - file_id
  '/api/insurer/avb/{avb_id}':
    post:
      summary: 'Updates an existing Insurer AVB.'
      operationId: updatesAnExistingInsurerAVB
      description: 'Validates the input data and updates the specified AVB.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'insurer avb updated successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'insurer avb updated successfully'
      tags:
        - 'Insurer AVB'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace_insurer_product_id:
                  type: integer
                  description: 'optional The workspace insurer product ID.'
                  example: 2
                  nullable: true
                file_id:
                  type: integer
                  description: 'optional The file ID of the AVB document.'
                  example: 3
                  nullable: true
                info:
                  type: string
                  description: 'optional Additional info for the AVB.'
                  example: '"Example info"'
                  nullable: true
                type:
                  type: string
                  description: 'optional Type of the AVB.'
                  example: '"Example type"'
                  nullable: true
    delete:
      summary: 'Deletes an Insurer AVB.'
      operationId: deletesAnInsurerAVB
      description: 'Removes the specified AVB from the database.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'insurer avb deleted successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'insurer avb deleted successfully'
      tags:
        - 'Insurer AVB'
    parameters:
      -
        in: path
        name: avb_id
        description: 'The ID of the avb.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: avb
        description: 'The ID of the AVB to update.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/insurer/obligation/{obligation}':
    get:
      summary: 'Retrieve insurer obligations or a single insurer obligation.'
      operationId: retrieveInsurerObligationsOrASingleInsurerObligation
      description: 'Returns all insurer obligations for the current workspace, or a specific obligation with its related workspace insurer product and file.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: array
                    items:
                      type: object
                    example:
                      -
                        id: 1
                        workspace_insurer_product_id: 2
                        file_id: 3
                        info: 'Some info'
                        workspaceInsurerProduct: {  }
                        file: {  }
                  -
                    description: ''
                    type: object
                    example:
                      id: 1
                      workspace_insurer_product_id: 2
                      file_id: 3
                      info: 'Some info'
                      workspaceInsurerProduct: {  }
                      file: {  }
                    properties:
                      id:
                        type: integer
                        example: 1
                      workspace_insurer_product_id:
                        type: integer
                        example: 2
                      file_id:
                        type: integer
                        example: 3
                      info:
                        type: string
                        example: 'Some info'
                      workspaceInsurerProduct:
                        type: object
                        properties: {  }
                      file:
                        type: object
                        properties: {  }
      tags:
        - InsurerObligation
    parameters:
      -
        in: path
        name: obligation
        description: 'Optional parameter. optional The ID of the insurer obligation.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/insurer/obligation:
    post:
      summary: 'Create a new insurer obligation.'
      operationId: createANewInsurerObligation
      description: 'Validates the request data and creates a new insurer obligation record.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'insurer obligation created successfully'
                  data:
                    id: 1
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'insurer obligation created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
      tags:
        - InsurerObligation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                file_id:
                  type: integer
                  description: 'The ID of the file.'
                  example: 3
                  nullable: false
                workspace_insurer_product_id:
                  type: integer
                  description: 'The workspace insurer product ID.'
                  example: 2
                  nullable: false
                info:
                  type: string
                  description: 'optional Additional info for the obligation.'
                  example: '"Some info"'
                  nullable: true
              required:
                - file_id
                - workspace_insurer_product_id
  '/api/insurer/obligation/{obligation_id}':
    post:
      summary: 'Update an existing insurer obligation.'
      operationId: updateAnExistingInsurerObligation
      description: 'Validates the request data and updates the specified insurer obligation record.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'insurer obligation updated successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'insurer obligation updated successfully'
      tags:
        - InsurerObligation
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                file_id:
                  type: integer
                  description: 'optional The ID of the file.'
                  example: 3
                  nullable: true
                workspace_insurer_product_id:
                  type: integer
                  description: 'optional The workspace insurer product ID.'
                  example: 2
                  nullable: true
                info:
                  type: string
                  description: 'optional Additional info for the obligation.'
                  example: '"Updated info"'
                  nullable: true
    delete:
      summary: 'Delete an insurer obligation.'
      operationId: deleteAnInsurerObligation
      description: 'Removes the specified insurer obligation from the database.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'insurer obligation deleted successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'insurer obligation deleted successfully'
      tags:
        - InsurerObligation
    parameters:
      -
        in: path
        name: obligation_id
        description: 'The ID of the obligation.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: obligation
        description: 'The ID of the insurer obligation to update.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/insurer/product/{product}':
    get:
      summary: 'Retrieve one or multiple insurer products.'
      operationId: retrieveOneOrMultipleInsurerProducts
      description: "If a product is provided, returns detailed information about that product including related models.\nOtherwise, returns a paginated or full list of insurer products, optionally with related data."
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - InsurerProduct
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                per_page:
                  type: integer
                  description: ''
                  example: 16
                  nullable: true
                page:
                  type: integer
                  description: ''
                  example: 16
                  nullable: true
                with:
                  type: array
                  description: ''
                  example:
                    - workspace
                  items:
                    type: string
                    enum:
                      - moduleProduct
                      - productItems
                      - childProducts
                      - workspace
                    nullable: true
                paged:
                  type: boolean
                  description: ''
                  example: true
                  nullable: true
                shortresult:
                  type: boolean
                  description: ''
                  example: false
                  nullable: true
    parameters:
      -
        in: path
        name: product
        description: 'Optional parameter.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  '/api/insurer/product/{product_id}/copy':
    post:
      summary: 'Copy an insurer product into another workspace.'
      operationId: copyAnInsurerProductIntoAnotherWorkspace
      description: "Duplicates the specified insurer product and all its related data into the target workspace.\nIf a copy already exists, returns the existing copy."
      parameters: []
      responses: {  }
      tags:
        - InsurerProduct
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace_id:
                  type: string
                  description: 'The <code>id</code> of an existing record in the workspaces table.'
                  example: architecto
                  nullable: false
              required:
                - workspace_id
    parameters:
      -
        in: path
        name: product_id
        description: 'The ID of the product.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/insurer/product/{product_id}':
    delete:
      summary: 'Delete an insurer product.'
      operationId: deleteAnInsurerProduct
      description: 'Removes the specified insurer product from the database.'
      parameters: []
      responses: {  }
      tags:
        - InsurerProduct
    post:
      summary: 'Update an existing insurer product.'
      operationId: updateAnExistingInsurerProduct
      description: "Updates the specified insurer product with new attributes.\nIf the module product changes, associated product items are replaced."
      parameters: []
      responses: {  }
      tags:
        - InsurerProduct
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: ''
                  example: architecto
                  nullable: true
                description:
                  type: string
                  description: ''
                  example: 'Eius et animi quos velit et.'
                  nullable: true
                tariff:
                  type: object
                  description: ''
                  example: null
                  nullable: true
                  properties: {  }
                start:
                  type: string
                  description: 'Must be a valid date.'
                  example: '2025-10-20T19:41:49'
                  nullable: true
                end:
                  type: string
                  description: 'Must be a valid date.'
                  example: '2025-10-20T19:41:49'
                  nullable: true
                module_product_id:
                  type: string
                  description: 'The <code>id</code> of an existing record in the module_products table.'
                  example: null
                  nullable: true
                parent_id:
                  type: string
                  description: 'The <code>id</code> of an existing record in the insurer_products table.'
                  example: null
                  nullable: true
    parameters:
      -
        in: path
        name: product_id
        description: 'The ID of the product.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/insurer/product/{product_id}/contacts':
    get:
      summary: 'Get lead insurer contacts for a product.'
      operationId: getLeadInsurerContactsForAProduct
      description: "Retrieves contact information for all users associated with the insurer product,\ngrouped by their workspace."
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - InsurerProduct
    parameters:
      -
        in: path
        name: product_id
        description: 'The ID of the product.'
        example: 1
        required: true
        schema:
          type: integer
  /api/insurer/product:
    post:
      summary: 'Create a new insurer product.'
      operationId: createANewInsurerProduct
      description: "Validates and creates an insurer product with the provided attributes.\nAutomatically adds module product items based on the selected module product."
      parameters: []
      responses: {  }
      tags:
        - InsurerProduct
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: ''
                  example: architecto
                  nullable: false
                description:
                  type: string
                  description: ''
                  example: 'Eius et animi quos velit et.'
                  nullable: true
                tariff:
                  type: object
                  description: ''
                  example: null
                  nullable: true
                  properties: {  }
                start:
                  type: string
                  description: 'Must be a valid date.'
                  example: '2025-10-20T19:41:49'
                  nullable: true
                end:
                  type: string
                  description: 'Must be a valid date.'
                  example: '2025-10-20T19:41:49'
                  nullable: true
                module_product_id:
                  type: string
                  description: 'The <code>id</code> of an existing record in the module_products table.'
                  example: architecto
                  nullable: false
                parent_id:
                  type: string
                  description: 'The <code>id</code> of an existing record in the insurer_products table.'
                  example: null
                  nullable: true
                workspace_id:
                  type: string
                  description: 'The <code>id</code> of an existing record in the workspaces table.'
                  example: null
                  nullable: true
              required:
                - name
                - module_product_id
  '/api/insurer/product/{product_id}/item/{item}':
    get:
      summary: 'Retrieve one or multiple insurer product items.'
      operationId: retrieveOneOrMultipleInsurerProductItems
      description: "This endpoint returns either a list of all items for a given insurer product,\nor detailed information about a specific item if an item ID is provided."
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  id: 1
                  name: 'Item Name'
                  insurer_product_id: 1
                  module_product_item_id: 2
                  info: 'Additional info'
                  type: Type
                  coverage_type: 'Coverage Type'
                  coverage: 'Coverage details'
                  insurerProduct: {  }
                  moduleProductItem: {  }
                  insurerProductItemAttributes: {  }
                properties:
                  id:
                    type: integer
                    example: 1
                  name:
                    type: string
                    example: 'Item Name'
                  insurer_product_id:
                    type: integer
                    example: 1
                  module_product_item_id:
                    type: integer
                    example: 2
                  info:
                    type: string
                    example: 'Additional info'
                  type:
                    type: string
                    example: Type
                  coverage_type:
                    type: string
                    example: 'Coverage Type'
                  coverage:
                    type: string
                    example: 'Coverage details'
                  insurerProduct:
                    type: object
                    properties: {  }
                  moduleProductItem:
                    type: object
                    properties: {  }
                  insurerProductItemAttributes:
                    type: object
                    properties: {  }
      tags:
        - InsurerProduct
    parameters:
      -
        in: path
        name: product_id
        description: 'The ID of the product.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: item
        description: 'Optional parameter.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  '/api/insurer/product/{product_id}/item':
    post:
      summary: 'Create a new insurer product item.'
      operationId: createANewInsurerProductItem
      description: "This endpoint validates and creates a new insurer product item with the provided attributes.\nAdditional custom attributes are stored in the related attribute model."
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'insurer product item created successfully'
                  data:
                    id: 1
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'insurer product item created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
      tags:
        - InsurerProduct
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The name of the product item.'
                  example: '"Haftpflicht"'
                  nullable: false
                module_product_item_id:
                  type: integer
                  description: 'optional The ID of the associated module product item.'
                  example: 2
                  nullable: true
                info:
                  type: string
                  description: 'optional Additional information.'
                  example: '"Deckungssumme 10 Mio"'
                  nullable: true
                type:
                  type: string
                  description: 'optional The type of the product item.'
                  example: '"Basis"'
                  nullable: true
                coverage_type:
                  type: string
                  description: 'optional The type of coverage.'
                  example: '"Voll"'
                  nullable: true
                coverage:
                  type: string
                  description: 'optional Coverage details.'
                  example: '"Europaweit"'
                  nullable: true
              required:
                - name
    parameters:
      -
        in: path
        name: product_id
        description: 'The ID of the product.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/insurer/product/{product_id}/item/{item_id}':
    post:
      summary: 'Update an existing insurer product item.'
      operationId: updateAnExistingInsurerProductItem
      description: "This endpoint updates the specified insurer product item with new attributes.\nAdditional custom attributes are updated in the related attribute model."
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'insurer product item updated successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'insurer product item updated successfully'
      tags:
        - InsurerProduct
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'optional The new name of the product item.'
                  example: '"Haftpflicht Plus"'
                  nullable: true
                module_product_item_id:
                  type: integer
                  description: 'optional The new module product item ID.'
                  example: 3
                  nullable: true
                info:
                  type: string
                  description: 'optional New information.'
                  example: '"Deckungssumme 20 Mio"'
                  nullable: true
                type:
                  type: string
                  description: 'optional New type.'
                  example: '"Premium"'
                  nullable: true
                coverage_type:
                  type: string
                  description: 'optional New coverage type.'
                  example: '"Teilkasko"'
                  nullable: true
                coverage:
                  type: string
                  description: 'optional New coverage details.'
                  example: '"Weltweit"'
                  nullable: true
    delete:
      summary: 'Delete an insurer product item.'
      operationId: deleteAnInsurerProductItem
      description: 'This endpoint removes the specified insurer product item from the database.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'insurer product item deleted successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'insurer product item deleted successfully'
      tags:
        - InsurerProduct
    parameters:
      -
        in: path
        name: product_id
        description: 'The ID of the product.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: item_id
        description: 'The ID of the item.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/insurer/product/{insurerproduct_id}/user/{user_id}':
    post:
      summary: 'Add a User to an Insurer Product'
      operationId: addAUserToAnInsurerProduct
      description: "Assigns a user to the specified insurer product. Optionally, the user can be set as the default user for the product.\nIf the user is already assigned, you can update their default status."
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      success: true
                      message: 'user set as default user for insurer product'
                      refreshToken: true
                    properties:
                      success:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'user set as default user for insurer product'
                      refreshToken:
                        type: boolean
                        example: true
                  -
                    description: ''
                    type: object
                    example:
                      success: false
                      message: 'user already assigned to insurer product'
                      refreshToken: true
                    properties:
                      success:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'user already assigned to insurer product'
                      refreshToken:
                        type: boolean
                        example: true
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'user assigned as default user to insurer product'
                  data:
                    id: 123
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'user assigned as default user to insurer product'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 123
                  refreshToken:
                    type: boolean
                    example: true
      tags:
        - InsurerProduct
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                default:
                  type: boolean
                  description: 'Optional. Set to 1 to make this user the default for the insurer product.'
                  example: true
                  nullable: true
    delete:
      summary: 'Remove a User from an Insurer Product'
      operationId: removeAUserFromAnInsurerProduct
      description: "Removes the specified user from the insurer product. If the user is the default, another user will be set as default.\nAt least one user must remain assigned to the insurer product."
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      success: true
                      message: 'user successfully removed from insurer product'
                      refreshToken: true
                    properties:
                      success:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'user successfully removed from insurer product'
                      refreshToken:
                        type: boolean
                        example: true
                  -
                    description: ''
                    type: object
                    example:
                      success: false
                      message: 'at least one user must be assigned to insurer product'
                      refreshToken: true
                    properties:
                      success:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'at least one user must be assigned to insurer product'
                      refreshToken:
                        type: boolean
                        example: true
                  -
                    description: ''
                    type: object
                    example:
                      success: false
                      message: 'user is not assigned to insurer product'
                      refreshToken: true
                    properties:
                      success:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'user is not assigned to insurer product'
                      refreshToken:
                        type: boolean
                        example: true
      tags:
        - InsurerProduct
    parameters:
      -
        in: path
        name: insurerproduct_id
        description: 'The ID of the insurerproduct.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: user_id
        description: 'The ID of the user.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/insurer/tariffconstructioncost/{tariff}':
    get:
      summary: 'Get insurer tariff construction costs.'
      operationId: getInsurerTariffConstructionCosts
      description: "Retrieves one or multiple insurer tariff construction cost records. If a specific tariff is provided, returns its details including related workspace insurer product and child tariffs.\nOtherwise, returns a paginated list of tariffs filtered by user role and workspace."
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"id\": 1,\n  \"workspace_insurer_product_id\": 5,\n  \"type\": \"construction_cost\",\n  \"low\": 100000,\n  \"high\": 500000,\n  \"workspaceInsurerProduct\": {...},\n  \"childTariffs\": [...]\n}"
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: Unauthorized
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Unauthorized
      tags:
        - InsurerTariffConstructionCost
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                per_page:
                  type: integer
                  description: 'optional Number of results per page.'
                  example: 15
                  nullable: true
                page:
                  type: integer
                  description: 'optional Page number.'
                  example: 1
                  nullable: true
                with:
                  type: array
                  description: 'optional Relations to include. Allowed: workspaceInsurerProduct,childTariffs.'
                  example:
                    - workspaceInsurerProduct
                  items:
                    type: string
                    nullable: true
                paged:
                  type: boolean
                  description: 'optional Whether to paginate results.'
                  example: true
                  nullable: true
                shortresult:
                  type: boolean
                  description: 'optional If true, returns a short result without relations.'
                  example: false
                  nullable: true
                workspace_insurer_product_id:
                  type: integer
                  description: 'optional Filter by workspace insurer product ID.'
                  example: 5
                  nullable: false
    parameters:
      -
        in: path
        name: tariff
        description: 'Optional parameter.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 121
  /api/insurer/tariffconstructioncost:
    post:
      summary: 'Create insurer tariff construction cost.'
      operationId: createInsurerTariffConstructionCost
      description: "Creates a new insurer tariff construction cost record. Supports batch creation for multiple types, low, and high values.\nThe first entry with type 'construction_cost' will be the parent, others will be children."
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'insurer tariff construction cost created successfully'
                  data:
                    id: 1
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'insurer tariff construction cost created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                  refreshToken:
                    type: boolean
                    example: true
        400:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      success: false
                      message: 'type, low or high values missing'
                      refreshToken: true
                    properties:
                      success:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'type, low or high values missing'
                      refreshToken:
                        type: boolean
                        example: true
                  -
                    description: ''
                    type: object
                    example:
                      success: false
                      message: 'one of the high values is lower as the low value'
                      refreshToken: true
                    properties:
                      success:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'one of the high values is lower as the low value'
                      refreshToken:
                        type: boolean
                        example: true
      tags:
        - InsurerTariffConstructionCost
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace_insurer_product_id:
                  type: integer
                  description: 'The workspace insurer product ID.'
                  example: 5
                  nullable: false
                type:
                  type: array
                  description: 'Array of tariff types.'
                  example:
                    - construction_cost
                    - other_type
                  items:
                    type: string
                low:
                  type: array
                  description: 'Array of low values.'
                  example:
                    - 100000
                    - 200000
                  items:
                    type: string
                high:
                  type: array
                  description: 'Array of high values.'
                  example:
                    - 500000
                    - 600000
                  items:
                    type: string
              required:
                - workspace_insurer_product_id
                - type
                - low
                - high
  '/api/insurer/tariffconstructioncost/{tariff_id}':
    post:
      summary: 'Update insurer tariff construction cost.'
      operationId: updateInsurerTariffConstructionCost
      description: 'Updates an existing insurer tariff construction cost record. Only provided fields will be updated.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'insurer tariff construction cost updated successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'insurer tariff construction cost updated successfully'
                  refreshToken:
                    type: boolean
                    example: true
        400:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'the high value is lower as the low value'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'the high value is lower as the low value'
                  refreshToken:
                    type: boolean
                    example: true
      tags:
        - InsurerTariffConstructionCost
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace_insurer_product_id:
                  type: integer
                  description: 'optional The workspace insurer product ID.'
                  example: 5
                  nullable: true
                type:
                  type: string
                  description: 'optional The tariff type.'
                  example: '"construction_cost"'
                  nullable: true
                high:
                  type: numeric
                  description: 'optional The high value.'
                  example: '500000'
                  nullable: true
                low:
                  type: numeric
                  description: 'optional The low value.'
                  example: '100000'
                  nullable: true
    delete:
      summary: 'Delete insurer tariff construction cost.'
      operationId: deleteInsurerTariffConstructionCost
      description: 'Deletes the specified insurer tariff construction cost record.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'insurer tariff construction cost deleted successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'insurer tariff construction cost deleted successfully'
                  refreshToken:
                    type: boolean
                    example: true
      tags:
        - InsurerTariffConstructionCost
    parameters:
      -
        in: path
        name: tariff_id
        description: 'The ID of the tariff.'
        example: 121
        required: true
        schema:
          type: integer
  '/api/journal/{journal}':
    get:
      summary: 'Get journal entries.'
      operationId: getJournalEntries
      description: 'Retrieves a single journal entry or a paginated list of journal entries. Supports filtering, sorting, and eager loading of relations.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"id\": 1,\n  \"type\": \"state\",\n  \"visible\": true,\n  \"object_id\": 123,\n  \"object_type\": \"App\\\\Models\\\\Workspace\",\n  \"user_id\": 5,\n  \"journalAttributes\": {...},\n  \"user\": {...}\n}"
      tags:
        - Journal
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                paged:
                  type: boolean
                  description: 'optional Whether to paginate results.'
                  example: true
                  nullable: true
                per_page:
                  type: integer
                  description: 'optional Number of results per page.'
                  example: 15
                  nullable: true
                page:
                  type: integer
                  description: 'optional Page number.'
                  example: 1
                  nullable: true
                with:
                  type: array
                  description: 'optional Relations to include. Allowed: journalAttributes,user.'
                  example:
                    - journalAttributes
                  items:
                    type: string
                    nullable: true
                shortresult:
                  type: boolean
                  description: 'optional If true, returns a short result without relations.'
                  example: false
                  nullable: true
    parameters:
      -
        in: path
        name: journal
        description: 'Optional parameter.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 998
  '/api/journal/{journal_id}':
    post:
      summary: 'Edit an existing journal entry.'
      operationId: editAnExistingJournalEntry
      description: 'Updates an existing journal entry. Only provided fields will be updated. Additional attributes will be stored in journalAttributes.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'journal updated'
                  data:
                    id: 1
                    type: task
                    visible: false
                    object_id: 124
                    object_type: App\Models\Workspace
                    user_id: 5
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'journal updated'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      type:
                        type: string
                        example: task
                      visible:
                        type: boolean
                        example: false
                      object_id:
                        type: integer
                        example: 124
                      object_type:
                        type: string
                        example: App\Models\Workspace
                      user_id:
                        type: integer
                        example: 5
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    type:
                      - 'The type field is invalid.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      type:
                        type: array
                        example:
                          - 'The type field is invalid.'
                        items:
                          type: string
      tags:
        - Journal
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  description: 'optional The type of the journal entry. Allowed: state, task.'
                  example: '"task"'
                  nullable: false
                visible:
                  type: boolean
                  description: 'optional Whether the journal entry is visible.'
                  example: false
                  nullable: true
                object_id:
                  type: integer
                  description: 'optional The ID of the related object.'
                  example: 124
                  nullable: false
                object_type:
                  type: string
                  description: 'optional The type of the related object. Allowed: FormLeads\FormLead, Modules\ModuleObject, Workspace, Policies\Policy, DamageReport.'
                  example: '"Workspace"'
                  nullable: false
                attributes:
                  type: mixed
                  description: 'optional Any additional attributes to be stored in journalAttributes (ex. "foo", "bar").'
                  example: architecto
                  nullable: false
    delete:
      summary: 'Delete a journal entry.'
      operationId: deleteAJournalEntry
      description: 'Deletes the specified journal entry.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'journal deleted'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'journal deleted'
                  refreshToken:
                    type: boolean
                    example: true
      tags:
        - Journal
    parameters:
      -
        in: path
        name: journal_id
        description: 'The ID of the journal.'
        example: 998
        required: true
        schema:
          type: integer
  /api/journal:
    post:
      summary: 'Create a new journal entry.'
      operationId: createANewJournalEntry
      description: 'Creates a new journal entry for a given object type and object ID. Additional attributes can be provided and will be stored as journal attributes.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'journal created'
                  data:
                    id: 1
                    type: state
                    visible: true
                    object_id: 123
                    object_type: App\Models\Workspace
                    user_id: 5
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'journal created'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      type:
                        type: string
                        example: state
                      visible:
                        type: boolean
                        example: true
                      object_id:
                        type: integer
                        example: 123
                      object_type:
                        type: string
                        example: App\Models\Workspace
                      user_id:
                        type: integer
                        example: 5
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    type:
                      - 'The type field is required.'
                    object_id:
                      - 'The object_id field is required.'
                    object_type:
                      - 'The object_type field is required.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      type:
                        type: array
                        example:
                          - 'The type field is required.'
                        items:
                          type: string
                      object_id:
                        type: array
                        example:
                          - 'The object_id field is required.'
                        items:
                          type: string
                      object_type:
                        type: array
                        example:
                          - 'The object_type field is required.'
                        items:
                          type: string
      tags:
        - Journal
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  description: 'The type of the journal entry. Allowed: state, task.'
                  example: '"state"'
                  nullable: false
                visible:
                  type: boolean
                  description: 'optional Whether the journal entry is visible.'
                  example: true
                  nullable: true
                object_id:
                  type: integer
                  description: 'The ID of the related object.'
                  example: 123
                  nullable: false
                object_type:
                  type: string
                  description: 'The type of the related object. Allowed: FormLeads\FormLead, Modules\ModuleObject, Workspace, Policies\Policy, DamageReport.'
                  example: '"Workspace"'
                  nullable: false
                attributes:
                  type: mixed
                  description: 'optional Any additional attributes to be stored in journalAttributes (ex. "foo", "bar").'
                  example: architecto
                  nullable: false
              required:
                - type
                - object_id
                - object_type
  '/api/formlead/{formlead_id}/mandate/{mandate}':
    get:
      summary: 'Get Mandates.'
      operationId: getMandates
      description: "Retrieves a single mandate or a list of mandates for the given form lead. If a specific mandate is provided, returns its details including related form lead and file.\nOtherwise, returns all mandates for the form lead."
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"id\": 1,\n  \"form_lead_id\": 2,\n  \"file_id\": 3,\n  \"user_id\": 4,\n  \"formLead\": {...},\n  \"file\": {...}\n}"
      tags:
        - Mandate
    parameters:
      -
        in: path
        name: formlead_id
        description: 'The ID of the formlead.'
        example: 26
        required: true
        schema:
          type: integer
      -
        in: path
        name: mandate
        description: 'Optional parameter.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 6
  '/api/formlead/{formlead_id}/mandate':
    post:
      summary: 'Create a Mandate.'
      operationId: createAMandate
      description: "Creates a new mandate for the given form lead. Requires file and user IDs. Additional attributes can be provided and will be stored.\nTriggers PDF generation and logs the creation."
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'mandate created successfully'
                  data:
                    id: 1
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'mandate created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    file_id:
                      - 'The file_id field is required.'
                    user_id:
                      - 'The user_id field is required.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      file_id:
                        type: array
                        example:
                          - 'The file_id field is required.'
                        items:
                          type: string
                      user_id:
                        type: array
                        example:
                          - 'The user_id field is required.'
                        items:
                          type: string
      tags:
        - Mandate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                file_id:
                  type: integer
                  description: 'The file ID associated with the mandate.'
                  example: 3
                  nullable: false
                user_id:
                  type: integer
                  description: 'The user ID associated with the mandate.'
                  example: 4
                  nullable: false
                attributes:
                  type: mixed
                  description: 'optional Any additional attributes for the mandate (ex "foo", "bar").'
                  example: architecto
                  nullable: false
              required:
                - file_id
                - user_id
    parameters:
      -
        in: path
        name: formlead_id
        description: 'The ID of the formlead.'
        example: 26
        required: true
        schema:
          type: integer
  '/api/formlead/{formlead_id}/mandate/{mandate_id}':
    post:
      summary: 'Update a Mandate.'
      operationId: updateAMandate
      description: "Updates an existing mandate for the given form lead. Only provided fields will be updated. Additional attributes will be stored.\nTriggers PDF generation and logs the update."
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'mandate updated successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'mandate updated successfully'
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    file_id:
                      - 'The file_id field is invalid.'
                    user_id:
                      - 'The user_id field is invalid.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      file_id:
                        type: array
                        example:
                          - 'The file_id field is invalid.'
                        items:
                          type: string
                      user_id:
                        type: array
                        example:
                          - 'The user_id field is invalid.'
                        items:
                          type: string
      tags:
        - Mandate
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                file_id:
                  type: integer
                  description: 'optional The file ID associated with the mandate.'
                  example: 3
                  nullable: true
                user_id:
                  type: integer
                  description: 'optional The user ID associated with the mandate.'
                  example: 4
                  nullable: true
                attributes:
                  type: mixed
                  description: 'optional Any additional attributes for the mandate (ex. "foo", "bar").'
                  example: architecto
                  nullable: false
    delete:
      summary: 'Delete a Mandate.'
      operationId: deleteAMandate
      description: 'Deletes the specified mandate for the given form lead and logs the deletion.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'mandate deleted successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'mandate deleted successfully'
                  refreshToken:
                    type: boolean
                    example: true
      tags:
        - Mandate
    parameters:
      -
        in: path
        name: formlead_id
        description: 'The ID of the formlead.'
        example: 26
        required: true
        schema:
          type: integer
      -
        in: path
        name: mandate_id
        description: 'The ID of the mandate.'
        example: 6
        required: true
        schema:
          type: integer
  '/api/module/{module}':
    get:
      summary: 'Get a module or all modules.'
      operationId: getAModuleOrAllModules
      description: 'Retrieves a single module with its settings or a paginated list of modules. Supports filtering, sorting, and eager loading of relations.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"id\": 1,\n  \"name\": \"Module Name\",\n  \"settings\": {...},\n  \"products\": [...]\n}"
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: Unauthorized
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Unauthorized
      tags:
        - Module
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                per_page:
                  type: integer
                  description: 'optional Number of results per page.'
                  example: 15
                  nullable: true
                page:
                  type: integer
                  description: 'optional Page number.'
                  example: 1
                  nullable: true
                with:
                  type: array
                  description: 'optional Relations to include. Allowed: settings,products.'
                  example:
                    - settings
                  items:
                    type: string
                    nullable: true
                paged:
                  type: boolean
                  description: 'optional Whether to paginate results.'
                  example: true
                  nullable: true
                shortresult:
                  type: boolean
                  description: 'optional If true, returns a short result without relations.'
                  example: false
                  nullable: true
    parameters:
      -
        in: path
        name: module
        description: 'Optional parameter.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/module:
    post:
      summary: 'Create a new module.'
      operationId: createANewModule
      description: 'Creates a new module with the given name and optional settings.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'module created successfully'
                  data:
                    id: 1
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'module created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    name:
                      - 'The name field is required.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      name:
                        type: array
                        example:
                          - 'The name field is required.'
                        items:
                          type: string
      tags:
        - Module
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The name of the module.'
                  example: '"New Module"'
                  nullable: false
                settings:
                  type: mixed
                  description: 'optional Any additional settings for the module (ex "foo", "bar").'
                  example: architecto
                  nullable: false
              required:
                - name
  '/api/module/{module_id}':
    post:
      summary: 'Update an existing module.'
      operationId: updateAnExistingModule
      description: 'Updates the name and settings of an existing module.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'module updated successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'module updated successfully'
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    name:
                      - 'The name field is required.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      name:
                        type: array
                        example:
                          - 'The name field is required.'
                        items:
                          type: string
      tags:
        - Module
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The new name of the module.'
                  example: '"Updated Module"'
                  nullable: false
                settings:
                  type: mixed
                  description: 'optional Any additional settings for the module (ex. "foo", "bar").'
                  example: architecto
                  nullable: false
              required:
                - name
    delete:
      summary: 'Delete an existing module.'
      operationId: deleteAnExistingModule
      description: 'Deletes the specified module.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'module deleted successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'module deleted successfully'
                  refreshToken:
                    type: boolean
                    example: true
      tags:
        - Module
    parameters:
      -
        in: path
        name: module_id
        description: 'The ID of the module.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/module/{module_id}/category/{category_id}':
    post:
      summary: 'Add a category to a module.'
      operationId: addACategoryToAModule
      description: 'Adds the specified category to the module.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'category added to module successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'category added to module successfully'
                  refreshToken:
                    type: boolean
                    example: true
      tags:
        - Module
    delete:
      summary: 'Remove a category from a module.'
      operationId: removeACategoryFromAModule
      description: 'Removes the specified category from the module.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'category removed from module successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'category removed from module successfully'
                  refreshToken:
                    type: boolean
                    example: true
      tags:
        - Module
    parameters:
      -
        in: path
        name: module_id
        description: 'The ID of the module.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: category_id
        description: 'The ID of the category.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/object/{object}':
    get:
      summary: 'Get Module Object(s).'
      operationId: getModuleObjects
      description: 'Retrieves a single module object (with relations) or a paginated list of module objects. Supports filtering, sorting, and eager loading of relations.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"id\": 1,\n  \"name\": \"Object Name\",\n  \"module_category_id\": 2,\n  \"user_id\": 3,\n  \"objectAttributes\": {...},\n  \"contacts\": [...],\n  \"...other relations...\"\n}"
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: Unauthorized
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Unauthorized
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'object not found'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'object not found'
      tags:
        - ModuleObject
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                per_page:
                  type: integer
                  description: 'optional Number of results per page.'
                  example: 15
                  nullable: true
                page:
                  type: integer
                  description: 'optional Page number.'
                  example: 1
                  nullable: true
                group_id:
                  type: integer
                  description: 'optional Filter by group ID.'
                  example: 5
                  nullable: true
                with:
                  type: array
                  description: 'optional Relations to include. Allowed: objectAttributes,user,moduleCategory,objectGroups,moduleObjectWorkspaceInsurerProduct,contacts,policyList,insuranceAnnouncements,insuranceOffers.'
                  example:
                    - objectAttributes
                  items:
                    type: string
                    nullable: true
                paged:
                  type: boolean
                  description: 'optional Whether to paginate results.'
                  example: true
                  nullable: true
                shortresult:
                  type: boolean
                  description: 'optional If true, returns a short result without relations.'
                  example: false
                  nullable: true
                user_id:
                  type: string
                  description: 'The id the object should be created for.'
                  example: PB-0123
                  nullable: false
              required:
                - user_id
    parameters:
      -
        in: path
        name: object
        description: 'Optional parameter.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 44
  /api/object:
    post:
      summary: 'Create a new Module Object.'
      operationId: createANewModuleObject
      description: 'Creates a new module object and assigns the user as owner. Also creates contacts and attributes, triggers jobs and logs the creation.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'object created successfully'
                  data:
                    id: 1
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'object created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    name:
                      - 'The name field is required.'
                    category:
                      - 'The category field is required.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      name:
                        type: array
                        example:
                          - 'The name field is required.'
                        items:
                          type: string
                      category:
                        type: array
                        example:
                          - 'The category field is required.'
                        items:
                          type: string
      tags:
        - ModuleObject
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                display_id:
                  type: string
                  description: 'optional Display ID for the object.'
                  example: '"OBJ-123"'
                  nullable: true
                name:
                  type: string
                  description: 'The name of the object.'
                  example: '"My Building"'
                  nullable: false
                category:
                  type: integer
                  description: 'The module category ID.'
                  example: 2
                  nullable: false
                group_id:
                  type: integer
                  description: 'optional The group ID to assign the object to.'
                  example: 5
                  nullable: true
                contacts:
                  type: array
                  description: 'optional Array of contacts for the object.'
                  example:
                    -
                      type: owner
                      firstname: John
                      lastname: Doe
                  items:
                    type: string
                    nullable: true
              required:
                - name
                - category
  '/api/object/{object_id}':
    post:
      summary: 'Update an existing Module Object.'
      operationId: updateAnExistingModuleObject
      description: 'Updates the fields and contacts of an existing module object. Only provided fields will be updated.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'object updated successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'object updated successfully'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    category:
                      - 'The category field is invalid.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      category:
                        type: array
                        example:
                          - 'The category field is invalid.'
                        items:
                          type: string
      tags:
        - ModuleObject
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                display_id:
                  type: string
                  description: 'optional Display ID for the object.'
                  example: '"OBJ-123"'
                  nullable: true
                name:
                  type: string
                  description: 'optional The name of the object.'
                  example: '"Updated Building"'
                  nullable: true
                category:
                  type: integer
                  description: 'optional The module category ID.'
                  example: 2
                  nullable: false
                contacts:
                  type: array
                  description: 'optional Array of contacts for the object.'
                  example:
                    -
                      type: owner
                      firstname: Jane
                      lastname: Smith
                  items:
                    type: string
                    nullable: true
    delete:
      summary: 'Delete a Module Object.'
      operationId: deleteAModuleObject
      description: 'Deletes the specified module object.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'object deleted successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'object deleted successfully'
                  refreshToken:
                    type: boolean
                    example: true
      tags:
        - ModuleObject
    parameters:
      -
        in: path
        name: object_id
        description: 'The ID of the object.'
        example: 44
        required: true
        schema:
          type: integer
  '/api/object/{object_id}/sendZipEmail':
    post:
      summary: 'Send object zip link by email.'
      operationId: sendObjectZipLinkByEmail
      description: 'Queues a job to send a document package for the module object to the specified email address.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'object document package queued successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'object document package queued successfully'
                  refreshToken:
                    type: boolean
                    example: true
      tags:
        - ModuleObject
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                files:
                  type: array
                  description: 'optional Array of file IDs to include.'
                  example:
                    - 1
                    - 2
                    - 3
                  items:
                    type: string
                email:
                  type: string
                  description: 'optional Email address to send the package to.'
                  example: '"john.doe@example.com"'
                  nullable: true
    parameters:
      -
        in: path
        name: object_id
        description: 'The ID of the object.'
        example: 44
        required: true
        schema:
          type: integer
  '/api/object/{object_id}/workspaceinsurerproduct/{workspaceinsurerproduct_id}':
    post:
      summary: 'Add a WorkspaceInsurerProduct to a ModuleObject.'
      operationId: addAWorkspaceInsurerProductToAModuleObject
      description: 'Assigns the specified workspace insurer product to the given module object. If the product is already assigned, returns an error.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'workspace insurer product already in module object'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'workspace insurer product already in module object'
                  refreshToken:
                    type: boolean
                    example: true
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'workspace insurer product assigned to module object'
                  data:
                    id: 1
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'workspace insurer product assigned to module object'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                  refreshToken:
                    type: boolean
                    example: true
      tags:
        - ModuleObject
    delete:
      summary: 'Remove a WorkspaceInsurerProduct from a ModuleObject.'
      operationId: removeAWorkspaceInsurerProductFromAModuleObject
      description: 'Removes the specified workspace insurer product from the given module object. If the product is not assigned, returns an error.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      success: true
                      message: 'workspace insurer product removed from module object'
                      refreshToken: true
                    properties:
                      success:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'workspace insurer product removed from module object'
                      refreshToken:
                        type: boolean
                        example: true
                  -
                    description: ''
                    type: object
                    example:
                      success: false
                      message: 'workspace insurer product is not assigned to module object'
                      refreshToken: true
                    properties:
                      success:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'workspace insurer product is not assigned to module object'
                      refreshToken:
                        type: boolean
                        example: true
      tags:
        - ModuleObject
    parameters:
      -
        in: path
        name: object_id
        description: 'The ID of the object.'
        example: 44
        required: true
        schema:
          type: integer
      -
        in: path
        name: workspaceinsurerproduct_id
        description: 'The ID of the workspaceinsurerproduct.'
        example: 2
        required: true
        schema:
          type: integer
  '/api/object/{object_id}/contact/{contact}':
    get:
      summary: 'Get all module object contacts for a module object or a module object contact by id.'
      operationId: getAllModuleObjectContactsForAModuleObjectOrAModuleObjectContactById
      description: "Retrieves either a single module object contact (with relations) or a paginated list of contacts for the given module object.\nSupports filtering, sorting, and eager loading of relations."
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"id\": 1,\n  \"module_object_id\": 2,\n  \"name\": \"title\",\n  \"type\": \"string\",\n  \"value_string\": \"Contact Title\",\n  \"object\": {...},\n  \"parentContact\": {...},\n  \"childContacts\": [...]\n}"
      tags:
        - ModuleObject
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                per_page:
                  type: integer
                  description: 'optional Number of results per page.'
                  example: 15
                  nullable: true
                page:
                  type: integer
                  description: 'optional Page number.'
                  example: 1
                  nullable: true
                with:
                  type: array
                  description: 'optional Relations to include. Allowed: object,parentContact,childContacts.'
                  example:
                    - object
                  items:
                    type: string
                    nullable: true
                paged:
                  type: boolean
                  description: 'optional Whether to paginate results.'
                  example: true
                  nullable: true
                shortresult:
                  type: boolean
                  description: 'optional If true, returns a short result without relations.'
                  example: false
                  nullable: true
    parameters:
      -
        in: path
        name: object_id
        description: 'The ID of the object.'
        example: 44
        required: true
        schema:
          type: integer
      -
        in: path
        name: contact
        description: 'Optional parameter.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 70
  '/api/object/{object_id}/contact':
    post:
      summary: 'Add a module object contact to a module object.'
      operationId: addAModuleObjectContactToAModuleObject
      description: 'Creates a new contact for the given module object. Additional contacts can be added as child contacts.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'module object contact created successfully'
                  data:
                    id: 1
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'module object contact created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    title:
                      - 'The title field is required.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      title:
                        type: array
                        example:
                          - 'The title field is required.'
                        items:
                          type: string
      tags:
        - ModuleObject
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: 'The title of the contact.'
                  example: '"Project Manager"'
                  nullable: false
                contacts:
                  type: array
                  description: 'optional Additional contacts as key-value pairs.'
                  example: null
                  items:
                    type: string
                    nullable: true
              required:
                - title
    parameters:
      -
        in: path
        name: object_id
        description: 'The ID of the object.'
        example: 44
        required: true
        schema:
          type: integer
  '/api/object/{object_id}/contact/{contact_id}':
    post:
      summary: 'Update an existing module object contact.'
      operationId: updateAnExistingModuleObjectContact
      description: 'Updates the title and/or child contacts of an existing module object contact.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'module object contact updated successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'module object contact updated successfully'
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    title:
                      - 'The title field must be a string.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      title:
                        type: array
                        example:
                          - 'The title field must be a string.'
                        items:
                          type: string
      tags:
        - ModuleObject
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: 'optional The new title of the contact.'
                  example: '"Senior Manager"'
                  nullable: true
                contacts:
                  type: array
                  description: 'optional Updated contacts as key-value pairs.'
                  example: null
                  items:
                    type: string
                    nullable: true
    delete:
      summary: 'Remove a module object contact from a module object.'
      operationId: removeAModuleObjectContactFromAModuleObject
      description: 'Deletes the specified contact from the module object.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'module object contact deleted successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'module object contact deleted successfully'
                  refreshToken:
                    type: boolean
                    example: true
      tags:
        - ModuleObject
    parameters:
      -
        in: path
        name: object_id
        description: 'The ID of the object.'
        example: 44
        required: true
        schema:
          type: integer
      -
        in: path
        name: contact_id
        description: 'The ID of the contact.'
        example: 70
        required: true
        schema:
          type: integer
  '/api/object/{moduleobject_id}/file/{file}':
    get:
      summary: 'Get ModuleObject files.'
      operationId: getModuleObjectFiles
      description: "Retrieves a single module object file (with relations) or a paginated list of files for the given module object.\nSupports filtering and pagination."
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"id\": 1,\n  \"module_object_id\": 2,\n  \"file_id\": 3,\n  \"type\": \"document\",\n  \"moduleObject\": {...}\n}"
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: Unauthorized
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Unauthorized
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'file not found'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'file not found'
      tags:
        - ModuleObject
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                per_page:
                  type: integer
                  description: 'optional Number of results per page.'
                  example: 15
                  nullable: false
                page:
                  type: integer
                  description: 'optional Page number.'
                  example: 1
                  nullable: false
    parameters:
      -
        in: path
        name: moduleobject_id
        description: 'The ID of the moduleobject.'
        example: 44
        required: true
        schema:
          type: integer
      -
        in: path
        name: file
        description: 'Optional parameter.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 16
  '/api/object/{moduleobject_id}/file':
    post:
      summary: 'Create a ModuleObject file.'
      operationId: createAModuleObjectFile
      description: 'Creates a new file for the given module object. Requires file ID and type.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'module object file created successfully'
                  data:
                    id: 1
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'module object file created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    file_id:
                      - 'The file_id field is required.'
                    type:
                      - 'The type field is required.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      file_id:
                        type: array
                        example:
                          - 'The file_id field is required.'
                        items:
                          type: string
                      type:
                        type: array
                        example:
                          - 'The type field is required.'
                        items:
                          type: string
      tags:
        - ModuleObject
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                file_id:
                  type: integer
                  description: 'The file ID to associate.'
                  example: 3
                  nullable: false
                type:
                  type: string
                  description: 'The type of the file.'
                  example: '"document"'
                  nullable: false
              required:
                - file_id
                - type
    parameters:
      -
        in: path
        name: moduleobject_id
        description: 'The ID of the moduleobject.'
        example: 44
        required: true
        schema:
          type: integer
  '/api/object/{moduleobject_id}/file/{file_id}':
    post:
      summary: 'Edit a ModuleObject file.'
      operationId: editAModuleObjectFile
      description: 'Updates the file ID and/or type of an existing module object file.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'module object file updated successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'module object file updated successfully'
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    file_id:
                      - 'The file_id field is invalid.'
                    type:
                      - 'The type field must be a string.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      file_id:
                        type: array
                        example:
                          - 'The file_id field is invalid.'
                        items:
                          type: string
                      type:
                        type: array
                        example:
                          - 'The type field must be a string.'
                        items:
                          type: string
      tags:
        - ModuleObject
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                file_id:
                  type: integer
                  description: 'optional The new file ID to associate.'
                  example: 4
                  nullable: true
                type:
                  type: string
                  description: 'optional The new type of the file.'
                  example: '"image"'
                  nullable: true
    delete:
      summary: 'Remove a ModuleObject file.'
      operationId: removeAModuleObjectFile
      description: 'Deletes the specified file from the module object.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'module object file deleted successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'module object file deleted successfully'
                  refreshToken:
                    type: boolean
                    example: true
      tags:
        - ModuleObject
    parameters:
      -
        in: path
        name: moduleobject_id
        description: 'The ID of the moduleobject.'
        example: 44
        required: true
        schema:
          type: integer
      -
        in: path
        name: file_id
        description: 'The ID of the file.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/module/{module_id}/product/{product}':
    get:
      summary: 'Get Module Product(s).'
      operationId: getModuleProducts
      description: "Retrieves a single module product (with relations) or a paginated list of module products for the given module.\nSupports filtering, sorting, and eager loading of relations."
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"id\": 1,\n  \"name\": \"Product Name\",\n  \"insure_what\": \"Building\",\n  \"parent_id\": null,\n  \"productItems\": [...],\n  \"childProducts\": [...],\n  \"modules\": [...]\n}"
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: Unauthorized
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Unauthorized
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'product not found'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'product not found'
      tags:
        - ModuleProduct
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                per_page:
                  type: integer
                  description: 'optional Number of results per page.'
                  example: 15
                  nullable: true
                page:
                  type: integer
                  description: 'optional Page number.'
                  example: 1
                  nullable: true
                with:
                  type: array
                  description: 'optional Relations to include. Allowed: productItems,childProducts,modules.'
                  example:
                    - productItems
                  items:
                    type: string
                    nullable: true
                paged:
                  type: boolean
                  description: 'optional Whether to paginate results.'
                  example: true
                  nullable: true
                shortresult:
                  type: boolean
                  description: 'optional If true, returns a short result without relations.'
                  example: false
                  nullable: true
    parameters:
      -
        in: path
        name: module_id
        description: 'The ID of the module.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: product
        description: 'Optional parameter.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  '/api/module/{module_id}/product':
    post:
      summary: 'Create a Module Product.'
      operationId: createAModuleProduct
      description: 'Creates a new module product for the given module. Requires name and insure_what fields. Optionally, a parent product can be specified.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'module product created successfully'
                  data:
                    id: 1
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'module product created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    name:
                      - 'The name field is required.'
                    insure_what:
                      - 'The insure_what field is required.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      name:
                        type: array
                        example:
                          - 'The name field is required.'
                        items:
                          type: string
                      insure_what:
                        type: array
                        example:
                          - 'The insure_what field is required.'
                        items:
                          type: string
      tags:
        - ModuleProduct
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The name of the module product.'
                  example: '"Fire Insurance"'
                  nullable: false
                insure_what:
                  type: string
                  description: 'The insured object/type.'
                  example: '"Building"'
                  nullable: false
                parent_id:
                  type: integer
                  description: 'optional The parent module product ID.'
                  example: 2
                  nullable: true
              required:
                - name
                - insure_what
    parameters:
      -
        in: path
        name: module_id
        description: 'The ID of the module.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/module/{module_id}/product/{product_id}/copy':
    post:
      summary: 'Copy a Module Product to an Insurer Product.'
      operationId: copyAModuleProductToAnInsurerProduct
      description: 'Creates a new insurer product in the specified workspace by duplicating the given module product.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'insurer product created successfully'
                  data:
                    id: 10
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'insurer product created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 10
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    workspace_id:
                      - 'The workspace_id field is required.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      workspace_id:
                        type: array
                        example:
                          - 'The workspace_id field is required.'
                        items:
                          type: string
      tags:
        - ModuleProduct
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace_id:
                  type: integer
                  description: 'The workspace ID where the insurer product will be created.'
                  example: 1
                  nullable: false
              required:
                - workspace_id
    parameters:
      -
        in: path
        name: module_id
        description: 'The ID of the module.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: product_id
        description: 'The ID of the product.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/module/{module_id}/product/{product_id}/add':
    post:
      summary: 'Add a Module Product to a Module.'
      operationId: addAModuleProductToAModule
      description: 'Assigns the specified module product to the given module. If already assigned, does nothing.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'module product added to module successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'module product added to module successfully'
                  refreshToken:
                    type: boolean
                    example: true
      tags:
        - ModuleProduct
    parameters:
      -
        in: path
        name: module_id
        description: 'The ID of the module.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: product_id
        description: 'The ID of the product.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/module/{module_id}/product/{product_id}/remove':
    post:
      summary: 'Remove a Module Product from a Module.'
      operationId: removeAModuleProductFromAModule
      description: 'Removes the specified module product from the given module.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'module product removed from module successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'module product removed from module successfully'
                  refreshToken:
                    type: boolean
                    example: true
      tags:
        - ModuleProduct
    parameters:
      -
        in: path
        name: module_id
        description: 'The ID of the module.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: product_id
        description: 'The ID of the product.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/module/{module_id}/product/{product_id}':
    post:
      summary: 'Edit a Module Product.'
      operationId: editAModuleProduct
      description: 'Updates the fields of an existing module product. Only provided fields will be updated.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'module product edited successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'module product edited successfully'
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    parent_id:
                      - 'The parent_id field is invalid.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      parent_id:
                        type: array
                        example:
                          - 'The parent_id field is invalid.'
                        items:
                          type: string
      tags:
        - ModuleProduct
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'optional The new name of the module product.'
                  example: '"Updated Insurance"'
                  nullable: true
                insure_what:
                  type: string
                  description: 'optional The new insured object/type.'
                  example: '"Updated Building"'
                  nullable: true
                parent_id:
                  type: integer
                  description: 'optional The new parent module product ID.'
                  example: 3
                  nullable: true
    delete:
      summary: 'Remove a Module Product.'
      operationId: removeAModuleProduct
      description: 'Deletes the specified module product from the module.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'module product deleted successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'module product deleted successfully'
                  refreshToken:
                    type: boolean
                    example: true
      tags:
        - ModuleProduct
    parameters:
      -
        in: path
        name: module_id
        description: 'The ID of the module.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: product_id
        description: 'The ID of the product.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/module/{module_id}/product/{product_id}/item/{item}':
    get:
      summary: 'Get Module Product Item(s).'
      operationId: getModuleProductItems
      description: "Retrieves a single module product item (with relations) or a list of items for the given module product.\nSupports filtering and sorting."
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"id\": 1,\n  \"module_product_id\": 2,\n  \"name\": \"Item Name\",\n  \"info\": \"Description\",\n  \"type\": \"string\",\n  \"moduleProduct\": {...}\n}"
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: Unauthorized
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Unauthorized
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'item not found'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'item not found'
      tags:
        - ModuleProduct
    parameters:
      -
        in: path
        name: module_id
        description: 'The ID of the module.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: product_id
        description: 'The ID of the product.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: item
        description: 'Optional parameter.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  '/api/module/{module_id}/product/{product_id}/item':
    post:
      summary: 'Create a Module Product Item.'
      operationId: createAModuleProductItem
      description: "Creates a new item for the given module product. Requires name, optional info and type.\nAdditional attributes can be provided and will be stored."
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'module product item created successfully'
                  data:
                    id: 1
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'module product item created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    name:
                      - 'The name field is required.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      name:
                        type: array
                        example:
                          - 'The name field is required.'
                        items:
                          type: string
      tags:
        - ModuleProduct
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The name of the product item.'
                  example: '"Fire Protection"'
                  nullable: false
                info:
                  type: string
                  description: 'optional Additional information about the item.'
                  example: '"Includes fire alarm system"'
                  nullable: true
                type:
                  type: string
                  description: 'optional The type of the item.'
                  example: '"safety"'
                  nullable: true
                attributes:
                  type: mixed
                  description: 'optional Any additional attributes for the item (ex. "foo", "bar").'
                  example: architecto
                  nullable: false
              required:
                - name
    parameters:
      -
        in: path
        name: module_id
        description: 'The ID of the module.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: product_id
        description: 'The ID of the product.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/module/{module_id}/product/{product_id}/item/{item_id}':
    post:
      summary: 'Edit a Module Product Item.'
      operationId: editAModuleProductItem
      description: "Updates the fields of an existing module product item. Only provided fields will be updated.\nAdditional attributes can be provided and will be stored."
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'module product item updated successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'module product item updated successfully'
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    name:
                      - 'The name field must be a string.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      name:
                        type: array
                        example:
                          - 'The name field must be a string.'
                        items:
                          type: string
      tags:
        - ModuleProduct
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'optional The new name of the product item.'
                  example: '"Updated Protection"'
                  nullable: true
                info:
                  type: string
                  description: 'optional Updated information about the item.'
                  example: '"Now includes smoke detectors"'
                  nullable: true
                type:
                  type: string
                  description: 'optional The new type of the item.'
                  example: '"security"'
                  nullable: true
                attributes:
                  type: mixed
                  description: 'optional Any additional attributes for the item (ex. "foo", "bar").'
                  example: architecto
                  nullable: false
    delete:
      summary: 'Remove a Module Product Item.'
      operationId: removeAModuleProductItem
      description: 'Deletes the specified module product item.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'module product item deleted successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'module product item deleted successfully'
                  refreshToken:
                    type: boolean
                    example: true
      tags:
        - ModuleProduct
    parameters:
      -
        in: path
        name: module_id
        description: 'The ID of the module.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: product_id
        description: 'The ID of the product.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: item_id
        description: 'The ID of the item.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/product/{product}':
    get:
      summary: 'Get Module Product(s).'
      operationId: getModuleProducts
      description: "Retrieves a single module product (with relations) or a paginated list of module products.\nSupports filtering, sorting, and eager loading of relations."
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"id\": 1,\n  \"name\": \"Product Name\",\n  \"insure_what\": \"Building\",\n  \"parent_id\": null,\n  \"productItems\": [...],\n  \"childProducts\": [...],\n  \"modules\": [...]\n}"
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: Unauthorized
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Unauthorized
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'product not found'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'product not found'
      tags:
        - ModuleProduct
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                per_page:
                  type: integer
                  description: 'optional Number of results per page.'
                  example: 15
                  nullable: true
                page:
                  type: integer
                  description: 'optional Page number.'
                  example: 1
                  nullable: true
                with:
                  type: array
                  description: 'optional Relations to include. Allowed: productItems,childProducts,modules.'
                  example:
                    - productItems
                  items:
                    type: string
                    nullable: true
                paged:
                  type: boolean
                  description: 'optional Whether to paginate results.'
                  example: true
                  nullable: true
                shortresult:
                  type: boolean
                  description: 'optional If true, returns a short result without relations.'
                  example: false
                  nullable: true
    parameters:
      -
        in: path
        name: product
        description: 'Optional parameter.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/product:
    post:
      summary: 'Create a Module Product.'
      operationId: createAModuleProduct
      description: 'Creates a new module product. Requires name and insure_what fields. Optionally, a parent product can be specified.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'module product created successfully'
                  data:
                    id: 1
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'module product created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    name:
                      - 'The name field is required.'
                    insure_what:
                      - 'The insure_what field is required.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      name:
                        type: array
                        example:
                          - 'The name field is required.'
                        items:
                          type: string
                      insure_what:
                        type: array
                        example:
                          - 'The insure_what field is required.'
                        items:
                          type: string
      tags:
        - ModuleProduct
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The name of the module product.'
                  example: '"Fire Insurance"'
                  nullable: false
                insure_what:
                  type: string
                  description: 'The insured object/type.'
                  example: '"Building"'
                  nullable: false
                parent_id:
                  type: integer
                  description: 'optional The parent module product ID.'
                  example: 2
                  nullable: true
              required:
                - name
                - insure_what
  '/api/product/{product_id}':
    post:
      summary: 'Edit a Module Product.'
      operationId: editAModuleProduct
      description: 'Updates the fields of an existing module product. Only provided fields will be updated.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'product edited successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'product edited successfully'
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    parent_id:
                      - 'The parent_id field is invalid.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      parent_id:
                        type: array
                        example:
                          - 'The parent_id field is invalid.'
                        items:
                          type: string
      tags:
        - ModuleProduct
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'optional The new name of the module product.'
                  example: '"Updated Insurance"'
                  nullable: true
                insure_what:
                  type: string
                  description: 'optional The new insured object/type.'
                  example: '"Updated Building"'
                  nullable: true
                parent_id:
                  type: integer
                  description: 'optional The new parent module product ID.'
                  example: 3
                  nullable: true
    delete:
      summary: 'Delete a Module Product.'
      operationId: deleteAModuleProduct
      description: 'Deletes the specified module product.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'product deleted successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'product deleted successfully'
                  refreshToken:
                    type: boolean
                    example: true
      tags:
        - ModuleProduct
    parameters:
      -
        in: path
        name: product_id
        description: 'The ID of the product.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/product/{product_id}/item/{item}':
    get:
      summary: 'Get Module Product Item(s).'
      operationId: getModuleProductItems
      description: "Retrieves a single module product item (with relations) or a list of items for the given module product.\nSupports filtering and sorting."
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"id\": 1,\n  \"module_product_id\": 2,\n  \"name\": \"Item Name\",\n  \"info\": \"Description\",\n  \"type\": \"string\",\n  \"moduleProduct\": {...}\n}"
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: Unauthorized
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Unauthorized
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'item not found'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'item not found'
      tags:
        - ModuleProduct
    parameters:
      -
        in: path
        name: product_id
        description: 'The ID of the product.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: item
        description: 'Optional parameter.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  '/api/product/{product_id}/item':
    post:
      summary: 'Create a Module Product Item.'
      operationId: createAModuleProductItem
      description: "Creates a new item for the given module product. Requires name, optional info and type.\nAdditional attributes can be provided and will be stored."
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'module product item created successfully'
                  data:
                    id: 1
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'module product item created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    name:
                      - 'The name field is required.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      name:
                        type: array
                        example:
                          - 'The name field is required.'
                        items:
                          type: string
      tags:
        - ModuleProduct
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The name of the product item.'
                  example: '"Fire Protection"'
                  nullable: false
                info:
                  type: string
                  description: 'optional Additional information about the item.'
                  example: '"Includes fire alarm system"'
                  nullable: true
                type:
                  type: string
                  description: 'optional The type of the item.'
                  example: '"safety"'
                  nullable: true
                attributes:
                  type: mixed
                  description: 'optional Any additional attributes for the item (ex. "foo", "bar").'
                  example: architecto
                  nullable: false
              required:
                - name
    parameters:
      -
        in: path
        name: product_id
        description: 'The ID of the product.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/product/{product_id}/item/{item_id}':
    post:
      summary: 'Edit a Module Product Item.'
      operationId: editAModuleProductItem
      description: "Updates the fields of an existing module product item. Only provided fields will be updated.\nAdditional attributes can be provided and will be stored."
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'module product item updated successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'module product item updated successfully'
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    name:
                      - 'The name field must be a string.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      name:
                        type: array
                        example:
                          - 'The name field must be a string.'
                        items:
                          type: string
      tags:
        - ModuleProduct
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'optional The new name of the product item.'
                  example: '"Updated Protection"'
                  nullable: true
                info:
                  type: string
                  description: 'optional Updated information about the item.'
                  example: '"Now includes smoke detectors"'
                  nullable: true
                type:
                  type: string
                  description: 'optional The new type of the item.'
                  example: '"security"'
                  nullable: true
                attributes:
                  type: mixed
                  description: 'optional Any additional attributes for the item (ex. "foo", "bar").'
                  example: architecto
                  nullable: false
    delete:
      summary: 'Remove a Module Product Item.'
      operationId: removeAModuleProductItem
      description: 'Deletes the specified module product item.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'module product item deleted successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'module product item deleted successfully'
                  refreshToken:
                    type: boolean
                    example: true
      tags:
        - ModuleProduct
    parameters:
      -
        in: path
        name: product_id
        description: 'The ID of the product.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: item_id
        description: 'The ID of the item.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/module/{module_id}/workspace/{workspace_id}':
    post:
      summary: 'Link a module to a workspace.'
      operationId: linkAModuleToAWorkspace
      description: 'Assigns the specified module to the given workspace. If the module is already assigned, returns an error.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'module already assigned to workspace'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'module already assigned to workspace'
                  refreshToken:
                    type: boolean
                    example: true
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'module has been assigned to workspace'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'module has been assigned to workspace'
                  refreshToken:
                    type: boolean
                    example: true
      tags:
        - ModuleWorkspaces
    delete:
      summary: 'Unlink a module from a workspace.'
      operationId: unlinkAModuleFromAWorkspace
      description: 'Removes the specified module from the given workspace. If the module is not assigned, returns an error.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      success: true
                      message: 'module has been removed from workspace'
                      refreshToken: true
                    properties:
                      success:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'module has been removed from workspace'
                      refreshToken:
                        type: boolean
                        example: true
                  -
                    description: ''
                    type: object
                    example:
                      success: false
                      message: 'module is not assigned to workspace'
                      refreshToken: true
                    properties:
                      success:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'module is not assigned to workspace'
                      refreshToken:
                        type: boolean
                        example: true
      tags:
        - ModuleWorkspaces
    parameters:
      -
        in: path
        name: module_id
        description: 'The ID of the module.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: workspace_id
        description: 'The ID of the workspace.'
        example: 2
        required: true
        schema:
          type: integer
  '/api/module/{module_id}/workspace/{workspace_id}/settings':
    get:
      summary: 'Get module workspace settings.'
      operationId: getModuleWorkspaceSettings
      description: 'Retrieves the settings for the specified module and workspace combination.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"settings\": {...}\n}"
      tags:
        - ModuleWorkspaces
    post:
      summary: 'Save module workspace settings.'
      operationId: saveModuleWorkspaceSettings
      description: 'Updates the settings for the specified module and workspace combination.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      success: true
                      message: 'module settings updated successfully'
                      refreshToken: true
                    properties:
                      success:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'module settings updated successfully'
                      refreshToken:
                        type: boolean
                        example: true
                  -
                    description: ''
                    type: object
                    example:
                      success: false
                      message: 'module is not assigned to workspace'
                      refreshToken: true
                    properties:
                      success:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'module is not assigned to workspace'
                      refreshToken:
                        type: boolean
                        example: true
      tags:
        - ModuleWorkspaces
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                settings:
                  type: mixed
                  description: 'The settings to update for the module workspace.'
                  example: architecto
                  nullable: false
              required:
                - settings
    parameters:
      -
        in: path
        name: module_id
        description: 'The ID of the module.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: workspace_id
        description: 'The ID of the workspace.'
        example: 2
        required: true
        schema:
          type: integer
  '/api/policy/{policy}':
    get:
      summary: 'Get Policy or Policies.'
      operationId: getPolicyOrPolicies
      description: "Retrieves a single policy (with relations) or a paginated list of policies. Supports filtering, sorting, and eager loading of relations.\nPolicies are visible to policy creators, object users, insurer admins, and broker admins."
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"id\": 1,\n  \"module_object_workspace_insurer_product_id\": 2,\n  \"user_id\": 3,\n  \"parent_id\": null,\n  \"policyAttributes\": {...},\n  \"products\": [...],\n  \"offers\": [...],\n  \"journals\": [...],\n  \"files\": [...],\n  \"...other relations...\"\n}"
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: Unauthorized
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Unauthorized
      tags:
        - Policy
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                per_page:
                  type: integer
                  description: 'optional Number of results per page.'
                  example: 15
                  nullable: true
                page:
                  type: integer
                  description: 'optional Page number.'
                  example: 1
                  nullable: true
                group_id:
                  type: integer
                  description: 'optional Filter by group ID.'
                  example: 5
                  nullable: true
                with:
                  type: array
                  description: 'optional Relations to include. Allowed: moduleObjectWorkspaceInsurerProduct,user,policyAttributes,parentPolicy,childPolicies,offers,products,journals,files.'
                  example:
                    - user
                  items:
                    type: string
                    nullable: true
                paged:
                  type: boolean
                  description: 'optional Whether to paginate results.'
                  example: true
                  nullable: true
                shortresult:
                  type: boolean
                  description: 'optional If true, returns a short result without relations.'
                  example: false
                  nullable: true
    parameters:
      -
        in: path
        name: policy
        description: 'Optional parameter.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 28
  /api/policy:
    post:
      summary: 'Create a Policy.'
      operationId: createAPolicy
      description: "Creates a new policy for a module object workspace insurer product. If IDs are not provided, related objects are created or fetched.\nAlso creates policy products and fills attributes."
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'policy created successfully'
                  data:
                    id: 1
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'policy created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    module_object_workspace_insurer_product_id:
                      - 'The module_object_workspace_insurer_product_id field is required.'
                    module_object_id:
                      - 'The module_object_id field is required.'
                    workspace_id:
                      - 'The workspace_id field is required.'
                    insurer_product_id:
                      - 'The insurer_product_id field is required.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      module_object_workspace_insurer_product_id:
                        type: array
                        example:
                          - 'The module_object_workspace_insurer_product_id field is required.'
                        items:
                          type: string
                      module_object_id:
                        type: array
                        example:
                          - 'The module_object_id field is required.'
                        items:
                          type: string
                      workspace_id:
                        type: array
                        example:
                          - 'The workspace_id field is required.'
                        items:
                          type: string
                      insurer_product_id:
                        type: array
                        example:
                          - 'The insurer_product_id field is required.'
                        items:
                          type: string
      tags:
        - Policy
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                module_object_workspace_insurer_product_id:
                  type: integer
                  description: 'required_without_all:module_object_id,workspace_id,insurer_product_id,module_product_ids The ID of the module object workspace insurer product.'
                  example: 2
                  nullable: false
                module_object_id:
                  type: integer
                  description: 'required_without:module_object_workspace_insurer_product_id The ID of the module object.'
                  example: 5
                  nullable: false
                workspace_id:
                  type: integer
                  description: 'required_without:module_object_workspace_insurer_product_id The workspace ID.'
                  example: 1
                  nullable: false
                insurer_product_id:
                  type: integer
                  description: 'required_without_all:module_object_workspace_insurer_product_id,module_product_ids The insurer product ID.'
                  example: 7
                  nullable: false
                module_product_ids:
                  type: array
                  description: 'required_without_all:module_object_workspace_insurer_product_id,module_object_id,workspace_id,insurer_product_id Array of module product IDs.'
                  example:
                    - 3
                    - 4
                  items:
                    type: string
                parent_id:
                  type: integer
                  description: 'optional The parent policy ID.'
                  example: 10
                  nullable: true
                policy_products:
                  type: array
                  description: 'optional Array of policy products to create.'
                  example:
                    -
                      insurer_product_item_id: 1
                      name: Coverage
                      value: '10000'
                  items:
                    type: string
                attributes:
                  type: mixed
                  description: 'optional Any additional attributes for the policy (ex. "foo", "bar").'
                  example: architecto
                  nullable: false
  '/api/policy/{policy_id}':
    post:
      summary: 'Update a Policy.'
      operationId: updateAPolicy
      description: 'Updates the module object workspace insurer product and attributes of an existing policy.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'policy updated successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'policy updated successfully'
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    module_object_workspace_insurer_product_id:
                      - 'The module_object_workspace_insurer_product_id field is invalid.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      module_object_workspace_insurer_product_id:
                        type: array
                        example:
                          - 'The module_object_workspace_insurer_product_id field is invalid.'
                        items:
                          type: string
      tags:
        - Policy
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                module_object_workspace_insurer_product_id:
                  type: integer
                  description: 'optional The new module object workspace insurer product ID.'
                  example: 2
                  nullable: true
                attributes:
                  type: mixed
                  description: 'optional Any additional attributes for the policy (ex. "foo", "bar").'
                  example: architecto
                  nullable: false
    delete:
      summary: 'Delete a Policy.'
      operationId: deleteAPolicy
      description: 'Deletes the specified policy.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'policy deleted successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'policy deleted successfully'
                  refreshToken:
                    type: boolean
                    example: true
      tags:
        - Policy
    parameters:
      -
        in: path
        name: policy_id
        description: 'The ID of the policy.'
        example: 28
        required: true
        schema:
          type: integer
  '/api/policy/{policy_id}/file/{file}':
    get:
      summary: 'Get Policy File(s).'
      operationId: getPolicyFiles
      description: "Retrieves a single policy file (with relations) or a list of files for the given policy.\nSupports eager loading of related policy, file, and insurer AVB."
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"id\": 1,\n  \"policy_id\": 2,\n  \"file_id\": 3,\n  \"type\": \"document\",\n  \"invoice_paid\": true,\n  \"send_notification\": false,\n  \"employee_id\": 4,\n  \"individual_email\": \"john.doe@example.com\",\n  \"policy\": {...},\n  \"file\": {...},\n  \"insurerAvb\": {...}\n}"
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: Unauthorized
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Unauthorized
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'file not found'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'file not found'
      tags:
        - Policy
    parameters:
      -
        in: path
        name: policy_id
        description: 'The ID of the policy.'
        example: 28
        required: true
        schema:
          type: integer
      -
        in: path
        name: file
        description: 'Optional parameter.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 24
  '/api/policy/{policy_id}/file':
    post:
      summary: 'Create a Policy File.'
      operationId: createAPolicyFile
      description: 'Creates a new file for the given policy. Requires file ID and type. Optionally, invoice paid status, notification settings, employee, and individual email can be provided.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'policy file created successfully'
                  data:
                    id: 1
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'policy file created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    file_id:
                      - 'The file_id field is required.'
                    type:
                      - 'The type field is required.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      file_id:
                        type: array
                        example:
                          - 'The file_id field is required.'
                        items:
                          type: string
                      type:
                        type: array
                        example:
                          - 'The type field is required.'
                        items:
                          type: string
      tags:
        - Policy
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                file_id:
                  type: integer
                  description: 'The file ID to associate.'
                  example: 3
                  nullable: false
                insurer_avb_id:
                  type: integer
                  description: 'optional The insurer AVB ID to associate.'
                  example: 5
                  nullable: true
                type:
                  type: string
                  description: 'The type of the file.'
                  example: '"document"'
                  nullable: false
                invoice_paid:
                  type: boolean
                  description: 'optional Whether the invoice is paid.'
                  example: true
                  nullable: true
                send_notification:
                  type: boolean
                  description: 'optional Whether to send notification to policyholder.'
                  example: false
                  nullable: true
                employee_id:
                  type: integer
                  description: 'optional The employee ID to notify.'
                  example: 4
                  nullable: true
                individual_email:
                  type: string
                  description: 'optional Individual email to notify.'
                  example: '"john.doe@example.com"'
                  nullable: true
              required:
                - file_id
                - type
    parameters:
      -
        in: path
        name: policy_id
        description: 'The ID of the policy.'
        example: 28
        required: true
        schema:
          type: integer
  '/api/policy/{policy_id}/file/{file_id}':
    post:
      summary: 'Edit a Policy File.'
      operationId: editAPolicyFile
      description: 'Updates the file ID, insurer AVB ID, type, or invoice paid status of an existing policy file.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'policy file updated successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'policy file updated successfully'
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    file_id:
                      - 'The file_id field is invalid.'
                    type:
                      - 'The type field must be a string.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      file_id:
                        type: array
                        example:
                          - 'The file_id field is invalid.'
                        items:
                          type: string
                      type:
                        type: array
                        example:
                          - 'The type field must be a string.'
                        items:
                          type: string
      tags:
        - Policy
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                file_id:
                  type: integer
                  description: 'optional The new file ID to associate.'
                  example: 4
                  nullable: true
                insurer_avb_id:
                  type: integer
                  description: 'optional The new insurer AVB ID to associate.'
                  example: 6
                  nullable: true
                type:
                  type: string
                  description: 'optional The new type of the file.'
                  example: '"image"'
                  nullable: true
                invoice_paid:
                  type: boolean
                  description: 'optional Whether the invoice is paid.'
                  example: false
                  nullable: true
    delete:
      summary: 'Remove a Policy File.'
      operationId: removeAPolicyFile
      description: 'Deletes the specified file from the policy.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'policy file deleted successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'policy file deleted successfully'
                  refreshToken:
                    type: boolean
                    example: true
      tags:
        - Policy
    parameters:
      -
        in: path
        name: policy_id
        description: 'The ID of the policy.'
        example: 28
        required: true
        schema:
          type: integer
      -
        in: path
        name: file_id
        description: 'The ID of the file.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/policy/{policy_id}/product/{product}':
    get:
      summary: 'Get Policy Product(s).'
      operationId: getPolicyProducts
      description: "Retrieves a single policy product (with relations) or a list of products for the given policy.\nSupports eager loading of related policy and insurer product item."
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"id\": 1,\n  \"policy_id\": 2,\n  \"insurer_product_item_id\": 3,\n  \"name\": \"Coverage\",\n  \"value\": \"10000\",\n  \"info\": \"Details\",\n  \"excess\": 500,\n  \"approved\": true,\n  \"policy\": {...},\n  \"insurerProductItem\": {...}\n}"
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: Unauthorized
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Unauthorized
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'product not found'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'product not found'
      tags:
        - Policy
    parameters:
      -
        in: path
        name: policy_id
        description: 'The ID of the policy.'
        example: 28
        required: true
        schema:
          type: integer
      -
        in: path
        name: product
        description: 'Optional parameter.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 184
  '/api/policy/{policy_id}/product':
    post:
      summary: 'Create a Policy Product.'
      operationId: createAPolicyProduct
      description: "Creates a new product for the given policy. Requires name, optionally links to insurer product item or module product item.\nAdditional fields like value, info, excess, and approved can be provided."
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'policy product created successfully'
                  data:
                    id: 1
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'policy product created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    name:
                      - 'The name field is required.'
                    insurer_product_item_id:
                      - 'The insurer_product_item_id field is invalid.'
                    module_product_item_id:
                      - 'The module_product_item_id field is invalid.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      name:
                        type: array
                        example:
                          - 'The name field is required.'
                        items:
                          type: string
                      insurer_product_item_id:
                        type: array
                        example:
                          - 'The insurer_product_item_id field is invalid.'
                        items:
                          type: string
                      module_product_item_id:
                        type: array
                        example:
                          - 'The module_product_item_id field is invalid.'
                        items:
                          type: string
      tags:
        - Policy
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                insurer_product_item_id:
                  type: integer
                  description: 'optional The insurer product item ID to associate.'
                  example: 3
                  nullable: true
                name:
                  type: string
                  description: 'The name of the policy product.'
                  example: '"Coverage"'
                  nullable: false
                value:
                  type: string
                  description: 'optional The value of the product.'
                  example: '"10000"'
                  nullable: true
                info:
                  type: string
                  description: 'optional Additional information.'
                  example: '"Details"'
                  nullable: true
                excess:
                  type: numeric
                  description: 'optional Excess value.'
                  example: '500'
                  nullable: true
                approved:
                  type: boolean
                  description: 'optional Approval status.'
                  example: true
                  nullable: true
                module_product_item_id:
                  type: integer
                  description: 'optional The module product item ID to associate.'
                  example: 5
                  nullable: true
              required:
                - name
    parameters:
      -
        in: path
        name: policy_id
        description: 'The ID of the policy.'
        example: 28
        required: true
        schema:
          type: integer
  '/api/policy/{policy_id}/product/{product_id}':
    post:
      summary: 'Edit a Policy Product.'
      operationId: editAPolicyProduct
      description: 'Updates the fields of an existing policy product. Only provided fields will be updated.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'policy product updated successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'policy product updated successfully'
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    insurer_product_item_id:
                      - 'The insurer_product_item_id field is invalid.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      insurer_product_item_id:
                        type: array
                        example:
                          - 'The insurer_product_item_id field is invalid.'
                        items:
                          type: string
      tags:
        - Policy
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                insurer_product_item_id:
                  type: integer
                  description: 'optional The insurer product item ID to associate.'
                  example: 3
                  nullable: true
                name:
                  type: string
                  description: 'optional The new name of the policy product.'
                  example: '"Updated Coverage"'
                  nullable: true
                value:
                  type: string
                  description: 'optional The new value of the product.'
                  example: '"15000"'
                  nullable: true
                info:
                  type: string
                  description: 'optional Updated information.'
                  example: '"Updated details"'
                  nullable: true
                excess:
                  type: numeric
                  description: 'optional Updated excess value.'
                  example: '1000'
                  nullable: true
                approved:
                  type: boolean
                  description: 'optional Updated approval status.'
                  example: false
                  nullable: true
    delete:
      summary: 'Remove a Policy Product.'
      operationId: removeAPolicyProduct
      description: 'Deletes the specified policy product from the policy.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'policy product deleted successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'policy product deleted successfully'
                  refreshToken:
                    type: boolean
                    example: true
      tags:
        - Policy
    parameters:
      -
        in: path
        name: policy_id
        description: 'The ID of the policy.'
        example: 28
        required: true
        schema:
          type: integer
      -
        in: path
        name: product_id
        description: 'The ID of the product.'
        example: 184
        required: true
        schema:
          type: integer
  '/api/propbase/journal/{externalId}':
    get:
      summary: 'Get journal entries.'
      operationId: getJournalEntries
      description: 'Retrieves a single journal entry or a paginated list of journal entries. Supports filtering, sorting, and eager loading of relations.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 2567
                    type: adipisci
                    visible: true
                    object_id: 1031881
                    object_type: commodi
                    comment: incidunt
                    information:
                      - iure
                      - odit
                      - et
                    subtype: et
                    categories:
                      - modi
                      - ipsum
                      - nostrum
                    pinned: false
                    created_at: '2025-10-20T17:41:50.000000Z'
                    updated_at: '2025-10-20T17:41:50.000000Z'
                    additional_data:
                      - autem
                      - et
                      - consequatur
                    user_id: 2637
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 2567
                      type:
                        type: string
                        example: adipisci
                      visible:
                        type: boolean
                        example: true
                      object_id:
                        type: integer
                        example: 1031881
                      object_type:
                        type: string
                        example: commodi
                      comment:
                        type: string
                        example: incidunt
                      information:
                        type: array
                        example:
                          - iure
                          - odit
                          - et
                        items:
                          type: string
                      subtype:
                        type: string
                        example: et
                      categories:
                        type: array
                        example:
                          - modi
                          - ipsum
                          - nostrum
                        items:
                          type: string
                      pinned:
                        type: boolean
                        example: false
                      created_at:
                        type: string
                        example: '2025-10-20T17:41:50.000000Z'
                      updated_at:
                        type: string
                        example: '2025-10-20T17:41:50.000000Z'
                      additional_data:
                        type: array
                        example:
                          - autem
                          - et
                          - consequatur
                        items:
                          type: string
                      user_id:
                        type: integer
                        example: 2637
      tags:
        - Propbase
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                paged:
                  type: boolean
                  description: 'Indicates if the results should be paginated. Defaults to true.'
                  example: false
                  nullable: true
                per_page:
                  type: integer
                  description: 'Number of results per page when pagination is enabled.'
                  example: 15
                  nullable: true
                page:
                  type: integer
                  description: 'The page number to retrieve when pagination is enabled.'
                  example: 1
                  nullable: true
                with:
                  type: array
                  description: ''
                  example:
                    - user
                  items:
                    type: string
                    enum:
                      - user
                    nullable: true
                shortresult:
                  type: boolean
                  description: 'If true, returns a simplified result set without related models. Defaults to false.'
                  example: false
                  nullable: true
    parameters:
      -
        in: path
        name: externalId
        description: 'Optional parameter.'
        required: true
        schema:
          type: string
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: architecto
  '/api/propbase/journal/object/{externalId}':
    get:
      summary: 'Get journals for a specific object.'
      operationId: getJournalsForASpecificObject
      description: 'Retrieves all journal entries associated with a specific object type and ID.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n \"status\": true,\n \"message\": \"3 entries found\",\n \"current_page\": 1,\n \"last_page\": 1,\n \"per_page\": 15,\n \"from\": 1,\n \"to\": 3,\n \"total\": 3,\n \"data\": [\n    {\n    \"id\": 1,\n    \"type\": \"state\",\n    \"visible\": true,\n    \"object_id\": 123,\n    \"object_type\": \"App\\\\Models\\\\Workspace\",\n    \"user_id\": 5,\n    \"additional_data\": {...},\n    \"user\": {...}\n }"
      tags:
        - Propbase
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                per_page:
                  type: integer
                  description: 'Number of results per page when pagination is enabled.'
                  example: 15
                  nullable: true
                page:
                  type: integer
                  description: 'The page number to retrieve when pagination is enabled.'
                  example: 1
                  nullable: true
                with:
                  type: array
                  description: ''
                  example:
                    - user
                  items:
                    type: string
                    enum:
                      - user
                    nullable: true
                paged:
                  type: boolean
                  description: 'Indicates if the results should be paginated. Defaults to true.'
                  example: false
                  nullable: true
                shortresult:
                  type: boolean
                  description: 'If true, returns a simplified result set without related models. Defaults to false.'
                  example: false
                  nullable: true
                type:
                  type: string
                  description: 'The type of the object to retrieve journals for. This should be the class name without the "App\Models\" namespace.'
                  example: Modules\ModuleObject
                  nullable: false
              required:
                - type
    parameters:
      -
        in: path
        name: externalId
        description: 'Optional parameter. propbase-internal ID'
        required: true
        schema:
          type: string
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: architecto
  /api/propbase/journal:
    post:
      summary: 'Create a new journal entry.'
      operationId: createANewJournalEntry
      description: 'Creates a new journal entry for a given object type and object ID. Additional attributes can be provided and will be stored as journal attributes.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"status\": true,\n  \"message\": \"Journal entry created successfully\",\n  \"data\": {\n    \"id\": 1,\n    \"type\": \"state\",\n    \"visible\": true,\n    \"object_id\": 123,\n    \"object_type\": \"App\\\\Models\\\\Workspace\",\n    \"user_id\": 5,\n    \"additional_data\": {...},\n    \"user\": {...}\n}"
      tags:
        - Propbase
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  description: 'The type of journal entry.'
                  example: note
                  nullable: false
                visible:
                  type: boolean
                  description: 'Indicates if the journal entry is visible.'
                  example: false
                  nullable: false
                object_id:
                  type: string
                  description: 'The ID of the associated object.'
                  example: PB-0123
                  nullable: false
                object_type:
                  type: string
                  description: 'The type of the associated object.'
                  example: Modules\ModuleObject
                  nullable: false
                  enum:
                    - FormLeads\FormLead
                    - Modules\ModuleObject
                    - Workspace
                    - Policies\Policy
                    - DamageReport
                user_id:
                  type: string
                  description: 'The ID of the user creating the journal entry.'
                  example: PB-0123
                  nullable: false
                comment:
                  type: string
                  description: 'The comment for the journal entry.'
                  example: 'This is a journal entry comment.'
                  nullable: true
                information:
                  type: string
                  description: 'Additional information for the journal entry.'
                  example: '{"key":"value"}'
                  nullable: true
                subtype:
                  type: string
                  description: 'The subtype of the journal entry.'
                  example: update
                  nullable: true
                categories:
                  type: string
                  description: 'Categories associated with the journal entry.'
                  example: '["category1","category2"]'
                  nullable: true
                pinned:
                  type: boolean
                  description: 'Indicates if the journal entry is pinned.'
                  example: false
                  nullable: false
                additional_data:
                  type: object
                  description: 'Additional data for the journal entry as a JSON object.'
                  example:
                    extra_info: 'some value'
                  nullable: true
                  properties: {  }
              required:
                - type
                - object_id
                - object_type
                - user_id
  '/api/propbase/object/{externalId}':
    get:
      summary: 'Get Module Object(s).'
      operationId: getModuleObjects
      description: 'Retrieves a single module object (with relations) or a paginated list of module objects. Supports filtering, sorting, and eager loading of relations.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"success\": true,\n  \"message\": \"object(s) retrieved successfully\",\n  \"data\": {\n     \"id\": 1,\n     \"name\": \"Object Name\",\n     \"module_category_id\": 2,\n     \"user_id\": 3,\n     \"objectAttributes\": {...},\n     \"contacts\": [...],\n     \"...other relations...\"\n  },"
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: Unauthorized
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Unauthorized
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'object not found'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'object not found'
      tags:
        - Propbase
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                per_page:
                  type: integer
                  description: 'Number of results per page when pagination is enabled.'
                  example: 15
                  nullable: true
                page:
                  type: integer
                  description: 'The page number to retrieve when pagination is enabled.'
                  example: 1
                  nullable: true
                group_id:
                  type: integer
                  description: 'Filter results by group ID.'
                  example: 2
                  nullable: true
                with:
                  type: array
                  description: ''
                  example:
                    - policyList
                  items:
                    type: string
                    enum:
                      - objectAttributes
                      - user
                      - moduleCategory
                      - objectGroups
                      - moduleObjectWorkspaceInsurerProduct
                      - contacts
                      - policyList
                      - insuranceAnnouncements
                      - insuranceOffers
                    nullable: true
                paged:
                  type: boolean
                  description: 'Indicates if the results should be paginated. Defaults to true.'
                  example: false
                  nullable: true
                shortresult:
                  type: boolean
                  description: 'If true, returns a simplified result set without related models. Defaults to false.'
                  example: false
                  nullable: true
                user_id:
                  type: string
                  description: 'The id the object should be created for.'
                  example: PB-0123
                  nullable: false
              required:
                - user_id
    parameters:
      -
        in: path
        name: externalId
        description: 'Optional parameter.'
        required: true
        schema:
          type: string
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: architecto
  /api/propbase/object:
    post:
      summary: 'Create a new Module Object.'
      operationId: createANewModuleObject
      description: 'Creates a new module object with the provided data.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'object created successfully'
                  data:
                    id: 1
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'object created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
        400:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'Validation error message'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Validation error message'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'User not found'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'User not found'
      tags:
        - Propbase
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  description: 'The display ID for the module object. If not provided, a new ID will be generated.'
                  example: OBJ-12345
                  nullable: true
                name:
                  type: string
                  description: 'The name of the module object.'
                  example: 'Sample Object'
                  nullable: false
                category:
                  type: string
                  description: 'The ID of the category the module object belongs to. The <code>id</code> of an existing record in the module_categories table.'
                  example: 1
                  nullable: false
                group_id:
                  type: integer
                  description: 'The ID of the group the module object is associated with (optional). The <code>id</code> of an existing record in the groups table.'
                  example: 10
                  nullable: true
                contacts:
                  type: object
                  description: 'An array of contact objects associated with the module object (optional).'
                  example:
                    -
                      type: address
                      street: 'Main St'
                      housenumber: '123'
                      zip: '12345'
                      city: Anytown
                      region: State
                      workspace_id: 1
                  nullable: true
                  properties: {  }
                user_id:
                  type: string
                  description: 'The ID of the user creating the module object.'
                  example: USR-67890
                  nullable: false
                propbase_id:
                  type: string
                  description: 'The Propbase ID associated with the module object.'
                  example: PB-54321
                  nullable: false
              required:
                - name
                - category
                - user_id
                - propbase_id
  /api/propbase/users:
    post:
      summary: 'Register a new user.'
      operationId: registerANewUser
      description: 'Creates a new user and assigns a role and group.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"success\": true,\n  \"message\": \"user created successfully\",\n  \"user\": {\n    \"workspace_id\": 1,\n    \"email\": \"mail@localhost\",\n    \"active\": true,\n    \"type\": \"customer\",\n    \"...\"\n}"
        400:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  status: false
                  message: 'user already exists'
                properties:
                  status:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'user already exists'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'workspace does not exist'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'workspace does not exist'
      tags:
        - Propbase
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  description: "The user's email address. Must be a valid email address."
                  example: user@example.com
                  nullable: false
                firstname:
                  type: string
                  description: "The user's first name."
                  example: John
                  nullable: false
                lastname:
                  type: string
                  description: "The user's last name."
                  example: Doe
                  nullable: false
                salutation:
                  type: string
                  description: 'Salutation, one character. Must be at least 1 character. Must not be greater than 1 character.'
                  example: M
                  nullable: false
                company:
                  type: string
                  description: 'Company name for group assignment.'
                  example: 'Acme Corp'
                  nullable: true
                type:
                  type: string
                  description: 'The user type.'
                  example: customer
                  nullable: false
                  enum:
                    - main
                    - sub
                subtype:
                  type: string
                  description: ''
                  example: architecto
                  nullable: false
                group_id:
                  type: integer
                  description: 'Group ID. The <code>id</code> of an existing record in the groups table.'
                  example: 2
                  nullable: true
                active_language:
                  type: string
                  description: 'Language code.'
                  example: de
                  nullable: true
                  enum:
                    - de
                    - en
                propbase_id:
                  type: string
                  description: 'propbase internal id.'
                  example: PB-54321
                  nullable: false
              required:
                - email
                - firstname
                - lastname
                - salutation
                - subtype
                - propbase_id
  '/api/role/name/{name}':
    get:
      summary: 'Get Role by Name.'
      operationId: getRoleByName
      description: 'Retrieves a role by its name.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  id: 1
                  name: Admin
                  description: 'Administrator role'
                properties:
                  id:
                    type: integer
                    example: 1
                  name:
                    type: string
                    example: Admin
                  description:
                    type: string
                    example: 'Administrator role'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'No query results for model [App\Models\Role] Admin'
                properties:
                  message:
                    type: string
                    example: 'No query results for model [App\Models\Role] Admin'
      tags:
        - Role
    parameters:
      -
        in: path
        name: name
        description: 'The name.'
        example: architecto
        required: true
        schema:
          type: string
  '/api/role/{role}':
    get:
      summary: 'Get Role(s).'
      operationId: getRoles
      description: 'Retrieves a single role by ID or a list of all roles.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      id: 1
                      name: Admin
                      description: 'Administrator role'
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: Admin
                      description:
                        type: string
                        example: 'Administrator role'
                  -
                    description: ''
                    type: array
                    items:
                      type: object
                    example:
                      -
                        id: 1
                        name: Admin
                        description: 'Administrator role'
                      -
                        id: 2
                        name: User
                        description: 'Standard user role'
      tags:
        - Role
    parameters:
      -
        in: path
        name: role
        description: 'Optional parameter.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/search:
    get:
      summary: 'Search all indexed models.'
      operationId: searchAllIndexedModels
      description: "Performs a search query across all Elasticsearch indices. Returns results grouped by model type.\nSupports fuzzy search and limits the number of results."
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"formlead\": [\n    {\n      \"id\": 1,\n      \"name\": \"Lead A\",\n      \"...other fields...\"\n    }\n  ],\n  \"user\": [\n    {\n      \"id\": 2,\n      \"name\": \"John Doe\",\n      \"...other fields...\"\n    }\n  ]\n}"
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 'No results found'
                properties:
                  error:
                    type: string
                    example: 'No results found'
      tags:
        - Search
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                query:
                  type: string
                  description: 'The search query string.'
                  example: '"insurance"'
                  nullable: false
                limit:
                  type: integer
                  description: 'optional Maximum number of results to return. Default: 100.'
                  example: 50
                  nullable: false
              required:
                - query
  /api/source/track:
    post:
      summary: 'Track Source-Template Relation.'
      operationId: trackSourceTemplateRelation
      description: 'Tracks the relation between a source and a template by IP address. Prevents duplicate entries from the same IP within 30 minutes.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                properties:
                  success:
                    type: boolean
                    example: true
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 'template or source not found'
                properties:
                  error:
                    type: string
                    example: 'template or source not found'
        409:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 'entry from this ip already stored'
                properties:
                  error:
                    type: string
                    example: 'entry from this ip already stored'
      tags:
        - Source
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                template:
                  type: string
                  description: 'The UUID of the template.'
                  example: '"template-uuid"'
                  nullable: false
                source:
                  type: string
                  description: 'The UUID of the source.'
                  example: '"source-uuid"'
                  nullable: false
              required:
                - template
                - source
      security: []
  '/api/source/{source}':
    get:
      summary: 'Get Source(s).'
      operationId: getSources
      description: "Retrieves a single source (with relations) or a paginated list of sources. Supports filtering, sorting, and eager loading of relations.\nOnly master users can access all sources; others are limited to their workspace."
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"id\": 1,\n  \"name\": \"Source Name\",\n  \"workspace_id\": 2,\n  \"workspace\": {...},\n  \"groups\": [...],\n  \"collections\": [...],\n  \"sourceAttributes\": {...}\n}"
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: Unauthorized
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Unauthorized
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'source not found'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'source not found'
      tags:
        - Source
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                per_page:
                  type: integer
                  description: 'optional Number of results per page.'
                  example: 15
                  nullable: true
                page:
                  type: integer
                  description: 'optional Page number.'
                  example: 1
                  nullable: true
                with:
                  type: array
                  description: 'optional Relations to include. Allowed: workspace,groups,collections,sourceAttributes.'
                  example:
                    - workspace
                  items:
                    type: string
                    nullable: true
                paged:
                  type: boolean
                  description: 'optional Whether to paginate results.'
                  example: true
                  nullable: true
                shortresult:
                  type: boolean
                  description: 'optional If true, returns a short result without relations.'
                  example: false
                  nullable: true
    parameters:
      -
        in: path
        name: source
        description: 'Optional parameter.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/source:
    post:
      summary: 'Create a Source.'
      operationId: createASource
      description: 'Creates a new source. Requires name, optionally workspace_id and avatar image. Additional attributes are stored.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'source created successfully'
                  data:
                    id: 1
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'source created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    name:
                      - 'The name field is required.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      name:
                        type: array
                        example:
                          - 'The name field is required.'
                        items:
                          type: string
      tags:
        - Source
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The name of the source.'
                  example: '"My Source"'
                  nullable: false
                workspace_id:
                  type: integer
                  description: 'optional The workspace ID to assign.'
                  example: 2
                  nullable: true
                avatar:
                  type: string
                  format: binary
                  description: 'optional Avatar image file (max 20MB).'
                  nullable: true
                attributes:
                  type: mixed
                  description: 'optional Any additional attributes for the source (ex. "foo", "bar").'
                  example: architecto
                  nullable: false
              required:
                - name
  '/api/source/{source_id}':
    post:
      summary: 'Edit a Source.'
      operationId: editASource
      description: 'Updates the fields and attributes of an existing source. Only provided fields will be updated.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'source edited successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'source edited successfully'
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    workspace_id:
                      - 'The workspace_id field is invalid.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      workspace_id:
                        type: array
                        example:
                          - 'The workspace_id field is invalid.'
                        items:
                          type: string
      tags:
        - Source
      requestBody:
        required: false
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'optional The new name of the source.'
                  example: '"Updated Source"'
                  nullable: true
                workspace_id:
                  type: integer
                  description: 'optional The new workspace ID.'
                  example: 3
                  nullable: true
                avatar:
                  type: string
                  format: binary
                  description: 'optional New avatar image file (max 20MB).'
                  nullable: true
                attributes:
                  type: mixed
                  description: 'optional Any additional attributes for the source (ex. "foo", "bar").'
                  example: architecto
                  nullable: false
    delete:
      summary: 'Delete a Source.'
      operationId: deleteASource
      description: 'Deletes the specified source.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'source deleted successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'source deleted successfully'
                  refreshToken:
                    type: boolean
                    example: true
      tags:
        - Source
    parameters:
      -
        in: path
        name: source_id
        description: 'The ID of the source.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/template/{template}':
    get:
      summary: 'Get Template(s).'
      operationId: getTemplates
      description: 'Retrieves a single template (with relations) or a paginated list of templates. Supports filtering, sorting, and eager loading of relations.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"id\": 1,\n  \"name\": \"Template Name\",\n  \"active\": true,\n  \"settings\": {...}\n}"
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: Unauthorized
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Unauthorized
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'template not found'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'template not found'
      tags:
        - Template
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                per_page:
                  type: integer
                  description: 'optional Number of results per page.'
                  example: 15
                  nullable: true
                page:
                  type: integer
                  description: 'optional Page number.'
                  example: 1
                  nullable: true
                with:
                  type: array
                  description: 'optional Relations to include. Allowed: settings.'
                  example:
                    - settings
                  items:
                    type: string
                    nullable: true
                paged:
                  type: boolean
                  description: 'optional Whether to paginate results.'
                  example: true
                  nullable: true
                shortresult:
                  type: boolean
                  description: 'optional If true, returns a short result without relations.'
                  example: false
                  nullable: true
    parameters:
      -
        in: path
        name: template
        description: 'Optional parameter.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/template:
    post:
      summary: 'Create a Template.'
      operationId: createATemplate
      description: 'Creates a new template. Requires name and active status.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'template created successfully'
                  data:
                    id: 1
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'template created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    name:
                      - 'The name field is required.'
                    active:
                      - 'The active field is required.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      name:
                        type: array
                        example:
                          - 'The name field is required.'
                        items:
                          type: string
                      active:
                        type: array
                        example:
                          - 'The active field is required.'
                        items:
                          type: string
      tags:
        - Template
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The name of the template.'
                  example: '"My Template"'
                  nullable: false
                active:
                  type: boolean
                  description: 'Whether the template is active.'
                  example: true
                  nullable: false
              required:
                - name
                - active
  '/api/template/{template_id}':
    post:
      summary: 'Edit a Template.'
      operationId: editATemplate
      description: 'Updates the name and active status of an existing template.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'template edited successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'template edited successfully'
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    name:
                      - 'The name field is required.'
                    active:
                      - 'The active field is required.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      name:
                        type: array
                        example:
                          - 'The name field is required.'
                        items:
                          type: string
                      active:
                        type: array
                        example:
                          - 'The active field is required.'
                        items:
                          type: string
      tags:
        - Template
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The new name of the template.'
                  example: '"Updated Template"'
                  nullable: false
                active:
                  type: boolean
                  description: 'The new active status.'
                  example: false
                  nullable: false
              required:
                - name
                - active
    delete:
      summary: 'Delete a Template.'
      operationId: deleteATemplate
      description: 'Deletes the specified template.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'template deleted successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'template deleted successfully'
                  refreshToken:
                    type: boolean
                    example: true
      tags:
        - Template
    parameters:
      -
        in: path
        name: template_id
        description: 'The ID of the template.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/template/{template_id}/settings':
    get:
      summary: 'Get Template Settings for Module Workspace.'
      operationId: getTemplateSettingsForModuleWorkspace
      description: 'Retrieves the settings for the specified template and module workspace combination.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                example:
                  -
                    id: 1
                    template_id: 2
                    module_workspace_id: 3
                    name: setting_name
                    value: setting_value
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    workspace:
                      - 'The workspace field is required.'
                    module:
                      - 'The module field is required.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      workspace:
                        type: array
                        example:
                          - 'The workspace field is required.'
                        items:
                          type: string
                      module:
                        type: array
                        example:
                          - 'The module field is required.'
                        items:
                          type: string
      tags:
        - Template
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace:
                  type: integer
                  description: 'The workspace ID.'
                  example: 2
                  nullable: false
                module:
                  type: integer
                  description: 'The module ID.'
                  example: 3
                  nullable: false
              required:
                - workspace
                - module
      security: []
    post:
      summary: 'Save Template Settings for Module Workspace.'
      operationId: saveTemplateSettingsForModuleWorkspace
      description: 'Updates the settings for the specified template and module workspace combination.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      success: true
                      message: 'template settings updated'
                      refreshToken: true
                    properties:
                      success:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'template settings updated'
                      refreshToken:
                        type: boolean
                        example: true
                  -
                    description: ''
                    type: object
                    example:
                      success: false
                      message: 'module not assigned to Workspace'
                      refreshToken: true
                    properties:
                      success:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'module not assigned to Workspace'
                      refreshToken:
                        type: boolean
                        example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    workspace:
                      - 'The workspace field is required.'
                    module:
                      - 'The module field is required.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      workspace:
                        type: array
                        example:
                          - 'The workspace field is required.'
                        items:
                          type: string
                      module:
                        type: array
                        example:
                          - 'The module field is required.'
                        items:
                          type: string
      tags:
        - Template
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace:
                  type: integer
                  description: 'The workspace ID.'
                  example: 2
                  nullable: false
                module:
                  type: integer
                  description: 'The module ID.'
                  example: 3
                  nullable: false
                settings:
                  type: mixed
                  description: 'The settings to update for the template (ex. "foo", "bar").'
                  example: architecto
                  nullable: false
              required:
                - workspace
                - module
                - settings
    parameters:
      -
        in: path
        name: template_id
        description: 'The ID of the template.'
        example: 1
        required: true
        schema:
          type: integer
  /api/user/change-password:
    post:
      summary: 'Change Password.'
      operationId: changePassword
      description: 'Updates the password for the currently authenticated user.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'password changed successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'password changed successfully'
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    password:
                      - 'The password field is invalid.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      password:
                        type: array
                        example:
                          - 'The password field is invalid.'
                        items:
                          type: string
      tags:
        - User
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                password:
                  type: string
                  description: 'The new password.'
                  example: '|]|{+-'
                  nullable: false
              required:
                - password
  '/api/user/permissions/{user}':
    get:
      summary: 'Get Permissions for the User.'
      operationId: getPermissionsForTheUser
      description: 'Retrieves the permissions for the specified user or the currently authenticated user.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "[\n  {\n    \"id\": 1,\n    \"name\": \"Admin\",\n    \"permissions\": [...]\n  }\n]"
      tags:
        - User
    post:
      summary: 'Update User Permissions.'
      operationId: updateUserPermissions
      description: 'Updates the role of the specified user. Deprecated: use update user endpoint with role_id instead.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'user roles changed successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'user roles changed successfully'
                  refreshToken:
                    type: boolean
                    example: true
      tags:
        - User
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                roles:
                  type: array
                  description: 'The new role(s) for the user.'
                  example:
                    - 2
                  items:
                    type: string
              required:
                - roles
    parameters:
      -
        in: path
        name: user
        description: 'Optional parameter.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  '/api/user/groups/{user}':
    post:
      summary: 'Add User to Group.'
      operationId: addUserToGroup
      description: "Adds the specified user to a group with a given role. If no role is provided, assigns the 'superadmin' customer role."
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'user added to group successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'user added to group successfully'
                  refreshToken:
                    type: boolean
                    example: true
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'group not found'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'group not found'
      tags:
        - User
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                group_id:
                  type: integer
                  description: 'The group ID to assign.'
                  example: 5
                  nullable: false
                role_id:
                  type: integer
                  description: 'optional The role ID to assign.'
                  example: 2
                  nullable: true
              required:
                - group_id
    parameters:
      -
        in: path
        name: user
        description: 'Optional parameter.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/user/remove:
    delete:
      summary: 'Delete Current User.'
      operationId: deleteCurrentUser
      description: 'Deletes the currently authenticated user and logs them out.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'user deleted successfully'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'user deleted successfully'
      tags:
        - User
  /api/user/current:
    get:
      summary: 'Get Current User.'
      operationId: getCurrentUser
      description: 'Retrieves the currently authenticated user with all relevant relations.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"id\": 1,\n  \"email\": \"john.doe@example.com\",\n  \"active\": true,\n  \"contacts\": [...],\n  \"formRoles\": [...],\n  \"role\": {...},\n  \"workspace\": {...},\n  \"inGroups\": {...},\n  \"formRoles\": {...},\n  \"uploads\": {...},\n}"
      tags:
        - User
  '/api/user/{user}':
    get:
      summary: 'Get User(s).'
      operationId: getUsers
      description: "Retrieves a single user (with relations) or a paginated list of users. Supports filtering, sorting, and eager loading of relations.\nOnly admins can access all users; customers and guests have limited access."
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"id\": 1,\n  \"email\": \"john.doe@example.com\",\n  \"active\": true,\n  \"contacts\": [...],\n  \"formRoles\": [...],\n  \"role\": {...},\n  \"...other relations...\"\n}"
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: Unauthorized
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Unauthorized
      tags:
        - User
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                per_page:
                  type: integer
                  description: 'optional Number of results per page.'
                  example: 15
                  nullable: true
                page:
                  type: integer
                  description: 'optional Page number.'
                  example: 1
                  nullable: true
                group_id:
                  type: integer
                  description: 'optional Filter by group ID.'
                  example: 5
                  nullable: true
                with:
                  type: array
                  description: 'optional Relations to include. Allowed: contacts,formRoles,role.'
                  example:
                    - contacts
                  items:
                    type: string
                    nullable: true
                paged:
                  type: boolean
                  description: 'optional Whether to paginate results.'
                  example: true
                  nullable: true
                shortresult:
                  type: boolean
                  description: 'optional If true, returns a short result without relations.'
                  example: false
                  nullable: true
    post:
      summary: 'Update User.'
      operationId: updateUser
      description: "Updates the fields and attributes of an existing user. Only provided fields will be updated.\nAlso updates contact and user attributes."
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'user updated successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'user updated successfully'
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    email:
                      - 'The email field must be a valid email address.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      email:
                        type: array
                        example:
                          - 'The email field must be a valid email address.'
                        items:
                          type: string
      tags:
        - User
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  description: 'optional The new email address.'
                  example: '"new.email@example.com"'
                  nullable: true
                active:
                  type: boolean
                  description: 'optional The active status.'
                  example: true
                  nullable: true
                tfatype:
                  type: string
                  description: 'optional Two-factor authentication type. Allowed: email, app.'
                  example: '"app"'
                  nullable: true
                google2fa_secret:
                  type: string
                  description: 'required_if:tfatype,app The Google 2FA secret.'
                  example: '"SECRET"'
                  nullable: false
                last_login:
                  type: date
                  description: 'optional Last login date.'
                  example: '"2024-06-01"'
                  nullable: true
                last_activity:
                  type: date
                  description: 'optional Last activity date.'
                  example: '"2024-06-01"'
                  nullable: true
                password:
                  type: string
                  description: 'optional The new password.'
                  example: '|]|{+-'
                  nullable: true
                active_language:
                  type: string
                  description: 'optional The active language. Allowed: de, en.'
                  example: '"en"'
                  nullable: true
                _data:
                  type: mixed
                  description: 'optional Connection data for contact.'
                  example: architecto
                  nullable: false
                attributes:
                  type: mixed
                  description: 'optional Any additional attributes for the user (ex. "foo", "bar").'
                  example: architecto
                  nullable: false
    parameters:
      -
        in: path
        name: user
        description: 'Optional parameter.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  '/api/version/{version_id}':
    get:
      summary: 'Get Versioned Model.'
      operationId: getVersionedModel
      description: 'Retrieves the model instance for the given version. Loads additional relations if specified in the request.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"id\": 1,\n  \"versionable_type\": \"App\\\\Models\\\\FormLead\",\n  \"versionable_id\": 123,\n  \"...model fields and relations...\"\n}"
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'Model not found'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Model not found'
      tags:
        - Version
    parameters:
      -
        in: path
        name: version_id
        description: 'The ID of the version.'
        example: 1
        required: true
        schema:
          type: integer
  /api/workspace/user:
    get:
      summary: 'Check if User is Invitable to Workspace.'
      operationId: checkIfUserIsInvitableToWorkspace
      description: 'Checks if a user can be invited to the specified workspace and role.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      success: true
                      message: 'user already exists in workspace'
                    properties:
                      success:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'user already exists in workspace'
                  -
                    description: ''
                    type: object
                    example:
                      success: true
                      message: 'role already assigned in workspace'
                    properties:
                      success:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'role already assigned in workspace'
                  -
                    description: ''
                    type: object
                    example:
                      success: false
                      message: 'user does not exist in workspace'
                    properties:
                      success:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'user does not exist in workspace'
                  -
                    description: ''
                    type: object
                    example:
                      success: false
                      message: 'role not assigned to user in workspace'
                    properties:
                      success:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'role not assigned to user in workspace'
      tags:
        - Workspace
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  description: 'The email address of the user.'
                  example: '"john.doe@example.com"'
                  nullable: false
                workspace:
                  type: integer
                  description: 'The workspace ID.'
                  example: 1
                  nullable: false
                role:
                  type: integer
                  description: 'optional The role ID.'
                  example: 2
                  nullable: true
              required:
                - email
                - workspace
  /api/workspace/user/invite:
    post:
      summary: 'Invite User to Workspace.'
      operationId: inviteUserToWorkspace
      description: 'Invites a user to the specified workspace with the given role and group. Optionally sends an email invitation.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'user invitation with given role to workspace succesful'
                  data:
                    id: 1
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'user invitation with given role to workspace succesful'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                  refreshToken:
                    type: boolean
                    example: true
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'workspace does not exist'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'workspace does not exist'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
      tags:
        - Workspace
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  description: 'The email address of the user.'
                  example: '"john.doe@example.com"'
                  nullable: false
                password:
                  type: string
                  description: 'The password for the user.'
                  example: '"secret123"'
                  nullable: false
                workspace:
                  type: integer
                  description: 'The workspace ID.'
                  example: 1
                  nullable: false
                role:
                  type: integer
                  description: 'The role ID.'
                  example: 2
                  nullable: false
                tfatype:
                  type: string
                  description: 'Two-factor authentication type.'
                  example: '"email"'
                  nullable: false
                firstname:
                  type: string
                  description: 'First name of the user.'
                  example: '"John"'
                  nullable: false
                lastname:
                  type: string
                  description: 'Last name of the user.'
                  example: '"Doe"'
                  nullable: false
                salutation:
                  type: string
                  description: 'Salutation (single character).'
                  example: '"M"'
                  nullable: false
                group_id:
                  type: integer
                  description: 'The group ID.'
                  example: 3
                  nullable: false
                google2fa_secret:
                  type: string
                  description: 'required_if:tfatype,app The Google 2FA secret.'
                  example: '"SECRET"'
                  nullable: false
                without_mail:
                  type: boolean
                  description: 'optional If true, does not send an email invitation.'
                  example: false
                  nullable: true
                active_language:
                  type: string
                  description: 'optional The active language.'
                  example: '"en"'
                  nullable: true
              required:
                - email
                - password
                - workspace
                - role
                - tfatype
                - firstname
                - lastname
                - salutation
                - group_id
  /api/workspace/user/resend:
    post:
      summary: 'Resend Invitation to User for Workspace.'
      operationId: resendInvitationToUserForWorkspace
      description: 'Resends the invitation email to the specified user for the given role in the workspace.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'resending user invitation with given role to workspace successful'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'resending user invitation with given role to workspace successful'
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
      tags:
        - Workspace
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                user:
                  type: integer
                  description: 'The user ID.'
                  example: 1
                  nullable: false
                role:
                  type: integer
                  description: 'The role ID.'
                  example: 2
                  nullable: false
              required:
                - user
                - role
  '/api/workspace/user/{user_id}':
    delete:
      summary: 'Remove User from Workspace.'
      operationId: removeUserFromWorkspace
      description: 'Removes the specified user from the workspace or removes a role from the user in the workspace.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      success: true
                      message: 'user removed from workspace'
                      refreshToken: true
                    properties:
                      success:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'user removed from workspace'
                      refreshToken:
                        type: boolean
                        example: true
                  -
                    description: ''
                    type: object
                    example:
                      success: true
                      message: 'role removed for user in workspace'
                      refreshToken: true
                    properties:
                      success:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'role removed for user in workspace'
                      refreshToken:
                        type: boolean
                        example: true
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'no user with given role exists in workspace'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'no user with given role exists in workspace'
      tags:
        - Workspace
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                role:
                  type: integer
                  description: 'optional The role ID to remove.'
                  example: 2
                  nullable: true
    parameters:
      -
        in: path
        name: user_id
        description: 'The ID of the user.'
        example: 1
        required: true
        schema:
          type: integer
  /api/workspace:
    post:
      summary: 'Create Workspace.'
      operationId: createWorkspace
      description: 'Creates a new workspace with the provided name, frontend URL, languages, default language, contacts, avatar, and attributes.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'workspace created successfully'
                  data:
                    id: 1
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'workspace created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    name:
                      - 'The name field is required.'
                    frontend_url:
                      - 'The frontend_url field is required.'
                    contacts:
                      - 'The contacts field is required.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      name:
                        type: array
                        example:
                          - 'The name field is required.'
                        items:
                          type: string
                      frontend_url:
                        type: array
                        example:
                          - 'The frontend_url field is required.'
                        items:
                          type: string
                      contacts:
                        type: array
                        example:
                          - 'The contacts field is required.'
                        items:
                          type: string
      tags:
        - Workspace
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The name of the workspace.'
                  example: '"My Workspace"'
                  nullable: false
                frontend_url:
                  type: string
                  description: 'The frontend URL of the workspace.'
                  example: '"https://frontend.example.com"'
                  nullable: false
                languages:
                  type: array
                  description: 'optional Supported languages.'
                  example:
                    - de
                    - en
                  items:
                    type: string
                    nullable: true
                default_language:
                  type: string
                  description: 'optional Default language.'
                  example: '"de"'
                  nullable: true
                contacts:
                  type: array
                  description: 'Array of contact data for the workspace.'
                  example:
                    - architecto
                  items:
                    type: string
                avatar:
                  type: string
                  format: binary
                  description: 'optional Avatar image file (max 20MB).'
                  nullable: true
                attributes:
                  type: array
                  description: 'optional Additional attributes for the workspace.'
                  example:
                    - architecto
                  items:
                    type: string
              required:
                - name
                - frontend_url
                - contacts
  /api/workspace/url:
    get:
      summary: 'Get Workspace Details By Frontend URL.'
      operationId: getWorkspaceDetailsByFrontendURL
      description: "Retrieves detailed information about a workspace by its frontend URL.\nThe method normalizes the provided URL, searches for a matching workspace,\nand returns various workspace attributes and configuration values."
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  id: 1
                  name: 'Workspace Name'
                  avatar: 'https://example.com/avatar.png'
                  primaryColor: '#123456'
                  fastlaneInsurerProductId: 10
                  fastlaneWorkspaceInsurerProductId: 20
                  fastlaneModuleWorkspaceId: 30
                  standardWorkspaceInsurerProductId: 40
                  standardModuleWorkspaceId: 50
                  standardModuleId: 60
                  standardModuleProductId: 70
                  currencyLocale: de-DE
                  currency: EUR
                  currencyPrefix: €
                  currencyThousandsSeparator: .
                  currencyDecimalSeparator: ','
                  privacyUrl: 'https://example.com/privacy'
                  termsUrl: 'https://example.com/terms'
                  languages:
                    - de
                    - en
                  defaultLanguage: de
                  footerMenu: []
                properties:
                  id:
                    type: integer
                    example: 1
                  name:
                    type: string
                    example: 'Workspace Name'
                  avatar:
                    type: string
                    example: 'https://example.com/avatar.png'
                  primaryColor:
                    type: string
                    example: '#123456'
                  fastlaneInsurerProductId:
                    type: integer
                    example: 10
                  fastlaneWorkspaceInsurerProductId:
                    type: integer
                    example: 20
                  fastlaneModuleWorkspaceId:
                    type: integer
                    example: 30
                  standardWorkspaceInsurerProductId:
                    type: integer
                    example: 40
                  standardModuleWorkspaceId:
                    type: integer
                    example: 50
                  standardModuleId:
                    type: integer
                    example: 60
                  standardModuleProductId:
                    type: integer
                    example: 70
                  currencyLocale:
                    type: string
                    example: de-DE
                  currency:
                    type: string
                    example: EUR
                  currencyPrefix:
                    type: string
                    example: €
                  currencyThousandsSeparator:
                    type: string
                    example: .
                  currencyDecimalSeparator:
                    type: string
                    example: ','
                  privacyUrl:
                    type: string
                    example: 'https://example.com/privacy'
                  termsUrl:
                    type: string
                    example: 'https://example.com/terms'
                  languages:
                    type: array
                    example:
                      - de
                      - en
                    items:
                      type: string
                  defaultLanguage:
                    type: string
                    example: de
                  footerMenu:
                    type: array
                    example: []
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    frontend_url:
                      - 'The frontend_url field is required.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      frontend_url:
                        type: array
                        example:
                          - 'The frontend_url field is required.'
                        items:
                          type: string
      tags:
        - Workspace
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                frontend_url:
                  type: string
                  description: 'The <code>frontend_url</code> of an existing record in the workspaces table.'
                  example: architecto
                  nullable: false
              required:
                - frontend_url
      security: []
  '/api/workspace/{workspace}':
    get:
      summary: 'Get Workspace(s).'
      operationId: getWorkspaces
      description: 'Retrieves a single workspace (with relations) by ID or a paginated list of workspaces. Supports filtering, sorting, and eager loading of relations.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"id\": 1,\n  \"name\": \"Workspace Name\",\n  \"avatar\": \"url\",\n  \"frontend_url\": \"https://frontend.example.com\",\n  \"active\": true,\n  \"languages\": [\"de\", \"en\"],\n  \"default_language\": \"de\",\n  \"users\": [...],\n  \"sources\": [...],\n  \"insurerProducts\": [...],\n  \"contacts\": [...],\n  \"workspaceAttributes\": [...],\n  \"...other relations...\"\n}"
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: Unauthorized
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Unauthorized
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'workspace does not exist'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'workspace does not exist'
      tags:
        - Workspace
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                per_page:
                  type: integer
                  description: 'optional Number of results per page.'
                  example: 15
                  nullable: true
                page:
                  type: integer
                  description: 'optional Page number.'
                  example: 1
                  nullable: true
                with:
                  type: array
                  description: 'optional Relations to include. Allowed: users,sources,insurerProducts,contacts,workspaceAttributes,moduleWorkspace,collections,workspaceInsurerProducts.'
                  example:
                    - users
                  items:
                    type: string
                    nullable: true
                paged:
                  type: boolean
                  description: 'optional Whether to paginate results.'
                  example: true
                  nullable: true
                shortresult:
                  type: boolean
                  description: 'optional If true, returns a short result without relations.'
                  example: false
                  nullable: true
                with_inactive:
                  type: boolean
                  description: 'optional If true, includes inactive workspaces.'
                  example: true
                  nullable: false
    post:
      summary: 'Update Workspace.'
      operationId: updateWorkspace
      description: 'Updates the fields and contacts of an existing workspace. Only provided fields will be updated.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'workspace updated successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'workspace updated successfully'
                  refreshToken:
                    type: boolean
                    example: true
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'workspace does not exist'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'workspace does not exist'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
      tags:
        - Workspace
      requestBody:
        required: false
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                frontend_url:
                  type: string
                  description: 'optional The new frontend URL.'
                  example: '"https://frontend.example.com"'
                  nullable: true
                languages:
                  type: array
                  description: 'optional Updated languages.'
                  example:
                    - de
                    - en
                  items:
                    type: string
                    nullable: true
                default_language:
                  type: string
                  description: 'optional Updated default language.'
                  example: '"en"'
                  nullable: true
                contacts:
                  type: array
                  description: 'optional Updated contacts for the workspace.'
                  example:
                    - architecto
                  items:
                    type: string
                    nullable: true
                avatar:
                  type: string
                  format: binary
                  description: 'optional New avatar image file (max 20MB).'
                  nullable: true
                attributes:
                  type: array
                  description: 'optional Updated attributes for the workspace.'
                  example:
                    - architecto
                  items:
                    type: string
    delete:
      summary: 'Delete Workspace.'
      operationId: deleteWorkspace
      description: 'Deletes the specified workspace.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'workspace deleted successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'workspace deleted successfully'
                  refreshToken:
                    type: boolean
                    example: true
      tags:
        - Workspace
    parameters:
      -
        in: path
        name: workspace
        description: 'Optional parameter.'
        required: true
        schema:
          type: string
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: architecto
  '/api/workspace/{workspace_id}/insurerproduct/{insurerproduct}':
    get:
      summary: 'Get Workspace Insurer Product(s).'
      operationId: getWorkspaceInsurerProducts
      description: "Retrieves a single workspace insurer product (with relations) or a paginated list of workspace insurer products for the given workspace.\nSupports filtering by module product, eager loading of relations, and pagination."
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"id\": 1,\n  \"workspace_id\": 2,\n  \"insurer_product_id\": 3,\n  \"insurerProduct\": {...},\n  \"insuranceAnnouncements\": [...],\n  \"insurerAvbs\": [...],\n  \"insuranceOffers\": [...],\n  \"insurerTariffConstructionCosts\": [...],\n  \"moduleObjectWorkspaceInsurerProduct\": [...]\n}"
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: Unauthorized
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Unauthorized
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'workspace insurer product not found'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'workspace insurer product not found'
      tags:
        - Workspace
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                module_product_id:
                  type: integer
                  description: 'optional Filter by module product ID.'
                  example: 2
                  nullable: true
                per_page:
                  type: integer
                  description: 'optional Number of results per page.'
                  example: 15
                  nullable: true
                page:
                  type: integer
                  description: 'optional Page number.'
                  example: 1
                  nullable: true
                with:
                  type: array
                  description: 'optional Relations to include. Allowed: insurerProduct,workspaceInsurerProductAttributes,workspace,insuranceAnnouncements,insurerAvbs,insuranceOffers,insurerTariffConstructionCosts,moduleObjectWorkspaceInsurerProduct.'
                  example:
                    - insurerProduct
                  items:
                    type: string
                    nullable: true
                paged:
                  type: boolean
                  description: 'optional Whether to paginate results.'
                  example: true
                  nullable: true
                shortresult:
                  type: boolean
                  description: 'optional If true, returns a short result without relations.'
                  example: false
                  nullable: true
    parameters:
      -
        in: path
        name: workspace_id
        description: 'The ID of the workspace.'
        example: 2
        required: true
        schema:
          type: integer
      -
        in: path
        name: insurerproduct
        description: 'Optional parameter.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  '/api/workspace/{workspace_id}/insurerproduct/{insurerproduct_id}':
    post:
      summary: 'Add an Insurer Product to Workspace.'
      operationId: addAnInsurerProductToWorkspace
      description: 'Assigns the specified insurer product to the given workspace. If the product is already assigned, returns an error.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'insurer product already in workspace'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'insurer product already in workspace'
                  refreshToken:
                    type: boolean
                    example: true
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'insurer product assigned to workspace'
                  data:
                    id: 1
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'insurer product assigned to workspace'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                  refreshToken:
                    type: boolean
                    example: true
      tags:
        - Workspace
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                attributes:
                  type: mixed
                  description: 'optional Additional attributes for the workspace insurer product (ex. "fop", "bar").'
                  example: architecto
                  nullable: false
    delete:
      summary: 'Remove an Insurer Product from Workspace.'
      operationId: removeAnInsurerProductFromWorkspace
      description: 'Deletes the specified insurer product from the workspace.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      success: true
                      message: 'insurer product removed from workspace'
                      refreshToken: true
                    properties:
                      success:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'insurer product removed from workspace'
                      refreshToken:
                        type: boolean
                        example: true
                  -
                    description: ''
                    type: object
                    example:
                      success: false
                      message: 'insurer product is not assigned to workspace'
                      refreshToken: true
                    properties:
                      success:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'insurer product is not assigned to workspace'
                      refreshToken:
                        type: boolean
                        example: true
      tags:
        - Workspace
    parameters:
      -
        in: path
        name: workspace_id
        description: 'The ID of the workspace.'
        example: 2
        required: true
        schema:
          type: integer
      -
        in: path
        name: insurerproduct_id
        description: 'The ID of the insurerproduct.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/workspace/{workspace_id}/insurerproduct/{insurerproduct_id}/edit':
    post:
      summary: 'Edit Workspace Insurer Product.'
      operationId: editWorkspaceInsurerProduct
      description: 'Updates the attributes of an existing workspace insurer product. Only provided fields will be updated.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      success: true
                      message: 'workspace insurer product updated'
                      refreshToken: true
                    properties:
                      success:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'workspace insurer product updated'
                      refreshToken:
                        type: boolean
                        example: true
                  -
                    description: ''
                    type: object
                    example:
                      success: false
                      message: 'insurer product is not assigned to workspace'
                      refreshToken: true
                    properties:
                      success:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'insurer product is not assigned to workspace'
                      refreshToken:
                        type: boolean
                        example: true
      tags:
        - Workspace
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                attributes:
                  type: mixed
                  description: 'optional Attributes to update for the workspace insurer product (ex. "foo", "bar").'
                  example: architecto
                  nullable: false
    parameters:
      -
        in: path
        name: workspace_id
        description: 'The ID of the workspace.'
        example: 2
        required: true
        schema:
          type: integer
      -
        in: path
        name: insurerproduct_id
        description: 'The ID of the insurerproduct.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/workspace/{workspace_id}/attribute/{attribute}':
    get:
      summary: 'Get Workspace Attribute(s).'
      operationId: getWorkspaceAttributes
      description: "Retrieves a single workspace attribute (with relations) or a list of attributes for the given workspace.\nSupports eager loading of the workspace relation."
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                oneOf:
                  -
                    description: ''
                    type: string
                    example: "[\n  {\n    \"id\": 1,\n    \"workspace_id\": 2,\n    \"name\": \"Attribute Name\",\n    \"type\": \"string\",\n    \"value_string\": \"Value\",\n    \"category\": \"General\",\n    \"workspace\": {...}\n  }\n]"
                  -
                    description: ''
                    type: string
                    example: "{\n  \"id\": 1,\n  \"workspace_id\": 2,\n  \"name\": \"Attribute Name\",\n  \"type\": \"string\",\n  \"value_string\": \"Value\",\n  \"category\": \"General\",\n  \"workspace\": {...}\n}"
      tags:
        - Workspace
    parameters:
      -
        in: path
        name: workspace_id
        description: 'The ID of the workspace.'
        example: 2
        required: true
        schema:
          type: integer
      -
        in: path
        name: attribute
        description: 'Optional parameter.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 150
  '/api/workspace/{workspace_id}/attribute':
    post:
      summary: 'Create Workspace Attribute.'
      operationId: createWorkspaceAttribute
      description: 'Creates a new attribute for the given workspace. Requires name, type, and value. Optionally, a category can be provided.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'workspace attribute created successfully'
                  data:
                    id: 1
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'workspace attribute created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    name:
                      - 'The name field is required.'
                    type:
                      - 'The type field is required.'
                    value:
                      - 'The value field is required.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      name:
                        type: array
                        example:
                          - 'The name field is required.'
                        items:
                          type: string
                      type:
                        type: array
                        example:
                          - 'The type field is required.'
                        items:
                          type: string
                      value:
                        type: array
                        example:
                          - 'The value field is required.'
                        items:
                          type: string
      tags:
        - Workspace
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The name of the attribute.'
                  example: '"Location"'
                  nullable: false
                type:
                  type: string
                  description: 'The type of the attribute. Allowed: bool, string, text, int, float, datetime.'
                  example: '"string"'
                  nullable: false
                value:
                  type: string
                  description: 'The value of the attribute.'
                  example: '"Berlin"'
                  nullable: false
                category:
                  type: string
                  description: 'optional The category of the attribute.'
                  example: '"General"'
                  nullable: true
              required:
                - name
                - type
                - value
    parameters:
      -
        in: path
        name: workspace_id
        description: 'The ID of the workspace.'
        example: 2
        required: true
        schema:
          type: integer
  '/api/workspace/{workspace_id}/attribute/{attribute_id}':
    post:
      summary: 'Edit Workspace Attribute.'
      operationId: editWorkspaceAttribute
      description: 'Updates the fields of an existing workspace attribute. Only provided fields will be updated.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'workspace attribute updated successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'workspace attribute updated successfully'
                  refreshToken:
                    type: boolean
                    example: true
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    value:
                      - 'The value field is required.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      value:
                        type: array
                        example:
                          - 'The value field is required.'
                        items:
                          type: string
      tags:
        - Workspace
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'optional The new name of the attribute.'
                  example: '"Updated Location"'
                  nullable: true
                type:
                  type: string
                  description: 'optional The new type of the attribute. Allowed: bool, string, text, int, float, datetime.'
                  example: '"int"'
                  nullable: true
                value:
                  type: mixed
                  description: 'The new value of the attribute. Type depends on attribute type.'
                  example: '42'
                  nullable: false
                category:
                  type: string
                  description: 'optional The new category of the attribute.'
                  example: '"Details"'
                  nullable: true
              required:
                - value
    delete:
      summary: 'Delete Workspace Attribute.'
      operationId: deleteWorkspaceAttribute
      description: 'Deletes the specified workspace attribute.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'workspace attribute deleted successfully'
                  refreshToken: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'workspace attribute deleted successfully'
                  refreshToken:
                    type: boolean
                    example: true
      tags:
        - Workspace
    parameters:
      -
        in: path
        name: workspace_id
        description: 'The ID of the workspace.'
        example: 2
        required: true
        schema:
          type: integer
      -
        in: path
        name: attribute_id
        description: 'The ID of the attribute.'
        example: 150
        required: true
        schema:
          type: integer
  /api/zefix:
    get:
      summary: 'Get Zefix Company Search Results.'
      operationId: getZefixCompanySearchResults
      description: 'Searches for Swiss companies using the Zefix API by name. Returns a list of matching companies and, if only one result is found, additional details including address, purpose, publications, and office information.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"search_result\": [\n    {\n      \"chid\": \"CHE123456789\",\n      \"name\": \"Swisscom AG\",\n      \"purpose\": \"Telecommunications\",\n      \"publications\": [...],\n      \"headOffices\": [...],\n      \"furtherHeadOffices\": [...],\n      \"branchOffices\": [...]\n    }\n  ],\n  \"address\": {\n    \"postal_code\": \"8000\",\n    \"street_nr\": \"1\",\n    \"street\": \"Bahnhofstrasse\",\n    \"ch_number\": \"CHE123456789\",\n    \"city\": \"Zurich\",\n    \"name\": \"Swisscom AG\",\n    \"region\": \"ZH\",\n    \"country\": \"CH\"\n  }\n}"
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    search:
                      - 'The search field is required.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      search:
                        type: array
                        example:
                          - 'The search field is required.'
                        items:
                          type: string
      tags:
        - Zefix
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                search:
                  type: string
                  description: 'The company name to search for.'
                  example: '"Swisscom"'
                  nullable: false
              required:
                - search
