openapi: 3.0.3
info:
  title: 'FortyHives Projects API Documentation'
  description: 'This is the API documentation for the taskify.'
  version: 1.0.0
servers:
  -
    url: 'http://127.0.0.1:8000'
paths:
  '/api/estimates-invoices/pdf/{id}':
    get:
      summary: ''
      operationId: getApiEstimatesInvoicesPdfId
      description: ''
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'No query results for model [App\Models\EstimatesInvoice] alias'
                properties:
                  message:
                    type: string
                    example: 'No query results for model [App\Models\EstimatesInvoice] alias'
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the pdf.'
        example: alias
        required: true
        schema:
          type: string
  /api/user/fcm-token:
    patch:
      summary: 'Update FCM Token.'
      operationId: updateFCMToken
      description: 'This endpoint allows an authenticated user or client to update their FCM token for push notifications.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'FCM token updated successfully.'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'FCM token updated successfully.'
      tags:
        - Endpoints
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                fcm_token:
                  type: string
                  description: 'The new FCM token for push notifications.'
                  example: 'dXkJz7KYZ9o:APA91bGfLa_qwAeD...'
              required:
                - fcm_token
      security: []
  /api/leave-requests/get-calendar-data:
    get:
      summary: ''
      operationId: getApiLeaveRequestsGetCalendarData
      description: ''
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: Unauthorized
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Unauthorized
      tags:
        - Endpoints
      security: []
  '/api/lead-stages/get/{id}':
    get:
      summary: 'Retrieve a specific lead stage.'
      operationId: retrieveASpecificLeadStage
      description: 'This endpoint retrieves the details of a specific lead stage by its ID. The user must be authenticated and authorized to manage lead stages.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Lead stage retrieved successfully!'
                  data:
                    id: 5
                    name: Qualified
                    slug: qualified
                    color: info
                    order: 2
                    workspace_id: 1
                    created_at: '2025-05-10T12:30:00.000000Z'
                    updated_at: '2025-05-15T09:12:00.000000Z'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Lead stage retrieved successfully!'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 5
                      name:
                        type: string
                        example: Qualified
                      slug:
                        type: string
                        example: qualified
                      color:
                        type: string
                        example: info
                      order:
                        type: integer
                        example: 2
                      workspace_id:
                        type: integer
                        example: 1
                      created_at:
                        type: string
                        example: '2025-05-10T12:30:00.000000Z'
                      updated_at:
                        type: string
                        example: '2025-05-15T09:12:00.000000Z'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Lead stage not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Lead stage not found.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while retrieving the lead stage.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while retrieving the lead stage.'
      tags:
        - Endpoints
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the lead stage to retrieve. Must exist in the `lead_stages` table.'
        example: 5
        required: true
        schema:
          type: integer
  '/api/custom-fields/{id}/edit':
    get:
      summary: ''
      operationId: getApiCustomFieldsIdEdit
      description: ''
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: Unauthorized
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Unauthorized
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the custom field.'
        example: 2
        required: true
        schema:
          type: integer
  /api/users/signup:
    post:
      summary: 'Register a new user.'
      operationId: registerANewUser
      description: 'This endpoint allows a new user to sign up by providing necessary details.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n\"error\": false,\n\"message\": \"Account created successfully.\",\n\"data\": {\n\"id\": 225,\n\"first_name\": \"Test\",\n\"last_name\": \"User\",\n\"role\": \"admin\",\n\"email\": \"test.user@example.com\",\n\"phone\": null,\n\"dob\": null,\n\"doj\": null,\n\"address\": null,\n\"city\": null,\n\"state\": null,\n\"country\": null,\n\"zip\": null,\n\"photo\": \"https://test-taskify.infinitietech.com/storage/photos/no-image.jpg\",\n\"status\": 0,\n\"created_at\": \"13-08-2024 14:59:38\",\n\"updated_at\": \"13-08-2024 14:59:38\"\n\"assigned\": {\n\"projects\": 0,\n\"tasks\": 0\n}\n}\n}"
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    email:
                      - 'The email field is required.'
                      - 'The email has already been taken.'
                    password:
                      - 'The password must be at least 6 characters.'
                    role:
                      - 'The role field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      email:
                        type: array
                        example:
                          - 'The email field is required.'
                          - 'The email has already been taken.'
                        items:
                          type: string
                      password:
                        type: array
                        example:
                          - 'The password must be at least 6 characters.'
                        items:
                          type: string
                      role:
                        type: array
                        example:
                          - 'The role field is required.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "Account couldn't be created, please contact the admin for assistance."
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "Account couldn't be created, please contact the admin for assistance."
      tags:
        - 'User Authentication'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  description: "The type of account ('member' for team member, 'client' for client)."
                  example: member
                first_name:
                  type: string
                  description: 'The first name of the user.'
                  example: John
                last_name:
                  type: string
                  description: 'The last name of the user.'
                  example: Doe
                email:
                  type: string
                  description: 'The email address of the user or client.'
                  example: john.doe@example.com
                password:
                  type: string
                  description: 'The password for the account.'
                  example: password123
                password_confirmation:
                  type: string
                  description: "The confirmation of the password. Must match 'password'."
                  example: password123
                company:
                  type: string
                  description: 'nullable The company name.'
                  example: 'Acme Inc.'
                fcm_token:
                  type: string
                  description: 'nullable The optional FCM token for push notifications.'
                  example: cXJ1AqT6B...
              required:
                - type
                - first_name
                - last_name
                - email
                - password
                - password_confirmation
      security: []
  /api/users/login:
    post:
      summary: 'Log in an existing user.'
      operationId: logInAnExistingUser
      description: 'This endpoint allows a user to log in by providing their email and password. Upon successful authentication, a token is returned for accessing protected resources.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Logged in successfully.'
                  token: 15|ANl9HwfqiiUxdOmNWba5qKhzfk3h1fyi8ZUoYbH8de8d3534
                  data:
                    user_id: 7
                    workspace_id: 6
                    my_locale: en
                    locale: en
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Logged in successfully.'
                  token:
                    type: string
                    example: 15|ANl9HwfqiiUxdOmNWba5qKhzfk3h1fyi8ZUoYbH8de8d3534
                  data:
                    type: object
                    properties:
                      user_id:
                        type: integer
                        example: 7
                      workspace_id:
                        type: integer
                        example: 6
                      my_locale:
                        type: string
                        example: en
                      locale:
                        type: string
                        example: en
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: Unauthorized
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Unauthorized
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    email:
                      - 'The email field is required.'
                    password:
                      - 'The password field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      email:
                        type: array
                        example:
                          - 'The email field is required.'
                        items:
                          type: string
                      password:
                        type: array
                        example:
                          - 'The password field is required.'
                        items:
                          type: string
      tags:
        - 'User Authentication'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  description: 'The email of the user.'
                  example: john.doe@example.com
                password:
                  type: string
                  description: 'The password for the user.'
                  example: password123
                fcm_token:
                  type: string
                  description: 'nullable The optional FCM token for push notifications.'
                  example: cXJ1AqT6B...
              required:
                - email
                - password
      security: []
  /api/password/reset-request:
    post:
      summary: 'Send Password Reset Link.'
      operationId: sendPasswordResetLink
      description: 'This endpoint allows a user or client to request a password reset link by providing their email and account type.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Password reset link emailed successfully.'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Password reset link emailed successfully.'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Account not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Account not found.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "Password reset link couldn't be sent, please check email settings."
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "Password reset link couldn't be sent, please check email settings."
      tags:
        - 'User Authentication'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  description: 'The email address of the user or client.'
                  example: john.doe@example.com
                account_type:
                  type: string
                  description: "The type of account ('user' for normal users, 'client' for clients)."
                  example: user
              required:
                - email
                - account_type
      security: []
  /api/password/reset:
    post:
      summary: 'Reset Password.'
      operationId: resetPassword
      description: 'This endpoint allows a user or client to reset their password using a valid token.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Password has been reset successfully.'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Password has been reset successfully.'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Account not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Account not found.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Password reset failed. Please try again later.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Password reset failed. Please try again later.'
      tags:
        - 'User Authentication'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                token:
                  type: string
                  description: 'The password reset token provided via the reset link.'
                  example: abc123
                email:
                  type: string
                  description: 'The email address of the user or client.'
                  example: john.doe@example.com
                password:
                  type: string
                  description: 'The new password for the account. Must be at least 6 characters and confirmed.'
                  example: newPassword123
                password_confirmation:
                  type: string
                  description: "The confirmation of the new password. Must match 'password'."
                  example: newPassword123
                account_type:
                  type: string
                  description: "The type of account ('user' for normal users, 'client' for clients)."
                  example: user
              required:
                - token
                - email
                - password
                - password_confirmation
                - account_type
      security: []
  /api/user:
    get:
      summary: "Retrieve the authenticated user's profile."
      operationId: retrieveTheAuthenticatedUsersProfile
      description: 'This endpoint returns the profile information of the currently authenticated user. The user must be authenticated to access their profile details.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Profile details retrieved successfully'
                  data:
                    id: 7
                    first_name: Madhavan
                    last_name: Vaidya
                    role: admin
                    email: admin@gmail.com
                    phone: '9099882203'
                    dob: 17-06-2024
                    doj: 03-10-2022
                    address: Devonshire
                    city: Windsor
                    state: 'ON'
                    country: Canada
                    zip: '123654'
                    photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                    status: 1
                    created_at: '03-01-2023 10:37:20'
                    updated_at: '13-08-2024 14:16:45'
                    assigned:
                      projects: 11
                      tasks: 9
                    is_admin_or_leave_editor: true
                    is_admin_or_has_all_data_access: true
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Profile details retrieved successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 7
                      first_name:
                        type: string
                        example: Madhavan
                      last_name:
                        type: string
                        example: Vaidya
                      role:
                        type: string
                        example: admin
                      email:
                        type: string
                        example: admin@gmail.com
                      phone:
                        type: string
                        example: '9099882203'
                      dob:
                        type: string
                        example: 17-06-2024
                      doj:
                        type: string
                        example: 03-10-2022
                      address:
                        type: string
                        example: Devonshire
                      city:
                        type: string
                        example: Windsor
                      state:
                        type: string
                        example: 'ON'
                      country:
                        type: string
                        example: Canada
                      zip:
                        type: string
                        example: '123654'
                      photo:
                        type: string
                        example: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                      status:
                        type: integer
                        example: 1
                      created_at:
                        type: string
                        example: '03-01-2023 10:37:20'
                      updated_at:
                        type: string
                        example: '13-08-2024 14:16:45'
                      assigned:
                        type: object
                        properties:
                          projects:
                            type: integer
                            example: 11
                          tasks:
                            type: integer
                            example: 9
                      is_admin_or_leave_editor:
                        type: boolean
                        example: true
                      is_admin_or_has_all_data_access:
                        type: boolean
                        example: true
      tags:
        - 'Profile Management'
  /api/users/photo:
    post:
      summary: 'Update the profile picture of a logged-in user or a specified user/client.'
      operationId: updateTheProfilePictureOfALoggedInUserOrASpecifiedUserclient
      description: "This endpoint allows the authenticated user to update their profile picture.\nIf both `id` and `type` are provided, the profile picture for the specified user or client will be updated.\nIf not, the profile picture of the logged-in user will be updated."
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Profile picture updated successfully.'
                      data:
                        id: 7
                        first_name: Madhavan
                        last_name: Vaidya
                        role: admin
                        email: admin@gmail.com
                        phone: '9099882203'
                        dob: 17-06-2024
                        doj: 03-10-2022
                        address: Devonshire
                        city: Windsor
                        state: 'ON'
                        country: Canada
                        zip: '123654'
                        photo: 'https://test-taskify.infinitietech.com/storage/photos/atEj9NKCeAJhM5VqBN69mFKHntHbZkPUl2Sa22RA.webp'
                        status: 1
                        created_at: '03-01-2023 10:37:20'
                        updated_at: '13-08-2024 18:58:34'
                        assigned:
                          projects: 11
                          tasks: 21
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Profile picture updated successfully.'
                      data:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 7
                          first_name:
                            type: string
                            example: Madhavan
                          last_name:
                            type: string
                            example: Vaidya
                          role:
                            type: string
                            example: admin
                          email:
                            type: string
                            example: admin@gmail.com
                          phone:
                            type: string
                            example: '9099882203'
                          dob:
                            type: string
                            example: 17-06-2024
                          doj:
                            type: string
                            example: 03-10-2022
                          address:
                            type: string
                            example: Devonshire
                          city:
                            type: string
                            example: Windsor
                          state:
                            type: string
                            example: 'ON'
                          country:
                            type: string
                            example: Canada
                          zip:
                            type: string
                            example: '123654'
                          photo:
                            type: string
                            example: 'https://test-taskify.infinitietech.com/storage/photos/atEj9NKCeAJhM5VqBN69mFKHntHbZkPUl2Sa22RA.webp'
                          status:
                            type: integer
                            example: 1
                          created_at:
                            type: string
                            example: '03-01-2023 10:37:20'
                          updated_at:
                            type: string
                            example: '13-08-2024 18:58:34'
                          assigned:
                            type: object
                            properties:
                              projects:
                                type: integer
                                example: 11
                              tasks:
                                type: integer
                                example: 21
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'No profile picture selected!'
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'No profile picture selected!'
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'User not found'
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'User not found'
                      data:
                        type: array
                        example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "Profile picture couldn't be updated."
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "Profile picture couldn't be updated."
      tags:
        - 'Profile Management'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  description: 'The ID of the user or client whose profile picture is being updated. Required if `type` is provided.'
                  example: 1
                type:
                  type: string
                  description: "The type of the entity whose profile picture is being updated. Must be either 'user' or 'client'."
                  example: user
                upload:
                  type: string
                  format: binary
                  description: 'The file of the new profile picture to be uploaded.'
              required:
                - id
                - type
                - upload
  '/api/users/{id}/profile':
    post:
      summary: 'Update the profile details of a logged-in user.'
      operationId: updateTheProfileDetailsOfALoggedInUser
      description: 'This endpoint allows the authenticated user to update their profile details such as name, email, address, and other relevant information.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Profile details updated successfully.'
                      data:
                        id: 7
                        first_name: Madhavan
                        last_name: Vaidya
                        role: admin
                        email: admin@gmail.com
                        phone: '9099882203'
                        dob: 17-06-2024
                        doj: 03-10-2022
                        address: Devonshire
                        city: Windsor
                        state: 'ON'
                        country: Canada
                        zip: '123654'
                        photo: 'https://test-taskify.infinitietech.com/storage/photos/atEj9NKCeAJhM5VqBN69mFKHntHbZkPUl2Sa22RA.webp'
                        status: 1
                        created_at: '03-01-2023 10:37:20'
                        updated_at: '13-08-2024 18:58:34'
                        assigned:
                          projects: 11
                          tasks: 21
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Profile details updated successfully.'
                      data:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 7
                          first_name:
                            type: string
                            example: Madhavan
                          last_name:
                            type: string
                            example: Vaidya
                          role:
                            type: string
                            example: admin
                          email:
                            type: string
                            example: admin@gmail.com
                          phone:
                            type: string
                            example: '9099882203'
                          dob:
                            type: string
                            example: 17-06-2024
                          doj:
                            type: string
                            example: 03-10-2022
                          address:
                            type: string
                            example: Devonshire
                          city:
                            type: string
                            example: Windsor
                          state:
                            type: string
                            example: 'ON'
                          country:
                            type: string
                            example: Canada
                          zip:
                            type: string
                            example: '123654'
                          photo:
                            type: string
                            example: 'https://test-taskify.infinitietech.com/storage/photos/atEj9NKCeAJhM5VqBN69mFKHntHbZkPUl2Sa22RA.webp'
                          status:
                            type: integer
                            example: 1
                          created_at:
                            type: string
                            example: '03-01-2023 10:37:20'
                          updated_at:
                            type: string
                            example: '13-08-2024 18:58:34'
                          assigned:
                            type: object
                            properties:
                              projects:
                                type: integer
                                example: 11
                              tasks:
                                type: integer
                                example: 21
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Validation error: The email has already been taken.'
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Validation error: The email has already been taken.'
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'User not found'
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'User not found'
                      data:
                        type: array
                        example: []
        500:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": true,\n  \"message\": \"Profile details couldn\\'t be updated.\"\n}"
      tags:
        - 'Profile Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                first_name:
                  type: string
                  description: "The user's first name."
                  example: Madhavan
                last_name:
                  type: string
                  description: "The user's last name."
                  example: Vaidya
                email:
                  type: string
                  description: "The user's email address. Can only be edited if `is_admin_or_has_all_data_access` is true for the logged-in user."
                  example: admin@gmail.com
                role:
                  type: integer
                  description: 'The ID of the role for the user. If the authenticated user is an admin, the provided role will be used. If the authenticated user is not an admin, the current role of the user will be used, regardless of the input.'
                  example: 1
                phone:
                  type: string
                  description: "The user's phone number."
                  example: '9099882203'
                country_code:
                  type: string
                  description: 'The country code for the phone number.'
                  example: '+91'
                country_iso_code:
                  type: string
                  description: 'nullable The ISO code for the phone number.'
                  example: in
                dob:
                  type: date
                  description: "The user's date of birth."
                  example: 17-06-2024
                doj:
                  type: date
                  description: "The user's date of joining."
                  example: 03-10-2022
                address:
                  type: string
                  description: "The user's address."
                  example: Devonshire
                city:
                  type: string
                  description: "The user's city."
                  example: Windsor
                state:
                  type: string
                  description: "The user's state."
                  example: 'ON'
                country:
                  type: string
                  description: "The user's country."
                  example: Canada
                zip:
                  type: string
                  description: "The user's zip code."
                  example: '123654'
                password:
                  type: string
                  description: "The user's new password (if changing)."
                  example: '12345678'
                password_confirmation:
                  type: string
                  description: 'The password confirmation (if changing password).'
                  example: '12345678'
              required:
                - first_name
                - last_name
                - email
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the user whose profile is being updated.'
        example: 2
        required: true
        schema:
          type: integer
  /api/account/destroy:
    delete:
      summary: 'Delete account of a logged-in user.'
      operationId: deleteAccountOfALoggedInUser
      description: 'This endpoint allows the authenticated user to delete their account.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": false,\n  \"message\": \"Account deleted successfully.\"\n  \"data\": []\n}"
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'User not found'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'User not found'
                  data:
                    type: array
                    example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "Account couldn't be deleted."
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "Account couldn't be deleted."
      tags:
        - 'Profile Management'
  /api/upcoming-birthdays:
    get:
      summary: 'List or search users with birthdays today or upcoming.'
      operationId: listOrSearchUsersWithBirthdaysTodayOrUpcoming
      description: 'This endpoint retrieves a list of users with birthdays occurring today or within a specified range of days. The user must be authenticated to perform this action.'
      parameters:
        -
          in: query
          name: search
          description: 'Optional. The search term to filter users by first name or last name or combination of first name and last name or User ID or date of birth.'
          example: John
          required: false
          schema:
            type: string
            description: 'Optional. The search term to filter users by first name or last name or combination of first name and last name or User ID or date of birth.'
            example: John
        -
          in: query
          name: order
          description: 'Optional. The sort order for the `dob` column. Acceptable values are `ASC` or `DESC`. Default is `ASC`.'
          example: DESC
          required: false
          schema:
            type: string
            description: 'Optional. The sort order for the `dob` column. Acceptable values are `ASC` or `DESC`. Default is `ASC`.'
            example: DESC
        -
          in: query
          name: upcoming_days
          description: 'Optional. The number of days from today to consider for upcoming birthdays. Default is 30.'
          example: 15
          required: false
          schema:
            type: integer
            description: 'Optional. The number of days from today to consider for upcoming birthdays. Default is 30.'
            example: 15
        -
          in: query
          name: user_ids
          description: 'Optional. The specific user IDs to filter the results.'
          example:
            - 123
            - 456
          required: false
          schema:
            type: array
            description: 'Optional. The specific user IDs to filter the results.'
            example:
              - 123
              - 456
            items:
              type: string
        -
          in: query
          name: limit
          description: 'Optional. The number of results to return per page. Default is 15.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'Optional. The number of results to return per page. Default is 15.'
            example: 10
        -
          in: query
          name: offset
          description: 'Optional. The number of results to skip before starting to collect the result set. Default is 0.'
          example: 5
          required: false
          schema:
            type: integer
            description: 'Optional. The number of results to skip before starting to collect the result set. Default is 0.'
            example: 5
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Upcoming birthdays retrieved successfully'
                      total: 1
                      data:
                        -
                          id: 1
                          member: 'John Doe'
                          photo: 'http://example.com/storage/photos/john_doe.jpg'
                          birthday_count: 30
                          days_left: 10
                          dob: 'Tue, 2024-08-08'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Upcoming birthdays retrieved successfully'
                      total:
                        type: integer
                        example: 1
                      data:
                        type: array
                        example:
                          -
                            id: 1
                            member: 'John Doe'
                            photo: 'http://example.com/storage/photos/john_doe.jpg'
                            birthday_count: 30
                            days_left: 10
                            dob: 'Tue, 2024-08-08'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1
                            member:
                              type: string
                              example: 'John Doe'
                            photo:
                              type: string
                              example: 'http://example.com/storage/photos/john_doe.jpg'
                            birthday_count:
                              type: integer
                              example: 30
                            days_left:
                              type: integer
                              example: 10
                            dob:
                              type: string
                              example: 'Tue, 2024-08-08'
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Upcoming birthdays not found.'
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Upcoming birthdays not found.'
                      data:
                        type: array
                        example: []
      tags:
        - 'Dashboard Management'
  /api/upcoming-work-anniversaries:
    get:
      summary: 'List or search users with work anniversaries today or upcoming.'
      operationId: listOrSearchUsersWithWorkAnniversariesTodayOrUpcoming
      description: 'This endpoint retrieves a list of users with work anniversaries occurring today or within a specified range of days. The user must be authenticated to perform this action.'
      parameters:
        -
          in: query
          name: search
          description: 'Optional. The search term to filter users by first name or last name or combination of first name and last name or User ID or date of joining.'
          example: John
          required: false
          schema:
            type: string
            description: 'Optional. The search term to filter users by first name or last name or combination of first name and last name or User ID or date of joining.'
            example: John
        -
          in: query
          name: order
          description: 'Optional. The sort order for the `doj` column. Acceptable values are `ASC` or `DESC`. Default is `ASC`.'
          example: DESC
          required: false
          schema:
            type: string
            description: 'Optional. The sort order for the `doj` column. Acceptable values are `ASC` or `DESC`. Default is `ASC`.'
            example: DESC
        -
          in: query
          name: upcoming_days
          description: 'Optional. The number of days from today to consider for upcoming work anniversaries. Default is 30.'
          example: 15
          required: false
          schema:
            type: integer
            description: 'Optional. The number of days from today to consider for upcoming work anniversaries. Default is 30.'
            example: 15
        -
          in: query
          name: user_ids
          description: 'Optional. The specific user IDs to filter the results.'
          example:
            - 123
            - 456
          required: false
          schema:
            type: array
            description: 'Optional. The specific user IDs to filter the results.'
            example:
              - 123
              - 456
            items:
              type: string
        -
          in: query
          name: limit
          description: 'Optional. The number of results to return per page. Default is 15.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'Optional. The number of results to return per page. Default is 15.'
            example: 10
        -
          in: query
          name: offset
          description: 'Optional. The number of results to skip before starting to collect the result set. Default is 0.'
          example: 5
          required: false
          schema:
            type: integer
            description: 'Optional. The number of results to skip before starting to collect the result set. Default is 0.'
            example: 5
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Upcoming work anniversaries retrieved successfully'
                      total: 1
                      data:
                        -
                          id: 1
                          member: 'John Doe'
                          photo: 'http://example.com/storage/photos/john_doe.jpg'
                          anniversary_count: 5
                          days_left: 10
                          doj: 'Tue, 2024-08-08'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Upcoming work anniversaries retrieved successfully'
                      total:
                        type: integer
                        example: 1
                      data:
                        type: array
                        example:
                          -
                            id: 1
                            member: 'John Doe'
                            photo: 'http://example.com/storage/photos/john_doe.jpg'
                            anniversary_count: 5
                            days_left: 10
                            doj: 'Tue, 2024-08-08'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1
                            member:
                              type: string
                              example: 'John Doe'
                            photo:
                              type: string
                              example: 'http://example.com/storage/photos/john_doe.jpg'
                            anniversary_count:
                              type: integer
                              example: 5
                            days_left:
                              type: integer
                              example: 10
                            doj:
                              type: string
                              example: 'Tue, 2024-08-08'
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Upcoming work anniversaries not found.'
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Upcoming work anniversaries not found.'
                      data:
                        type: array
                        example: []
      tags:
        - 'Dashboard Management'
  /api/members-on-leave:
    get:
      summary: 'List members currently on leave or scheduled to be on leave.'
      operationId: listMembersCurrentlyOnLeaveOrScheduledToBeOnLeave
      description: "This endpoint retrieves a list of members who are currently on leave or scheduled to be on leave within a specified range of days.\nThe user must be authenticated to perform this action."
      parameters:
        -
          in: query
          name: search
          description: 'Optional. The search term to filter users by first name or last name or combination of first name and last name or User ID or date of joining.'
          example: John
          required: false
          schema:
            type: string
            description: 'Optional. The search term to filter users by first name or last name or combination of first name and last name or User ID or date of joining.'
            example: John
        -
          in: query
          name: sort
          description: 'Optional. The field to sort by. Acceptable values are `from_date` and `to_date`. Default is `from_date`.'
          example: to_date
          required: false
          schema:
            type: string
            description: 'Optional. The field to sort by. Acceptable values are `from_date` and `to_date`. Default is `from_date`.'
            example: to_date
        -
          in: query
          name: order
          description: 'Optional. The sort order. Acceptable values are `ASC` or `DESC`. Default is `ASC`.'
          example: DESC
          required: false
          schema:
            type: string
            description: 'Optional. The sort order. Acceptable values are `ASC` or `DESC`. Default is `ASC`.'
            example: DESC
        -
          in: query
          name: upcoming_days
          description: 'Optional. The number of days from today to consider for upcoming leave. Default is 30.'
          example: 15
          required: false
          schema:
            type: integer
            description: 'Optional. The number of days from today to consider for upcoming leave. Default is 30.'
            example: 15
        -
          in: query
          name: user_ids
          description: 'Optional. The specific user IDs to filter the results.'
          example:
            - 123
            - 456
          required: false
          schema:
            type: array
            description: 'Optional. The specific user IDs to filter the results.'
            example:
              - 123
              - 456
            items:
              type: string
        -
          in: query
          name: limit
          description: 'Optional. The number of results to return per page. Default is 15.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'Optional. The number of results to return per page. Default is 15.'
            example: 10
        -
          in: query
          name: offset
          description: 'Optional. The number of results to skip before starting to collect the result set. Default is 0.'
          example: 5
          required: false
          schema:
            type: integer
            description: 'Optional. The number of results to skip before starting to collect the result set. Default is 0.'
            example: 5
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Members on leave retrieved successfully.'
                      total: 1
                      data:
                        -
                          id: 1
                          member: 'John Doe'
                          photo: 'http://example.com/storage/photos/john_doe.jpg'
                          from_date: 'Mon, 2024-07-15'
                          to_date: 'Fri, 2024-07-19'
                          type: Full
                          duration: '5 days'
                          days_left: 0
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Members on leave retrieved successfully.'
                      total:
                        type: integer
                        example: 1
                      data:
                        type: array
                        example:
                          -
                            id: 1
                            member: 'John Doe'
                            photo: 'http://example.com/storage/photos/john_doe.jpg'
                            from_date: 'Mon, 2024-07-15'
                            to_date: 'Fri, 2024-07-19'
                            type: Full
                            duration: '5 days'
                            days_left: 0
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1
                            member:
                              type: string
                              example: 'John Doe'
                            photo:
                              type: string
                              example: 'http://example.com/storage/photos/john_doe.jpg'
                            from_date:
                              type: string
                              example: 'Mon, 2024-07-15'
                            to_date:
                              type: string
                              example: 'Fri, 2024-07-19'
                            type:
                              type: string
                              example: Full
                            duration:
                              type: string
                              example: '5 days'
                            days_left:
                              type: integer
                              example: 0
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Members on leave not found.'
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Members on leave not found.'
                      data:
                        type: array
                        example: []
      tags:
        - 'Dashboard Management'
  /api/dashboard/statistics:
    get:
      summary: 'Get Statistics'
      operationId: getStatistics
      description: 'This endpoint retrieves workspace-specific statistics related to projects, tasks, users, clients, todos, and meetings. The user must be authenticated and have the necessary permissions to manage (if applicable) each respective module.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Statistics retrieved successfully'
                  data:
                    total_projects: 8
                    total_tasks: 8
                    total_users: 8
                    total_clients: 8
                    total_meetings: 8
                    total_todos: 0
                    completed_todos: 0
                    pending_todos: 0
                    status_wise_projects:
                      -
                        id: 1
                        title: 'In Progress'
                        color: primary
                        total_projects: 4
                      -
                        id: 2
                        title: Completed
                        color: success
                        total_projects: 4
                    status_wise_tasks:
                      -
                        id: 1
                        title: 'In Progress'
                        color: primary
                        total_tasks: 4
                      -
                        id: 2
                        title: Completed
                        color: success
                        total_tasks: 4
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Statistics retrieved successfully'
                  data:
                    type: object
                    properties:
                      total_projects:
                        type: integer
                        example: 8
                      total_tasks:
                        type: integer
                        example: 8
                      total_users:
                        type: integer
                        example: 8
                      total_clients:
                        type: integer
                        example: 8
                      total_meetings:
                        type: integer
                        example: 8
                      total_todos:
                        type: integer
                        example: 0
                      completed_todos:
                        type: integer
                        example: 0
                      pending_todos:
                        type: integer
                        example: 0
                      status_wise_projects:
                        type: array
                        example:
                          -
                            id: 1
                            title: 'In Progress'
                            color: primary
                            total_projects: 4
                          -
                            id: 2
                            title: Completed
                            color: success
                            total_projects: 4
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1
                            title:
                              type: string
                              example: 'In Progress'
                            color:
                              type: string
                              example: primary
                            total_projects:
                              type: integer
                              example: 4
                      status_wise_tasks:
                        type: array
                        example:
                          -
                            id: 1
                            title: 'In Progress'
                            color: primary
                            total_tasks: 4
                          -
                            id: 2
                            title: Completed
                            color: success
                            total_tasks: 4
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1
                            title:
                              type: string
                              example: 'In Progress'
                            color:
                              type: string
                              example: primary
                            total_tasks:
                              type: integer
                              example: 4
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while retrieving statistics: Internal server error message'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while retrieving statistics: Internal server error message'
      tags:
        - 'Dashboard Management'
  '/api/projects/{id}':
    get:
      summary: 'List or search projects.'
      operationId: listOrSearchProjects
      description: 'This endpoint retrieves a list of projects based on various filters. The user must be authenticated to perform this action. The request allows filtering by status, user, client, priority, tag, date ranges, and other parameters.'
      parameters:
        -
          in: query
          name: search
          description: 'optional The search term to filter projects by title or id.'
          example: Project
          required: false
          schema:
            type: string
            description: 'optional The search term to filter projects by title or id.'
            example: Project
        -
          in: query
          name: sort
          description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id, title, status, priority, start_date, end_date, budget, created_at, and updated_at.'
          example: title
          required: false
          schema:
            type: string
            description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id, title, status, priority, start_date, end_date, budget, created_at, and updated_at.'
            example: title
        -
          in: query
          name: order
          description: 'optional The sort order, either "ASC" or "DESC". Defaults to "DESC".'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional The sort order, either "ASC" or "DESC". Defaults to "DESC".'
            example: ASC
        -
          in: query
          name: status_ids
          description: 'optional An array of status IDs to filter projects by.'
          example:
            - 2
            - 3
          required: false
          schema:
            type: array
            description: 'optional An array of status IDs to filter projects by.'
            example:
              - 2
              - 3
            items:
              type: string
        -
          in: query
          name: user_ids
          description: 'optional An array of user IDs to filter projects by.'
          example:
            - 1
            - 2
            - 3
          required: false
          schema:
            type: array
            description: 'optional An array of user IDs to filter projects by.'
            example:
              - 1
              - 2
              - 3
            items:
              type: string
        -
          in: query
          name: client_ids
          description: 'optional An array of client IDs to filter projects by.'
          example:
            - 5
            - 6
          required: false
          schema:
            type: array
            description: 'optional An array of client IDs to filter projects by.'
            example:
              - 5
              - 6
            items:
              type: string
        -
          in: query
          name: priority_ids
          description: 'optional An array of priority IDs to filter projects by.'
          example:
            - 1
            - 2
          required: false
          schema:
            type: array
            description: 'optional An array of priority IDs to filter projects by.'
            example:
              - 1
              - 2
            items:
              type: string
        -
          in: query
          name: tag_ids
          description: 'optional An array of tag IDs to filter projects by.'
          example:
            - 1
            - 2
          required: false
          schema:
            type: array
            description: 'optional An array of tag IDs to filter projects by.'
            example:
              - 1
              - 2
            items:
              type: string
        -
          in: query
          name: project_start_date_from
          description: "optional The start date range's start in YYYY-MM-DD format."
          example: '2024-01-01'
          required: false
          schema:
            type: string
            description: "optional The start date range's start in YYYY-MM-DD format."
            example: '2024-01-01'
        -
          in: query
          name: project_start_date_to
          description: "optional The start date range's end in YYYY-MM-DD format."
          example: '2024-12-31'
          required: false
          schema:
            type: string
            description: "optional The start date range's end in YYYY-MM-DD format."
            example: '2024-12-31'
        -
          in: query
          name: project_end_date_from
          description: "optional The end date range's start in YYYY-MM-DD format."
          example: '2024-01-01'
          required: false
          schema:
            type: string
            description: "optional The end date range's start in YYYY-MM-DD format."
            example: '2024-01-01'
        -
          in: query
          name: project_end_date_to
          description: "optional The end date range's end in YYYY-MM-DD format."
          example: '2024-12-31'
          required: false
          schema:
            type: string
            description: "optional The end date range's end in YYYY-MM-DD format."
            example: '2024-12-31'
        -
          in: query
          name: is_favorites
          description: 'optional Filter projects marked as favorites.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Filter projects marked as favorites.'
            example: true
        -
          in: query
          name: limit
          description: 'optional The number of projects per page for pagination.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional The number of projects per page for pagination.'
            example: 10
        -
          in: query
          name: offset
          description: 'optional The offset for pagination, indicating the starting point of results.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'optional The offset for pagination, indicating the starting point of results.'
            example: 0
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Projects retrieved successfully'
                      total: 1
                      data:
                        -
                          id: 351
                          title: rwer
                          status: 'Rel test'
                          priority: Default
                          users:
                            -
                              id: 7
                              first_name: Madhavan
                              last_name: Vaidya
                              photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                            -
                              id: 183
                              first_name: Girish
                              last_name: Thacker
                              photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                          clients: []
                          tags: []
                          start_date: 14-06-2024
                          end_date: 14-06-2024
                          budget: ''
                          created_at: '14-06-2024 17:50:09'
                          updated_at: '17-06-2024 19:08:16'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Projects retrieved successfully'
                      total:
                        type: integer
                        example: 1
                      data:
                        type: array
                        example:
                          -
                            id: 351
                            title: rwer
                            status: 'Rel test'
                            priority: Default
                            users:
                              -
                                id: 7
                                first_name: Madhavan
                                last_name: Vaidya
                                photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                              -
                                id: 183
                                first_name: Girish
                                last_name: Thacker
                                photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                            clients: []
                            tags: []
                            start_date: 14-06-2024
                            end_date: 14-06-2024
                            budget: ''
                            created_at: '14-06-2024 17:50:09'
                            updated_at: '17-06-2024 19:08:16'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 351
                            title:
                              type: string
                              example: rwer
                            status:
                              type: string
                              example: 'Rel test'
                            priority:
                              type: string
                              example: Default
                            users:
                              type: array
                              example:
                                -
                                  id: 7
                                  first_name: Madhavan
                                  last_name: Vaidya
                                  photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                                -
                                  id: 183
                                  first_name: Girish
                                  last_name: Thacker
                                  photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                              items:
                                type: object
                                properties:
                                  id:
                                    type: integer
                                    example: 7
                                  first_name:
                                    type: string
                                    example: Madhavan
                                  last_name:
                                    type: string
                                    example: Vaidya
                                  photo:
                                    type: string
                                    example: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                            clients:
                              type: array
                              example: []
                            tags:
                              type: array
                              example: []
                            start_date:
                              type: string
                              example: 14-06-2024
                            end_date:
                              type: string
                              example: 14-06-2024
                            budget:
                              type: string
                              example: ''
                            created_at:
                              type: string
                              example: '14-06-2024 17:50:09'
                            updated_at:
                              type: string
                              example: '17-06-2024 19:08:16'
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Project not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Project not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Projects not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Projects not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
      tags:
        - 'Project Management'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                user_ids:
                  type: array
                  description: ''
                  example:
                    - 18
                  items:
                    type: integer
                client_ids:
                  type: array
                  description: ''
                  example:
                    - 6
                  items:
                    type: integer
                priority_ids:
                  type: array
                  description: ''
                  example:
                    - 3
                  items:
                    type: integer
                tag_ids:
                  type: array
                  description: ''
                  example:
                    - 9
                  items:
                    type: integer
                status_ids:
                  type: array
                  description: ''
                  example:
                    - 7
                  items:
                    type: integer
    parameters:
      -
        in: path
        name: id
        description: 'Optional parameter. optional The ID of the project to retrieve.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/projects/store:
    post:
      summary: 'Create a new project.'
      operationId: createANewProject
      description: 'This endpoint creates a new project with the provided details. The user must be authenticated to perform this action. The request validates various fields, including title, status, priority, dates, and task accessibility.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Project created successfully.'
                      id: 438
                      data:
                        id: 438
                        title: 'Res Test'
                        status: Default
                        priority: dsfdsf
                        users:
                          -
                            id: 7
                            first_name: Madhavan
                            last_name: Vaidya
                            photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                          -
                            id: 185
                            first_name: Admin
                            last_name: Test
                            photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                        clients:
                          -
                            id: 103
                            first_name: Test
                            last_name: Test
                            photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                        tags:
                          -
                            id: 45
                            title: 'Tag from update project'
                        start_date: null
                        end_date: null
                        budget: '1000'
                        task_accessibility: assigned_users
                        description: null
                        note: null
                        favorite: 0
                        created_at: '07-08-2024 14:38:51'
                        updated_at: '07-08-2024 14:38:51'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Project created successfully.'
                      id:
                        type: integer
                        example: 438
                      data:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 438
                          title:
                            type: string
                            example: 'Res Test'
                          status:
                            type: string
                            example: Default
                          priority:
                            type: string
                            example: dsfdsf
                          users:
                            type: array
                            example:
                              -
                                id: 7
                                first_name: Madhavan
                                last_name: Vaidya
                                photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                              -
                                id: 185
                                first_name: Admin
                                last_name: Test
                                photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                            items:
                              type: object
                              properties:
                                id:
                                  type: integer
                                  example: 7
                                first_name:
                                  type: string
                                  example: Madhavan
                                last_name:
                                  type: string
                                  example: Vaidya
                                photo:
                                  type: string
                                  example: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                          clients:
                            type: array
                            example:
                              -
                                id: 103
                                first_name: Test
                                last_name: Test
                                photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                            items:
                              type: object
                              properties:
                                id:
                                  type: integer
                                  example: 103
                                first_name:
                                  type: string
                                  example: Test
                                last_name:
                                  type: string
                                  example: Test
                                photo:
                                  type: string
                                  example: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                          tags:
                            type: array
                            example:
                              -
                                id: 45
                                title: 'Tag from update project'
                            items:
                              type: object
                              properties:
                                id:
                                  type: integer
                                  example: 45
                                title:
                                  type: string
                                  example: 'Tag from update project'
                          start_date:
                            type: string
                            example: null
                          end_date:
                            type: string
                            example: null
                          budget:
                            type: string
                            example: '1000'
                          task_accessibility:
                            type: string
                            example: assigned_users
                          description:
                            type: string
                            example: null
                          note:
                            type: string
                            example: null
                          favorite:
                            type: integer
                            example: 0
                          created_at:
                            type: string
                            example: '07-08-2024 14:38:51'
                          updated_at:
                            type: string
                            example: '07-08-2024 14:38:51'
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'You are not authorized to set this status.'
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'You are not authorized to set this status.'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    title:
                      - 'The title field is required.'
                    status_id:
                      - 'The status_id field is required.'
                    start_date:
                      - 'The start date must be before or equal to the end date.'
                    budget:
                      - 'The budget format is invalid.'
                    task_accessibility:
                      - 'The task accessibility must be either project_users or assigned_users.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      title:
                        type: array
                        example:
                          - 'The title field is required.'
                        items:
                          type: string
                      status_id:
                        type: array
                        example:
                          - 'The status_id field is required.'
                        items:
                          type: string
                      start_date:
                        type: array
                        example:
                          - 'The start date must be before or equal to the end date.'
                        items:
                          type: string
                      budget:
                        type: array
                        example:
                          - 'The budget format is invalid.'
                        items:
                          type: string
                      task_accessibility:
                        type: array
                        example:
                          - 'The task accessibility must be either project_users or assigned_users.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while creating the project.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while creating the project.'
      tags:
        - 'Project Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: 'The title of the project.'
                  example: 'New Website Launch'
                status_id:
                  type: integer
                  description: "The ID of the project's status."
                  example: 1
                priority_id:
                  type: integer
                  description: "optional The ID of the project's priority."
                  example: 2
                start_date:
                  type: string|null
                  description: 'optional The start date of the project in the format specified in the general settings.'
                  example: '2024-08-01'
                end_date:
                  type: string|null
                  description: 'optional The end date of the project in the format specified in the general settings.'
                  example: '2024-08-31'
                budget:
                  type: string|null
                  description: 'optional Only digits, commas as thousand separators, and a single decimal point are allowed. digits can optionally be grouped in thousands with commas, where each group of digits must be exactly three digits long (e.g., 1,000 is correct; 10,0000 is not).'
                  example: '5000.00'
                task_accessibility:
                  type: string
                  description: "Indicates who can access the task. Must be either 'project_users' or 'assigned_users'."
                  example: project_users
                description:
                  type: string|null
                  description: 'optional A description of the project.'
                  example: 'A project to launch a new company website.'
                note:
                  type: string|null
                  description: 'optional Additional notes for the project.'
                  example: 'Ensure all team members are informed.'
                user_id:
                  type: array|null
                  description: 'optional Array of user IDs to be associated with the project.'
                  example: '[1, 2, 3]'
                client_id:
                  type: array|null
                  description: 'optional Array of client IDs to be associated with the project.'
                  example: '[5, 6]'
                tag_ids:
                  type: array|null
                  description: 'optional Array of tag IDs to be associated with the project.'
                  example: '[10, 11]'
                clientCanDiscuss:
                  type: string
                  description: "optional Indicates if the client can participate in project discussions. Can only specify if `is_admin_or_has_all_data_access` is true for the logged-in user; otherwise, it will be considered 0 by default. The value should be 'on' to allow client participation."
                  example: 'on'
              required:
                - title
                - status_id
                - task_accessibility
  /api/projects/update:
    post:
      summary: 'Update an existing project.'
      operationId: updateAnExistingProject
      description: 'This endpoint updates an existing project with the provided details. The user must be authenticated to perform this action. The request validates various fields, including title, status, priority, dates, and task accessibility.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Project updated successfully.'
                      id: 438
                      data:
                        id: 438
                        title: 'Res Test'
                        status: Default
                        priority: dsfdsf
                        users:
                          -
                            id: 7
                            first_name: Madhavan
                            last_name: Vaidya
                            photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                          -
                            id: 185
                            first_name: Admin
                            last_name: Test
                            photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                        clients:
                          -
                            id: 103
                            first_name: Test
                            last_name: Test
                            photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                        tags:
                          -
                            id: 45
                            title: 'Tag from update project'
                        start_date: null
                        end_date: null
                        budget: '1000'
                        task_accessibility: assigned_users
                        description: null
                        note: null
                        favorite: 0
                        created_at: '07-08-2024 14:38:51'
                        updated_at: '07-08-2024 14:38:51'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Project updated successfully.'
                      id:
                        type: integer
                        example: 438
                      data:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 438
                          title:
                            type: string
                            example: 'Res Test'
                          status:
                            type: string
                            example: Default
                          priority:
                            type: string
                            example: dsfdsf
                          users:
                            type: array
                            example:
                              -
                                id: 7
                                first_name: Madhavan
                                last_name: Vaidya
                                photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                              -
                                id: 185
                                first_name: Admin
                                last_name: Test
                                photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                            items:
                              type: object
                              properties:
                                id:
                                  type: integer
                                  example: 7
                                first_name:
                                  type: string
                                  example: Madhavan
                                last_name:
                                  type: string
                                  example: Vaidya
                                photo:
                                  type: string
                                  example: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                          clients:
                            type: array
                            example:
                              -
                                id: 103
                                first_name: Test
                                last_name: Test
                                photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                            items:
                              type: object
                              properties:
                                id:
                                  type: integer
                                  example: 103
                                first_name:
                                  type: string
                                  example: Test
                                last_name:
                                  type: string
                                  example: Test
                                photo:
                                  type: string
                                  example: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                          tags:
                            type: array
                            example:
                              -
                                id: 45
                                title: 'Tag from update project'
                            items:
                              type: object
                              properties:
                                id:
                                  type: integer
                                  example: 45
                                title:
                                  type: string
                                  example: 'Tag from update project'
                          start_date:
                            type: string
                            example: null
                          end_date:
                            type: string
                            example: null
                          budget:
                            type: string
                            example: '1000'
                          task_accessibility:
                            type: string
                            example: assigned_users
                          description:
                            type: string
                            example: null
                          note:
                            type: string
                            example: null
                          favorite:
                            type: integer
                            example: 0
                          created_at:
                            type: string
                            example: '07-08-2024 14:38:51'
                          updated_at:
                            type: string
                            example: '07-08-2024 14:38:51'
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'You are not authorized to set this status.'
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'You are not authorized to set this status.'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    id:
                      - 'The project ID is required.'
                      - 'The project ID does not exist in our records.'
                    status_id:
                      - 'The status field is required.'
                    budget:
                      - 'The budget format is invalid.'
                    task_accessibility:
                      - 'The task accessibility must be either project_users or assigned_users.'
                    start_date:
                      - 'The start date must be before or equal to the end date.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      id:
                        type: array
                        example:
                          - 'The project ID is required.'
                          - 'The project ID does not exist in our records.'
                        items:
                          type: string
                      status_id:
                        type: array
                        example:
                          - 'The status field is required.'
                        items:
                          type: string
                      budget:
                        type: array
                        example:
                          - 'The budget format is invalid.'
                        items:
                          type: string
                      task_accessibility:
                        type: array
                        example:
                          - 'The task accessibility must be either project_users or assigned_users.'
                        items:
                          type: string
                      start_date:
                        type: array
                        example:
                          - 'The start date must be before or equal to the end date.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while updating the project.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while updating the project.'
      tags:
        - 'Project Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  description: 'The ID of the project to update.'
                  example: 1
                title:
                  type: string
                  description: 'The title of the project.'
                  example: 'Updated Project Title'
                status_id:
                  type: integer
                  description: "The ID of the project's status."
                  example: 2
                priority_id:
                  type: integer
                  description: "optional The ID of the project's priority."
                  example: 3
                budget:
                  type: string|null
                  description: 'optional Only digits, commas as thousand separators, and a single decimal point are allowed. digits can optionally be grouped in thousands with commas, where each group of digits must be exactly three digits long (e.g., 1,000 is correct; 10,0000 is not).'
                  example: '5000.00'
                task_accessibility:
                  type: string
                  description: "Indicates who can access the task. Must be either 'project_users' or 'assigned_users'."
                  example: assigned_users
                start_date:
                  type: string|null
                  description: 'optional The start date of the project in the format specified in the general settings.'
                  example: '2024-08-01'
                end_date:
                  type: string|null
                  description: 'optional The end date of the project in the format specified in the general settings.'
                  example: '2024-08-31'
                description:
                  type: string|null
                  description: 'optional A description of the project.'
                  example: 'Updated project description.'
                note:
                  type: string|null
                  description: 'optional Additional notes for the project.'
                  example: 'Updated note for the project.'
                user_id:
                  type: array|null
                  description: 'optional Array of user IDs to be associated with the project.'
                  example: '[2, 3]'
                client_id:
                  type: array|null
                  description: 'optional Array of client IDs to be associated with the project.'
                  example: '[5, 6]'
                tag_ids:
                  type: array|null
                  description: 'optional Array of tag IDs to be associated with the project.'
                  example: '[10, 11]'
                clientCanDiscuss:
                  type: string
                  description: "optional Indicates if the client can participate in project discussions. Can only specify if `is_admin_or_has_all_data_access` is true for the logged-in user; otherwise, it will be considered current value by default. The value should be 'on' to allow client participation."
                  example: 'on'
              required:
                - id
                - title
                - status_id
                - task_accessibility
  '/api/projects/{id}/favorite':
    patch:
      summary: 'Update the favorite status of a project.'
      operationId: updateTheFavoriteStatusOfAProject
      description: 'This endpoint updates whether a project is marked as a favorite or not. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Project favorite status updated successfully'
                      data:
                        id: 438
                        title: 'Res Test'
                        status: Default
                        priority: dsfdsf
                        users:
                          -
                            id: 7
                            first_name: Madhavan
                            last_name: Vaidya
                            photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                        clients:
                          -
                            id: 103
                            first_name: Test
                            last_name: Test
                            photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                        tags:
                          -
                            id: 45
                            title: 'Tag from update project'
                        start_date: null
                        end_date: null
                        budget: '1000.00'
                        task_accessibility: assigned_users
                        description: null
                        note: null
                        favorite: 1
                        created_at: '07-08-2024 14:38:51'
                        updated_at: '12-08-2024 13:36:10'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Project favorite status updated successfully'
                      data:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 438
                          title:
                            type: string
                            example: 'Res Test'
                          status:
                            type: string
                            example: Default
                          priority:
                            type: string
                            example: dsfdsf
                          users:
                            type: array
                            example:
                              -
                                id: 7
                                first_name: Madhavan
                                last_name: Vaidya
                                photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                            items:
                              type: object
                              properties:
                                id:
                                  type: integer
                                  example: 7
                                first_name:
                                  type: string
                                  example: Madhavan
                                last_name:
                                  type: string
                                  example: Vaidya
                                photo:
                                  type: string
                                  example: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                          clients:
                            type: array
                            example:
                              -
                                id: 103
                                first_name: Test
                                last_name: Test
                                photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                            items:
                              type: object
                              properties:
                                id:
                                  type: integer
                                  example: 103
                                first_name:
                                  type: string
                                  example: Test
                                last_name:
                                  type: string
                                  example: Test
                                photo:
                                  type: string
                                  example: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                          tags:
                            type: array
                            example:
                              -
                                id: 45
                                title: 'Tag from update project'
                            items:
                              type: object
                              properties:
                                id:
                                  type: integer
                                  example: 45
                                title:
                                  type: string
                                  example: 'Tag from update project'
                          start_date:
                            type: string
                            example: null
                          end_date:
                            type: string
                            example: null
                          budget:
                            type: string
                            example: '1000.00'
                          task_accessibility:
                            type: string
                            example: assigned_users
                          description:
                            type: string
                            example: null
                          note:
                            type: string
                            example: null
                          favorite:
                            type: integer
                            example: 1
                          created_at:
                            type: string
                            example: '07-08-2024 14:38:51'
                          updated_at:
                            type: string
                            example: '12-08-2024 13:36:10'
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Project not found'
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Project not found'
                      data:
                        type: array
                        example: []
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    is_favorite:
                      - 'The is favorite field must be either 0 or 1.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      is_favorite:
                        type: array
                        example:
                          - 'The is favorite field must be either 0 or 1.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while updating the favorite status.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while updating the favorite status.'
      tags:
        - 'Project Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                is_favorite:
                  type: integer
                  description: 'Indicates whether the project is a favorite. Use 1 for true and 0 for false.'
                  example: 9
              required:
                - is_favorite
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the project to update.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/projects/{id}/pinned':
    patch:
      summary: 'Update the pinned status of a project.'
      operationId: updateThePinnedStatusOfAProject
      description: 'This endpoint updates whether a project is marked as pinned or not. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n\"error\": false,\n\"message\": \"Project pinned status updated successfully\",\n\"data\": {\n  \"id\": 438,\n  \"title\": \"Res Test\"\n  // Other project details will be included in the actual response\n}\n}"
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    is_pinned:
                      - 'The is pinned field must be either 0 or 1.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      is_pinned:
                        type: array
                        example:
                          - 'The is pinned field must be either 0 or 1.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while updating the pinned status.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while updating the pinned status.'
      tags:
        - 'Project Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                is_pinned:
                  type: integer
                  description: 'Indicates whether the project is pinned. Use 1 for true and 0 for false.'
                  example: 2
              required:
                - is_pinned
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the project to update.'
        example: 6
        required: true
        schema:
          type: integer
  '/api/projects/{id}/status':
    patch:
      summary: 'Update the status of a project.'
      operationId: updateTheStatusOfAProject
      description: 'This endpoint updates the status of a specified project. The user must be authenticated and have permission to set the new status. A notification will be sent to all users and clients associated with the project.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Status updated successfully.'
                      id: '438'
                      type: project
                      activity_message: 'Madhavan Vaidya updated project status from Default to vbnvbnvbn'
                      data:
                        id: 438
                        title: 'Res Test'
                        status: vbnvbnvbn
                        priority: dsfdsf
                        users:
                          -
                            id: 7
                            first_name: Madhavan
                            last_name: Vaidya
                            photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                        clients:
                          -
                            id: 103
                            first_name: Test
                            last_name: Test
                            photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                        tags:
                          -
                            id: 45
                            title: 'Tag from update project'
                        start_date: null
                        end_date: null
                        budget: '1000.00'
                        task_accessibility: assigned_users
                        description: null
                        note: null
                        favorite: 1
                        created_at: '07-08-2024 14:38:51'
                        updated_at: '12-08-2024 13:49:33'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Status updated successfully.'
                      id:
                        type: string
                        example: '438'
                      type:
                        type: string
                        example: project
                      activity_message:
                        type: string
                        example: 'Madhavan Vaidya updated project status from Default to vbnvbnvbn'
                      data:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 438
                          title:
                            type: string
                            example: 'Res Test'
                          status:
                            type: string
                            example: vbnvbnvbn
                          priority:
                            type: string
                            example: dsfdsf
                          users:
                            type: array
                            example:
                              -
                                id: 7
                                first_name: Madhavan
                                last_name: Vaidya
                                photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                            items:
                              type: object
                              properties:
                                id:
                                  type: integer
                                  example: 7
                                first_name:
                                  type: string
                                  example: Madhavan
                                last_name:
                                  type: string
                                  example: Vaidya
                                photo:
                                  type: string
                                  example: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                          clients:
                            type: array
                            example:
                              -
                                id: 103
                                first_name: Test
                                last_name: Test
                                photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                            items:
                              type: object
                              properties:
                                id:
                                  type: integer
                                  example: 103
                                first_name:
                                  type: string
                                  example: Test
                                last_name:
                                  type: string
                                  example: Test
                                photo:
                                  type: string
                                  example: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                          tags:
                            type: array
                            example:
                              -
                                id: 45
                                title: 'Tag from update project'
                            items:
                              type: object
                              properties:
                                id:
                                  type: integer
                                  example: 45
                                title:
                                  type: string
                                  example: 'Tag from update project'
                          start_date:
                            type: string
                            example: null
                          end_date:
                            type: string
                            example: null
                          budget:
                            type: string
                            example: '1000.00'
                          task_accessibility:
                            type: string
                            example: assigned_users
                          description:
                            type: string
                            example: null
                          note:
                            type: string
                            example: null
                          favorite:
                            type: integer
                            example: 1
                          created_at:
                            type: string
                            example: '07-08-2024 14:38:51'
                          updated_at:
                            type: string
                            example: '12-08-2024 13:49:33'
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'You are not authorized to set this status.'
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'You are not authorized to set this status.'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    id:
                      - 'The selected id is invalid.'
                    statusId:
                      - 'The selected status id is invalid.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      id:
                        type: array
                        example:
                          - 'The selected id is invalid.'
                        items:
                          type: string
                      statusId:
                        type: array
                        example:
                          - 'The selected status id is invalid.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "Status couldn't be updated."
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "Status couldn't be updated."
      tags:
        - 'Project Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                statusId:
                  type: integer
                  description: 'The ID of the new status to set for the project.'
                  example: 9
                note:
                  type: string
                  description: 'optional An optional note to attach to the project update.'
                  example: aut
              required:
                - statusId
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the project whose status is to be updated.'
        example: 18
        required: true
        schema:
          type: integer
  '/api/projects/{id}/priority':
    patch:
      summary: 'Update the priority of a project.'
      operationId: updateThePriorityOfAProject
      description: 'This endpoint updates the priority of a specified project. The user must be authenticated and have permission to set the new priority.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Priority updated successfully.'
                  id: '438'
                  type: project
                  activity_message: 'Madhavan Vaidya updated project priority from Low to Medium'
                  data:
                    id: 438
                    title: 'Res Test'
                    status: 'Test From Pro'
                    priority: Medium
                    users:
                      -
                        id: 7
                        first_name: Madhavan
                        last_name: Vaidya
                        photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                    clients:
                      -
                        id: 103
                        first_name: Test
                        last_name: Test
                        photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                    tags:
                      -
                        id: 45
                        title: 'Tag from update project'
                    start_date: null
                    end_date: null
                    budget: '1000.00'
                    task_accessibility: assigned_users
                    description: null
                    note: null
                    favorite: 1
                    created_at: '07-08-2024 14:38:51'
                    updated_at: '12-08-2024 13:58:55'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Priority updated successfully.'
                  id:
                    type: string
                    example: '438'
                  type:
                    type: string
                    example: project
                  activity_message:
                    type: string
                    example: 'Madhavan Vaidya updated project priority from Low to Medium'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 438
                      title:
                        type: string
                        example: 'Res Test'
                      status:
                        type: string
                        example: 'Test From Pro'
                      priority:
                        type: string
                        example: Medium
                      users:
                        type: array
                        example:
                          -
                            id: 7
                            first_name: Madhavan
                            last_name: Vaidya
                            photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 7
                            first_name:
                              type: string
                              example: Madhavan
                            last_name:
                              type: string
                              example: Vaidya
                            photo:
                              type: string
                              example: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                      clients:
                        type: array
                        example:
                          -
                            id: 103
                            first_name: Test
                            last_name: Test
                            photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 103
                            first_name:
                              type: string
                              example: Test
                            last_name:
                              type: string
                              example: Test
                            photo:
                              type: string
                              example: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                      tags:
                        type: array
                        example:
                          -
                            id: 45
                            title: 'Tag from update project'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 45
                            title:
                              type: string
                              example: 'Tag from update project'
                      start_date:
                        type: string
                        example: null
                      end_date:
                        type: string
                        example: null
                      budget:
                        type: string
                        example: '1000.00'
                      task_accessibility:
                        type: string
                        example: assigned_users
                      description:
                        type: string
                        example: null
                      note:
                        type: string
                        example: null
                      favorite:
                        type: integer
                        example: 1
                      created_at:
                        type: string
                        example: '07-08-2024 14:38:51'
                      updated_at:
                        type: string
                        example: '12-08-2024 13:58:55'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    id:
                      - 'The selected id is invalid.'
                    priorityId:
                      - 'The selected priority id is invalid.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      id:
                        type: array
                        example:
                          - 'The selected id is invalid.'
                        items:
                          type: string
                      priorityId:
                        type: array
                        example:
                          - 'The selected priority id is invalid.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "Priority couldn't be updated."
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "Priority couldn't be updated."
      tags:
        - 'Project Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                priorityId:
                  type: integer
                  description: 'The ID of the new priority to set for the project.'
                  example: 18
              required:
                - priorityId
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the project whose priority is to be updated.'
        example: 9
        required: true
        schema:
          type: integer
  '/api/projects/destroy/{id}':
    delete:
      summary: 'Remove the specified project.'
      operationId: removeTheSpecifiedProject
      description: 'This endpoint deletes a project based on the provided ID. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Project deleted successfully.'
                      id: 1
                      title: 'Project Title'
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Project deleted successfully.'
                      id:
                        type: integer
                        example: 1
                      title:
                        type: string
                        example: 'Project Title'
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Project not found.'
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Project not found.'
                      data:
                        type: array
                        example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while deleting the project.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while deleting the project.'
      tags:
        - 'Project Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the project to be deleted.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/projects/{id}/status-timelines':
    get:
      summary: 'Get project status timeline.'
      operationId: getProjectStatusTimeline
      description: 'This endpoint retrieves the status change history of a project, sorted in descending order.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Status timeline retrieved successfully.'
                  status_timeline:
                    -
                      id: 1
                      status: 'In Progress'
                      previous_status: Pending
                      new_color: '#ffcc00'
                      old_color: '#cccccc'
                      changed_at: '2025-03-03'
                    -
                      id: 2
                      status: Completed
                      previous_status: 'In Progress'
                      new_color: '#00cc66'
                      old_color: '#ffcc00'
                      changed_at: '2025-03-05 16:00:00'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Status timeline retrieved successfully.'
                  status_timeline:
                    type: array
                    example:
                      -
                        id: 1
                        status: 'In Progress'
                        previous_status: Pending
                        new_color: '#ffcc00'
                        old_color: '#cccccc'
                        changed_at: '2025-03-03'
                      -
                        id: 2
                        status: Completed
                        previous_status: 'In Progress'
                        new_color: '#00cc66'
                        old_color: '#ffcc00'
                        changed_at: '2025-03-05 16:00:00'
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        status:
                          type: string
                          example: 'In Progress'
                        previous_status:
                          type: string
                          example: Pending
                        new_color:
                          type: string
                          example: '#ffcc00'
                        old_color:
                          type: string
                          example: '#cccccc'
                        changed_at:
                          type: string
                          example: '2025-03-03'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Project not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Project not found.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Could not retrieve status timeline.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Could not retrieve status timeline.'
      tags:
        - 'Project Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the project whose status timeline is to be retrieved.'
        example: 3
        required: true
        schema:
          type: integer
  '/api/projects/{id}/mind-map':
    get:
      summary: 'Get Mind Map Data of a specific project.'
      operationId: getMindMapDataOfASpecificProject
      description: 'This endpoint retrieves mind map data of a specific project by its ID.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": false,\n  \"data\":  {\n      \"id\": \"project_2\",\n      \"topic\": \"hola\",\n\"link\": \"https://dev-taskify.taskhub.company/projects/information/2\",\n\"isroot\": true,\n\"level\": 1,\n\"children\": [\n{\n\"id\": \"tasks\",\n\"topic\": \"Tasks\",\n\"level\": 2,\n\"children\": [\n{\n\"id\": \"task_4\",\n\"topic\": \"Test\",\n\"link\": \"https://dev-taskify.taskhub.company/tasks/information/4\",\n\"children\": [\n{\n\"id\": \"task_users_4\",\n\"topic\": \"Users\",\n\"children\": [\n{\n\"id\": \"task_user_4_1\",\n\"topic\": \"Admin User\",\n\"link\": \"https://dev-taskify.taskhub.company/users/profile/1\"\n}\n]\n},\n{\n\"id\": \"task_clients_4\",\n\"topic\": \"Clients\",\n\"children\": []\n}\n]\n},\n{\n\"id\": \"task_5\",\n\"topic\": \"test\",\n\"link\": \"https://dev-taskify.taskhub.company/tasks/information/5\",\n\"children\": [\n{\n\"id\": \"task_users_5\",\n\"topic\": \"Users\",\n\"children\": [\n{\n\"id\": \"task_user_5_1\",\n\"topic\": \"Admin User\",\n\"link\": \"https://dev-taskify.taskhub.company/users/profile/1\"\n}\n]\n},\n{\n\"id\": \"task_clients_5\",\n\"topic\": \"Clients\",\n\"children\": []\n}\n]\n},\n{\n\"id\": \"task_6\",\n\"topic\": \"test 1\",\n\"link\": \"https://dev-taskify.taskhub.company/tasks/information/6\",\n\"children\": [\n{\n\"id\": \"task_users_6\",\n\"topic\": \"Users\",\n\"children\": [\n{\n\"id\": \"task_user_6_1\",\n\"topic\": \"Admin User\",\n\"link\": \"https://dev-taskify.taskhub.company/users/profile/1\"\n}\n]\n},\n{\n\"id\": \"task_clients_6\",\n\"topic\": \"Clients\",\n\"children\": []\n}\n]\n}\n]\n},\n{\n\"id\": \"users\",\n\"topic\": \"Users\",\n\"children\": [\n{\n\"id\": \"user_1\",\n\"topic\": \"Admin User\",\n\"link\": \"https://dev-taskify.taskhub.company/users/profile/1\"\n}\n]\n},\n{\n\"id\": \"clients\",\n\"topic\": \"Clients\",\n\"children\": []\n},\n{\n\"id\": \"milestones\",\n\"topic\": \"Milestones\",\n\"children\": []\n},\n{\n\"id\": \"media\",\n\"topic\": \"Media\",\n\"children\": []\n}\n]\n}"
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Project not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Project not found.'
      tags:
        - 'Project Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the data to retrieve.'
        example: 9
        required: true
        schema:
          type: integer
  /api/milestones/store:
    post:
      summary: 'Store a new milestone.'
      operationId: storeANewMilestone
      description: 'This endpoint creates a new milestone for a specified project. The user must be authenticated and have permission to create milestones.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Milestone created successfully.'
                  id: 12
                  type: milestone
                  parent_type: project
                  parent_id: 438
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Milestone created successfully.'
                  id:
                    type: integer
                    example: 12
                  type:
                    type: string
                    example: milestone
                  parent_type:
                    type: string
                    example: project
                  parent_id:
                    type: integer
                    example: 438
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    project_id:
                      - 'The selected project_id is invalid.'
                    title:
                      - 'The title field is required.'
                    cost:
                      - 'The cost format is invalid.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      project_id:
                        type: array
                        example:
                          - 'The selected project_id is invalid.'
                        items:
                          type: string
                      title:
                        type: array
                        example:
                          - 'The title field is required.'
                        items:
                          type: string
                      cost:
                        type: array
                        example:
                          - 'The cost format is invalid.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "Milestone couldn't be created."
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "Milestone couldn't be created."
      tags:
        - 'Milestone Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                project_id:
                  type: integer
                  description: 'The ID of the project to which the milestone belongs.'
                  example: 5
                title:
                  type: string
                  description: 'The title of the milestone.'
                  example: omnis
                status:
                  type: string
                  description: 'The status of the milestone.'
                  example: praesentium
                start_date:
                  type: date
                  description: 'optional The start date of the milestone (YYYY-MM-DD).'
                  example: adipisci
                end_date:
                  type: date
                  description: 'optional The end date of the milestone (YYYY-MM-DD).'
                  example: velit
                cost:
                  type: numeric
                  description: 'The cost of the milestone.'
                  example: aperiam
                description:
                  type: string
                  description: 'optional A description of the milestone.'
                  example: 'Id dignissimos ullam amet neque quisquam.'
              required:
                - project_id
                - title
                - status
                - cost
  '/api/milestones/{id}':
    get:
      summary: 'Get a list of milestones for a project.'
      operationId: getAListOfMilestonesForAProject
      description: "This endpoint retrieves all milestones associated with a given project.\nIt supports searching, filtering, and sorting functionalities."
      parameters:
        -
          in: query
          name: search
          description: 'optional Search for milestones by title, ID, cost, or description.'
          example: et
          required: false
          schema:
            type: string
            description: 'optional Search for milestones by title, ID, cost, or description.'
            example: et
        -
          in: query
          name: sort
          description: 'optional Field to sort by (default: "id").'
          example: exercitationem
          required: false
          schema:
            type: string
            description: 'optional Field to sort by (default: "id").'
            example: exercitationem
        -
          in: query
          name: order
          description: 'optional Sorting order (ASC/DESC, default: "DESC").'
          example: tenetur
          required: false
          schema:
            type: string
            description: 'optional Sorting order (ASC/DESC, default: "DESC").'
            example: tenetur
        -
          in: query
          name: statuses
          description: 'optional Filter by milestone statuses.'
          example:
            - facere
          required: false
          schema:
            type: array
            description: 'optional Filter by milestone statuses.'
            example:
              - facere
            items:
              type: string
        -
          in: query
          name: date_between_from
          description: 'date optional Filter milestones starting from this date.'
          example: debitis
          required: false
          schema:
            type: string
            description: 'date optional Filter milestones starting from this date.'
            example: debitis
        -
          in: query
          name: date_between_to
          description: 'date optional Filter milestones ending at this date.'
          example: aliquid
          required: false
          schema:
            type: string
            description: 'date optional Filter milestones ending at this date.'
            example: aliquid
        -
          in: query
          name: start_date_from
          description: 'date optional Filter milestones with a start date after this date.'
          example: consequatur
          required: false
          schema:
            type: string
            description: 'date optional Filter milestones with a start date after this date.'
            example: consequatur
        -
          in: query
          name: start_date_to
          description: 'date optional Filter milestones with a start date before this date.'
          example: animi
          required: false
          schema:
            type: string
            description: 'date optional Filter milestones with a start date before this date.'
            example: animi
        -
          in: query
          name: end_date_from
          description: 'date optional Filter milestones with an end date after this date.'
          example: illum
          required: false
          schema:
            type: string
            description: 'date optional Filter milestones with an end date after this date.'
            example: illum
        -
          in: query
          name: end_date_to
          description: 'date optional Filter milestones with an end date before this date.'
          example: amet
          required: false
          schema:
            type: string
            description: 'date optional Filter milestones with an end date before this date.'
            example: amet
        -
          in: query
          name: limit
          description: 'optional Number of records per page.'
          example: 15
          required: false
          schema:
            type: integer
            description: 'optional Number of records per page.'
            example: 15
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"data\": [\n    {\n      \"id\": 12,\n      \"title\": \"Design Phase\",\n      \"status\": Complete,\n      \"progress\": \"75\",\n      \"cost\": \"₹1,500.00\",\n      \"start_date\": \"2025-03-10\",\n      \"end_date\": \"2025-03-20\",\n      \"created_by\": \"John Doe\",\n      \"description\": \"Initial design phase for the project.\",\n      \"created_at\": \"2025-03-01\",\n      \"updated_at\": \"2025-03-05\",\n\n    }\n  ],\n  \"total\": 1\n}"
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Project not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Project not found.'
      tags:
        - 'Milestone Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the project whose milestones are to be retrieved.'
        example: 9
        required: true
        schema:
          type: integer
  '/api/milestones/get/{id}':
    get:
      summary: 'Get details of a specific milestone.'
      operationId: getDetailsOfASpecificMilestone
      description: 'This endpoint retrieves details of a specific milestone by its ID.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  milestone:
                    id: 12
                    title: 'Design Phase'
                    status: 'In Progress'
                    cost: '₹1,500.00'
                    start_date: '2025-03-10'
                    end_date: '2025-03-20'
                    description: 'Initial design phase for the project.'
                    created_at: '2025-03-01'
                    updated_at: '2025-03-05'
                properties:
                  error:
                    type: boolean
                    example: false
                  milestone:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 12
                      title:
                        type: string
                        example: 'Design Phase'
                      status:
                        type: string
                        example: 'In Progress'
                      cost:
                        type: string
                        example: '₹1,500.00'
                      start_date:
                        type: string
                        example: '2025-03-10'
                      end_date:
                        type: string
                        example: '2025-03-20'
                      description:
                        type: string
                        example: 'Initial design phase for the project.'
                      created_at:
                        type: string
                        example: '2025-03-01'
                      updated_at:
                        type: string
                        example: '2025-03-05'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Milestone not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Milestone not found.'
      tags:
        - 'Milestone Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the milestone to retrieve.'
        example: 13
        required: true
        schema:
          type: integer
  /api/milestones/update:
    post:
      summary: 'Update an existing milestone.'
      operationId: updateAnExistingMilestone
      description: 'This endpoint updates a specified milestone. The user must be authenticated and have permission to modify the milestone.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Milestone updated successfully.'
                  id: 12
                  type: milestone
                  parent_type: project
                  parent_id: 438
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Milestone updated successfully.'
                  id:
                    type: integer
                    example: 12
                  type:
                    type: string
                    example: milestone
                  parent_type:
                    type: string
                    example: project
                  parent_id:
                    type: integer
                    example: 438
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Milestone not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Milestone not found.'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    title:
                      - 'The title field is required.'
                    cost:
                      - 'The cost format is invalid.'
                    progress:
                      - 'The progress field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      title:
                        type: array
                        example:
                          - 'The title field is required.'
                        items:
                          type: string
                      cost:
                        type: array
                        example:
                          - 'The cost format is invalid.'
                        items:
                          type: string
                      progress:
                        type: array
                        example:
                          - 'The progress field is required.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "Milestone couldn't be updated."
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "Milestone couldn't be updated."
      tags:
        - 'Milestone Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: 'The updated title of the milestone.'
                  example: aut
                status:
                  type: string
                  description: 'The updated status of the milestone.'
                  example: pariatur
                start_date:
                  type: date
                  description: 'optional The updated start date of the milestone (YYYY-MM-DD).'
                  example: non
                end_date:
                  type: date
                  description: 'optional The updated end date of the milestone (YYYY-MM-DD).'
                  example: eligendi
                cost:
                  type: numeric
                  description: 'The updated cost of the milestone.'
                  example: nulla
                progress:
                  type: integer
                  description: 'The updated progress percentage of the milestone.'
                  example: 2
                description:
                  type: string
                  description: 'optional An updated description of the milestone.'
                  example: 'In ut non dolore tempore sunt temporibus.'
              required:
                - title
                - status
                - cost
                - progress
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the milestone to be updated.'
        example: 15
        required: true
        schema:
          type: integer
  '/api/milestones/destroy/{id}':
    delete:
      summary: 'Delete a milestone.'
      operationId: deleteAMilestone
      description: 'This endpoint deletes a specified milestone. The user must be authenticated and have permission to delete milestones.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Milestone deleted successfully.'
                  id: 12
                  title: 'Design Phase'
                  type: milestone
                  parent_type: project
                  parent_id: 438
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Milestone deleted successfully.'
                  id:
                    type: integer
                    example: 12
                  title:
                    type: string
                    example: 'Design Phase'
                  type:
                    type: string
                    example: milestone
                  parent_type:
                    type: string
                    example: project
                  parent_id:
                    type: integer
                    example: 438
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Milestone not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Milestone not found.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "Milestone couldn't be deleted."
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "Milestone couldn't be deleted."
      tags:
        - 'Milestone Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the milestone to delete.'
        example: 19
        required: true
        schema:
          type: integer
  '/api/projects/{id}/comments':
    post:
      summary: 'Add a comment.'
      operationId: addAComment
      description: "This endpoint allows authenticated users to add comments to a specific model (e.g., tasks, projects).\nUsers can also attach files and mention other users."
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"success\": true,\n  \"message\": \"Comment Added Successfully\",\n  \"comment\": {\n    \"id\": 45,\n    \"commentable_type\": \"App\\Models\\Project\",\n    \"commentable_id\": 438,\n    \"content\": \"This is a sample comment with a mention @JohnDoe\",\n    \"commenter_id\": 7,\n    \"commenter_type\": \"App\\\\Models\\\\User\",\n    \"parent_id\": null,\n    \"created_at\": \"2 minutes ago\",\n    \"attachments\": [\n      {\n        \"id\": 1,\n        \"file_name\": \"document.pdf\",\n        \"file_path\": \"comment_attachments/document.pdf\",\n        \"file_type\": \"application/pdf\"\n      }\n    ]\n  },\n  \"user\": {\n    \"id\": 7,\n    \"name\": \"John Doe\"\n  }\n}"
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'Validation errors occurred'
                  errors:
                    content:
                      - 'Please enter a comment.'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      content:
                        type: array
                        example:
                          - 'Please enter a comment.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'Comment could not be added.'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Comment could not be added.'
      tags:
        - 'Project Comments'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                model_type:
                  type: string
                  description: 'The type of model being commented on (e.g., "Task", "Project").'
                  example: explicabo
                model_id:
                  type: integer
                  description: 'The ID of the model being commented on.'
                  example: 16
                content:
                  type: string
                  description: 'The comment text.'
                  example: quod
                parent_id:
                  type: integer
                  description: 'optional The ID of the parent comment (for replies).'
                  example: 12
                'attachments[]':
                  type: string
                  format: binary
                  description: 'optional An array of files to attach to the comment. Maximum file size is defined in the config.'
              required:
                - model_type
                - model_id
                - content
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the project to add a comment to.'
        example: 14
        required: true
        schema:
          type: integer
  '/api/projects/comments/get/{id}':
    get:
      summary: 'Get details of a specific comment.'
      operationId: getDetailsOfASpecificComment
      description: 'This endpoint retrieves details of a specific comment by its ID, including any attachments.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  comment:
                    id: 45
                    commentable_type: App\Models\Project
                    commentable_id: 438
                    content: 'This is a sample comment with a mention @JohnDoe'
                    commenter_id: 7
                    commenter_type: App\Models\User
                    parent_id: null
                    created_at: '2025-03-03 14:00:00'
                    updated_at: '2025-03-03 16:00:00'
                    attachments:
                      -
                        id: 1
                        file_name: document.pdf
                        file_path: comment_attachments/document.pdf
                        file_type: application/pdf
                properties:
                  error:
                    type: boolean
                    example: false
                  comment:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 45
                      commentable_type:
                        type: string
                        example: App\Models\Project
                      commentable_id:
                        type: integer
                        example: 438
                      content:
                        type: string
                        example: 'This is a sample comment with a mention @JohnDoe'
                      commenter_id:
                        type: integer
                        example: 7
                      commenter_type:
                        type: string
                        example: App\Models\User
                      parent_id:
                        type: string
                        example: null
                      created_at:
                        type: string
                        example: '2025-03-03 14:00:00'
                      updated_at:
                        type: string
                        example: '2025-03-03 16:00:00'
                      attachments:
                        type: array
                        example:
                          -
                            id: 1
                            file_name: document.pdf
                            file_path: comment_attachments/document.pdf
                            file_type: application/pdf
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1
                            file_name:
                              type: string
                              example: document.pdf
                            file_path:
                              type: string
                              example: comment_attachments/document.pdf
                            file_type:
                              type: string
                              example: application/pdf
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Comment not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Comment not found.'
      tags:
        - 'Project Comments'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the comment to retrieve.'
        example: 9
        required: true
        schema:
          type: integer
  /api/projects/comments/update:
    post:
      summary: 'Update a comment.'
      operationId: updateAComment
      description: 'This endpoint updates a specified comment. The user must be authenticated and have permission to modify the comment.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Comment updated successfully.'
                  id: 45
                  type: project
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Comment updated successfully.'
                  id:
                    type: integer
                    example: 45
                  type:
                    type: string
                    example: project
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Comment not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Comment not found.'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    content:
                      - 'Please enter a comment.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      content:
                        type: array
                        example:
                          - 'Please enter a comment.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "Comment couldn't be updated."
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "Comment couldn't be updated."
      tags:
        - 'Project Comments'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                comment_id:
                  type: integer
                  description: 'The ID of the comment to be updated.'
                  example: 20
                content:
                  type: string
                  description: 'The updated content of the comment.'
                  example: facilis
              required:
                - comment_id
                - content
  /api/projects/comments/destroy:
    delete:
      summary: 'Delete a comment.'
      operationId: deleteAComment
      description: "This endpoint deletes a specified comment and removes its attachments from storage.\nThe user must be authenticated and have permission to delete comments."
      parameters:
        -
          in: query
          name: comment_id
          description: 'The ID of the comment to delete.'
          example: 4
          required: true
          schema:
            type: integer
            description: 'The ID of the comment to delete.'
            example: 4
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Comment deleted successfully.'
                  id: 45
                  type: project
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Comment deleted successfully.'
                  id:
                    type: integer
                    example: 45
                  type:
                    type: string
                    example: project
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Comment not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Comment not found.'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    comment_id:
                      - 'The comment_id field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      comment_id:
                        type: array
                        example:
                          - 'The comment_id field is required.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "Comment couldn't be deleted."
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "Comment couldn't be deleted."
      tags:
        - 'Project Comments'
  '/api/projects/{id}/comments/list':
    get:
      summary: 'Get all comments for a project with attachments and children.'
      operationId: getAllCommentsForAProjectWithAttachmentsAndChildren
      description: ''
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": false,\n  \"comments\": [\n    {\n      \"id\": 1,\n      \"content\": \"Parent comment\",\n      \"attachments\": [...],\n      \"children\": [\n        {\n          \"id\": 2,\n          \"content\": \"Reply\",\n          \"attachments\": [...],\n          \"children\": [...]\n        }\n      ]\n    }\n  ]\n}"
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Project not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Project not found.'
      tags:
        - 'Project Comments'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the project.'
        example: 20
        required: true
        schema:
          type: integer
  '/api/projects/comments/destroy-attachment/{id}':
    delete:
      summary: 'Delete a comment attachment.'
      operationId: deleteACommentAttachment
      description: "This endpoint deletes a specific attachment belonging to a comment and removes its file from storage.\nThe user must be authenticated and have permission to delete comment attachments."
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Attachment deleted successfully.'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Attachment deleted successfully.'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Attachment not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Attachment not found.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "Attachment couldn't be deleted."
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "Attachment couldn't be deleted."
      tags:
        - 'Project Comments'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the comment attachment to delete.'
        example: 20
        required: true
        schema:
          type: integer
  /api/projects/upload-media:
    post:
      summary: 'Upload media files to a project.'
      operationId: uploadMediaFilesToAProject
      description: 'This endpoint allows authenticated users to upload media files related to a project.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'File(s) uploaded successfully.'
                  id:
                    - 101
                    - 102
                  type: media
                  parent_type: project
                  parent_id: 438
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'File(s) uploaded successfully.'
                  id:
                    type: array
                    example:
                      - 101
                      - 102
                    items:
                      type: integer
                  type:
                    type: string
                    example: media
                  parent_type:
                    type: string
                    example: project
                  parent_id:
                    type: integer
                    example: 438
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Project not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Project not found.'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    id:
                      - 'The selected id is invalid.'
                    media_files:
                      - 'The media file size exceeds the limit.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      id:
                        type: array
                        example:
                          - 'The selected id is invalid.'
                        items:
                          type: string
                      media_files:
                        type: array
                        example:
                          - 'The media file size exceeds the limit.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred during file upload.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred during file upload.'
      tags:
        - 'Project Media'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  description: 'The ID of the project to which media files are being uploaded.'
                  example: 18
                'media_files[]':
                  type: string
                  format: binary
                  description: 'An array of media files to be uploaded. Maximum file size is defined in the config.'
              required:
                - id
                - 'media_files[]'
  '/api/projects/get-media/{id}':
    get:
      summary: 'Get project media files.'
      operationId: getProjectMediaFiles
      description: 'This endpoint retrieves all media files associated with a specific project, including sorting and search capabilities.'
      parameters:
        -
          in: query
          name: search
          description: 'optional A search query to filter media files by name, ID, or upload date.'
          example: vel
          required: false
          schema:
            type: string
            description: 'optional A search query to filter media files by name, ID, or upload date.'
            example: vel
        -
          in: query
          name: sort
          description: 'optional The column to sort by (default: "id").'
          example: fuga
          required: false
          schema:
            type: string
            description: 'optional The column to sort by (default: "id").'
            example: fuga
        -
          in: query
          name: order
          description: 'optional The sorting order: "ASC" or "DESC" (default: "DESC").'
          example: ipsam
          required: false
          schema:
            type: string
            description: 'optional The sorting order: "ASC" or "DESC" (default: "DESC").'
            example: ipsam
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": false,\n  \"message\": \"Media files retrieved successfully.\",\n  \"rows\": [\n    {\n      \"id\": 101,\n      \"file\": \"<a href='https://example.com/storage/project-media/image.jpg' data-lightbox='project-media'><img src='https://example.com/storage/project-media/image.jpg' alt='image.jpg' width='50'></a>\",\n      \"file_name\": \"image.jpg\",\n      \"file_size\": \"2 MB\",\n      \"created_at\": \"2025-03-03\",\n      \"updated_at\": \"2025-03-03\",\n\n    }\n  ],\n  \"total\": 1\n}"
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Project not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Project not found.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Could not retrieve media files.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Could not retrieve media files.'
      tags:
        - 'Project Media'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the project whose media files are to be retrieved.'
        example: 18
        required: true
        schema:
          type: integer
  '/api/projects/delete-media/{id}':
    delete:
      summary: 'Delete a media file.'
      operationId: deleteAMediaFile
      description: 'This endpoint deletes a specified media file associated with a project. The user must be authenticated and have permission to delete media files.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'File deleted successfully.'
                  id: 101
                  title: image.jpg
                  parent_id: 438
                  type: media
                  parent_type: project
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'File deleted successfully.'
                  id:
                    type: integer
                    example: 101
                  title:
                    type: string
                    example: image.jpg
                  parent_id:
                    type: integer
                    example: 438
                  type:
                    type: string
                    example: media
                  parent_type:
                    type: string
                    example: project
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'File not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'File not found.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "File couldn't be deleted."
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "File couldn't be deleted."
      tags:
        - 'Project Media'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the delete medium.'
        example: dicta
        required: true
        schema:
          type: string
      -
        in: path
        name: mediaId
        description: 'The ID of the media file to delete.'
        example: 8
        required: true
        schema:
          type: integer
  /api/tasks/store:
    post:
      summary: 'Create a new task.'
      operationId: createANewTask
      description: 'This endpoint creates a new task with the provided details. The user must be authenticated to perform this action. The request validates various fields, including title, status, priority, start and due dates, project association, and optional notes.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Task created successfully.'
                  id: 280
                  parent_id: '420'
                  parent_type: project
                  data:
                    id: 280
                    workspace_id: 6
                    title: 'Res Test'
                    status: Default
                    status_id: '0'
                    priority: Default
                    priority_id: '0'
                    users:
                      -
                        id: 7
                        first_name: Madhavan
                        last_name: Vaidya
                        photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                    user_id:
                      - 1
                      - 2
                    clients:
                      -
                        id: 173
                        first_name: '666'
                        last_name: '666'
                        photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                    start_date: 07-08-2024
                    due_date: 07-08-2024
                    project:
                      id: 420
                      title: 'Updated Project Title'
                    description: 'Test Desc'
                    note: 'Test Note'
                    created_at: '07-08-2024 13:02:52'
                    updated_at: '07-08-2024 13:02:52'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Task created successfully.'
                  id:
                    type: integer
                    example: 280
                  parent_id:
                    type: string
                    example: '420'
                  parent_type:
                    type: string
                    example: project
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 280
                      workspace_id:
                        type: integer
                        example: 6
                      title:
                        type: string
                        example: 'Res Test'
                      status:
                        type: string
                        example: Default
                      status_id:
                        type: string
                        example: '0'
                      priority:
                        type: string
                        example: Default
                      priority_id:
                        type: string
                        example: '0'
                      users:
                        type: array
                        example:
                          -
                            id: 7
                            first_name: Madhavan
                            last_name: Vaidya
                            photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 7
                            first_name:
                              type: string
                              example: Madhavan
                            last_name:
                              type: string
                              example: Vaidya
                            photo:
                              type: string
                              example: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                      user_id:
                        type: array
                        example:
                          - 1
                          - 2
                        items:
                          type: integer
                      clients:
                        type: array
                        example:
                          -
                            id: 173
                            first_name: '666'
                            last_name: '666'
                            photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 173
                            first_name:
                              type: string
                              example: '666'
                            last_name:
                              type: string
                              example: '666'
                            photo:
                              type: string
                              example: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                      start_date:
                        type: string
                        example: 07-08-2024
                      due_date:
                        type: string
                        example: 07-08-2024
                      project:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 420
                          title:
                            type: string
                            example: 'Updated Project Title'
                      description:
                        type: string
                        example: 'Test Desc'
                      note:
                        type: string
                        example: 'Test Note'
                      created_at:
                        type: string
                        example: '07-08-2024 13:02:52'
                      updated_at:
                        type: string
                        example: '07-08-2024 13:02:52'
        422:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n \"error\": true,\n \"message\": \"Validation errors occurred\",\n \"errors\": {\n   \"title\": [\"The title field is required.\"],\n   \"status_id\": [\"The selected status_id is invalid.\"],\n   ...\n }\n}"
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while creating the task.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while creating the task.'
      tags:
        - 'Task Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: 'The title of the task.'
                  example: 'New Task'
                status_id:
                  type: integer
                  description: 'The status of the task. Must exist in the `statuses` table.'
                  example: 1
                priority_id:
                  type: integer
                  description: 'nullable The priority of the task. Must exist in the `priorities` table.'
                  example: 2
                start_date:
                  type: string|null
                  description: 'optional The start date of the task in the format specified in the general settings.'
                  example: '2024-07-20'
                due_date:
                  type: string|null
                  description: 'optional The due date of the task in the format specified in the general settings.'
                  example: '2024-08-20'
                description:
                  type: string
                  description: 'nullable A description of the task.'
                  example: 'This is a detailed description of the task.'
                project:
                  type: integer
                  description: 'The ID of the project associated with the task. Must exist in the `projects` table.'
                  example: 10
                note:
                  type: string
                  description: 'nullable Additional notes about the task.'
                  example: Urgent
                user_id:
                  type: array
                  description: 'nullable An array of user IDs to be assigned to the task.'
                  example:
                    - 1
                    - 2
                    - 3
                  items:
                    type: string
                clientCanDiscuss:
                  type: string
                  description: "optional Indicates if the client can participate in task discussions. Can only specify if `is_admin_or_has_all_data_access` is true for the logged-in user; otherwise, it will be considered 0 by default. The value should be 'on' to allow client participation."
                  example: 'on'
              required:
                - title
                - status_id
                - project
  '/api/tasks/{id}':
    get:
      summary: 'List or search tasks.'
      operationId: listOrSearchTasks
      description: 'This endpoint retrieves a list of tasks based on various filters. The user must be authenticated to perform this action. The request allows filtering by multiple statuses, users, clients, projects, date ranges, and other parameters.'
      parameters:
        -
          in: query
          name: search
          description: 'optional The search term to filter tasks by title or id.'
          example: Task
          required: false
          schema:
            type: string
            description: 'optional The search term to filter tasks by title or id.'
            example: Task
        -
          in: query
          name: sort
          description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id, title, project, status, priority, start_date, due_date, created_at, and updated_at.'
          example: title
          required: false
          schema:
            type: string
            description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id, title, project, status, priority, start_date, due_date, created_at, and updated_at.'
            example: title
        -
          in: query
          name: order
          description: 'optional The sort order, either "ASC" or "DESC". Defaults to "DESC".'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional The sort order, either "ASC" or "DESC". Defaults to "DESC".'
            example: ASC
        -
          in: query
          name: status_ids
          description: 'optional An array of status IDs to filter tasks by.'
          example:
            - 2
            - 3
          required: false
          schema:
            type: array
            description: 'optional An array of status IDs to filter tasks by.'
            example:
              - 2
              - 3
            items:
              type: string
        -
          in: query
          name: user_ids
          description: 'optional An array of user IDs to filter tasks by.'
          example:
            - 1
            - 2
            - 3
          required: false
          schema:
            type: array
            description: 'optional An array of user IDs to filter tasks by.'
            example:
              - 1
              - 2
              - 3
            items:
              type: string
        -
          in: query
          name: client_ids
          description: 'optional An array of client IDs to filter tasks by.'
          example:
            - 5
            - 6
          required: false
          schema:
            type: array
            description: 'optional An array of client IDs to filter tasks by.'
            example:
              - 5
              - 6
            items:
              type: string
        -
          in: query
          name: priority_ids
          description: 'optional An array of priority IDs to filter tasks by.'
          example:
            - 1
            - 2
          required: false
          schema:
            type: array
            description: 'optional An array of priority IDs to filter tasks by.'
            example:
              - 1
              - 2
            items:
              type: string
        -
          in: query
          name: project_ids
          description: 'optional An array of project IDs to filter tasks by.'
          example:
            - 1
            - 2
          required: false
          schema:
            type: array
            description: 'optional An array of project IDs to filter tasks by.'
            example:
              - 1
              - 2
            items:
              type: string
        -
          in: query
          name: task_start_date_from
          description: "optional The start date range's start in YYYY-MM-DD format."
          example: '2024-01-01'
          required: false
          schema:
            type: string
            description: "optional The start date range's start in YYYY-MM-DD format."
            example: '2024-01-01'
        -
          in: query
          name: task_start_date_to
          description: "optional The start date range's end in YYYY-MM-DD format."
          example: '2024-12-31'
          required: false
          schema:
            type: string
            description: "optional The start date range's end in YYYY-MM-DD format."
            example: '2024-12-31'
        -
          in: query
          name: task_end_date_from
          description: "optional The end date range's start in YYYY-MM-DD format."
          example: '2024-01-01'
          required: false
          schema:
            type: string
            description: "optional The end date range's start in YYYY-MM-DD format."
            example: '2024-01-01'
        -
          in: query
          name: task_end_date_to
          description: "optional The end date range's end in YYYY-MM-DD format."
          example: '2024-12-31'
          required: false
          schema:
            type: string
            description: "optional The end date range's end in YYYY-MM-DD format."
            example: '2024-12-31'
        -
          in: query
          name: is_favorites
          description: 'optional Filter projects marked as favorites.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Filter projects marked as favorites.'
            example: true
        -
          in: query
          name: limit
          description: 'optional The number of tasks per page for pagination.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional The number of tasks per page for pagination.'
            example: 10
        -
          in: query
          name: offset
          description: 'optional The offset for pagination, indicating the starting point of results.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'optional The offset for pagination, indicating the starting point of results.'
            example: 0
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Tasks retrieved successfully'
                      total: 1
                      data:
                        -
                          id: 268
                          workspace_id: 6
                          title: sdff
                          status: Default
                          priority: Default
                          users:
                            -
                              id: 7
                              first_name: Madhavan
                              last_name: Vaidya
                              photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                          clients:
                            -
                              id: 102
                              first_name: Test
                              last_name: Client
                              photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                          start_date: 23-07-2024
                          due_date: 24-07-2024
                          project:
                            id: 379
                            title: 'From API'
                          description: '<p>Test Desc</p>'
                          note: 'Test note'
                          created_at: '23-07-2024 17:50:09'
                          updated_at: '23-07-2024 19:08:16'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Tasks retrieved successfully'
                      total:
                        type: integer
                        example: 1
                      data:
                        type: array
                        example:
                          -
                            id: 268
                            workspace_id: 6
                            title: sdff
                            status: Default
                            priority: Default
                            users:
                              -
                                id: 7
                                first_name: Madhavan
                                last_name: Vaidya
                                photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                            clients:
                              -
                                id: 102
                                first_name: Test
                                last_name: Client
                                photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                            start_date: 23-07-2024
                            due_date: 24-07-2024
                            project:
                              id: 379
                              title: 'From API'
                            description: '<p>Test Desc</p>'
                            note: 'Test note'
                            created_at: '23-07-2024 17:50:09'
                            updated_at: '23-07-2024 19:08:16'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 268
                            workspace_id:
                              type: integer
                              example: 6
                            title:
                              type: string
                              example: sdff
                            status:
                              type: string
                              example: Default
                            priority:
                              type: string
                              example: Default
                            users:
                              type: array
                              example:
                                -
                                  id: 7
                                  first_name: Madhavan
                                  last_name: Vaidya
                                  photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                              items:
                                type: object
                                properties:
                                  id:
                                    type: integer
                                    example: 7
                                  first_name:
                                    type: string
                                    example: Madhavan
                                  last_name:
                                    type: string
                                    example: Vaidya
                                  photo:
                                    type: string
                                    example: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                            clients:
                              type: array
                              example:
                                -
                                  id: 102
                                  first_name: Test
                                  last_name: Client
                                  photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                              items:
                                type: object
                                properties:
                                  id:
                                    type: integer
                                    example: 102
                                  first_name:
                                    type: string
                                    example: Test
                                  last_name:
                                    type: string
                                    example: Client
                                  photo:
                                    type: string
                                    example: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                            start_date:
                              type: string
                              example: 23-07-2024
                            due_date:
                              type: string
                              example: 24-07-2024
                            project:
                              type: object
                              properties:
                                id:
                                  type: integer
                                  example: 379
                                title:
                                  type: string
                                  example: 'From API'
                            description:
                              type: string
                              example: '<p>Test Desc</p>'
                            note:
                              type: string
                              example: 'Test note'
                            created_at:
                              type: string
                              example: '23-07-2024 17:50:09'
                            updated_at:
                              type: string
                              example: '23-07-2024 19:08:16'
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Task not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Task not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Tasks not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Tasks not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
      tags:
        - 'Task Management'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                user_ids:
                  type: array
                  description: ''
                  example:
                    - 19
                  items:
                    type: integer
                client_ids:
                  type: array
                  description: ''
                  example:
                    - 15
                  items:
                    type: integer
                priority_ids:
                  type: array
                  description: ''
                  example:
                    - 16
                  items:
                    type: integer
                project_ids:
                  type: array
                  description: ''
                  example:
                    - 6
                  items:
                    type: integer
                status_ids:
                  type: array
                  description: ''
                  example:
                    - 18
                  items:
                    type: integer
    parameters:
      -
        in: path
        name: id
        description: 'Optional parameter. optional The ID of the task to retrieve.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/tasks/update:
    post:
      summary: 'Update an existing task.'
      operationId: updateAnExistingTask
      description: 'This endpoint updates the details of an existing task. The user must be authenticated to perform this action. The request validates various fields including title, status, priority, start and due dates, and optional notes. It also handles user assignments and notifies relevant parties of any status changes.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Task updated successfully.'
                  id: 280
                  parent_id: '420'
                  parent_type: project
                  data:
                    id: 280
                    workspace_id: 6
                    title: 'Res Test'
                    status: Default
                    priority: Default
                    users:
                      -
                        id: 7
                        first_name: Madhavan
                        last_name: Vaidya
                        photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                    clients:
                      -
                        id: 173
                        first_name: '666'
                        last_name: '666'
                        photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                    start_date: 07-08-2024
                    due_date: 07-08-2024
                    project:
                      id: 420
                      title: 'Updated Project Title'
                    description: 'Test Desc'
                    note: 'Test Note'
                    created_at: '07-08-2024 13:02:52'
                    updated_at: '07-08-2024 13:02:52'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Task updated successfully.'
                  id:
                    type: integer
                    example: 280
                  parent_id:
                    type: string
                    example: '420'
                  parent_type:
                    type: string
                    example: project
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 280
                      workspace_id:
                        type: integer
                        example: 6
                      title:
                        type: string
                        example: 'Res Test'
                      status:
                        type: string
                        example: Default
                      priority:
                        type: string
                        example: Default
                      users:
                        type: array
                        example:
                          -
                            id: 7
                            first_name: Madhavan
                            last_name: Vaidya
                            photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 7
                            first_name:
                              type: string
                              example: Madhavan
                            last_name:
                              type: string
                              example: Vaidya
                            photo:
                              type: string
                              example: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                      clients:
                        type: array
                        example:
                          -
                            id: 173
                            first_name: '666'
                            last_name: '666'
                            photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 173
                            first_name:
                              type: string
                              example: '666'
                            last_name:
                              type: string
                              example: '666'
                            photo:
                              type: string
                              example: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                      start_date:
                        type: string
                        example: 07-08-2024
                      due_date:
                        type: string
                        example: 07-08-2024
                      project:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 420
                          title:
                            type: string
                            example: 'Updated Project Title'
                      description:
                        type: string
                        example: 'Test Desc'
                      note:
                        type: string
                        example: 'Test Note'
                      created_at:
                        type: string
                        example: '07-08-2024 13:02:52'
                      updated_at:
                        type: string
                        example: '07-08-2024 13:02:52'
        422:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n \"error\": true,\n \"message\": \"Validation errors occurred\",\n \"errors\": {\n   \"id\": [\"The selected id is invalid.\"],\n   \"title\": [\"The title field is required.\"],\n   \"status_id\": [\"The selected status_id is invalid.\"],\n   ...\n }\n}"
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while updating the task.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while updating the task.'
      tags:
        - 'Task Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  description: 'The ID of the task to be updated. Must exist in the `tasks` table.'
                  example: 267
                title:
                  type: string
                  description: 'The title of the task.'
                  example: 'Updated Task'
                status_id:
                  type: integer
                  description: 'The status of the task. Must exist in the `statuses` table.'
                  example: 2
                priority_id:
                  type: integer
                  description: 'nullable The priority of the task. Must exist in the `priorities` table.'
                  example: 1
                start_date:
                  type: string|null
                  description: 'optional The start date of the task in the format specified in the general settings.'
                  example: '2024-07-20'
                due_date:
                  type: string|null
                  description: 'optional The due date of the task in the format specified in the general settings.'
                  example: '2024-08-20'
                description:
                  type: string
                  description: 'nullable A description of the task.'
                  example: 'Updated task description.'
                note:
                  type: string
                  description: 'nullable Additional notes about the task.'
                  example: 'Needs immediate attention.'
                user_id:
                  type: array
                  description: 'nullable An array of user IDs to be assigned to the task.'
                  example:
                    - 2
                    - 3
                  items:
                    type: string
                clientCanDiscuss:
                  type: string
                  description: "optional Indicates if the client can participate in task discussions. Can only specify if `is_admin_or_has_all_data_access` is true for the logged-in user; otherwise, it will be considered current value by default. The value should be 'on' to allow client participation."
                  example: 'on'
              required:
                - id
                - title
                - status_id
  '/api/tasks/{id}/favorite':
    patch:
      summary: 'Update the favorite status of a task.'
      operationId: updateTheFavoriteStatusOfATask
      description: 'This endpoint updates whether a task is marked as a favorite or not. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n\"error\": false,\n\"message\": \"Task favorite status updated successfully\",\n\"data\": {\n  \"id\": 438,\n  \"title\": \"Task Example\"\n  // Other task details will be included in the actual response\n}\n}"
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    is_favorite:
                      - 'The is favorite field must be either 0 or 1.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      is_favorite:
                        type: array
                        example:
                          - 'The is favorite field must be either 0 or 1.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while updating the favorite status.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while updating the favorite status.'
      tags:
        - 'Task Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                is_favorite:
                  type: integer
                  description: 'Indicates whether the task is a favorite. Use 1 for true and 0 for false.'
                  example: 18
              required:
                - is_favorite
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the task to update.'
        example: 12
        required: true
        schema:
          type: integer
  '/api/tasks/{id}/pinned':
    patch:
      summary: 'Update the pinned status of a task.'
      operationId: updateThePinnedStatusOfATask
      description: 'This endpoint updates whether a task is marked as pinned or not. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n\"error\": false,\n\"message\": \"Task pinned status updated successfully\",\n\"data\": {\n  \"id\": 438,\n  \"title\": \"Task Example\"\n  // Other task details will be included in the actual response\n}\n}"
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    is_pinned:
                      - 'The is pinned field must be either 0 or 1.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      is_pinned:
                        type: array
                        example:
                          - 'The is pinned field must be either 0 or 1.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while updating the pinned status.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while updating the pinned status.'
      tags:
        - 'Task Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                is_pinned:
                  type: integer
                  description: 'Indicates whether the task is pinned. Use 1 for true and 0 for false.'
                  example: 19
              required:
                - is_pinned
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the task to update.'
        example: 7
        required: true
        schema:
          type: integer
  '/api/tasks/{id}/status':
    patch:
      summary: 'Update the status of a task.'
      operationId: updateTheStatusOfATask
      description: 'This endpoint updates the status of a specified task. The user must be authenticated and have permission to set the new status. A notification will be sent to all users and clients associated with the task.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Status updated successfully.'
                      id: '278'
                      type: task
                      activity_message: 'Madhavan Vaidya updated task status from Ongoing to Completed'
                      data:
                        id: 278
                        workspace_id: 6
                        title: 'New Task'
                        status: Completed
                        priority: dsfdsf
                        users:
                          -
                            id: 7
                            first_name: Madhavan
                            last_name: Vaidya
                            photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                        clients:
                          -
                            id: 173
                            first_name: '666'
                            last_name: '666'
                            photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                        start_date: 20-08-2024
                        due_date: null
                        project:
                          id: 419
                          title: 'Updated Project Title'
                        description: 'This is a detailed description of the task.'
                        note: null
                        created_at: '06-08-2024 11:42:13'
                        updated_at: '12-08-2024 15:18:09'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Status updated successfully.'
                      id:
                        type: string
                        example: '278'
                      type:
                        type: string
                        example: task
                      activity_message:
                        type: string
                        example: 'Madhavan Vaidya updated task status from Ongoing to Completed'
                      data:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 278
                          workspace_id:
                            type: integer
                            example: 6
                          title:
                            type: string
                            example: 'New Task'
                          status:
                            type: string
                            example: Completed
                          priority:
                            type: string
                            example: dsfdsf
                          users:
                            type: array
                            example:
                              -
                                id: 7
                                first_name: Madhavan
                                last_name: Vaidya
                                photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                            items:
                              type: object
                              properties:
                                id:
                                  type: integer
                                  example: 7
                                first_name:
                                  type: string
                                  example: Madhavan
                                last_name:
                                  type: string
                                  example: Vaidya
                                photo:
                                  type: string
                                  example: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                          clients:
                            type: array
                            example:
                              -
                                id: 173
                                first_name: '666'
                                last_name: '666'
                                photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                            items:
                              type: object
                              properties:
                                id:
                                  type: integer
                                  example: 173
                                first_name:
                                  type: string
                                  example: '666'
                                last_name:
                                  type: string
                                  example: '666'
                                photo:
                                  type: string
                                  example: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                          start_date:
                            type: string
                            example: 20-08-2024
                          due_date:
                            type: string
                            example: null
                          project:
                            type: object
                            properties:
                              id:
                                type: integer
                                example: 419
                              title:
                                type: string
                                example: 'Updated Project Title'
                          description:
                            type: string
                            example: 'This is a detailed description of the task.'
                          note:
                            type: string
                            example: null
                          created_at:
                            type: string
                            example: '06-08-2024 11:42:13'
                          updated_at:
                            type: string
                            example: '12-08-2024 15:18:09'
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'You are not authorized to set this status.'
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'You are not authorized to set this status.'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    id:
                      - 'The selected id is invalid.'
                    statusId:
                      - 'The selected status id is invalid.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      id:
                        type: array
                        example:
                          - 'The selected id is invalid.'
                        items:
                          type: string
                      statusId:
                        type: array
                        example:
                          - 'The selected status id is invalid.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "Status couldn't be updated."
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "Status couldn't be updated."
      tags:
        - 'Task Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                statusId:
                  type: integer
                  description: 'The ID of the new status to set for the task. Must exist in the `statuses` table.'
                  example: 2
                note:
                  type: string
                  description: 'optional An optional note to attach to the task update.'
                  example: 'Updated due to client request.'
              required:
                - statusId
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the task whose status is to be updated.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/tasks/{id}/priority':
    patch:
      summary: 'Update the priority of a task.'
      operationId: updateThePriorityOfATask
      description: 'This endpoint updates the priority of a specified task. The user must be authenticated and have permission to set the new priority.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Priority updated successfully.'
                  id: '278'
                  type: task
                  activity_message: 'Madhavan Vaidya updated task priority from Medium to High'
                  data:
                    id: 278
                    workspace_id: 6
                    title: 'New Task'
                    status: Completed
                    priority: High
                    users:
                      -
                        id: 7
                        first_name: Madhavan
                        last_name: Vaidya
                        photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                    clients:
                      -
                        id: 173
                        first_name: '666'
                        last_name: '666'
                        photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                    start_date: 20-08-2024
                    due_date: null
                    project:
                      id: 419
                      title: 'Updated Project Title'
                    description: 'This is a detailed description of the task.'
                    note: null
                    created_at: '06-08-2024 11:42:13'
                    updated_at: '12-08-2024 15:40:41'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Priority updated successfully.'
                  id:
                    type: string
                    example: '278'
                  type:
                    type: string
                    example: task
                  activity_message:
                    type: string
                    example: 'Madhavan Vaidya updated task priority from Medium to High'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 278
                      workspace_id:
                        type: integer
                        example: 6
                      title:
                        type: string
                        example: 'New Task'
                      status:
                        type: string
                        example: Completed
                      priority:
                        type: string
                        example: High
                      users:
                        type: array
                        example:
                          -
                            id: 7
                            first_name: Madhavan
                            last_name: Vaidya
                            photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 7
                            first_name:
                              type: string
                              example: Madhavan
                            last_name:
                              type: string
                              example: Vaidya
                            photo:
                              type: string
                              example: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                      clients:
                        type: array
                        example:
                          -
                            id: 173
                            first_name: '666'
                            last_name: '666'
                            photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 173
                            first_name:
                              type: string
                              example: '666'
                            last_name:
                              type: string
                              example: '666'
                            photo:
                              type: string
                              example: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                      start_date:
                        type: string
                        example: 20-08-2024
                      due_date:
                        type: string
                        example: null
                      project:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 419
                          title:
                            type: string
                            example: 'Updated Project Title'
                      description:
                        type: string
                        example: 'This is a detailed description of the task.'
                      note:
                        type: string
                        example: null
                      created_at:
                        type: string
                        example: '06-08-2024 11:42:13'
                      updated_at:
                        type: string
                        example: '12-08-2024 15:40:41'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    id:
                      - 'The selected id is invalid.'
                    priorityId:
                      - 'The selected priorityId is invalid.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      id:
                        type: array
                        example:
                          - 'The selected id is invalid.'
                        items:
                          type: string
                      priorityId:
                        type: array
                        example:
                          - 'The selected priorityId is invalid.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "Priority couldn't be updated."
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "Priority couldn't be updated."
      tags:
        - 'Task Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                priorityId:
                  type: integer
                  description: 'The ID of the new priority to set for the task. Must exist in the `priorities` table.'
                  example: 3
              required:
                - priorityId
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the task whose priority is to be updated.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/tasks/destroy/{id}':
    delete:
      summary: 'Remove the specified task.'
      operationId: removeTheSpecifiedTask
      description: 'This endpoint deletes a task based on the provided ID. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Task deleted successfully.'
                      id: '262'
                      title: 'From API'
                      parent_id: 377
                      parent_type: project
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Task deleted successfully.'
                      id:
                        type: string
                        example: '262'
                      title:
                        type: string
                        example: 'From API'
                      parent_id:
                        type: integer
                        example: 377
                      parent_type:
                        type: string
                        example: project
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Task not found.'
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Task not found.'
                      data:
                        type: array
                        example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while deleting the task.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while deleting the task.'
      tags:
        - 'Task Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the task to be deleted.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/tasks/{id}/status-timelines':
    get:
      summary: 'Get task status timeline.'
      operationId: getTaskStatusTimeline
      description: 'This endpoint retrieves the status change history of a task, sorted in descending order.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Status timeline retrieved successfully.'
                  status_timeline:
                    -
                      id: 1
                      status: 'In Progress'
                      previous_status: Pending
                      new_color: '#ffcc00'
                      old_color: '#cccccc'
                      changed_at: '2025-03-03'
                    -
                      id: 2
                      status: Completed
                      previous_status: 'In Progress'
                      new_color: '#00cc66'
                      old_color: '#ffcc00'
                      changed_at: '2025-03-05 16:00:00'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Status timeline retrieved successfully.'
                  status_timeline:
                    type: array
                    example:
                      -
                        id: 1
                        status: 'In Progress'
                        previous_status: Pending
                        new_color: '#ffcc00'
                        old_color: '#cccccc'
                        changed_at: '2025-03-03'
                      -
                        id: 2
                        status: Completed
                        previous_status: 'In Progress'
                        new_color: '#00cc66'
                        old_color: '#ffcc00'
                        changed_at: '2025-03-05 16:00:00'
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        status:
                          type: string
                          example: 'In Progress'
                        previous_status:
                          type: string
                          example: Pending
                        new_color:
                          type: string
                          example: '#ffcc00'
                        old_color:
                          type: string
                          example: '#cccccc'
                        changed_at:
                          type: string
                          example: '2025-03-03'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Task not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Task not found.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Could not retrieve status timeline.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Could not retrieve status timeline.'
      tags:
        - 'Task Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the task whose status timeline is to be retrieved.'
        example: 13
        required: true
        schema:
          type: integer
  '/api/tasks/{id}/comments':
    post:
      summary: 'Add a comment with attachments.'
      operationId: addACommentWithAttachments
      description: "This endpoint allows authenticated users to add comments to a specific model (e.g., tasks, projects).\nUsers can also attach files and mention other users."
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'Comment Added Successfully'
                  comment:
                    id: 45
                    commentable_type: App\Models\Task
                    commentable_id: 438
                    content: 'This is a sample comment with a mention @JohnDoe'
                    user_id: 7
                    parent_id: null
                    created_at: '2 minutes ago'
                    attachments:
                      -
                        id: 1
                        file_name: document.pdf
                        file_path: comment_attachments/document.pdf
                        file_type: application/pdf
                  user:
                    id: 7
                    name: 'John Doe'
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Comment Added Successfully'
                  comment:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 45
                      commentable_type:
                        type: string
                        example: App\Models\Task
                      commentable_id:
                        type: integer
                        example: 438
                      content:
                        type: string
                        example: 'This is a sample comment with a mention @JohnDoe'
                      user_id:
                        type: integer
                        example: 7
                      parent_id:
                        type: string
                        example: null
                      created_at:
                        type: string
                        example: '2 minutes ago'
                      attachments:
                        type: array
                        example:
                          -
                            id: 1
                            file_name: document.pdf
                            file_path: comment_attachments/document.pdf
                            file_type: application/pdf
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1
                            file_name:
                              type: string
                              example: document.pdf
                            file_path:
                              type: string
                              example: comment_attachments/document.pdf
                            file_type:
                              type: string
                              example: application/pdf
                  user:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 7
                      name:
                        type: string
                        example: 'John Doe'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'Validation errors occurred'
                  errors:
                    content:
                      - 'Please enter a comment.'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      content:
                        type: array
                        example:
                          - 'Please enter a comment.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'Comment could not be added.'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Comment could not be added.'
      tags:
        - 'Task Comments'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                model_type:
                  type: string
                  description: 'The type of model being commented on (e.g., "Task", "Project").'
                  example: ut
                model_id:
                  type: integer
                  description: 'The ID of the model being commented on.'
                  example: 10
                content:
                  type: string
                  description: 'The comment text.'
                  example: optio
                parent_id:
                  type: integer
                  description: 'optional The ID of the parent comment (for replies).'
                  example: 9
                'attachments[]':
                  type: string
                  format: binary
                  description: 'optional An array of files to attach to the comment. Supported formats: jpg, jpeg, png, pdf, xlsx, txt, docx (max size: 2MB).'
              required:
                - model_type
                - model_id
                - content
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the task.'
        example: porro
        required: true
        schema:
          type: string
  '/api/tasks/comments/get/{id}':
    get:
      summary: 'Get details of a specific comment.'
      operationId: getDetailsOfASpecificComment
      description: 'This endpoint retrieves the details of a specific comment, including any attachments.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Comment retrieved successfully.'
                  comment:
                    id: 45
                    commentable_type: App\Models\Task
                    commentable_id: 438
                    content: 'This is a sample comment with a mention @JohnDoe'
                    user_id: 7
                    parent_id: null
                    created_at: '2025-03-03 14:00:00'
                    updated_at: '2025-03-03 16:00:00'
                    attachments:
                      -
                        id: 1
                        file_name: document.pdf
                        file_path: comment_attachments/document.pdf
                        file_type: application/pdf
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Comment retrieved successfully.'
                  comment:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 45
                      commentable_type:
                        type: string
                        example: App\Models\Task
                      commentable_id:
                        type: integer
                        example: 438
                      content:
                        type: string
                        example: 'This is a sample comment with a mention @JohnDoe'
                      user_id:
                        type: integer
                        example: 7
                      parent_id:
                        type: string
                        example: null
                      created_at:
                        type: string
                        example: '2025-03-03 14:00:00'
                      updated_at:
                        type: string
                        example: '2025-03-03 16:00:00'
                      attachments:
                        type: array
                        example:
                          -
                            id: 1
                            file_name: document.pdf
                            file_path: comment_attachments/document.pdf
                            file_type: application/pdf
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1
                            file_name:
                              type: string
                              example: document.pdf
                            file_path:
                              type: string
                              example: comment_attachments/document.pdf
                            file_type:
                              type: string
                              example: application/pdf
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Comment not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Comment not found.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Could not retrieve comment.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Could not retrieve comment.'
      tags:
        - 'Task Comments'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the comment to retrieve.'
        example: 5
        required: true
        schema:
          type: integer
  /api/tasks/comments/update:
    post:
      summary: 'Update a comment.'
      operationId: updateAComment
      description: 'This endpoint updates a specified comment. The user must be authenticated and have permission to modify the comment.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Comment updated successfully.'
                  id: 45
                  type: task
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Comment updated successfully.'
                  id:
                    type: integer
                    example: 45
                  type:
                    type: string
                    example: task
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Comment not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Comment not found.'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    content:
                      - 'Please enter a comment.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      content:
                        type: array
                        example:
                          - 'Please enter a comment.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "Comment couldn't be updated."
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "Comment couldn't be updated."
      tags:
        - 'Task Comments'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                comment_id:
                  type: integer
                  description: 'The ID of the comment to be updated.'
                  example: 20
                content:
                  type: string
                  description: 'The updated content of the comment.'
                  example: libero
              required:
                - comment_id
                - content
  /api/tasks/comments/destroy:
    delete:
      summary: 'Delete a comment.'
      operationId: deleteAComment
      description: "This endpoint deletes a specified comment and removes its attachments from storage.\nThe user must be authenticated and have permission to delete comments."
      parameters:
        -
          in: query
          name: comment_id
          description: 'The ID of the comment to delete.'
          example: 8
          required: true
          schema:
            type: integer
            description: 'The ID of the comment to delete.'
            example: 8
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Comment deleted successfully.'
                  id: 45
                  type: task
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Comment deleted successfully.'
                  id:
                    type: integer
                    example: 45
                  type:
                    type: string
                    example: task
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Comment not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Comment not found.'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    comment_id:
                      - 'The comment_id field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      comment_id:
                        type: array
                        example:
                          - 'The comment_id field is required.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "Comment couldn't be deleted."
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "Comment couldn't be deleted."
      tags:
        - 'Task Comments'
  '/api/tasks/{id}/comments/list':
    get:
      summary: 'Get all comments for a task with attachments and children.'
      operationId: getAllCommentsForATaskWithAttachmentsAndChildren
      description: ''
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": false,\n  \"comments\": [\n    {\n      \"id\": 1,\n      \"content\": \"Parent comment\",\n      \"attachments\": [...],\n      \"children\": [\n        {\n          \"id\": 2,\n          \"content\": \"Reply\",\n          \"attachments\": [...],\n          \"children\": [...]\n        }\n      ]\n    }\n  ]\n}"
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Project not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Project not found.'
      tags:
        - 'Task Comments'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the project.'
        example: 4
        required: true
        schema:
          type: integer
  '/api/tasks/comments/destroy-attachment/{id}':
    delete:
      summary: 'Delete a comment attachment.'
      operationId: deleteACommentAttachment
      description: "This endpoint deletes a specific attachment belonging to a comment and removes its file from storage.\nThe user must be authenticated and have permission to delete comment attachments."
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Attachment deleted successfully.'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Attachment deleted successfully.'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Attachment not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Attachment not found.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "Attachment couldn't be deleted."
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "Attachment couldn't be deleted."
      tags:
        - 'Task Comments'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the comment attachment to delete.'
        example: 19
        required: true
        schema:
          type: integer
  /api/tasks/upload-media:
    post:
      summary: 'Upload media files for a task.'
      operationId: uploadMediaFilesForATask
      description: 'This endpoint allows authenticated users to upload media files and associate them with a specific task.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'File(s) uploaded successfully.'
                  id:
                    - 201
                    - 202
                  type: media
                  parent_type: task
                  parent_id: 15
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'File(s) uploaded successfully.'
                  id:
                    type: array
                    example:
                      - 201
                      - 202
                    items:
                      type: integer
                  type:
                    type: string
                    example: media
                  parent_type:
                    type: string
                    example: task
                  parent_id:
                    type: integer
                    example: 15
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred.'
                  errors:
                    id:
                      - 'The selected id is invalid.'
                    media_files:
                      - 'The media file must be a valid file.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred.'
                  errors:
                    type: object
                    properties:
                      id:
                        type: array
                        example:
                          - 'The selected id is invalid.'
                        items:
                          type: string
                      media_files:
                        type: array
                        example:
                          - 'The media file must be a valid file.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred during file upload: [error details]'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred during file upload: [error details]'
      tags:
        - 'Task Media'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  description: 'The ID of the task where the media will be uploaded.'
                  example: 9
                'media_files[]':
                  type: string
                  format: binary
                  description: 'An array of media files to upload. Max size is defined by system settings.'
              required:
                - id
                - 'media_files[]'
  '/api/tasks/get-media/{id}':
    get:
      summary: 'Get Task media files.'
      operationId: getTaskMediaFiles
      description: 'This endpoint retrieves all media files associated with a specific project, including sorting and search capabilities.'
      parameters:
        -
          in: query
          name: search
          description: 'optional A search query to filter media files by name, ID, or upload date.'
          example: fuga
          required: false
          schema:
            type: string
            description: 'optional A search query to filter media files by name, ID, or upload date.'
            example: fuga
        -
          in: query
          name: sort
          description: 'optional The column to sort by (default: "id").'
          example: minus
          required: false
          schema:
            type: string
            description: 'optional The column to sort by (default: "id").'
            example: minus
        -
          in: query
          name: order
          description: 'optional The sorting order: "ASC" or "DESC" (default: "DESC").'
          example: odit
          required: false
          schema:
            type: string
            description: 'optional The sorting order: "ASC" or "DESC" (default: "DESC").'
            example: odit
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": false,\n  \"message\": \"Media files retrieved successfully.\",\n  \"rows\": [\n    {\n      \"id\": 101,\n      \"file\": \"<a href='https://example.com/storage/task-media/image.jpg' data-lightbox='task-media'><img src='https://example.com/storage/project-media/image.jpg' alt='image.jpg' width='50'></a>\",\n      \"file_name\": \"image.jpg\",\n      \"file_size\": \"2 MB\",\n      \"created_at\": \"2025-03-03\",\n      \"updated_at\": \"2025-03-03\",\n\n    }\n  ],\n  \"total\": 1\n}"
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Task not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Task not found.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Could not retrieve media files.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Could not retrieve media files.'
      tags:
        - 'Task Media'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the project whose media files are to be retrieved.'
        example: 18
        required: true
        schema:
          type: integer
  '/api/tasks/delete-media/{id}':
    delete:
      summary: 'Delete a media file.'
      operationId: deleteAMediaFile
      description: 'This endpoint allows authenticated users to delete a specific media file associated with a task.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'File deleted successfully.'
                  id: 301
                  title: document.pdf
                  parent_id: 15
                  type: media
                  parent_type: task
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'File deleted successfully.'
                  id:
                    type: integer
                    example: 301
                  title:
                    type: string
                    example: document.pdf
                  parent_id:
                    type: integer
                    example: 15
                  type:
                    type: string
                    example: media
                  parent_type:
                    type: string
                    example: task
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'File not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'File not found.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while deleting the file.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while deleting the file.'
      tags:
        - 'Task Media'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the delete medium.'
        example: quidem
        required: true
        schema:
          type: string
      -
        in: path
        name: mediaId
        description: 'The ID of the media file to delete.'
        example: 11
        required: true
        schema:
          type: integer
  /api/reports/income-vs-expense-report-data:
    get:
      summary: 'Get the Income vs Expense Statistics.'
      operationId: getTheIncomeVsExpenseStatistics
      description: "This endpoint provides the Income vs Expense Statistics.\nThe user must be authenticated to access this data."
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  total_income: '$ 705.00'
                  total_expenses: '$ 20,000.00'
                  profit_or_loss: '$ -19,295.00'
                  invoices:
                    -
                      id: 3
                      view_route: 'http://localhost:8000/estimates-invoices/view/3'
                      amount: '$ 105.00'
                      to_date: 05-02-2025
                      from_date: 05-02-2025
                    -
                      id: 4
                      view_route: 'http://localhost:8000/estimates-invoices/view/4'
                      amount: '$ 600.00'
                      to_date: 05-02-2025
                      from_date: 05-02-2025
                  expenses:
                    -
                      id: 1
                      title: Salary
                      amount: '$ 500.00'
                      expense_date: 31-01-2025
                    -
                      id: 2
                      title: 'January Rent Pay'
                      amount: '$ 5,000.00'
                      expense_date: 04-02-2025
                    -
                      id: 3
                      title: 'Salary to Karen'
                      amount: '$ 5,000.00'
                      expense_date: 31-01-2025
                    -
                      id: 4
                      title: 'Internet Bill Payment'
                      amount: '$ 300.00'
                      expense_date: 31-01-2025
                    -
                      id: 5
                      title: 'Office Refreshment Items'
                      amount: '$ 1,000.00'
                      expense_date: 31-01-2025
                    -
                      id: 9
                      title: 'Transportation Fuel'
                      amount: '$ 2,000.00'
                      expense_date: 08-02-2025
                    -
                      id: 10
                      title: 'Corporate Tax'
                      amount: '$ 1,200.00'
                      expense_date: 08-02-2025
                    -
                      id: 11
                      title: 'Event Sponsorships'
                      amount: '$ 5,000.00'
                      expense_date: 08-02-2025
                properties:
                  total_income:
                    type: string
                    example: '$ 705.00'
                  total_expenses:
                    type: string
                    example: '$ 20,000.00'
                  profit_or_loss:
                    type: string
                    example: '$ -19,295.00'
                  invoices:
                    type: array
                    example:
                      -
                        id: 3
                        view_route: 'http://localhost:8000/estimates-invoices/view/3'
                        amount: '$ 105.00'
                        to_date: 05-02-2025
                        from_date: 05-02-2025
                      -
                        id: 4
                        view_route: 'http://localhost:8000/estimates-invoices/view/4'
                        amount: '$ 600.00'
                        to_date: 05-02-2025
                        from_date: 05-02-2025
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 3
                        view_route:
                          type: string
                          example: 'http://localhost:8000/estimates-invoices/view/3'
                        amount:
                          type: string
                          example: '$ 105.00'
                        to_date:
                          type: string
                          example: 05-02-2025
                        from_date:
                          type: string
                          example: 05-02-2025
                  expenses:
                    type: array
                    example:
                      -
                        id: 1
                        title: Salary
                        amount: '$ 500.00'
                        expense_date: 31-01-2025
                      -
                        id: 2
                        title: 'January Rent Pay'
                        amount: '$ 5,000.00'
                        expense_date: 04-02-2025
                      -
                        id: 3
                        title: 'Salary to Karen'
                        amount: '$ 5,000.00'
                        expense_date: 31-01-2025
                      -
                        id: 4
                        title: 'Internet Bill Payment'
                        amount: '$ 300.00'
                        expense_date: 31-01-2025
                      -
                        id: 5
                        title: 'Office Refreshment Items'
                        amount: '$ 1,000.00'
                        expense_date: 31-01-2025
                      -
                        id: 9
                        title: 'Transportation Fuel'
                        amount: '$ 2,000.00'
                        expense_date: 08-02-2025
                      -
                        id: 10
                        title: 'Corporate Tax'
                        amount: '$ 1,200.00'
                        expense_date: 08-02-2025
                      -
                        id: 11
                        title: 'Event Sponsorships'
                        amount: '$ 5,000.00'
                        expense_date: 08-02-2025
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        title:
                          type: string
                          example: Salary
                        amount:
                          type: string
                          example: '$ 500.00'
                        expense_date:
                          type: string
                          example: 31-01-2025
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Something went wrong.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Something went wrong.'
      tags:
        - 'Income vs Expense'
  '/api/statuses/{id}':
    get:
      summary: 'List or search statuses.'
      operationId: listOrSearchStatuses
      description: 'This endpoint retrieves a list of statuses based on various filters. The user must be authenticated to perform this action. The request allows searching and sorting by different parameters.'
      parameters:
        -
          in: query
          name: search
          description: 'optional The search term to filter statuses by title or id.'
          example: Active
          required: false
          schema:
            type: string
            description: 'optional The search term to filter statuses by title or id.'
            example: Active
        -
          in: query
          name: sort
          description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id, title, color, created_at, and updated_at.'
          example: title
          required: false
          schema:
            type: string
            description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id, title, color, created_at, and updated_at.'
            example: title
        -
          in: query
          name: order
          description: 'optional The sort order, either "ASC" or "DESC". Defaults to "DESC".'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional The sort order, either "ASC" or "DESC". Defaults to "DESC".'
            example: ASC
        -
          in: query
          name: limit
          description: 'optional The number of statuses per page for pagination.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional The number of statuses per page for pagination.'
            example: 10
        -
          in: query
          name: offset
          description: 'optional The offset for pagination, indicating the starting point of results.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'optional The offset for pagination, indicating the starting point of results.'
            example: 0
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Statuses retrieved successfully'
                      total: 1
                      data:
                        -
                          id: 1
                          title: Active
                          color: primary
                          created_at: '20-07-2024 17:50:09'
                          updated_at: '21-07-2024 19:08:16'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Statuses retrieved successfully'
                      total:
                        type: integer
                        example: 1
                      data:
                        type: array
                        example:
                          -
                            id: 1
                            title: Active
                            color: primary
                            created_at: '20-07-2024 17:50:09'
                            updated_at: '21-07-2024 19:08:16'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1
                            title:
                              type: string
                              example: Active
                            color:
                              type: string
                              example: primary
                            created_at:
                              type: string
                              example: '20-07-2024 17:50:09'
                            updated_at:
                              type: string
                              example: '21-07-2024 19:08:16'
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Status not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Status not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Statuses not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Statuses not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
      tags:
        - 'Status Management'
    parameters:
      -
        in: path
        name: id
        description: 'Optional parameter. optional The ID of the status to retrieve.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/status/store:
    post:
      summary: 'Create a new status.'
      operationId: createANewStatus
      description: 'This endpoint allows authenticated users to create a new status with a unique slug and assign roles to it.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Status created successfully.'
                  id: 101
                  status:
                    id: 101
                    title: 'In Progress'
                    color: primary
                    slug: in-progress
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Status created successfully.'
                  id:
                    type: integer
                    example: 101
                  status:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 101
                      title:
                        type: string
                        example: 'In Progress'
                      color:
                        type: string
                        example: primary
                      slug:
                        type: string
                        example: in-progress
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred.'
                  errors:
                    title:
                      - 'The title field is required.'
                    color:
                      - 'The color field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred.'
                  errors:
                    type: object
                    properties:
                      title:
                        type: array
                        example:
                          - 'The title field is required.'
                        items:
                          type: string
                      color:
                        type: array
                        example:
                          - 'The color field is required.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "Status couldn't be created."
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "Status couldn't be created."
      tags:
        - 'Status Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: 'The title of the status.'
                  example: ut
                color:
                  type: string
                  description: 'The color code associated with the status.'
                  example: quo
                role_ids:
                  type: array
                  description: 'optional An array of role IDs to be associated with the status.'
                  example:
                    - aut
                  items:
                    type: string
              required:
                - title
                - color
  /api/status/update:
    post:
      summary: 'Update an existing status.'
      operationId: updateAnExistingStatus
      description: 'This endpoint allows authenticated users to update a status, including modifying the title, color, and associated roles.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Status updated successfully.'
                  id: 101
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Status updated successfully.'
                  id:
                    type: integer
                    example: 101
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Status not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Status not found.'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred.'
                  errors:
                    id:
                      - 'The id field is required.'
                    title:
                      - 'The title field is required.'
                    color:
                      - 'The color field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred.'
                  errors:
                    type: object
                    properties:
                      id:
                        type: array
                        example:
                          - 'The id field is required.'
                        items:
                          type: string
                      title:
                        type: array
                        example:
                          - 'The title field is required.'
                        items:
                          type: string
                      color:
                        type: array
                        example:
                          - 'The color field is required.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "Status couldn't be updated."
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "Status couldn't be updated."
      tags:
        - 'Status Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  description: 'The ID of the status to update.'
                  example: 16
                title:
                  type: string
                  description: 'The updated title of the status.'
                  example: veniam
                color:
                  type: string
                  description: 'The updated color code associated with the status.'
                  example: officiis
                role_ids:
                  type: array
                  description: 'optional An array of role IDs to associate with the status.'
                  example:
                    - molestiae
                  items:
                    type: string
              required:
                - id
                - title
                - color
  '/api/status/get/{id}':
    get:
      summary: 'Get details of a specific status.'
      operationId: getDetailsOfASpecificStatus
      description: 'This endpoint retrieves the details of a specific status, including the roles associated with it.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Status retrieved successfully.'
                  status:
                    id: 101
                    title: 'In Progress'
                    color: primary
                    slug: in-progress
                  roles:
                    - 1
                    - 2
                    - 3
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Status retrieved successfully.'
                  status:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 101
                      title:
                        type: string
                        example: 'In Progress'
                      color:
                        type: string
                        example: primary
                      slug:
                        type: string
                        example: in-progress
                  roles:
                    type: array
                    example:
                      - 1
                      - 2
                      - 3
                    items:
                      type: integer
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Status not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Status not found.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Could not retrieve status.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Could not retrieve status.'
      tags:
        - 'Status Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the status to retrieve.'
        example: 19
        required: true
        schema:
          type: integer
  '/api/status/destroy/{id}':
    delete:
      summary: 'Delete a status.'
      operationId: deleteAStatus
      description: "This endpoint allows authenticated users to delete a specific status. Before deletion,\nall associated projects and tasks will be updated to have a default status ID of `0`."
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Status deleted successfully.'
                  id: 101
                  title: 'In Progress'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Status deleted successfully.'
                  id:
                    type: integer
                    example: 101
                  title:
                    type: string
                    example: 'In Progress'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Status not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Status not found.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "Status couldn't be deleted."
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "Status couldn't be deleted."
      tags:
        - 'Status Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the status to delete.'
        example: 19
        required: true
        schema:
          type: integer
  '/api/priorities/{id}':
    get:
      summary: 'List or search priorities.'
      operationId: listOrSearchPriorities
      description: 'This endpoint retrieves a list of priorities based on various filters. The user must be authenticated to perform this action. The request allows searching and sorting by different parameters.'
      parameters:
        -
          in: query
          name: search
          description: 'optional The search term to filter priorities by title or id.'
          example: High
          required: false
          schema:
            type: string
            description: 'optional The search term to filter priorities by title or id.'
            example: High
        -
          in: query
          name: sort
          description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id, title, color, created_at, and updated_at.'
          example: title
          required: false
          schema:
            type: string
            description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id, title, color, created_at, and updated_at.'
            example: title
        -
          in: query
          name: order
          description: 'optional The sort order, either "ASC" or "DESC". Defaults to "DESC".'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional The sort order, either "ASC" or "DESC". Defaults to "DESC".'
            example: ASC
        -
          in: query
          name: limit
          description: 'optional The number of priorities per page for pagination.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional The number of priorities per page for pagination.'
            example: 10
        -
          in: query
          name: offset
          description: 'optional The offset for pagination, indicating the starting point of results.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'optional The offset for pagination, indicating the starting point of results.'
            example: 0
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Priorities retrieved successfully'
                      total: 1
                      data:
                        -
                          id: 1
                          title: High
                          color: primary
                          created_at: '20-07-2024 17:50:09'
                          updated_at: '21-07-2024 19:08:16'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Priorities retrieved successfully'
                      total:
                        type: integer
                        example: 1
                      data:
                        type: array
                        example:
                          -
                            id: 1
                            title: High
                            color: primary
                            created_at: '20-07-2024 17:50:09'
                            updated_at: '21-07-2024 19:08:16'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1
                            title:
                              type: string
                              example: High
                            color:
                              type: string
                              example: primary
                            created_at:
                              type: string
                              example: '20-07-2024 17:50:09'
                            updated_at:
                              type: string
                              example: '21-07-2024 19:08:16'
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Priority not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Priority not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Priorities not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Priorities not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
      tags:
        - 'Priority Management'
    parameters:
      -
        in: path
        name: id
        description: 'Optional parameter. optional The ID of the priority to retrieve.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/priority/store:
    post:
      summary: 'Create a new priority.'
      operationId: createANewPriority
      description: 'This endpoint allows authenticated users to create a new priority with a unique slug.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Priority created successfully.'
                  id: 101
                  priority:
                    id: 101
                    title: High
                    color: primary
                    slug: high
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Priority created successfully.'
                  id:
                    type: integer
                    example: 101
                  priority:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 101
                      title:
                        type: string
                        example: High
                      color:
                        type: string
                        example: primary
                      slug:
                        type: string
                        example: high
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred.'
                  errors:
                    title:
                      - 'The title field is required.'
                    color:
                      - 'The color field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred.'
                  errors:
                    type: object
                    properties:
                      title:
                        type: array
                        example:
                          - 'The title field is required.'
                        items:
                          type: string
                      color:
                        type: array
                        example:
                          - 'The color field is required.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "Priority couldn't be created."
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "Priority couldn't be created."
      tags:
        - 'Priority Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: 'The title of the priority.'
                  example: rerum
                color:
                  type: string
                  description: 'The color code associated with the priority.'
                  example: non
              required:
                - title
                - color
  /api/priority/update:
    post:
      summary: 'Update an existing priority.'
      operationId: updateAnExistingPriority
      description: 'This endpoint allows authenticated users to update a priority, including modifying the title and color.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Priority updated successfully.'
                  id: 101
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Priority updated successfully.'
                  id:
                    type: integer
                    example: 101
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Priority not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Priority not found.'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred.'
                  errors:
                    id:
                      - 'The id field is required.'
                    title:
                      - 'The title field is required.'
                    color:
                      - 'The color field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred.'
                  errors:
                    type: object
                    properties:
                      id:
                        type: array
                        example:
                          - 'The id field is required.'
                        items:
                          type: string
                      title:
                        type: array
                        example:
                          - 'The title field is required.'
                        items:
                          type: string
                      color:
                        type: array
                        example:
                          - 'The color field is required.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "Priority couldn't be updated."
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "Priority couldn't be updated."
      tags:
        - 'Priority Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  description: 'The ID of the priority to update.'
                  example: 5
                title:
                  type: string
                  description: 'The updated title of the priority.'
                  example: atque
                color:
                  type: string
                  description: 'The updated color code associated with the priority.'
                  example: error
              required:
                - id
                - title
                - color
  '/api/priority/get/{id}':
    get:
      summary: 'Get details of a specific priority.'
      operationId: getDetailsOfASpecificPriority
      description: 'This endpoint retrieves the details of a specific priority.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Priority retrieved successfully.'
                  priority:
                    id: 101
                    title: High
                    color: '#ff0000'
                    slug: high
                    created_at: '2025-03-04 14:00:00'
                    updated_at: '2025-03-04 16:00:00'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Priority retrieved successfully.'
                  priority:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 101
                      title:
                        type: string
                        example: High
                      color:
                        type: string
                        example: '#ff0000'
                      slug:
                        type: string
                        example: high
                      created_at:
                        type: string
                        example: '2025-03-04 14:00:00'
                      updated_at:
                        type: string
                        example: '2025-03-04 16:00:00'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Priority not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Priority not found.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Could not retrieve priority.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Could not retrieve priority.'
      tags:
        - 'Priority Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the priority to retrieve.'
        example: 9
        required: true
        schema:
          type: integer
  '/api/priority/destroy/{id}':
    delete:
      summary: 'Delete a priority.'
      operationId: deleteAPriority
      description: "This endpoint allows authenticated users to delete a specific priority.\nBefore deletion, all associated projects and tasks will have their `priority_id` set to `null`."
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Priority deleted successfully.'
                  id: 101
                  title: High
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Priority deleted successfully.'
                  id:
                    type: integer
                    example: 101
                  title:
                    type: string
                    example: High
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Priority not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Priority not found.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "Priority couldn't be deleted."
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "Priority couldn't be deleted."
      tags:
        - 'Priority Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the priority to delete.'
        example: 11
        required: true
        schema:
          type: integer
  '/api/tags/{id}':
    get:
      summary: 'List or search tags.'
      operationId: listOrSearchTags
      description: 'This endpoint retrieves a list of tags based on various filters. The user must be authenticated to perform this action. The request allows searching and sorting by different parameters.'
      parameters:
        -
          in: query
          name: search
          description: 'optional The search term to filter tags by title or id.'
          example: Urgent
          required: false
          schema:
            type: string
            description: 'optional The search term to filter tags by title or id.'
            example: Urgent
        -
          in: query
          name: sort
          description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id, title, created_at, and updated_at.'
          example: title
          required: false
          schema:
            type: string
            description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id, title, created_at, and updated_at.'
            example: title
        -
          in: query
          name: order
          description: 'optional The sort order, either "ASC" or "DESC". Defaults to "DESC".'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional The sort order, either "ASC" or "DESC". Defaults to "DESC".'
            example: ASC
        -
          in: query
          name: limit
          description: 'optional The number of tags per page for pagination.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional The number of tags per page for pagination.'
            example: 10
        -
          in: query
          name: offset
          description: 'optional The offset for pagination, indicating the starting point of results.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'optional The offset for pagination, indicating the starting point of results.'
            example: 0
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Tags retrieved successfully'
                      total: 1
                      data:
                        -
                          id: 1
                          title: Urgent
                          color: primary
                          created_at: '20-07-2024 17:50:09'
                          updated_at: '21-07-2024 19:08:16'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Tags retrieved successfully'
                      total:
                        type: integer
                        example: 1
                      data:
                        type: array
                        example:
                          -
                            id: 1
                            title: Urgent
                            color: primary
                            created_at: '20-07-2024 17:50:09'
                            updated_at: '21-07-2024 19:08:16'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1
                            title:
                              type: string
                              example: Urgent
                            color:
                              type: string
                              example: primary
                            created_at:
                              type: string
                              example: '20-07-2024 17:50:09'
                            updated_at:
                              type: string
                              example: '21-07-2024 19:08:16'
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Tag not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Tag not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Tags not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Tags not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
      tags:
        - 'Tag Management'
    parameters:
      -
        in: path
        name: id
        description: 'Optional parameter. optional The ID of the tag to retrieve.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/tags/store:
    post:
      summary: 'Create a new tag.'
      operationId: createANewTag
      description: 'This endpoint creates a new todo item with the specified title, color. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Tag created successfully.'
                  id: 36
                  data:
                    id: 36
                    title: test
                    color: secondary
                    created_at: '07-08-2024 16:30:09'
                    updated_at: '07-08-2024 16:30:09'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Tag created successfully.'
                  id:
                    type: integer
                    example: 36
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 36
                      title:
                        type: string
                        example: test
                      color:
                        type: string
                        example: secondary
                      created_at:
                        type: string
                        example: '07-08-2024 16:30:09'
                      updated_at:
                        type: string
                        example: '07-08-2024 16:30:09'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    title:
                      - 'The title field is required.'
                    color:
                      - 'The color must be one of the following: primary, secondary, warning, info, dark, success, danger.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      title:
                        type: array
                        example:
                          - 'The title field is required.'
                        items:
                          type: string
                      color:
                        type: array
                        example:
                          - 'The color must be one of the following: primary, secondary, warning, info, dark, success, danger.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while creating the todo.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while creating the todo.'
      tags:
        - 'Tag Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: 'The title of the tag.'
                  example: 'Finish report'
                color:
                  type: string
                  description: 'The priority of the tag. Must be one of "primary", "secondary", or "warning".'
                  example: secondary
              required:
                - title
                - color
  /api/tags/update:
    post:
      summary: 'Update an existing tag.'
      operationId: updateAnExistingTag
      description: 'This endpoint updates an existing tag item with the specified title, color. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n\"error\": false,\n\"message\": \"Tag updated successfully.\",\n\"id\": \"36\",\n\"data\": {\n  \"id\": 36,\n  \"title\": \"test\",\n  \"color\": \"secondary\",\n  \"created_at\": \"07-08-2024 16:30:09\",\n  \"updated_at\": \"07-08-2024 16:30:09\"\n}\n}\n\n}"
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    id:
                      - 'The id field is required.'
                    title:
                      - 'The title field is required.'
                    color:
                      - 'The color must be one of the following: secondary, primary, info, warning, dark, danger.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      id:
                        type: array
                        example:
                          - 'The id field is required.'
                        items:
                          type: string
                      title:
                        type: array
                        example:
                          - 'The title field is required.'
                        items:
                          type: string
                      color:
                        type: array
                        example:
                          - 'The color must be one of the following: secondary, primary, info, warning, dark, danger.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while updating the tag.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while updating the tag.'
      tags:
        - 'Tag Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  description: 'The ID of the todo to be updated.'
                  example: 1
                title:
                  type: string
                  description: 'The new title of the todo.'
                  example: 'Finish report'
                color:
                  type: string
                  description: 'The new priority of the todo. Must be one of "primary", "secondary", "warning", "dark", "info","danger" or "success".'
                  example: secondary
              required:
                - id
                - title
                - color
  '/api/tags/destroy/{id}':
    delete:
      summary: 'Remove the specified tag.'
      operationId: removeTheSpecifiedTag
      description: 'This endpoint deletes a tag item based on the provided ID. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": false,\n  \"message\": \"Tag deleted successfully.\",\n  \"id\": 1,\n  \"title\": \"Tag Title\"\n  \"data\": []\n}"
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while deleting the tag.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while deleting the tag.'
      tags:
        - 'Tag Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the todo to be deleted.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/users/{id}':
    get:
      summary: 'List or search users.'
      operationId: listOrSearchUsers
      description: 'This endpoint retrieves a list of users based on various filters. The user must be authenticated to perform this action. The request allows filtering by status, search term, role, type, type_id, and other parameters.'
      parameters:
        -
          in: query
          name: search
          description: 'optional The search term to filter users by id, first name, last name, phone, or email.'
          example: John
          required: false
          schema:
            type: string
            description: 'optional The search term to filter users by id, first name, last name, phone, or email.'
            example: John
        -
          in: query
          name: sort
          description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id, phone, dob, doj, created_at, and updated_at.'
          example: id
          required: false
          schema:
            type: string
            description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id, phone, dob, doj, created_at, and updated_at.'
            example: id
        -
          in: query
          name: order
          description: 'optional The sort order, either "ASC" or "DESC". Defaults to "DESC".'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional The sort order, either "ASC" or "DESC". Defaults to "DESC".'
            example: ASC
        -
          in: query
          name: status
          description: 'optional The status ID to filter users by, either 0 or 1.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'optional The status ID to filter users by, either 0 or 1.'
            example: 1
        -
          in: query
          name: role_ids
          description: 'optional The role IDs to filter users by.'
          example:
            - 1
            - 2
          required: false
          schema:
            type: array
            description: 'optional The role IDs to filter users by.'
            example:
              - 1
              - 2
            items:
              type: string
        -
          in: query
          name: type
          description: 'optional The type of filter to apply, either "project" or "task".'
          example: project
          required: false
          schema:
            type: string
            description: 'optional The type of filter to apply, either "project" or "task".'
            example: project
        -
          in: query
          name: type_id
          description: 'optional The ID associated with the type filter.'
          example: 3
          required: false
          schema:
            type: integer
            description: 'optional The ID associated with the type filter.'
            example: 3
        -
          in: query
          name: limit
          description: 'optional The number of users per page for pagination.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional The number of users per page for pagination.'
            example: 10
        -
          in: query
          name: offset
          description: 'optional The offset for pagination, indicating the starting point of results.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'optional The offset for pagination, indicating the starting point of results.'
            example: 0
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Users retrieved successfully'
                      total: 1
                      data:
                        -
                          id: 219
                          first_name: Test
                          last_name: Test
                          role: Member
                          email: test@gmail.com
                          phone: '+91 1111111111'
                          dob: 09-08-2024
                          doj: 09-08-2024
                          address: Test
                          city: Test
                          state: Test
                          country: Test
                          zip: 111-111
                          photo: 'https://test-taskify.infinitietech.com/storage/photos/K0OAOzWyoeD0ZXBzgsaeHZUZERbOTKRljRIYOEYU.png'
                          status: 1
                          created_at: '09-08-2024 17:04:29'
                          updated_at: '09-08-2024 17:04:29'
                          assigned:
                            projects: 0
                            tasks: 0
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Users retrieved successfully'
                      total:
                        type: integer
                        example: 1
                      data:
                        type: array
                        example:
                          -
                            id: 219
                            first_name: Test
                            last_name: Test
                            role: Member
                            email: test@gmail.com
                            phone: '+91 1111111111'
                            dob: 09-08-2024
                            doj: 09-08-2024
                            address: Test
                            city: Test
                            state: Test
                            country: Test
                            zip: 111-111
                            photo: 'https://test-taskify.infinitietech.com/storage/photos/K0OAOzWyoeD0ZXBzgsaeHZUZERbOTKRljRIYOEYU.png'
                            status: 1
                            created_at: '09-08-2024 17:04:29'
                            updated_at: '09-08-2024 17:04:29'
                            assigned:
                              projects: 0
                              tasks: 0
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 219
                            first_name:
                              type: string
                              example: Test
                            last_name:
                              type: string
                              example: Test
                            role:
                              type: string
                              example: Member
                            email:
                              type: string
                              example: test@gmail.com
                            phone:
                              type: string
                              example: '+91 1111111111'
                            dob:
                              type: string
                              example: 09-08-2024
                            doj:
                              type: string
                              example: 09-08-2024
                            address:
                              type: string
                              example: Test
                            city:
                              type: string
                              example: Test
                            state:
                              type: string
                              example: Test
                            country:
                              type: string
                              example: Test
                            zip:
                              type: string
                              example: 111-111
                            photo:
                              type: string
                              example: 'https://test-taskify.infinitietech.com/storage/photos/K0OAOzWyoeD0ZXBzgsaeHZUZERbOTKRljRIYOEYU.png'
                            status:
                              type: integer
                              example: 1
                            created_at:
                              type: string
                              example: '09-08-2024 17:04:29'
                            updated_at:
                              type: string
                              example: '09-08-2024 17:04:29'
                            assigned:
                              type: object
                              properties:
                                projects:
                                  type: integer
                                  example: 0
                                tasks:
                                  type: integer
                                  example: 0
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'User not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'User not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Users not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Users not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Project not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Project not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Task not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Task not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
      tags:
        - 'User Management'
    parameters:
      -
        in: path
        name: id
        description: 'Optional parameter. optional The ID of the user to retrieve.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/users/store:
    post:
      summary: 'Create a new user.'
      operationId: createANewUser
      description: 'This endpoint creates a new user with the provided details. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'User created successfully.'
                  id: 219
                  data:
                    id: 219
                    first_name: Test
                    last_name: Test
                    role: Member
                    email: test@gmail.com
                    phone: '+91 1111111111'
                    dob: 09-08-2024
                    doj: 09-08-2024
                    address: Test
                    city: Test
                    state: Test
                    country: Test
                    zip: 111-111
                    photo: 'https://test-taskify.infinitietech.com/storage/photos/K0OAOzWyoeD0ZXBzgsaeHZUZERbOTKRljRIYOEYU.png'
                    status: 1
                    created_at: '09-08-2024 17:04:29'
                    updated_at: '09-08-2024 17:04:29'
                    assigned:
                      projects: 0
                      tasks: 0
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'User created successfully.'
                  id:
                    type: integer
                    example: 219
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 219
                      first_name:
                        type: string
                        example: Test
                      last_name:
                        type: string
                        example: Test
                      role:
                        type: string
                        example: Member
                      email:
                        type: string
                        example: test@gmail.com
                      phone:
                        type: string
                        example: '+91 1111111111'
                      dob:
                        type: string
                        example: 09-08-2024
                      doj:
                        type: string
                        example: 09-08-2024
                      address:
                        type: string
                        example: Test
                      city:
                        type: string
                        example: Test
                      state:
                        type: string
                        example: Test
                      country:
                        type: string
                        example: Test
                      zip:
                        type: string
                        example: 111-111
                      photo:
                        type: string
                        example: 'https://test-taskify.infinitietech.com/storage/photos/K0OAOzWyoeD0ZXBzgsaeHZUZERbOTKRljRIYOEYU.png'
                      status:
                        type: integer
                        example: 1
                      created_at:
                        type: string
                        example: '09-08-2024 17:04:29'
                      updated_at:
                        type: string
                        example: '09-08-2024 17:04:29'
                      assigned:
                        type: object
                        properties:
                          projects:
                            type: integer
                            example: 0
                          tasks:
                            type: integer
                            example: 0
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    first_name:
                      - 'The first name field is required.'
                    last_name:
                      - 'The last name field is required.'
                    email:
                      - 'The email has already been taken.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      first_name:
                        type: array
                        example:
                          - 'The first name field is required.'
                        items:
                          type: string
                      last_name:
                        type: array
                        example:
                          - 'The last name field is required.'
                        items:
                          type: string
                      email:
                        type: array
                        example:
                          - 'The email has already been taken.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'User couldn’t be created, please make sure email settings are operational.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'User couldn’t be created, please make sure email settings are operational.'
      tags:
        - 'User Management'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                first_name:
                  type: string
                  description: 'The first name of the user.'
                  example: John
                last_name:
                  type: string
                  description: 'The last name of the user.'
                  example: Doe
                email:
                  type: string
                  description: 'The email address of the user.'
                  example: john.doe@example.com
                password:
                  type: string
                  description: 'The password for the user.'
                  example: password123
                password_confirmation:
                  type: string
                  description: 'The password confirmation.'
                  example: password123
                address:
                  type: string
                  description: 'nullable The address of the user.'
                  example: '123 Main St'
                phone:
                  type: string
                  description: 'nullable The phone number of the user.'
                  example: '1234567890'
                country_code:
                  type: string
                  description: 'nullable The country code for the phone number.'
                  example: '+91'
                country_iso_code:
                  type: string
                  description: 'nullable The ISO code for the phone number.'
                  example: in
                city:
                  type: string
                  description: 'nullable The city of the user.'
                  example: 'New York'
                state:
                  type: string
                  description: 'nullable The state of the user.'
                  example: NY
                country:
                  type: string
                  description: 'nullable The country of the user.'
                  example: USA
                zip:
                  type: string
                  description: 'nullable The ZIP code of the user.'
                  example: '10001'
                dob:
                  type: string
                  description: 'nullable The date of birth of the user in the format specified in the general settings.'
                  example: '1990-01-01'
                doj:
                  type: string
                  description: 'nullable The date of joining in the format specified in the general settings.'
                  example: '2024-01-01'
                role:
                  type: integer
                  description: 'The ID of the role for the user.'
                  example: 1
                profile:
                  type: string
                  format: binary
                  description: 'nullable The profile photo of the user.'
                status:
                  type: boolean
                  description: "0 or 1. If Deactivated (0), the user won't be able to log in to their account.\nCan only specify if `is_admin_or_has_all_data_access` is true for the logged-in user, else 0 will be considered by default."
                  example: true
                require_ev:
                  type: boolean
                  description: "0 or 1. If Yes (1) is selected, the user will receive a verification link via email.\nCan only specify if `is_admin_or_has_all_data_access` is true for the logged-in user, else 1 will be considered by default."
                  example: true
              required:
                - first_name
                - last_name
                - email
                - password
                - password_confirmation
                - role
                - status
                - require_ev
  /api/users/update:
    post:
      summary: 'Update an existing user.'
      operationId: updateAnExistingUser
      description: 'This endpoint updates the details of an existing user. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'User updated successfully.'
                  id: 219
                  data:
                    id: 219
                    first_name: APII
                    last_name: User
                    role: Member
                    email: test@gmail.com
                    phone: '+91 1111111111'
                    dob: 09-08-2024
                    doj: 09-08-2024
                    address: 'Test adr'
                    city: 'Test cty'
                    state: 'Test ct'
                    country: 'test ctr'
                    zip: 111-111
                    photo: 'https://test-taskify.infinitietech.com/storage/photos/28NcF6qzmIRiOhN9zrtEu5x1iN55OBspR9o1ONMO.webp'
                    status: '1'
                    created_at: '09-08-2024 17:04:29'
                    updated_at: '09-08-2024 18:32:10'
                    assigned:
                      projects: 14
                      tasks: 12
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'User updated successfully.'
                  id:
                    type: integer
                    example: 219
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 219
                      first_name:
                        type: string
                        example: APII
                      last_name:
                        type: string
                        example: User
                      role:
                        type: string
                        example: Member
                      email:
                        type: string
                        example: test@gmail.com
                      phone:
                        type: string
                        example: '+91 1111111111'
                      dob:
                        type: string
                        example: 09-08-2024
                      doj:
                        type: string
                        example: 09-08-2024
                      address:
                        type: string
                        example: 'Test adr'
                      city:
                        type: string
                        example: 'Test cty'
                      state:
                        type: string
                        example: 'Test ct'
                      country:
                        type: string
                        example: 'test ctr'
                      zip:
                        type: string
                        example: 111-111
                      photo:
                        type: string
                        example: 'https://test-taskify.infinitietech.com/storage/photos/28NcF6qzmIRiOhN9zrtEu5x1iN55OBspR9o1ONMO.webp'
                      status:
                        type: string
                        example: '1'
                      created_at:
                        type: string
                        example: '09-08-2024 17:04:29'
                      updated_at:
                        type: string
                        example: '09-08-2024 18:32:10'
                      assigned:
                        type: object
                        properties:
                          projects:
                            type: integer
                            example: 14
                          tasks:
                            type: integer
                            example: 12
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    first_name:
                      - 'The first name field is required.'
                    last_name:
                      - 'The last name field is required.'
                    email:
                      - 'The email has already been taken.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      first_name:
                        type: array
                        example:
                          - 'The first name field is required.'
                        items:
                          type: string
                      last_name:
                        type: array
                        example:
                          - 'The last name field is required.'
                        items:
                          type: string
                      email:
                        type: array
                        example:
                          - 'The email has already been taken.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "User couldn't be updated."
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "User couldn't be updated."
      tags:
        - 'User Management'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  description: 'The ID of the user to be updated.'
                  example: 1
                first_name:
                  type: string
                  description: 'The first name of the user.'
                  example: John
                last_name:
                  type: string
                  description: 'The last name of the user.'
                  example: Doe
                email:
                  type: string
                  description: 'The email address of the user.'
                  example: john.doe@example.com
                password:
                  type: string
                  description: 'nullable The new password for the user. Can only be updated if `is_admin_or_has_all_data_access` is true for the logged-in user.'
                  example: newpassword123
                password_confirmation:
                  type: string
                  description: 'required_with:password The password confirmation.'
                  example: newpassword123
                address:
                  type: string
                  description: 'nullable The address of the user.'
                  example: '123 Main St'
                phone:
                  type: string
                  description: 'nullable The phone number of the user.'
                  example: '1234567890'
                country_code:
                  type: string
                  description: 'nullable The country code for the phone number.'
                  example: '+91'
                country_iso_code:
                  type: string
                  description: 'nullable The ISO code for the phone number.'
                  example: in
                city:
                  type: string
                  description: 'nullable The city of the user.'
                  example: 'New York'
                state:
                  type: string
                  description: 'nullable The state of the user.'
                  example: NY
                country:
                  type: string
                  description: 'nullable The country of the user.'
                  example: USA
                zip:
                  type: string
                  description: 'nullable The ZIP code of the user.'
                  example: '10001'
                dob:
                  type: string
                  description: 'nullable The date of birth of the user in the format specified in the general settings.'
                  example: '1990-01-01'
                doj:
                  type: string
                  description: 'nullable The date of joining in the format specified in the general settings.'
                  example: '2024-01-01'
                role:
                  type: integer
                  description: 'The ID of the role for the user.'
                  example: 1
                profile:
                  type: string
                  format: binary
                  description: 'nullable The new profile photo of the user.'
                status:
                  type: boolean
                  description: "0 or 1. If Deactivated (0), the user won't be able to log in to their account.\nCan only specify status if `is_admin_or_has_all_data_access` is true for the logged-in user, else the current status will be considered by default."
                  example: true
              required:
                - id
                - first_name
                - last_name
                - email
                - role
                - status
  '/api/users/destroy/{id}':
    delete:
      summary: 'Remove the specified user.'
      operationId: removeTheSpecifiedUser
      description: 'This endpoint deletes a user based on the provided ID. The request must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'User deleted successfully.'
                      id: '1'
                      title: 'John Doe'
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'User deleted successfully.'
                      id:
                        type: string
                        example: '1'
                      title:
                        type: string
                        example: 'John Doe'
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'User not found.'
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'User not found.'
                      data:
                        type: array
                        example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An internal server error occurred.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An internal server error occurred.'
      tags:
        - 'User Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the user to be deleted.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/clients/{id}':
    get:
      summary: 'List or search clients.'
      operationId: listOrSearchClients
      description: 'This endpoint retrieves a list of clients based on various filters. The user must be authenticated to perform this action. The request allows filtering by status, search term, type, type_id, and other parameters.'
      parameters:
        -
          in: query
          name: search
          description: 'optional The search term to filter clients by id, first name, last name, comapny, phone, or email.'
          example: John
          required: false
          schema:
            type: string
            description: 'optional The search term to filter clients by id, first name, last name, comapny, phone, or email.'
            example: John
        -
          in: query
          name: sort
          description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id, company, phone, created_at, and updated_at.'
          example: id
          required: false
          schema:
            type: string
            description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id, company, phone, created_at, and updated_at.'
            example: id
        -
          in: query
          name: order
          description: 'optional The sort order, either "ASC" or "DESC". Defaults to "DESC".'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional The sort order, either "ASC" or "DESC". Defaults to "DESC".'
            example: ASC
        -
          in: query
          name: status
          description: 'optional The status ID to filter clients by, either 0 or 1.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'optional The status ID to filter clients by, either 0 or 1.'
            example: 1
        -
          in: query
          name: type
          description: 'optional The type of filter to apply, either "project" or "task".'
          example: project
          required: false
          schema:
            type: string
            description: 'optional The type of filter to apply, either "project" or "task".'
            example: project
        -
          in: query
          name: type_id
          description: 'optional The ID associated with the type filter.'
          example: 3
          required: false
          schema:
            type: integer
            description: 'optional The ID associated with the type filter.'
            example: 3
        -
          in: query
          name: limit
          description: 'optional The number of clients per page for pagination.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional The number of clients per page for pagination.'
            example: 10
        -
          in: query
          name: offset
          description: 'optional The offset for pagination, indicating the starting point of results.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'optional The offset for pagination, indicating the starting point of results.'
            example: 0
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Clients retrieved successfully'
                      total: 1
                      clients:
                        -
                          id: 185
                          first_name: Client
                          last_name: Test
                          company: 'Test Company'
                          email: client@test.com
                          phone: '1 5555555555'
                          status: 1
                          internal_purpose: 1
                          created_at: 10-06-2024
                          updated_at: 29-07-2024
                          assigned:
                            projects: 0
                            tasks: 0
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Clients retrieved successfully'
                      total:
                        type: integer
                        example: 1
                      clients:
                        type: array
                        example:
                          -
                            id: 185
                            first_name: Client
                            last_name: Test
                            company: 'Test Company'
                            email: client@test.com
                            phone: '1 5555555555'
                            status: 1
                            internal_purpose: 1
                            created_at: 10-06-2024
                            updated_at: 29-07-2024
                            assigned:
                              projects: 0
                              tasks: 0
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 185
                            first_name:
                              type: string
                              example: Client
                            last_name:
                              type: string
                              example: Test
                            company:
                              type: string
                              example: 'Test Company'
                            email:
                              type: string
                              example: client@test.com
                            phone:
                              type: string
                              example: '1 5555555555'
                            status:
                              type: integer
                              example: 1
                            internal_purpose:
                              type: integer
                              example: 1
                            created_at:
                              type: string
                              example: 10-06-2024
                            updated_at:
                              type: string
                              example: 29-07-2024
                            assigned:
                              type: object
                              properties:
                                projects:
                                  type: integer
                                  example: 0
                                tasks:
                                  type: integer
                                  example: 0
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Client not found'
                      total: 0
                      clients: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Client not found'
                      total:
                        type: integer
                        example: 0
                      clients:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Clients not found'
                      total: 0
                      clients: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Clients not found'
                      total:
                        type: integer
                        example: 0
                      clients:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Project not found'
                      total: 0
                      clients: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Project not found'
                      total:
                        type: integer
                        example: 0
                      clients:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Task not found'
                      total: 0
                      clients: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Task not found'
                      total:
                        type: integer
                        example: 0
                      clients:
                        type: array
                        example: []
      tags:
        - 'Client Management'
    parameters:
      -
        in: path
        name: id
        description: 'Optional parameter. optional The ID of the client to retrieve.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/clients/store:
    post:
      summary: 'Store a new client.'
      operationId: storeANewClient
      description: 'This endpoint creates a new client. The client must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Client created successfully.'
                  data:
                    id: 183
                    first_name: API
                    last_name: Client
                    company: test
                    email: 777@gmail.com
                    phone: '+91 1111111111'
                    address: 'Test adr'
                    city: 'Test cty'
                    state: 'Test ct'
                    country: 'test ctr'
                    zip: 111-111
                    photo: 'https://test-taskify.infinitietech.com/storage/photos/a5xT73btrbk7sybc0768Bv8xlBn16ROK1Znf1Ddc.webp'
                    status: '1'
                    internal_purpose: 0
                    created_at: '09-08-2024 19:22:17'
                    updated_at: '09-08-2024 20:10:06'
                    assigned:
                      projects: 0
                      tasks: 0
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Client created successfully.'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 183
                      first_name:
                        type: string
                        example: API
                      last_name:
                        type: string
                        example: Client
                      company:
                        type: string
                        example: test
                      email:
                        type: string
                        example: 777@gmail.com
                      phone:
                        type: string
                        example: '+91 1111111111'
                      address:
                        type: string
                        example: 'Test adr'
                      city:
                        type: string
                        example: 'Test cty'
                      state:
                        type: string
                        example: 'Test ct'
                      country:
                        type: string
                        example: 'test ctr'
                      zip:
                        type: string
                        example: 111-111
                      photo:
                        type: string
                        example: 'https://test-taskify.infinitietech.com/storage/photos/a5xT73btrbk7sybc0768Bv8xlBn16ROK1Znf1Ddc.webp'
                      status:
                        type: string
                        example: '1'
                      internal_purpose:
                        type: integer
                        example: 0
                      created_at:
                        type: string
                        example: '09-08-2024 19:22:17'
                      updated_at:
                        type: string
                        example: '09-08-2024 20:10:06'
                      assigned:
                        type: object
                        properties:
                          projects:
                            type: integer
                            example: 0
                          tasks:
                            type: integer
                            example: 0
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    first_name:
                      - 'The first name field is required.'
                    last_name:
                      - 'The last name field is required.'
                    email:
                      - 'The email has already been taken.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      first_name:
                        type: array
                        example:
                          - 'The first name field is required.'
                        items:
                          type: string
                      last_name:
                        type: array
                        example:
                          - 'The last name field is required.'
                        items:
                          type: string
                      email:
                        type: array
                        example:
                          - 'The email has already been taken.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Client couldn’t be created, please make sure email settings are operational.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Client couldn’t be created, please make sure email settings are operational.'
      tags:
        - 'Client Management'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                first_name:
                  type: string
                  description: 'The first name of the client.'
                  example: John
                last_name:
                  type: string
                  description: 'The last name of the client.'
                  example: Doe
                company:
                  type: string
                  description: 'nullable The company of the client.'
                  example: 'Example Corp'
                email:
                  type: string
                  description: 'The email address of the client.'
                  example: john.doe@example.com
                phone:
                  type: string
                  description: 'nullable The phone number of the client.'
                  example: '1234567890'
                country_code:
                  type: string
                  description: 'nullable The country code for the phone number.'
                  example: '+91'
                country_iso_code:
                  type: string
                  description: 'nullable The ISO code for the phone number.'
                  example: in
                password:
                  type: string
                  description: 'The password for the client. Must be confirmed and at least 6 characters long.'
                  example: password123
                password_confirmation:
                  type: string
                  description: 'The password confirmation. Required if password is provided.'
                  example: password123
                address:
                  type: string
                  description: 'nullable The address of the client.'
                  example: '123 Main St'
                city:
                  type: string
                  description: 'nullable The city of the client.'
                  example: 'New York'
                state:
                  type: string
                  description: 'nullable The state of the client.'
                  example: NY
                country:
                  type: string
                  description: 'nullable The country of the client.'
                  example: USA
                zip:
                  type: string
                  description: 'nullable The ZIP code of the client.'
                  example: '10001'
                dob:
                  type: string
                  description: 'nullable The date of birth of the user in the format specified in the general settings.'
                  example: '1990-01-01'
                doj:
                  type: string
                  description: 'nullable The date of joining in the format specified in the general settings.'
                  example: '2024-01-01'
                internal_purpose:
                  type: string
                  description: "nullable Set to 'on' if the client is for internal purposes."
                  example: 'on'
                profile:
                  type: string
                  format: binary
                  description: 'nullable The profile photo of the client.'
                status:
                  type: boolean
                  description: "0 or 1. If Deactivated (0), the client won't be able to log in to their account.\nCan only specify if `is_admin_or_has_all_data_access` is true for the logged-in user, else 0 will be considered by default."
                  example: true
                require_ev:
                  type: boolean
                  description: "0 or 1. If Yes (1) is selected, the client will receive a verification link via email.\nCan only specify if `is_admin_or_has_all_data_access` is true for the logged-in user, else 1 will be considered by default."
                  example: true
              required:
                - first_name
                - last_name
                - email
                - password
                - password_confirmation
                - status
                - require_ev
  /api/clients/update:
    post:
      summary: 'Update an existing client.'
      operationId: updateAnExistingClient
      description: 'This endpoint updates the details of an existing client. The client must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Client updated successfully.'
                  data:
                    id: 183
                    first_name: API
                    last_name: Client
                    company: test
                    email: 777@gmail.com
                    phone: '+91 1111111111'
                    address: 'Test adr'
                    city: 'Test cty'
                    state: 'Test ct'
                    country: 'test ctr'
                    zip: 111-111
                    photo: 'https://test-taskify.infinitietech.com/storage/photos/a5xT73btrbk7sybc0768Bv8xlBn16ROK1Znf1Ddc.webp'
                    status: '1'
                    internal_purpose: 0
                    created_at: '09-08-2024 19:22:17'
                    updated_at: '09-08-2024 20:10:06'
                    assigned:
                      projects: 0
                      tasks: 0
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Client updated successfully.'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 183
                      first_name:
                        type: string
                        example: API
                      last_name:
                        type: string
                        example: Client
                      company:
                        type: string
                        example: test
                      email:
                        type: string
                        example: 777@gmail.com
                      phone:
                        type: string
                        example: '+91 1111111111'
                      address:
                        type: string
                        example: 'Test adr'
                      city:
                        type: string
                        example: 'Test cty'
                      state:
                        type: string
                        example: 'Test ct'
                      country:
                        type: string
                        example: 'test ctr'
                      zip:
                        type: string
                        example: 111-111
                      photo:
                        type: string
                        example: 'https://test-taskify.infinitietech.com/storage/photos/a5xT73btrbk7sybc0768Bv8xlBn16ROK1Znf1Ddc.webp'
                      status:
                        type: string
                        example: '1'
                      internal_purpose:
                        type: integer
                        example: 0
                      created_at:
                        type: string
                        example: '09-08-2024 19:22:17'
                      updated_at:
                        type: string
                        example: '09-08-2024 20:10:06'
                      assigned:
                        type: object
                        properties:
                          projects:
                            type: integer
                            example: 0
                          tasks:
                            type: integer
                            example: 0
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    first_name:
                      - 'The first name field is required.'
                    last_name:
                      - 'The last name field is required.'
                    email:
                      - 'The email has already been taken.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      first_name:
                        type: array
                        example:
                          - 'The first name field is required.'
                        items:
                          type: string
                      last_name:
                        type: array
                        example:
                          - 'The last name field is required.'
                        items:
                          type: string
                      email:
                        type: array
                        example:
                          - 'The email has already been taken.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "Client couldn't be updated."
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "Client couldn't be updated."
      tags:
        - 'Client Management'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  description: 'The ID of the client to be updated.'
                  example: 1
                first_name:
                  type: string
                  description: 'The first name of the client.'
                  example: John
                last_name:
                  type: string
                  description: 'The last name of the client.'
                  example: Doe
                company:
                  type: string
                  description: 'nullable The company of the client.'
                  example: XYZ
                email:
                  type: string
                  description: 'The email address of the client.'
                  example: john.doe@example.com
                password:
                  type: string
                  description: 'nullable The new password for the client. Can only be updated if `is_admin_or_has_all_data_access` is true for the logged-in user.'
                  example: newpassword123
                password_confirmation:
                  type: string
                  description: 'required_with:password The password confirmation.'
                  example: newpassword123
                address:
                  type: string
                  description: 'nullable The address of the client.'
                  example: '123 Main St'
                phone:
                  type: string
                  description: 'nullable The phone number of the client.'
                  example: '1234567890'
                country_code:
                  type: string
                  description: 'nullable The country code for the phone number.'
                  example: '+91'
                country_iso_code:
                  type: string
                  description: 'nullable The ISO code for the phone number.'
                  example: in
                city:
                  type: string
                  description: 'nullable The city of the client.'
                  example: 'New York'
                state:
                  type: string
                  description: 'nullable The state of the client.'
                  example: NY
                country:
                  type: string
                  description: 'nullable The country of the client.'
                  example: USA
                zip:
                  type: string
                  description: 'nullable The ZIP code of the client.'
                  example: '10001'
                dob:
                  type: string
                  description: 'nullable The date of birth of the user in the format specified in the general settings.'
                  example: '1990-01-01'
                doj:
                  type: string
                  description: 'nullable The date of joining in the format specified in the general settings.'
                  example: '2024-01-01'
                internal_purpose:
                  type: string
                  description: "nullable Set to 'on' if the client is for internal purposes."
                  example: 'on'
                profile:
                  type: string
                  format: binary
                  description: 'nullable The new profile photo of the client.'
                status:
                  type: boolean
                  description: "0 or 1. If Deactivated (0), the client won't be able to log in to their account.\nCan only specify if `is_admin_or_has_all_data_access` is true for the logged-in user, else the current status will be considered by default."
                  example: true
                require_ev:
                  type: boolean
                  description: "0 or 1. If Yes (1) is selected, the client will receive a verification link via email.\nCan only specify if `is_admin_or_has_all_data_access` is true for the logged-in user, else the current require_ev will be considered by default."
                  example: true
              required:
                - id
                - first_name
                - last_name
                - email
                - status
                - require_ev
  '/api/clients/destroy/{id}':
    delete:
      summary: 'Remove the specified client.'
      operationId: removeTheSpecifiedClient
      description: 'This endpoint deletes a client based on the provided ID. The request must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      data:
                        error: false
                        message: 'Client deleted successfully.'
                        id: '1'
                        title: 'Jane Doe'
                        data: []
                    properties:
                      data:
                        type: object
                        properties:
                          error:
                            type: boolean
                            example: false
                          message:
                            type: string
                            example: 'Client deleted successfully.'
                          id:
                            type: string
                            example: '1'
                          title:
                            type: string
                            example: 'Jane Doe'
                          data:
                            type: array
                            example: []
                  -
                    description: ''
                    type: object
                    example:
                      data:
                        error: true
                        message: 'Client not found.'
                        data: []
                    properties:
                      data:
                        type: object
                        properties:
                          error:
                            type: boolean
                            example: true
                          message:
                            type: string
                            example: 'Client not found.'
                          data:
                            type: array
                            example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    error: true
                    message: 'An internal server error occurred.'
                properties:
                  data:
                    type: object
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'An internal server error occurred.'
      tags:
        - 'Client Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the client to be deleted.'
        example: 1
        required: true
        schema:
          type: integer
  /api/workspaces/store:
    post:
      summary: 'Create a new workspace.'
      operationId: createANewWorkspace
      description: 'This endpoint creates a new workspace with the provided details. The user must be authenticated to perform this action. The request validates various fields, including title and participants.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Workspace created successfully.'
                  id: 438
                  data:
                    id: 438
                    title: 'Design Team'
                    is_primary: true
                    users:
                      -
                        id: 7
                        first_name: Madhavan
                        last_name: Vaidya
                        photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                    clients:
                      -
                        id: 103
                        first_name: Test
                        last_name: Test
                        photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                    created_at: '07-08-2024 14:38:51'
                    updated_at: '07-08-2024 14:38:51'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Workspace created successfully.'
                  id:
                    type: integer
                    example: 438
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 438
                      title:
                        type: string
                        example: 'Design Team'
                      is_primary:
                        type: boolean
                        example: true
                      users:
                        type: array
                        example:
                          -
                            id: 7
                            first_name: Madhavan
                            last_name: Vaidya
                            photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 7
                            first_name:
                              type: string
                              example: Madhavan
                            last_name:
                              type: string
                              example: Vaidya
                            photo:
                              type: string
                              example: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                      clients:
                        type: array
                        example:
                          -
                            id: 103
                            first_name: Test
                            last_name: Test
                            photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 103
                            first_name:
                              type: string
                              example: Test
                            last_name:
                              type: string
                              example: Test
                            photo:
                              type: string
                              example: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                      created_at:
                        type: string
                        example: '07-08-2024 14:38:51'
                      updated_at:
                        type: string
                        example: '07-08-2024 14:38:51'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    title:
                      - 'The title field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      title:
                        type: array
                        example:
                          - 'The title field is required.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while creating the workspace.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while creating the workspace.'
      tags:
        - 'Workspace Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: 'The title of the workspace.'
                  example: 'Design Team'
                user_ids:
                  type: array|null
                  description: 'optional Array of user IDs to be associated with the workspace.'
                  example: '[1, 2, 3]'
                client_ids:
                  type: array|null
                  description: 'optional Array of client IDs to be associated with the workspace.'
                  example: '[5, 6]'
                primaryWorkspace:
                  type: string
                  description: "optional Indicates if this workspace should be set as primary. Can only specify if `is_admin_or_has_all_data_access` is true for the logged-in user, else it will be considered 0 by default. The value should be 'on' to set as primary."
                  example: 'on'
              required:
                - title
  '/api/workspaces/{id}':
    get:
      summary: 'List or search workspaces.'
      operationId: listOrSearchWorkspaces
      description: 'This endpoint retrieves a list of workspaces based on various filters. The user must be authenticated to perform this action. The request allows filtering by user, client, and other parameters.'
      parameters:
        -
          in: query
          name: search
          description: 'optional The search term to filter workspaces by title or id.'
          example: Workspace
          required: false
          schema:
            type: string
            description: 'optional The search term to filter workspaces by title or id.'
            example: Workspace
        -
          in: query
          name: sort
          description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id, title, created_at, and updated_at.'
          example: title
          required: false
          schema:
            type: string
            description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id, title, created_at, and updated_at.'
            example: title
        -
          in: query
          name: order
          description: 'optional The sort order, either "ASC" or "DESC". Defaults to "DESC".'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional The sort order, either "ASC" or "DESC". Defaults to "DESC".'
            example: ASC
        -
          in: query
          name: user_id
          description: 'optional The user ID to filter workspaces by.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'optional The user ID to filter workspaces by.'
            example: 1
        -
          in: query
          name: client_id
          description: 'optional The client ID to filter workspaces by.'
          example: 5
          required: false
          schema:
            type: integer
            description: 'optional The client ID to filter workspaces by.'
            example: 5
        -
          in: query
          name: limit
          description: 'optional The number of workspaces per page for pagination.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional The number of workspaces per page for pagination.'
            example: 10
        -
          in: query
          name: offset
          description: 'optional The offset for pagination, indicating the starting point of results.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'optional The offset for pagination, indicating the starting point of results.'
            example: 0
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Workspaces retrieved successfully'
                      total: 1
                      data:
                        -
                          id: 351
                          title: 'Workspace Title'
                          is_primary: 0
                          users:
                            -
                              id: 7
                              first_name: Madhavan
                              last_name: Vaidya
                              photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                          clients:
                            -
                              id: 12
                              first_name: Client
                              last_name: Name
                              photo: 'https://test-taskify.infinitietech.com/storage/photos/client-photo.png'
                          created_at: '20-07-2024 17:50:09'
                          updated_at: '21-07-2024 19:08:16'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Workspaces retrieved successfully'
                      total:
                        type: integer
                        example: 1
                      data:
                        type: array
                        example:
                          -
                            id: 351
                            title: 'Workspace Title'
                            is_primary: 0
                            users:
                              -
                                id: 7
                                first_name: Madhavan
                                last_name: Vaidya
                                photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                            clients:
                              -
                                id: 12
                                first_name: Client
                                last_name: Name
                                photo: 'https://test-taskify.infinitietech.com/storage/photos/client-photo.png'
                            created_at: '20-07-2024 17:50:09'
                            updated_at: '21-07-2024 19:08:16'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 351
                            title:
                              type: string
                              example: 'Workspace Title'
                            is_primary:
                              type: integer
                              example: 0
                            users:
                              type: array
                              example:
                                -
                                  id: 7
                                  first_name: Madhavan
                                  last_name: Vaidya
                                  photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                              items:
                                type: object
                                properties:
                                  id:
                                    type: integer
                                    example: 7
                                  first_name:
                                    type: string
                                    example: Madhavan
                                  last_name:
                                    type: string
                                    example: Vaidya
                                  photo:
                                    type: string
                                    example: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                            clients:
                              type: array
                              example:
                                -
                                  id: 12
                                  first_name: Client
                                  last_name: Name
                                  photo: 'https://test-taskify.infinitietech.com/storage/photos/client-photo.png'
                              items:
                                type: object
                                properties:
                                  id:
                                    type: integer
                                    example: 12
                                  first_name:
                                    type: string
                                    example: Client
                                  last_name:
                                    type: string
                                    example: Name
                                  photo:
                                    type: string
                                    example: 'https://test-taskify.infinitietech.com/storage/photos/client-photo.png'
                            created_at:
                              type: string
                              example: '20-07-2024 17:50:09'
                            updated_at:
                              type: string
                              example: '21-07-2024 19:08:16'
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Workspace not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Workspace not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Workspaces not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Workspaces not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
      tags:
        - 'Workspace Management'
    parameters:
      -
        in: path
        name: id
        description: 'Optional parameter. optional The ID of the workspace to retrieve.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/workspaces/update:
    post:
      summary: 'Update an existing workspace.'
      operationId: updateAnExistingWorkspace
      description: 'This endpoint updates the details of an existing workspace. The user must be authenticated to perform this action. The request validates various fields, including title and participants.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Workspace updated successfully.'
                  id: 438
                  data:
                    id: 438
                    title: 'Design Team'
                    is_primary: true
                    users:
                      -
                        id: 7
                        first_name: Madhavan
                        last_name: Vaidya
                        photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                    clients:
                      -
                        id: 103
                        first_name: Test
                        last_name: Test
                        photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                    created_at: '07-08-2024 14:38:51'
                    updated_at: '07-08-2024 14:38:51'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Workspace updated successfully.'
                  id:
                    type: integer
                    example: 438
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 438
                      title:
                        type: string
                        example: 'Design Team'
                      is_primary:
                        type: boolean
                        example: true
                      users:
                        type: array
                        example:
                          -
                            id: 7
                            first_name: Madhavan
                            last_name: Vaidya
                            photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 7
                            first_name:
                              type: string
                              example: Madhavan
                            last_name:
                              type: string
                              example: Vaidya
                            photo:
                              type: string
                              example: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                      clients:
                        type: array
                        example:
                          -
                            id: 103
                            first_name: Test
                            last_name: Test
                            photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 103
                            first_name:
                              type: string
                              example: Test
                            last_name:
                              type: string
                              example: Test
                            photo:
                              type: string
                              example: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                      created_at:
                        type: string
                        example: '07-08-2024 14:38:51'
                      updated_at:
                        type: string
                        example: '07-08-2024 14:38:51'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    title:
                      - 'The title field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      title:
                        type: array
                        example:
                          - 'The title field is required.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while updating the workspace.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while updating the workspace.'
      tags:
        - 'Workspace Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  description: 'The ID of the workspace to update.'
                  example: 438
                title:
                  type: string
                  description: 'The new title of the workspace.'
                  example: 'Design Team'
                user_ids:
                  type: array|null
                  description: 'optional Array of user IDs to be associated with the workspace.'
                  example: '[1, 2, 3]'
                client_ids:
                  type: array|null
                  description: 'optional Array of client IDs to be associated with the workspace.'
                  example: '[5, 6]'
                primaryWorkspace:
                  type: string
                  description: "optional Indicates if this workspace should be set as primary. Can only specify if `is_admin_or_has_all_data_access` is true for the logged-in user, else current value will be considered by default. The value should be 'on' to set as primary."
                  example: 'on'
              required:
                - id
                - title
  '/api/workspaces/destroy/{id}':
    delete:
      summary: 'Remove the specified workspace.'
      operationId: removeTheSpecifiedWorkspace
      description: 'This endpoint deletes a workspace based on the provided ID. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Workspace deleted successfully.'
                      id: '60'
                      title: 'Workspace Title'
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Workspace deleted successfully.'
                      id:
                        type: string
                        example: '60'
                      title:
                        type: string
                        example: 'Workspace Title'
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Workspace not found.'
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Workspace not found.'
                      data:
                        type: array
                        example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while deleting the workspace.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while deleting the workspace.'
      tags:
        - 'Workspace Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the workspace to be deleted.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/workspaces/{id}/default':
    patch:
      summary: 'Set or remove a default workspace for the authenticated user.'
      operationId: setOrRemoveADefaultWorkspaceForTheAuthenticatedUser
      description: 'This endpoint updates whether a workspace is set as the default workspace for the user. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n\"error\": false,\n\"message\": \"Default status updated successfully\"\n\"data\":[Workspace data here]\n}"
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Workspace not found'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Workspace not found'
                  data:
                    type: array
                    example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Failed to update default workspace'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Failed to update default workspace'
      tags:
        - 'Workspace Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                is_default:
                  type: boolean
                  description: 'Indicates whether the workspace should be set as default. Use 1 for setting as default and 0 for removing it as default.'
                  example: true
              required:
                - is_default
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the workspace to update.'
        example: 9
        required: true
        schema:
          type: integer
  /api/workspaces/remove-participant:
    delete:
      summary: 'Remove the authenticated user from the current workspace.'
      operationId: removeTheAuthenticatedUserFromTheCurrentWorkspace
      description: 'This endpoint removes the authenticated user from the workspace they are currently in. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": false,\n  \"message\": \"Removed from workspace successfully.\",\n  \"data\": {\n    \"workspace_id\": 1\n  }\n}\n}"
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while removing the participant from the workspace.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while removing the participant from the workspace.'
      tags:
        - 'Workspace Management'
  /api/meetings/store:
    post:
      summary: 'Create a new meeting.'
      operationId: createANewMeeting
      description: 'This endpoint creates a new meeting with the provided details. The user must be authenticated to perform this action. The request validates various fields, including title, start and end dates, start and end times, and participant IDs.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Meeting created successfully.'
                  id: 119
                  data:
                    id: 119
                    title: 'From API'
                    start_date: 25-07-2024
                    start_time: '15:00:00'
                    end_date: 25-08-2024
                    end_time: '11:41:05'
                    users:
                      -
                        id: 7
                        first_name: Madhavan
                        last_name: Vaidya
                        photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                    clients:
                      -
                        id: 173
                        first_name: '666'
                        last_name: '666'
                        photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                    status: Ongoing
                    created_at: '07-08-2024 17:11:05'
                    updated_at: '07-08-2024 17:11:05'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Meeting created successfully.'
                  id:
                    type: integer
                    example: 119
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 119
                      title:
                        type: string
                        example: 'From API'
                      start_date:
                        type: string
                        example: 25-07-2024
                      start_time:
                        type: string
                        example: '15:00:00'
                      end_date:
                        type: string
                        example: 25-08-2024
                      end_time:
                        type: string
                        example: '11:41:05'
                      users:
                        type: array
                        example:
                          -
                            id: 7
                            first_name: Madhavan
                            last_name: Vaidya
                            photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 7
                            first_name:
                              type: string
                              example: Madhavan
                            last_name:
                              type: string
                              example: Vaidya
                            photo:
                              type: string
                              example: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                      clients:
                        type: array
                        example:
                          -
                            id: 173
                            first_name: '666'
                            last_name: '666'
                            photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 173
                            first_name:
                              type: string
                              example: '666'
                            last_name:
                              type: string
                              example: '666'
                            photo:
                              type: string
                              example: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                      status:
                        type: string
                        example: Ongoing
                      created_at:
                        type: string
                        example: '07-08-2024 17:11:05'
                      updated_at:
                        type: string
                        example: '07-08-2024 17:11:05'
        422:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n \"error\": true,\n \"message\": \"Validation errors occurred\",\n \"errors\": {\n   \"title\": [\"The title field is required.\"],\n   \"start_date\": [\"The start date field is required.\"],\n   ...\n }\n}"
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while creating the meeting.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while creating the meeting.'
      tags:
        - 'Meeting Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: 'The title of the meeting.'
                  example: 'Project Kickoff'
                start_date:
                  type: string
                  description: 'The start date of the meeting in the format specified in the general settings.'
                  example: 25-07-2024
                end_date:
                  type: string
                  description: 'The end date of the meeting in the format specified in the general settings.'
                  example: 25-07-2024
                start_time:
                  type: string
                  description: 'The start time of the meeting in the format HH:MM.'
                  example: '10:00'
                end_time:
                  type: string
                  description: 'The end time of the meeting in the format HH:MM.'
                  example: '11:00'
                user_ids:
                  type: array
                  description: 'nullable An array of user IDs to be assigned to the meeting.'
                  example:
                    - 1
                    - 2
                    - 3
                  items:
                    type: string
                client_ids:
                  type: array
                  description: 'nullable An array of client IDs to be assigned to the meeting.'
                  example:
                    - 4
                    - 5
                  items:
                    type: string
              required:
                - title
                - start_date
                - end_date
                - start_time
                - end_time
  '/api/meetings/{id}':
    get:
      summary: 'List or search meetings.'
      operationId: listOrSearchMeetings
      description: 'This endpoint retrieves a list of meetings based on various filters. The user must be authenticated to perform this action. The request allows filtering by status, user, client, date ranges, and other parameters.'
      parameters:
        -
          in: query
          name: search
          description: 'optional The search term to filter meetings by title or id.'
          example: Meeting
          required: false
          schema:
            type: string
            description: 'optional The search term to filter meetings by title or id.'
            example: Meeting
        -
          in: query
          name: sort
          description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id, title, start_date_time, end_date_time, created_at, and updated_at.'
          example: title
          required: false
          schema:
            type: string
            description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id, title, start_date_time, end_date_time, created_at, and updated_at.'
            example: title
        -
          in: query
          name: order
          description: 'optional The sort order, either "ASC" or "DESC". Defaults to "DESC".'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional The sort order, either "ASC" or "DESC". Defaults to "DESC".'
            example: ASC
        -
          in: query
          name: status
          description: 'optional The status of the meeting to filter by. Can be "ongoing", "ended", or "yet_to_start".'
          example: ongoing
          required: false
          schema:
            type: string
            description: 'optional The status of the meeting to filter by. Can be "ongoing", "ended", or "yet_to_start".'
            example: ongoing
        -
          in: query
          name: user_id
          description: 'optional The user ID to filter meetings by.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'optional The user ID to filter meetings by.'
            example: 1
        -
          in: query
          name: client_id
          description: 'optional The client ID to filter meetings by.'
          example: 5
          required: false
          schema:
            type: integer
            description: 'optional The client ID to filter meetings by.'
            example: 5
        -
          in: query
          name: start_date_from
          description: "optional The start date range's start in YYYY-MM-DD format."
          example: '2024-01-01'
          required: false
          schema:
            type: string
            description: "optional The start date range's start in YYYY-MM-DD format."
            example: '2024-01-01'
        -
          in: query
          name: start_date_to
          description: "optional The start date range's end in YYYY-MM-DD format."
          example: '2024-12-31'
          required: false
          schema:
            type: string
            description: "optional The start date range's end in YYYY-MM-DD format."
            example: '2024-12-31'
        -
          in: query
          name: end_date_from
          description: "optional The end date range's start in YYYY-MM-DD format."
          example: '2024-01-01'
          required: false
          schema:
            type: string
            description: "optional The end date range's start in YYYY-MM-DD format."
            example: '2024-01-01'
        -
          in: query
          name: end_date_to
          description: "optional The end date range's end in YYYY-MM-DD format."
          example: '2024-12-31'
          required: false
          schema:
            type: string
            description: "optional The end date range's end in YYYY-MM-DD format."
            example: '2024-12-31'
        -
          in: query
          name: limit
          description: 'optional The number of meetings per page for pagination.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional The number of meetings per page for pagination.'
            example: 10
        -
          in: query
          name: offset
          description: 'optional The offset for pagination, indicating the starting point of results.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'optional The offset for pagination, indicating the starting point of results.'
            example: 0
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Meetings retrieved successfully'
                      total: 1
                      data:
                        -
                          id: 351
                          title: 'Project Kickoff'
                          start_date: '2024-07-01'
                          start_time: '10:00:00'
                          end_date: '2024-07-01'
                          end_time: '11:00:00'
                          users:
                            -
                              id: 7
                              first_name: Madhavan
                              last_name: Vaidya
                              photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                          clients: []
                          status: Ongoing
                          created_at: '14-06-2024 17:50:09'
                          updated_at: '17-06-2024 19:08:16'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Meetings retrieved successfully'
                      total:
                        type: integer
                        example: 1
                      data:
                        type: array
                        example:
                          -
                            id: 351
                            title: 'Project Kickoff'
                            start_date: '2024-07-01'
                            start_time: '10:00:00'
                            end_date: '2024-07-01'
                            end_time: '11:00:00'
                            users:
                              -
                                id: 7
                                first_name: Madhavan
                                last_name: Vaidya
                                photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                            clients: []
                            status: Ongoing
                            created_at: '14-06-2024 17:50:09'
                            updated_at: '17-06-2024 19:08:16'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 351
                            title:
                              type: string
                              example: 'Project Kickoff'
                            start_date:
                              type: string
                              example: '2024-07-01'
                            start_time:
                              type: string
                              example: '10:00:00'
                            end_date:
                              type: string
                              example: '2024-07-01'
                            end_time:
                              type: string
                              example: '11:00:00'
                            users:
                              type: array
                              example:
                                -
                                  id: 7
                                  first_name: Madhavan
                                  last_name: Vaidya
                                  photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                              items:
                                type: object
                                properties:
                                  id:
                                    type: integer
                                    example: 7
                                  first_name:
                                    type: string
                                    example: Madhavan
                                  last_name:
                                    type: string
                                    example: Vaidya
                                  photo:
                                    type: string
                                    example: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                            clients:
                              type: array
                              example: []
                            status:
                              type: string
                              example: Ongoing
                            created_at:
                              type: string
                              example: '14-06-2024 17:50:09'
                            updated_at:
                              type: string
                              example: '17-06-2024 19:08:16'
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Meeting not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Meeting not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Meetings not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Meetings not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
      tags:
        - 'Meeting Management'
    parameters:
      -
        in: path
        name: id
        description: 'Optional parameter. optional The ID of the meeting to retrieve.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/meetings/update:
    post:
      summary: 'Update an existing meeting.'
      operationId: updateAnExistingMeeting
      description: 'This endpoint updates an existing meeting with the provided details. The user must be authenticated to perform this action. The request validates various fields, including title, dates, and times.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Meeting updated successfully.'
                  id: 119
                  data:
                    id: 119
                    title: 'From API'
                    start_date: 25-07-2024
                    start_time: '15:00:00'
                    end_date: 25-08-2024
                    end_time: '11:45:15'
                    users:
                      -
                        id: 7
                        first_name: Madhavan
                        last_name: Vaidya
                        photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                    clients:
                      -
                        id: 173
                        first_name: '666'
                        last_name: '666'
                        photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                    status: Ongoing
                    created_at: '07-08-2024 17:11:05'
                    updated_at: '07-08-2024 17:15:15'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Meeting updated successfully.'
                  id:
                    type: integer
                    example: 119
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 119
                      title:
                        type: string
                        example: 'From API'
                      start_date:
                        type: string
                        example: 25-07-2024
                      start_time:
                        type: string
                        example: '15:00:00'
                      end_date:
                        type: string
                        example: 25-08-2024
                      end_time:
                        type: string
                        example: '11:45:15'
                      users:
                        type: array
                        example:
                          -
                            id: 7
                            first_name: Madhavan
                            last_name: Vaidya
                            photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 7
                            first_name:
                              type: string
                              example: Madhavan
                            last_name:
                              type: string
                              example: Vaidya
                            photo:
                              type: string
                              example: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                      clients:
                        type: array
                        example:
                          -
                            id: 173
                            first_name: '666'
                            last_name: '666'
                            photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 173
                            first_name:
                              type: string
                              example: '666'
                            last_name:
                              type: string
                              example: '666'
                            photo:
                              type: string
                              example: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                      status:
                        type: string
                        example: Ongoing
                      created_at:
                        type: string
                        example: '07-08-2024 17:11:05'
                      updated_at:
                        type: string
                        example: '07-08-2024 17:15:15'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    id:
                      - 'The meeting ID is required.'
                      - 'The meeting ID does not exist in our records.'
                    start_date:
                      - 'The start date must be before or equal to the end date.'
                    start_time:
                      - 'The start time field is required.'
                    end_time:
                      - 'The end time field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      id:
                        type: array
                        example:
                          - 'The meeting ID is required.'
                          - 'The meeting ID does not exist in our records.'
                        items:
                          type: string
                      start_date:
                        type: array
                        example:
                          - 'The start date must be before or equal to the end date.'
                        items:
                          type: string
                      start_time:
                        type: array
                        example:
                          - 'The start time field is required.'
                        items:
                          type: string
                      end_time:
                        type: array
                        example:
                          - 'The end time field is required.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while updating the meeting.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while updating the meeting.'
      tags:
        - 'Meeting Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  description: 'The ID of the meeting to update.'
                  example: 1
                title:
                  type: string
                  description: 'The title of the meeting.'
                  example: 'Updated Meeting Title'
                start_date:
                  type: string
                  description: 'The start date of the meeting in the format specified in the general settings.'
                  example: '2024-08-01'
                end_date:
                  type: string
                  description: 'The end date of the meeting in the format specified in the general settings.'
                  example: '2024-08-31'
                start_time:
                  type: string
                  description: 'The start time of the meeting.'
                  example: '09:00'
                end_time:
                  type: string
                  description: 'The end time of the meeting.'
                  example: '10:00'
                user_ids:
                  type: array|null
                  description: 'optional Array of user IDs to be associated with the meeting.'
                  example: '[2, 3]'
                client_ids:
                  type: array|null
                  description: 'optional Array of client IDs to be associated with the meeting.'
                  example: '[5, 6]'
              required:
                - id
                - title
                - start_date
                - end_date
                - start_time
                - end_time
  '/api/meetings/destroy/{id}':
    delete:
      summary: 'Remove the specified meeting.'
      operationId: removeTheSpecifiedMeeting
      description: 'This endpoint deletes a meeting based on the provided ID. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Meeting deleted successfully.'
                      id: 1
                      title: 'Meeting Title'
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Meeting deleted successfully.'
                      id:
                        type: integer
                        example: 1
                      title:
                        type: string
                        example: 'Meeting Title'
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Meeting not found.'
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Meeting not found.'
                      data:
                        type: array
                        example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while deleting the meeting.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while deleting the meeting.'
      tags:
        - 'Meeting Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the meeting to be deleted.'
        example: 1
        required: true
        schema:
          type: integer
  /api/todos/store:
    post:
      summary: 'Create a new todo.'
      operationId: createANewTodo
      description: 'This endpoint creates a new todo item with the specified title, priority, and description. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Todo created successfully.'
                  id: 36
                  data:
                    id: 36
                    title: test
                    description: test
                    priority: low
                    is_completed: 0
                    created_at: '07-08-2024 16:30:09'
                    updated_at: '07-08-2024 16:30:09'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Todo created successfully.'
                  id:
                    type: integer
                    example: 36
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 36
                      title:
                        type: string
                        example: test
                      description:
                        type: string
                        example: test
                      priority:
                        type: string
                        example: low
                      is_completed:
                        type: integer
                        example: 0
                      created_at:
                        type: string
                        example: '07-08-2024 16:30:09'
                      updated_at:
                        type: string
                        example: '07-08-2024 16:30:09'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    title:
                      - 'The title field is required.'
                    priority:
                      - 'The priority must be one of the following: low, medium, high.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      title:
                        type: array
                        example:
                          - 'The title field is required.'
                        items:
                          type: string
                      priority:
                        type: array
                        example:
                          - 'The priority must be one of the following: low, medium, high.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while creating the todo.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while creating the todo.'
      tags:
        - 'Todo Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: 'The title of the todo.'
                  example: 'Finish report'
                priority:
                  type: string
                  description: 'The priority of the todo. Must be one of "low", "medium", or "high".'
                  example: medium
                description:
                  type: string
                  description: 'optional A description of the todo.'
                  example: 'Complete the report by end of day'
              required:
                - title
                - priority
  '/api/todos/{id}':
    get:
      summary: 'List or search todos.'
      operationId: listOrSearchTodos
      description: 'This endpoint retrieves a list of todos based on various filters. The user must be authenticated to perform this action. The request allows filtering by search term, status, and pagination parameters.'
      parameters:
        -
          in: query
          name: search
          description: 'optional The search term to filter todos by id, title, or description.'
          example: Test
          required: false
          schema:
            type: string
            description: 'optional The search term to filter todos by id, title, or description.'
            example: Test
        -
          in: query
          name: sort
          description: 'optional The field to sort by. Defaults to "is_completed". All fields are sortable.'
          example: created_at
          required: false
          schema:
            type: string
            description: 'optional The field to sort by. Defaults to "is_completed". All fields are sortable.'
            example: created_at
        -
          in: query
          name: order
          description: 'optional The sort order, either "asc" or "desc". Defaults to "desc".'
          example: asc
          required: false
          schema:
            type: string
            description: 'optional The sort order, either "asc" or "desc". Defaults to "desc".'
            example: asc
        -
          in: query
          name: status
          description: 'optional The status to filter todos by.'
          example: completed
          required: false
          schema:
            type: string
            description: 'optional The status to filter todos by.'
            example: completed
        -
          in: query
          name: limit
          description: 'optional The number of todos per page for pagination. Defaults to 10.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional The number of todos per page for pagination. Defaults to 10.'
            example: 10
        -
          in: query
          name: offset
          description: 'optional The offset for pagination, indicating the starting point of results. Defaults to 0.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'optional The offset for pagination, indicating the starting point of results. Defaults to 0.'
            example: 0
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Todos retrieved successfully.'
                      total: 1
                      data:
                        -
                          id: 35
                          title: test
                          description: test
                          priority: low
                          is_completed: 0
                          created_at: '07-08-2024 15:28:22'
                          updated_at: '07-08-2024 15:28:22'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Todos retrieved successfully.'
                      total:
                        type: integer
                        example: 1
                      data:
                        type: array
                        example:
                          -
                            id: 35
                            title: test
                            description: test
                            priority: low
                            is_completed: 0
                            created_at: '07-08-2024 15:28:22'
                            updated_at: '07-08-2024 15:28:22'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 35
                            title:
                              type: string
                              example: test
                            description:
                              type: string
                              example: test
                            priority:
                              type: string
                              example: low
                            is_completed:
                              type: integer
                              example: 0
                            created_at:
                              type: string
                              example: '07-08-2024 15:28:22'
                            updated_at:
                              type: string
                              example: '07-08-2024 15:28:22'
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Todo not found.'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Todo not found.'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Todos not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Todos not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while retrieving the todos.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while retrieving the todos.'
      tags:
        - 'Todo Management'
    parameters:
      -
        in: path
        name: id
        description: 'Optional parameter. optional The ID of the todo to retrieve.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/todos/update:
    post:
      summary: 'Update an existing todo.'
      operationId: updateAnExistingTodo
      description: 'This endpoint updates an existing todo item with the specified title, priority, and description. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n\"error\": false,\n\"message\": \"Todo updated successfully.\",\n\"id\": \"36\",\n\"data\": {\n  \"id\": 36,\n  \"is_completed\": 0,\n  \"title\": \"test\",\n  \"priority\": \"low\",\n  \"description\": \"test\",\n  \"created_at\": \"07-08-2024 16:30:09\",\n  \"updated_at\": \"07-08-2024 16:30:09\"\n}\n}\n\n}"
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    id:
                      - 'The id field is required.'
                    title:
                      - 'The title field is required.'
                    priority:
                      - 'The priority must be one of the following: low, medium, high.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      id:
                        type: array
                        example:
                          - 'The id field is required.'
                        items:
                          type: string
                      title:
                        type: array
                        example:
                          - 'The title field is required.'
                        items:
                          type: string
                      priority:
                        type: array
                        example:
                          - 'The priority must be one of the following: low, medium, high.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while updating the todo.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while updating the todo.'
      tags:
        - 'Todo Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  description: 'The ID of the todo to be updated.'
                  example: 1
                title:
                  type: string
                  description: 'The new title of the todo.'
                  example: 'Finish report'
                priority:
                  type: string
                  description: 'The new priority of the todo. Must be one of "low", "medium", or "high".'
                  example: medium
                description:
                  type: string
                  description: 'optional A new description for the todo.'
                  example: 'Complete the report by end of day'
              required:
                - id
                - title
                - priority
  '/api/todos/{id}/status':
    patch:
      summary: 'Update the completion status of a todo.'
      operationId: updateTheCompletionStatusOfATodo
      description: 'This endpoint updates the completion status of a specified todo item. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Status updated successfully.'
                  id: '60'
                  activity_message: 'Madhavan Vaidya marked todo iouyhgyu as Completed'
                  data:
                    id: 60
                    title: iouyhgyu
                    description: ty8uifyu
                    priority: medium
                    is_completed: 1
                    created_at: '10-08-2024 10:28:59'
                    updated_at: '12-08-2024 18:08:14'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Status updated successfully.'
                  id:
                    type: string
                    example: '60'
                  activity_message:
                    type: string
                    example: 'Madhavan Vaidya marked todo iouyhgyu as Completed'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 60
                      title:
                        type: string
                        example: iouyhgyu
                      description:
                        type: string
                        example: ty8uifyu
                      priority:
                        type: string
                        example: medium
                      is_completed:
                        type: integer
                        example: 1
                      created_at:
                        type: string
                        example: '10-08-2024 10:28:59'
                      updated_at:
                        type: string
                        example: '12-08-2024 18:08:14'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    id:
                      - 'The id field is required.'
                    status:
                      - 'The status field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      id:
                        type: array
                        example:
                          - 'The id field is required.'
                        items:
                          type: string
                      status:
                        type: array
                        example:
                          - 'The status field is required.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "Status couldn't be updated."
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "Status couldn't be updated."
      tags:
        - 'Todo Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  type: boolean
                  description: 'The new completion status of the todo.'
                  example: true
              required:
                - status
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the todo whose status is to be updated.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/todos/{id}/priority':
    patch:
      summary: 'Update the priority of a todo.'
      operationId: updateThePriorityOfATodo
      description: "This endpoint updates the priority of a specified todo item. The user must be authenticated to perform this action. The priority must be one of 'low', 'medium', or 'high'."
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Priority updated successfully.'
                  id: '60'
                  activity_message: 'Madhavan Vaidya updated the priority of todo iouyhgyu from High to Low'
                  data:
                    id: 60
                    title: iouyhgyu
                    description: ty8uifyu
                    priority: low
                    is_completed: 1
                    created_at: '10-08-2024 10:28:59'
                    updated_at: '12-08-2024 18:11:13'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Priority updated successfully.'
                  id:
                    type: string
                    example: '60'
                  activity_message:
                    type: string
                    example: 'Madhavan Vaidya updated the priority of todo iouyhgyu from High to Low'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 60
                      title:
                        type: string
                        example: iouyhgyu
                      description:
                        type: string
                        example: ty8uifyu
                      priority:
                        type: string
                        example: low
                      is_completed:
                        type: integer
                        example: 1
                      created_at:
                        type: string
                        example: '10-08-2024 10:28:59'
                      updated_at:
                        type: string
                        example: '12-08-2024 18:11:13'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    id:
                      - 'The id field is required.'
                    priority:
                      - 'The priority field is required.'
                      - 'The selected priority is invalid.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      id:
                        type: array
                        example:
                          - 'The id field is required.'
                        items:
                          type: string
                      priority:
                        type: array
                        example:
                          - 'The priority field is required.'
                          - 'The selected priority is invalid.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "Priority couldn't be updated."
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "Priority couldn't be updated."
      tags:
        - 'Todo Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                priority:
                  type: string
                  description: "The new priority of the todo. Must be one of 'low', 'medium', or 'high'."
                  example: medium
              required:
                - priority
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the todo whose priority is to be updated.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/todos/destroy/{id}':
    delete:
      summary: 'Remove the specified todo.'
      operationId: removeTheSpecifiedTodo
      description: 'This endpoint deletes a todo item based on the provided ID. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": false,\n  \"message\": \"Todo deleted successfully.\",\n  \"id\": 1,\n  \"title\": \"Todo Title\"\n  \"data\": []\n}"
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while deleting the todo.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while deleting the todo.'
      tags:
        - 'Todo Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the todo to be deleted.'
        example: 1
        required: true
        schema:
          type: integer
  /api/notes/store:
    post:
      summary: 'Create a new note.'
      operationId: createANewNote
      description: 'This endpoint creates a new note item with the specified title, color, and description. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n\"error\": false,\n\"message\": \"Note created successfully.\",\n\"id\": 44,\n\"data\": {\n  \"id\": 44,\n  \"title\": \"Test Note\",\n  \"color\": \"info\",\n  \"note_type\" : \"text|drawing\",\n  \"drawing_data\":\"urlencoded(base64encoded(Svg)),\n  \"description\": \"test\",\n  \"workspace_id\": 6,\n  \"creator_id\": \"u_7\",\n  \"created_at\": \"07-08-2024 16:24:57\",\n  \"updated_at\": \"07-08-2024 16:24:57\"\n}\n}"
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    title:
                      - 'The title field is required.'
                    color:
                      - 'The color must be one of the following: info, warning, danger.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      title:
                        type: array
                        example:
                          - 'The title field is required.'
                        items:
                          type: string
                      color:
                        type: array
                        example:
                          - 'The color must be one of the following: info, warning, danger.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while creating the note.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while creating the note.'
      tags:
        - 'Note Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: 'The title of the note.'
                  example: 'Meeting notes'
                color:
                  type: string
                  description: 'The color associated with the note. Must be one of "info", "warning", or "danger".'
                  example: warning
                description:
                  type: string
                  description: 'optional A description of the note.'
                  example: 'Notes from the client meeting'
              required:
                - title
                - color
  '/api/notes/{id}':
    get:
      summary: 'List or search notes.'
      operationId: listOrSearchNotes
      description: 'This endpoint retrieves a list of notes based on various filters. The user must be authenticated to perform this action. The request allows filtering by search term and pagination parameters.'
      parameters:
        -
          in: query
          name: search
          description: 'optional The search term to filter notes by id, title, or description.'
          example: Test
          required: false
          schema:
            type: string
            description: 'optional The search term to filter notes by id, title, or description.'
            example: Test
        -
          in: query
          name: sort
          description: 'optional The field to sort by. Defaults to "is_completed". All fields are sortable.'
          example: created_at
          required: false
          schema:
            type: string
            description: 'optional The field to sort by. Defaults to "is_completed". All fields are sortable.'
            example: created_at
        -
          in: query
          name: order
          description: 'optional The sort order, either "asc" or "desc". Defaults to "desc".'
          example: asc
          required: false
          schema:
            type: string
            description: 'optional The sort order, either "asc" or "desc". Defaults to "desc".'
            example: asc
        -
          in: query
          name: limit
          description: 'optional The number of notes per page for pagination. Defaults to 10.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional The number of notes per page for pagination. Defaults to 10.'
            example: 10
        -
          in: query
          name: offset
          description: 'optional The offset for pagination, indicating the starting point of results. Defaults to 0.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'optional The offset for pagination, indicating the starting point of results. Defaults to 0.'
            example: 0
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Notes retrieved successfully.'
                      total: 1
                      data:
                        -
                          id: 43
                          title: upper
                          color: warning
                          description: jhdcsd
                          workspace_id: 6
                          creator_id: u_7
                          created_at: '07-08-2024 16:12:13'
                          updated_at: '07-08-2024 16:12:13'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Notes retrieved successfully.'
                      total:
                        type: integer
                        example: 1
                      data:
                        type: array
                        example:
                          -
                            id: 43
                            title: upper
                            color: warning
                            description: jhdcsd
                            workspace_id: 6
                            creator_id: u_7
                            created_at: '07-08-2024 16:12:13'
                            updated_at: '07-08-2024 16:12:13'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 43
                            title:
                              type: string
                              example: upper
                            color:
                              type: string
                              example: warning
                            description:
                              type: string
                              example: jhdcsd
                            workspace_id:
                              type: integer
                              example: 6
                            creator_id:
                              type: string
                              example: u_7
                            created_at:
                              type: string
                              example: '07-08-2024 16:12:13'
                            updated_at:
                              type: string
                              example: '07-08-2024 16:12:13'
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Note not found.'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Note not found.'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Notes not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Notes not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while retrieving the notes.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while retrieving the notes.'
      tags:
        - 'Note Management'
    parameters:
      -
        in: path
        name: id
        description: 'Optional parameter. optional The ID of the note to retrieve.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/notes/update:
    post:
      summary: 'Update an existing note.'
      operationId: updateAnExistingNote
      description: 'This endpoint updates an existing note item with the specified title, color, and description. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Note updated successfully.'
                  id: 44
                  data:
                    id: 44
                    title: 'Test Note'
                    color: info
                    description: test
                    workspace_id: 6
                    creator_id: u_7
                    created_at: '07-08-2024 16:24:57'
                    updated_at: '07-08-2024 16:24:57'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Note updated successfully.'
                  id:
                    type: integer
                    example: 44
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 44
                      title:
                        type: string
                        example: 'Test Note'
                      color:
                        type: string
                        example: info
                      description:
                        type: string
                        example: test
                      workspace_id:
                        type: integer
                        example: 6
                      creator_id:
                        type: string
                        example: u_7
                      created_at:
                        type: string
                        example: '07-08-2024 16:24:57'
                      updated_at:
                        type: string
                        example: '07-08-2024 16:24:57'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    id:
                      - 'The id field is required.'
                    title:
                      - 'The title field is required.'
                    color:
                      - 'The color must be one of the following: info, warning, danger.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      id:
                        type: array
                        example:
                          - 'The id field is required.'
                        items:
                          type: string
                      title:
                        type: array
                        example:
                          - 'The title field is required.'
                        items:
                          type: string
                      color:
                        type: array
                        example:
                          - 'The color must be one of the following: info, warning, danger.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while updating the note.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while updating the note.'
      tags:
        - 'Note Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  description: 'The ID of the note to be updated.'
                  example: 1
                title:
                  type: string
                  description: 'The new title of the note.'
                  example: 'Meeting notes'
                color:
                  type: string
                  description: 'The new color of the note. Must be one of "info", "warning", or "danger".'
                  example: warning
                description:
                  type: string
                  description: 'optional A new description for the note.'
                  example: 'Notes from the client meeting'
              required:
                - id
                - title
                - color
  '/api/notes/destroy/{id}':
    delete:
      summary: 'Remove the specified note.'
      operationId: removeTheSpecifiedNote
      description: 'This endpoint deletes a note item based on the provided ID. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Note deleted successfully.'
                      id: 1
                      title: 'Note Title'
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Note deleted successfully.'
                      id:
                        type: integer
                        example: 1
                      title:
                        type: string
                        example: 'Note Title'
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Note not found.'
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Note not found.'
                      data:
                        type: array
                        example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while deleting the note.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while deleting the note.'
      tags:
        - 'Note Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the note to be deleted.'
        example: 1
        required: true
        schema:
          type: integer
  /api/leave-requests/store:
    post:
      summary: 'Create a new leave request.'
      operationId: createANewLeaveRequest
      description: 'This endpoint creates a new leave request with the provided details. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Leave request created successfully.'
                  id: 187
                  type: leave_request
                  data:
                    id: 187
                    user_name: 'Madhavan Vaidya'
                    user_photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                    action_by: null
                    action_by_id: null
                    from_date: 'Wed, 07-08-2024'
                    to_date: 'Wed, 07-08-2024'
                    type: Full
                    duration: '1 day'
                    reason: Test
                    status: Pending
                    visible_to: null
                    created_at: '07-08-2024 18:31:28'
                    updated_at: '07-08-2024 18:31:28'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Leave request created successfully.'
                  id:
                    type: integer
                    example: 187
                  type:
                    type: string
                    example: leave_request
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 187
                      user_name:
                        type: string
                        example: 'Madhavan Vaidya'
                      user_photo:
                        type: string
                        example: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                      action_by:
                        type: string
                        example: null
                      action_by_id:
                        type: string
                        example: null
                      from_date:
                        type: string
                        example: 'Wed, 07-08-2024'
                      to_date:
                        type: string
                        example: 'Wed, 07-08-2024'
                      type:
                        type: string
                        example: Full
                      duration:
                        type: string
                        example: '1 day'
                      reason:
                        type: string
                        example: Test
                      status:
                        type: string
                        example: Pending
                      visible_to:
                        type: string
                        example: null
                      created_at:
                        type: string
                        example: '07-08-2024 18:31:28'
                      updated_at:
                        type: string
                        example: '07-08-2024 18:31:28'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    reason:
                      - 'The reason field is required.'
                    from_date:
                      - 'The from date field is required.'
                    to_date:
                      - 'The to date field is required.'
                    from_time:
                      - 'The from time field is required when partial leave is checked.'
                    to_time:
                      - 'The to time field is required when partial leave is checked.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      reason:
                        type: array
                        example:
                          - 'The reason field is required.'
                        items:
                          type: string
                      from_date:
                        type: array
                        example:
                          - 'The from date field is required.'
                        items:
                          type: string
                      to_date:
                        type: array
                        example:
                          - 'The to date field is required.'
                        items:
                          type: string
                      from_time:
                        type: array
                        example:
                          - 'The from time field is required when partial leave is checked.'
                        items:
                          type: string
                      to_time:
                        type: array
                        example:
                          - 'The to time field is required when partial leave is checked.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while creating the leave request.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while creating the leave request.'
      tags:
        - 'Leave Request Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                reason:
                  type: string
                  description: 'The reason for the leave.'
                  example: 'Family function'
                from_date:
                  type: date
                  description: 'The start date of the leave in the format specified in the general settings.'
                  example: '2024-08-05'
                to_date:
                  type: date
                  description: 'The end date of the leave in the format specified in the general settings.'
                  example: '2024-08-01'
                from_time:
                  type: time
                  description: 'required_if:partialLeave,on The start time of the leave in HH:MM format.'
                  example: '09:00'
                to_time:
                  type: time
                  description: 'required_if:partialLeave,on The end time of the leave in HH:MM format.'
                  example: '17:00'
                status:
                  type: string
                  description: "nullable The status of the leave request. Can be 'pending', 'approved', or 'rejected'."
                  example: pending
                leaveVisibleToAll:
                  type: string
                  description: "optional Set to 'on' if the leave should be visible to all users in the workspace."
                  example: 'on'
                visible_to_ids:
                  type: array
                  description: 'The IDs of users who can see the leave if it is not visible to all.'
                  example:
                    - 1
                    - 2
                    - 3
                  items:
                    type: string
                user_id:
                  type: integer
                  description: 'The ID of the user requesting the leave. Only admins or leave editors can specify this.'
                  example: 4
                partialLeave:
                  type: string
                  description: "optional Set to 'on' if the leave is partial (specific times within a day)."
                  example: 'on'
                comment:
                  type: string
                  description: 'optional An optional comment that can only be set by admin or leave editor.'
                  example: 'Approved due to exceptional circumstances'
              required:
                - reason
                - from_date
                - to_date
  '/api/leave-requests/{id}':
    get:
      summary: 'List or search leave requests.'
      operationId: listOrSearchLeaveRequests
      description: 'This endpoint retrieves a list of leave requests based on various filters. The user must be authenticated to perform this action. The request allows filtering by status, user, action_by, date ranges, type, and search term.'
      parameters:
        -
          in: query
          name: search
          description: 'optional The search term to filter leave requests by reason or id.'
          example: Vacation
          required: false
          schema:
            type: string
            description: 'optional The search term to filter leave requests by reason or id.'
            example: Vacation
        -
          in: query
          name: sort
          description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id, from_date, to_date, type, reason, status, action_by_id, created_at, and updated_at.'
          example: id
          required: false
          schema:
            type: string
            description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id, from_date, to_date, type, reason, status, action_by_id, created_at, and updated_at.'
            example: id
        -
          in: query
          name: order
          description: 'optional The sort order, either "ASC" or "DESC". Defaults to "DESC".'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional The sort order, either "ASC" or "DESC". Defaults to "DESC".'
            example: ASC
        -
          in: query
          name: status
          description: 'optional The status of the leave request to filter by. Can be "pending", "approved", "rejected", etc.'
          example: pending
          required: false
          schema:
            type: string
            description: 'optional The status of the leave request to filter by. Can be "pending", "approved", "rejected", etc.'
            example: pending
        -
          in: query
          name: user_id
          description: 'optional The user ID to filter leave requests by.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'optional The user ID to filter leave requests by.'
            example: 1
        -
          in: query
          name: action_by_id
          description: 'optional The ID of the user who acted on the request to filter by.'
          example: 2
          required: false
          schema:
            type: integer
            description: 'optional The ID of the user who acted on the request to filter by.'
            example: 2
        -
          in: query
          name: start_date_from
          description: "optional The start date range's start in YYYY-MM-DD format."
          example: '2024-01-01'
          required: false
          schema:
            type: string
            description: "optional The start date range's start in YYYY-MM-DD format."
            example: '2024-01-01'
        -
          in: query
          name: start_date_to
          description: "optional The start date range's end in YYYY-MM-DD format."
          example: '2024-12-31'
          required: false
          schema:
            type: string
            description: "optional The start date range's end in YYYY-MM-DD format."
            example: '2024-12-31'
        -
          in: query
          name: end_date_from
          description: "optional The end date range's start in YYYY-MM-DD format."
          example: '2024-01-01'
          required: false
          schema:
            type: string
            description: "optional The end date range's start in YYYY-MM-DD format."
            example: '2024-01-01'
        -
          in: query
          name: end_date_to
          description: "optional The end date range's end in YYYY-MM-DD format."
          example: '2024-12-31'
          required: false
          schema:
            type: string
            description: "optional The end date range's end in YYYY-MM-DD format."
            example: '2024-12-31'
        -
          in: query
          name: type
          description: 'optional The type of leave request. Can be "full" or "partial".'
          example: full
          required: false
          schema:
            type: string
            description: 'optional The type of leave request. Can be "full" or "partial".'
            example: full
        -
          in: query
          name: limit
          description: 'optional The number of leave requests per page for pagination.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional The number of leave requests per page for pagination.'
            example: 10
        -
          in: query
          name: offset
          description: 'optional The offset for pagination, indicating the starting point of results.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'optional The offset for pagination, indicating the starting point of results.'
            example: 0
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Leave requests retrieved successfully'
                      total: 25
                      data:
                        -
                          id: 175
                          user_name: 'Admin Test'
                          user_photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                          action_by: null
                          from_date: 'Mon, 29-07-2024'
                          to_date: 'Mon, 29-07-2024'
                          type: Full
                          duration: '1 day'
                          reason: dsdsdsd
                          status: Pending
                          visible_to:
                            -
                              id: 183
                              first_name: Girish
                              last_name: Thacker
                              photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                          created_at: '29-07-2024 10:02:45'
                          updated_at: '29-07-2024 10:02:45'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Leave requests retrieved successfully'
                      total:
                        type: integer
                        example: 25
                      data:
                        type: array
                        example:
                          -
                            id: 175
                            user_name: 'Admin Test'
                            user_photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                            action_by: null
                            from_date: 'Mon, 29-07-2024'
                            to_date: 'Mon, 29-07-2024'
                            type: Full
                            duration: '1 day'
                            reason: dsdsdsd
                            status: Pending
                            visible_to:
                              -
                                id: 183
                                first_name: Girish
                                last_name: Thacker
                                photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                            created_at: '29-07-2024 10:02:45'
                            updated_at: '29-07-2024 10:02:45'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 175
                            user_name:
                              type: string
                              example: 'Admin Test'
                            user_photo:
                              type: string
                              example: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                            action_by:
                              type: string
                              example: null
                            from_date:
                              type: string
                              example: 'Mon, 29-07-2024'
                            to_date:
                              type: string
                              example: 'Mon, 29-07-2024'
                            type:
                              type: string
                              example: Full
                            duration:
                              type: string
                              example: '1 day'
                            reason:
                              type: string
                              example: dsdsdsd
                            status:
                              type: string
                              example: Pending
                            visible_to:
                              type: array
                              example:
                                -
                                  id: 183
                                  first_name: Girish
                                  last_name: Thacker
                                  photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                              items:
                                type: object
                                properties:
                                  id:
                                    type: integer
                                    example: 183
                                  first_name:
                                    type: string
                                    example: Girish
                                  last_name:
                                    type: string
                                    example: Thacker
                                  photo:
                                    type: string
                                    example: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                            created_at:
                              type: string
                              example: '29-07-2024 10:02:45'
                            updated_at:
                              type: string
                              example: '29-07-2024 10:02:45'
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Leave request not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Leave request not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Leave requests not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Leave requests not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
      tags:
        - 'Leave Request Management'
    parameters:
      -
        in: path
        name: id
        description: 'Optional parameter. optional The ID of the leave request to retrieve.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/leave-requests/update:
    post:
      summary: 'Update an existing leave request.'
      operationId: updateAnExistingLeaveRequest
      description: 'This endpoint updates an existing leave request with the provided details. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Leave request updated successfully.'
                  id: 187
                  type: leave_request
                  data:
                    id: 187
                    user_name: 'Madhavan Vaidya'
                    user_photo: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                    action_by: null
                    action_by_id: null
                    from_date: 'Wed, 07-08-2024'
                    to_date: 'Wed, 07-08-2024'
                    type: Full
                    duration: '1 day'
                    reason: Test
                    status: Pending
                    visible_to: null
                    created_at: '07-08-2024 18:31:28'
                    updated_at: '07-08-2024 18:31:28'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Leave request updated successfully.'
                  id:
                    type: integer
                    example: 187
                  type:
                    type: string
                    example: leave_request
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 187
                      user_name:
                        type: string
                        example: 'Madhavan Vaidya'
                      user_photo:
                        type: string
                        example: 'https://test-taskify.infinitietech.com/storage/photos/yxNYBlFLALdLomrL0JzUY2USPLILL9Ocr16j4n2o.png'
                      action_by:
                        type: string
                        example: null
                      action_by_id:
                        type: string
                        example: null
                      from_date:
                        type: string
                        example: 'Wed, 07-08-2024'
                      to_date:
                        type: string
                        example: 'Wed, 07-08-2024'
                      type:
                        type: string
                        example: Full
                      duration:
                        type: string
                        example: '1 day'
                      reason:
                        type: string
                        example: Test
                      status:
                        type: string
                        example: Pending
                      visible_to:
                        type: string
                        example: null
                      created_at:
                        type: string
                        example: '07-08-2024 18:31:28'
                      updated_at:
                        type: string
                        example: '07-08-2024 18:31:28'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    id:
                      - 'The id field is required.'
                      - 'The selected id is invalid.'
                    reason:
                      - 'The reason field is required.'
                    from_date:
                      - 'The from date field is required.'
                    to_date:
                      - 'The to date field is required.'
                    from_time:
                      - 'The from time field is required when partial leave is checked.'
                    to_time:
                      - 'The to time field is required when partial leave is checked.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      id:
                        type: array
                        example:
                          - 'The id field is required.'
                          - 'The selected id is invalid.'
                        items:
                          type: string
                      reason:
                        type: array
                        example:
                          - 'The reason field is required.'
                        items:
                          type: string
                      from_date:
                        type: array
                        example:
                          - 'The from date field is required.'
                        items:
                          type: string
                      to_date:
                        type: array
                        example:
                          - 'The to date field is required.'
                        items:
                          type: string
                      from_time:
                        type: array
                        example:
                          - 'The from time field is required when partial leave is checked.'
                        items:
                          type: string
                      to_time:
                        type: array
                        example:
                          - 'The to time field is required when partial leave is checked.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while updating the leave request.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while updating the leave request.'
      tags:
        - 'Leave Request Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  description: 'The ID of the leave request to be updated.'
                  example: 1
                reason:
                  type: string
                  description: 'The reason for the leave.'
                  example: 'Family function'
                from_date:
                  type: date
                  description: 'The start date of the leave in the format specified in the general settings.'
                  example: '2024-08-05'
                to_date:
                  type: date
                  description: 'The end date of the leave in the format specified in the general settings.'
                  example: '2024-08-01'
                from_time:
                  type: time
                  description: 'required_if:partialLeave,on The start time of the leave in HH:MM format.'
                  example: '09:00'
                to_time:
                  type: time
                  description: 'required_if:partialLeave,on The end time of the leave in HH:MM format.'
                  example: '17:00'
                status:
                  type: string
                  description: "nullable The status of the leave request. Can be 'pending', 'approved', or 'rejected'."
                  example: pending
                leaveVisibleToAll:
                  type: string
                  description: "optional Set to 'on' if the leave should be visible to all users in the workspace."
                  example: 'on'
                visible_to_ids:
                  type: array
                  description: 'nullable The IDs of users who can see the leave if it is not visible to all.'
                  example:
                    - 1
                    - 2
                    - 3
                  items:
                    type: string
                partialLeave:
                  type: string
                  description: "optional Set to 'on' if the leave is partial (specific times within a day)."
                  example: 'on'
                comment:
                  type: string
                  description: 'optional An optional comment that can only be set by admin or leave editor.'
                  example: 'Approved due to exceptional circumstances'
              required:
                - id
                - reason
                - from_date
                - to_date
  '/api/leave-requests/destroy/{id}':
    delete:
      summary: 'Remove the specified leave request.'
      operationId: removeTheSpecifiedLeaveRequest
      description: 'This endpoint deletes a leave request item based on the provided ID. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Leave request deleted successfully.'
                      id: 1
                      type: leave_request
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Leave request deleted successfully.'
                      id:
                        type: integer
                        example: 1
                      type:
                        type: string
                        example: leave_request
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Leave request not found.'
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Leave request not found.'
                      data:
                        type: array
                        example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while deleting the leave request.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while deleting the leave request.'
      tags:
        - 'Leave Request Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the leave request to be deleted.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/notifications/{id}':
    get:
      summary: 'List or search notifications.'
      operationId: listOrSearchNotifications
      description: 'This endpoint retrieves a list of notifications based on various filters. The user must be authenticated to perform this action. The request allows filtering by status, type, user, client, and other parameters.'
      parameters:
        -
          in: query
          name: search
          description: 'optional The search term to filter notifications by title, message and id.'
          example: Alert
          required: false
          schema:
            type: string
            description: 'optional The search term to filter notifications by title, message and id.'
            example: Alert
        -
          in: query
          name: sort
          description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id, title, message, type, status, created_at, and updated_at.'
          example: title
          required: false
          schema:
            type: string
            description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id, title, message, type, status, created_at, and updated_at.'
            example: title
        -
          in: query
          name: order
          description: 'optional The sort order, either "ASC" or "DESC". Defaults to "DESC".'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional The sort order, either "ASC" or "DESC". Defaults to "DESC".'
            example: ASC
        -
          in: query
          name: status
          description: 'optional The status of the notification to filter by. Can be "read" or "unread".'
          example: unread
          required: false
          schema:
            type: string
            description: 'optional The status of the notification to filter by. Can be "read" or "unread".'
            example: unread
        -
          in: query
          name: type
          description: 'optional The type of notifications to filter by.'
          example: project
          required: false
          schema:
            type: string
            description: 'optional The type of notifications to filter by.'
            example: project
        -
          in: query
          name: user_id
          description: 'optional The user ID to filter notifications by.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'optional The user ID to filter notifications by.'
            example: 1
        -
          in: query
          name: client_id
          description: 'optional The client ID to filter notifications by.'
          example: 5
          required: false
          schema:
            type: integer
            description: 'optional The client ID to filter notifications by.'
            example: 5
        -
          in: query
          name: notification_type
          description: 'optional The notification type to filter by. Can be "system" or "push".'
          example: system
          required: false
          schema:
            type: string
            description: 'optional The notification type to filter by. Can be "system" or "push".'
            example: system
        -
          in: query
          name: limit
          description: 'optional The number of notifications per page for pagination.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional The number of notifications per page for pagination.'
            example: 10
        -
          in: query
          name: offset
          description: 'optional The offset for pagination, indicating the starting point of results.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'optional The offset for pagination, indicating the starting point of results.'
            example: 0
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Notifications retrieved successfully'
                      total: 1
                      data:
                        -
                          id: 116
                          title: 'Task Status Updated'
                          users:
                            -
                              id: 183
                              first_name: Girish
                              last_name: Thacker
                              photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                          clients:
                            -
                              id: 102
                              first_name: Test
                              last_name: Client
                              photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                          type: Task
                          type_id: 268
                          message: 'Madhavan Vaidya has updated the status of task sdff, ID:#268, from Default to Test From Pro.'
                          status: Unread
                          read_at: null
                          created_at: '23-07-2024 17:50:09'
                          updated_at: '23-07-2024 19:08:16'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Notifications retrieved successfully'
                      total:
                        type: integer
                        example: 1
                      data:
                        type: array
                        example:
                          -
                            id: 116
                            title: 'Task Status Updated'
                            users:
                              -
                                id: 183
                                first_name: Girish
                                last_name: Thacker
                                photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                            clients:
                              -
                                id: 102
                                first_name: Test
                                last_name: Client
                                photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                            type: Task
                            type_id: 268
                            message: 'Madhavan Vaidya has updated the status of task sdff, ID:#268, from Default to Test From Pro.'
                            status: Unread
                            read_at: null
                            created_at: '23-07-2024 17:50:09'
                            updated_at: '23-07-2024 19:08:16'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 116
                            title:
                              type: string
                              example: 'Task Status Updated'
                            users:
                              type: array
                              example:
                                -
                                  id: 183
                                  first_name: Girish
                                  last_name: Thacker
                                  photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                              items:
                                type: object
                                properties:
                                  id:
                                    type: integer
                                    example: 183
                                  first_name:
                                    type: string
                                    example: Girish
                                  last_name:
                                    type: string
                                    example: Thacker
                                  photo:
                                    type: string
                                    example: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                            clients:
                              type: array
                              example:
                                -
                                  id: 102
                                  first_name: Test
                                  last_name: Client
                                  photo: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                              items:
                                type: object
                                properties:
                                  id:
                                    type: integer
                                    example: 102
                                  first_name:
                                    type: string
                                    example: Test
                                  last_name:
                                    type: string
                                    example: Client
                                  photo:
                                    type: string
                                    example: 'https://test-taskify.infinitietech.com/storage/photos/no-image.jpg'
                            type:
                              type: string
                              example: Task
                            type_id:
                              type: integer
                              example: 268
                            message:
                              type: string
                              example: 'Madhavan Vaidya has updated the status of task sdff, ID:#268, from Default to Test From Pro.'
                            status:
                              type: string
                              example: Unread
                            read_at:
                              type: string
                              example: null
                            created_at:
                              type: string
                              example: '23-07-2024 17:50:09'
                            updated_at:
                              type: string
                              example: '23-07-2024 19:08:16'
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Notification not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Notification not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Notifications not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Notifications not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
      tags:
        - 'Notification Management'
    parameters:
      -
        in: path
        name: id
        description: 'Optional parameter. optional The ID of the meeting to retrieve.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  '/api/notifications/destroy/{id}':
    delete:
      summary: 'Remove the specified notification.'
      operationId: removeTheSpecifiedNotification
      description: 'This endpoint deletes a notification based on the provided ID. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Notification deleted successfully.'
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Notification deleted successfully.'
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Notification not found.'
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Notification not found.'
                      data:
                        type: array
                        example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while deleting the notification.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while deleting the notification.'
      tags:
        - 'Notification Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the notification to be deleted.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/notifications/mark-as-read/{id}':
    patch:
      summary: 'Mark notification(s) as read.'
      operationId: markNotificationsAsRead
      description: "This endpoint marks a specific notification as read if a notification ID is provided.\nIf no ID is provided, it will mark all unread notifications as read for the authenticated user.\nThe user must be authenticated to perform this action."
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Notification marked as read successfully.'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Notification marked as read successfully.'
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'All notifications marked as read successfully.'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'All notifications marked as read successfully.'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Notification not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Notification not found.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Failed to mark notifications as read.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Failed to mark notifications as read.'
      tags:
        - 'Notification Management'
    parameters:
      -
        in: path
        name: id
        description: 'Optional parameter. optional The ID of the notification to mark as read.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  '/api/activity-log/{id}':
    get:
      summary: 'List or search activity logs.'
      operationId: listOrSearchActivityLogs
      description: 'This endpoint retrieves a list of activity logs based on various filters. The user must be authenticated to perform this action. The request allows filtering by date ranges, user, client, activity type, and other parameters.'
      parameters:
        -
          in: query
          name: search
          description: 'optional The search term to filter activity logs.'
          example: update
          required: false
          schema:
            type: string
            description: 'optional The search term to filter activity logs.'
            example: update
        -
          in: query
          name: sort
          description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id, created_at, and updated_at.'
          example: created_at
          required: false
          schema:
            type: string
            description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id, created_at, and updated_at.'
            example: created_at
        -
          in: query
          name: order
          description: 'optional The sort order, either "ASC" or "DESC". Defaults to "DESC".'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional The sort order, either "ASC" or "DESC". Defaults to "DESC".'
            example: ASC
        -
          in: query
          name: date_from
          description: "optional The start date range's start in YYYY-MM-DD format."
          example: '2024-01-01'
          required: false
          schema:
            type: string
            description: "optional The start date range's start in YYYY-MM-DD format."
            example: '2024-01-01'
        -
          in: query
          name: date_to
          description: "optional The end date range's end in YYYY-MM-DD format."
          example: '2024-12-31'
          required: false
          schema:
            type: string
            description: "optional The end date range's end in YYYY-MM-DD format."
            example: '2024-12-31'
        -
          in: query
          name: user_id
          description: 'optional The user ID to filter activity logs by.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'optional The user ID to filter activity logs by.'
            example: 1
        -
          in: query
          name: client_id
          description: 'optional The client ID to filter activity logs by.'
          example: 5
          required: false
          schema:
            type: integer
            description: 'optional The client ID to filter activity logs by.'
            example: 5
        -
          in: query
          name: activity
          description: 'optional The activity type to filter by.'
          example: update
          required: false
          schema:
            type: string
            description: 'optional The activity type to filter by.'
            example: update
        -
          in: query
          name: type
          description: 'optional The type of activity to filter by.'
          example: task
          required: false
          schema:
            type: string
            description: 'optional The type of activity to filter by.'
            example: task
        -
          in: query
          name: type_id
          description: 'optional The type ID to filter activity logs by.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional The type ID to filter activity logs by.'
            example: 10
        -
          in: query
          name: limit
          description: 'optional The number of logs per page for pagination.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional The number of logs per page for pagination.'
            example: 10
        -
          in: query
          name: offset
          description: 'optional The offset for pagination.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'optional The offset for pagination.'
            example: 0
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Activity logs retrieved successfully'
                      total: 1
                      data:
                        -
                          id: 974
                          actor_id: 183
                          actor_name: 'Girish Thacker'
                          actor_type: User
                          type_id: 31
                          parent_type_id: ''
                          type: Payslip
                          parent_type: ''
                          type_title: CTR-31
                          parent_type_title: ''
                          activity: Created
                          message: 'Girish Thacker created payslip PSL-31'
                          created_at: '06-08-2024 18:10:41'
                          updated_at: '06-08-2024 18:10:41'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Activity logs retrieved successfully'
                      total:
                        type: integer
                        example: 1
                      data:
                        type: array
                        example:
                          -
                            id: 974
                            actor_id: 183
                            actor_name: 'Girish Thacker'
                            actor_type: User
                            type_id: 31
                            parent_type_id: ''
                            type: Payslip
                            parent_type: ''
                            type_title: CTR-31
                            parent_type_title: ''
                            activity: Created
                            message: 'Girish Thacker created payslip PSL-31'
                            created_at: '06-08-2024 18:10:41'
                            updated_at: '06-08-2024 18:10:41'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 974
                            actor_id:
                              type: integer
                              example: 183
                            actor_name:
                              type: string
                              example: 'Girish Thacker'
                            actor_type:
                              type: string
                              example: User
                            type_id:
                              type: integer
                              example: 31
                            parent_type_id:
                              type: string
                              example: ''
                            type:
                              type: string
                              example: Payslip
                            parent_type:
                              type: string
                              example: ''
                            type_title:
                              type: string
                              example: CTR-31
                            parent_type_title:
                              type: string
                              example: ''
                            activity:
                              type: string
                              example: Created
                            message:
                              type: string
                              example: 'Girish Thacker created payslip PSL-31'
                            created_at:
                              type: string
                              example: '06-08-2024 18:10:41'
                            updated_at:
                              type: string
                              example: '06-08-2024 18:10:41'
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Activity logs not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Activity logs not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
      tags:
        - 'Activity Log Management'
    parameters:
      -
        in: path
        name: id
        description: 'Optional parameter. optional The ID of the activity log to retrieve.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  '/api/activity-log/destroy/{id}':
    delete:
      summary: 'Remove the specified activity log.'
      operationId: removeTheSpecifiedActivityLog
      description: 'This endpoint deletes a activity log based on the provided ID. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Record deleted successfully.'
                      title: null
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Record deleted successfully.'
                      title:
                        type: string
                        example: null
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Record not found.'
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Record not found.'
                      data:
                        type: array
                        example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while deleting the activity log.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while deleting the activity log.'
      tags:
        - 'Activity Log Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the activity log to be deleted.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/roles/{id}':
    get:
      summary: 'List or search roles.'
      operationId: listOrSearchRoles
      description: 'This endpoint retrieves a list of roles based on various filters. The request allows filtering by search term and pagination parameters.'
      parameters:
        -
          in: query
          name: search
          description: 'optional The search term to filter roles by id, name or guard_name.'
          example: Admin
          required: false
          schema:
            type: string
            description: 'optional The search term to filter roles by id, name or guard_name.'
            example: Admin
        -
          in: query
          name: sort
          description: 'optional The field to sort by. all fields are sortable. Defaults to "created_at".'
          example: name
          required: false
          schema:
            type: string
            description: 'optional The field to sort by. all fields are sortable. Defaults to "created_at".'
            example: name
        -
          in: query
          name: order
          description: 'optional The sort order, either "asc" or "desc". Defaults to "desc".'
          example: asc
          required: false
          schema:
            type: string
            description: 'optional The sort order, either "asc" or "desc". Defaults to "desc".'
            example: asc
        -
          in: query
          name: limit
          description: 'optional The number of roles per page for pagination. Defaults to 10.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional The number of roles per page for pagination. Defaults to 10.'
            example: 10
        -
          in: query
          name: offset
          description: 'optional The offset for pagination, indicating the starting point of results. Defaults to 0.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'optional The offset for pagination, indicating the starting point of results. Defaults to 0.'
            example: 0
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Roles retrieved successfully.'
                      total: 1
                      data:
                        -
                          id: 1
                          name: Admin
                          guard_name: web
                          created_at: '10-10-2023 17:50:09'
                          updated_at: '23-07-2024 19:08:16'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Roles retrieved successfully.'
                      total:
                        type: integer
                        example: 1
                      data:
                        type: array
                        example:
                          -
                            id: 1
                            name: Admin
                            guard_name: web
                            created_at: '10-10-2023 17:50:09'
                            updated_at: '23-07-2024 19:08:16'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1
                            name:
                              type: string
                              example: Admin
                            guard_name:
                              type: string
                              example: web
                            created_at:
                              type: string
                              example: '10-10-2023 17:50:09'
                            updated_at:
                              type: string
                              example: '23-07-2024 19:08:16'
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Role not found.'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Role not found.'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Roles not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Roles not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while retrieving the roles.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while retrieving the roles.'
      tags:
        - 'Role/Permission Management'
      security: []
    parameters:
      -
        in: path
        name: id
        description: 'Optional parameter. optional The ID of the role to retrieve.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  '/api/permissions/{permission}':
    get:
      summary: 'Check user permissions.'
      operationId: checkUserPermissions
      description: "This endpoint checks the module-wise permissions assigned to the authenticated user.\nIf a specific permission is provided in the URL, it checks only that permission for the authenticated user.\nOtherwise, it returns all permissions for the authenticated user."
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n    \"error\": false,\n    \"message\": \"Permissions check completed.\",\n    \"data\": {\n        \"permissions\": {\n            \"create_projects\": true,\n            \"manage_projects\": false,\n            ...\n        }\n    }\n}"
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while checking the permission.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while checking the permission.'
      tags:
        - 'Role/Permission Management'
    parameters:
      -
        in: path
        name: permission
        description: 'Optional parameter. optional The specific permission to check.'
        required: true
        schema:
          type: string
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: "\"edit-post\"\n\nHere is the module-wise permissions list.\n\nActivity Log:\n- manage_activity_log\n- delete_activity_log\n\nAllowances:\n- create_allowances\n- manage_allowances\n- edit_allowances\n- delete_allowances\n\nClients:\n- create_clients\n- manage_clients\n- edit_clients\n- delete_clients\n\nContract Types:\n- create_contract_types\n- manage_contract_types\n- edit_contract_types\n- delete_contract_types\n\nContracts:\n- create_contracts\n- manage_contracts\n- edit_contracts\n- delete_contracts\n\nDeductions:\n- create_deductions\n- manage_deductions\n- edit_deductions\n- delete_deductions\n\nEstimates/Invoices:\n- create_estimates_invoices\n- manage_estimates_invoices\n- edit_estimates_invoices\n- delete_estimates_invoices\n\nExpense Types:\n- create_expense_types\n- manage_expense_types\n- edit_expense_types\n- delete_expense_types\n\nExpenses:\n- create_expenses\n- manage_expenses\n- edit_expenses\n- delete_expenses\n\nItems:\n- create_items\n- manage_items\n- edit_items\n- delete_items\n\nMedia:\n- create_media\n- manage_media\n- delete_media\n\nMeetings:\n- create_meetings\n- manage_meetings\n- edit_meetings\n- delete_meetings\n\nMilestones:\n- create_milestones\n- manage_milestones\n- edit_milestones\n- delete_milestones\n\nPayment Methods:\n- create_payment_methods\n- manage_payment_methods\n- edit_payment_methods\n- delete_payment_methods\n\nPayments:\n- create_payments\n- manage_payments\n- edit_payments\n- delete_payments\n\nPayslips:\n- create_payslips\n- manage_payslips\n- edit_payslips\n- delete_payslips\n\nPriorities:\n- create_priorities\n- manage_priorities\n- edit_priorities\n- delete_priorities\n\nProjects:\n- create_projects\n- manage_projects\n- edit_projects\n- delete_projects\n\nStatuses:\n- create_statuses\n- manage_statuses\n- edit_statuses\n- delete_statuses\n\nSystem Notifications:\n- manage_system_notifications\n- delete_system_notifications\n\nTags:\n- create_tags\n- manage_tags\n- edit_tags\n- delete_tags\n\nTasks:\n- create_tasks\n- manage_tasks\n- edit_tasks\n- delete_tasks\n\nTaxes:\n- create_taxes\n- manage_taxes\n- edit_taxes\n- delete_taxes\n\nTimesheet:\n- create_timesheet\n- manage_timesheet\n- delete_timesheet\n\nUnits:\n- create_units\n- manage_units\n- edit_units\n- delete_units\n\nUsers:\n- create_users\n- manage_users\n- edit_users\n- delete_users\n\nWorkspaces:\n- create_workspaces\n- manage_workspaces\n- edit_workspaces\n- delete_workspaces"
  /api/roles/store:
    post:
      summary: 'Create a new role.'
      operationId: createANewRole
      description: 'This endpoint allows authenticated users to create a new role and assign permissions.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Role created successfully.'
                  role:
                    id: 5
                    name: Supervisor
                    permissions:
                      - edit_tasks
                      - assign_tasks
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Role created successfully.'
                  role:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 5
                      name:
                        type: string
                        example: Supervisor
                      permissions:
                        type: array
                        example:
                          - edit_tasks
                          - assign_tasks
                        items:
                          type: string
        409:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'A role `Manager` already exists.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'A role `Manager` already exists.'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation failed.'
                  errors:
                    name:
                      - 'The name field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation failed.'
                  errors:
                    type: object
                    properties:
                      name:
                        type: array
                        example:
                          - 'The name field is required.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while creating the role.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while creating the role.'
      tags:
        - 'Role/Permission Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The updated name of the role.'
                  example: '"Supervisor"'
                permissions:
                  type: array
                  description: 'optional A list of permission IDs to assign to the role.'
                  example:
                    - 1
                    - 2
                    - 3
                  items:
                    type: string
              required:
                - name
  '/api/roles/update/{id}':
    post:
      summary: 'Update an existing role.'
      operationId: updateAnExistingRole
      description: 'This endpoint allows authenticated users to update a role name and modify its permissions.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Role updated successfully.'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Role updated successfully.'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Role not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Role not found.'
        409:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'A role `Manager` already exists.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'A role `Manager` already exists.'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation failed.'
                  errors:
                    name:
                      - 'The name field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation failed.'
                  errors:
                    type: object
                    properties:
                      name:
                        type: array
                        example:
                          - 'The name field is required.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while updating the role.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while updating the role.'
      tags:
        - 'Role/Permission Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The updated name of the role.'
                  example: '"Supervisor"'
                permissions:
                  type: array
                  description: 'optional A list of permission IDs to assign to the role.'
                  example:
                    - 1
                    - 2
                    - 3
                  items:
                    type: string
              required:
                - name
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the role to update.'
        example: 5
        required: true
        schema:
          type: integer
  '/api/roles/destroy/{id}':
    delete:
      summary: 'Delete a role.'
      operationId: deleteARole
      description: 'This endpoint allows authenticated users to delete a specific role.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Role deleted successfully.'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Role deleted successfully.'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Role not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Role not found.'
        409:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Cannot delete this role because it is assigned to users.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Cannot delete this role because it is assigned to users.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while deleting the role.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while deleting the role.'
      tags:
        - 'Role/Permission Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the role to delete.'
        example: 10
        required: true
        schema:
          type: integer
  '/api/roles/get/{id}':
    get:
      summary: 'Get a specific role with its permissions, grouped by category.'
      operationId: getASpecificRoleWithItsPermissionsGroupedByCategory
      description: ''
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  role:
                    id: 1
                    name: Admin
                    permissions:
                      projects:
                        create_projects: true
                        delete_projects: false
                      tasks:
                        create_tasks: true
                properties:
                  error:
                    type: boolean
                    example: false
                  role:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: Admin
                      permissions:
                        type: object
                        properties:
                          projects:
                            type: object
                            properties:
                              create_projects:
                                type: boolean
                                example: true
                              delete_projects:
                                type: boolean
                                example: false
                          tasks:
                            type: object
                            properties:
                              create_tasks:
                                type: boolean
                                example: true
      tags:
        - 'Role/Permission Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the role to retrieve.'
        example: 14
        required: true
        schema:
          type: integer
  /api/permissions-list:
    get:
      summary: 'List all permissions.'
      operationId: listAllPermissions
      description: 'This endpoint retrieves a list of all permissions.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": false,\n  \"message\": \"Permissions retrieved successfully.\",\n  \"total\": 5,\n  \"data\": [\n    {\n      \"id\": 1,\n      \"name\": \"create_projects\",\n      \"guard_name\": \"web\",\n      \"created_at\": \"2023-10-10T17:50:09.000000Z\",\n      \"updated_at\": \"2024-07-23T19:08:16.000000Z\"\n    },\n    ...\n  ]\n}"
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while retrieving the permissions.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while retrieving the permissions.'
      tags:
        - 'Role/Permission Management'
      security: []
  '/api/settings/{variable}':
    get:
      summary: 'Retrieve the settings for a specific variable.'
      operationId: retrieveTheSettingsForASpecificVariable
      description: 'This endpoint returns the settings for a given variable. The user must be authenticated.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Settings retrieved successfully'
                      settings:
                        company_title: FortyHives Projects
                        currency_full_form: 'Indian Rupee'
                        currency_symbol: ₹
                        currency_code: INR
                        currency_symbol_position: before
                        currency_formate: comma_separated
                        decimal_points_in_currency: '2'
                        allowed_max_upload_size: '2000'
                        allowSignup: 1
                        timezone: Asia/Kolkata
                        date_format: DD-MM-YYYY|d-m-Y
                        time_format: 'H:i:s'
                        toast_position: toast-bottom-center
                        toast_time_out: '2'
                        footer_text: '<p>made with ❤️ by <a href="https://www.infinitietech.com/" target="_blank" rel="noopener">Infinitie Technologies</a></p>'
                        full_logo: 'https://test-taskify.infinitietech.com/storage/logos/zEy4tSCAFSMczWbOoxBZ3B43Nc9eeqMlNBXDrOzn.png'
                        half_logo: null
                        favicon: 'https://test-taskify.infinitietech.com/storage/logos/2FZTNY1qDTz7CTtwWC8Hh1eY4l7cIHgOXG2stVIU.png'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Settings retrieved successfully'
                      settings:
                        type: object
                        properties:
                          company_title:
                            type: string
                            example: FortyHives Projects
                          currency_full_form:
                            type: string
                            example: 'Indian Rupee'
                          currency_symbol:
                            type: string
                            example: ₹
                          currency_code:
                            type: string
                            example: INR
                          currency_symbol_position:
                            type: string
                            example: before
                          currency_formate:
                            type: string
                            example: comma_separated
                          decimal_points_in_currency:
                            type: string
                            example: '2'
                          allowed_max_upload_size:
                            type: string
                            example: '2000'
                          allowSignup:
                            type: integer
                            example: 1
                          timezone:
                            type: string
                            example: Asia/Kolkata
                          date_format:
                            type: string
                            example: DD-MM-YYYY|d-m-Y
                          time_format:
                            type: string
                            example: 'H:i:s'
                          toast_position:
                            type: string
                            example: toast-bottom-center
                          toast_time_out:
                            type: string
                            example: '2'
                          footer_text:
                            type: string
                            example: '<p>made with ❤️ by <a href="https://www.infinitietech.com/" target="_blank" rel="noopener">Infinitie Technologies</a></p>'
                          full_logo:
                            type: string
                            example: 'https://test-taskify.infinitietech.com/storage/logos/zEy4tSCAFSMczWbOoxBZ3B43Nc9eeqMlNBXDrOzn.png'
                          half_logo:
                            type: string
                            example: null
                          favicon:
                            type: string
                            example: 'https://test-taskify.infinitietech.com/storage/logos/2FZTNY1qDTz7CTtwWC8Hh1eY4l7cIHgOXG2stVIU.png'
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Un Authorized Action!'
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Un Authorized Action!'
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Setting not found'
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Setting not found'
      tags:
        - 'Setting Management'
    parameters:
      -
        in: path
        name: variable
        description: 'The variable type for which settings are to be retrieved. Must be one of the following: general_settings, pusher_settings, email_settings, media_storage_settings, sms_gateway_settings, whatsapp_settings, privacy_policy, about_us, terms_conditions.'
        example: general_settings
        required: true
        schema:
          type: string
  /api/settings/update:
    post:
      summary: 'Store the settings for a specific variable.'
      operationId: storeTheSettingsForASpecificVariable
      description: 'This endpoint stores the settings for a given variable. The user must be authenticated.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Settings saved successfully.'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Settings saved successfully.'
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Un Authorized Action!'
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Un Authorized Action!'
      tags:
        - 'Setting Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                variable:
                  type: string
                  description: 'The variable type for which settings are to be stored. Must be one of the following: general_settings, pusher_settings, email_settings, media_storage_settings, sms_gateway_settings, whatsapp_settings, privacy_policy, about_us, terms_conditions.'
                  example: general_settings
                company_title:
                  type: string
                  description: 'The title of the company.'
                  example: FortyHives Projects
                site_url:
                  type: string
                  description: 'The URL of the site.'
                  example: 'https://www.taskify.com'
                timezone:
                  type: string
                  description: 'The timezone of the site.'
                  example: Asia/Kolkata
                currency_full_form:
                  type: string
                  description: 'The full form of the currency.'
                  example: 'Indian Rupee'
                currency_symbol:
                  type: string
                  description: 'The symbol of the currency.'
                  example: ₹
                currency_code:
                  type: string
                  description: 'The code of the currency.'
                  example: INR
                date_format:
                  type: string
                  description: 'The format of the date.'
                  example: DD-MM-YYYY|d-m-Y
                toast_time_out:
                  type: numeric
                  description: 'The time duration for the toast message to be displayed.'
                  example: '2'
                allowed_max_upload_size:
                  type: numeric
                  description: 'The maximum allowed upload size.'
                  example: '2000'
              required:
                - variable
                - company_title
                - site_url
                - timezone
                - currency_full_form
                - currency_symbol
                - currency_code
                - date_format
    parameters:
      -
        in: path
        name: variable
        description: 'The variable type for which settings are to be stored. Must be one of the following: general_settings, pusher_settings, email_settings, media_storage_settings, sms_gateway_settings, whatsapp_settings, privacy_policy, about_us, terms_conditions.'
        example: general_settings
        required: true
        schema:
          type: string
  /api/expenses/store:
    post:
      summary: 'Create a new expense.'
      operationId: createANewExpense
      description: 'This endpoint creates a new expense item with the specified title, expense_type_id,user_id,amount,expense_date,note. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n\"error\": false,\n\"message\": \"Expense created successfully.\",\n\"id\": 36,\n\"data\": {\n          'id' => '1',\n          'title' => 'Expense Title',\n          'expense_type_id' => '1',\n          'user_id' => '1',\n          'amount' => '100.00',\n          'expense_date' => '2023-10-01',\n          'note' => 'Expense note',\n          'created_by' => 'John Doe',\n          'created_at' => format_date($exp->created_at, true),\n         }"
        422:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": true,\n  \"message\": \"Validation errors occurred\",\n  \"errors\": {\n    \"title\": [\n      \"The title field is required.\"\n    ],\n    \"expense_type_id\": [\n      \"The expense type field is required.\"\n    ],\n   \"user_id\": [\n     \"The user id field is required.\"\n   ],\n   \"amount\": [\n     \"The amount field is required.\"\n  ],\n  \"expense_date\": [\n    \"The expense date field is required.\"\n   ],\n  }\n}"
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while creating the expense.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while creating the expense.'
      tags:
        - 'Expense Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: 'The note of the expense.'
                  example: 'Finish report'
              required:
                - title
  '/api/expenses/{id}':
    get:
      summary: 'List or search expenses.'
      operationId: listOrSearchExpenses
      description: 'Retrieve a paginated list of expenses or a single expense by ID.'
      parameters:
        -
          in: query
          name: search
          description: 'optional Search keyword for title, amount, note, or ID.'
          example: Lunch
          required: false
          schema:
            type: string
            description: 'optional Search keyword for title, amount, note, or ID.'
            example: Lunch
        -
          in: query
          name: sort
          description: 'optional Column to sort by. Default: id. Allowed: id, title, created_at, updated_at.'
          example: title
          required: false
          schema:
            type: string
            description: 'optional Column to sort by. Default: id. Allowed: id, title, created_at, updated_at.'
            example: title
        -
          in: query
          name: order
          description: 'optional Sort order: ASC or DESC. Default: DESC.'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional Sort order: ASC or DESC. Default: DESC.'
            example: ASC
        -
          in: query
          name: limit
          description: 'optional Number of records per page.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional Number of records per page.'
            example: 10
        -
          in: query
          name: offset
          description: 'optional Offset for pagination.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'optional Offset for pagination.'
            example: 0
        -
          in: query
          name: 'type_ids[]'
          description: 'optional Filter by expense type IDs.'
          example:
            - 1
            - 2
          required: false
          schema:
            type: array
            description: 'optional Filter by expense type IDs.'
            example:
              - 1
              - 2
            items:
              type: integer
        -
          in: query
          name: 'user_ids[]'
          description: 'optional Filter by user IDs.'
          example:
            - 3
            - 5
          required: false
          schema:
            type: array
            description: 'optional Filter by user IDs.'
            example:
              - 3
              - 5
            items:
              type: integer
        -
          in: query
          name: date_from
          description: 'date optional Start date for expense_date filtering.'
          example: '2023-01-01'
          required: false
          schema:
            type: string
            description: 'date optional Start date for expense_date filtering.'
            example: '2023-01-01'
        -
          in: query
          name: date_to
          description: 'date optional End date for expense_date filtering.'
          example: '2023-01-31'
          required: false
          schema:
            type: string
            description: 'date optional End date for expense_date filtering.'
            example: '2023-01-31'
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Expenses retrieved successfully'
                  total: 2
                  data:
                    -
                      id: 1
                      title: 'Travel Reimbursement'
                      expense_type_id: 2
                      expense_type: Travel
                      user_id: 5
                      user:
                        id: 5
                        first_name: Alice
                        last_name: Smith
                        email: alice@example.com
                        photo: 'https://yourdomain.com/storage/photos/alice.jpg'
                      amount: '150.00'
                      expense_date: '2023-10-01'
                      note: 'Flight ticket'
                      created_by: 'John Doe'
                      created_at: '2023-10-01'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Expenses retrieved successfully'
                  total:
                    type: integer
                    example: 2
                  data:
                    type: array
                    example:
                      -
                        id: 1
                        title: 'Travel Reimbursement'
                        expense_type_id: 2
                        expense_type: Travel
                        user_id: 5
                        user:
                          id: 5
                          first_name: Alice
                          last_name: Smith
                          email: alice@example.com
                          photo: 'https://yourdomain.com/storage/photos/alice.jpg'
                        amount: '150.00'
                        expense_date: '2023-10-01'
                        note: 'Flight ticket'
                        created_by: 'John Doe'
                        created_at: '2023-10-01'
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        title:
                          type: string
                          example: 'Travel Reimbursement'
                        expense_type_id:
                          type: integer
                          example: 2
                        expense_type:
                          type: string
                          example: Travel
                        user_id:
                          type: integer
                          example: 5
                        user:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 5
                            first_name:
                              type: string
                              example: Alice
                            last_name:
                              type: string
                              example: Smith
                            email:
                              type: string
                              example: alice@example.com
                            photo:
                              type: string
                              example: 'https://yourdomain.com/storage/photos/alice.jpg'
                        amount:
                          type: string
                          example: '150.00'
                        expense_date:
                          type: string
                          example: '2023-10-01'
                        note:
                          type: string
                          example: 'Flight ticket'
                        created_by:
                          type: string
                          example: 'John Doe'
                        created_at:
                          type: string
                          example: '2023-10-01'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Expense not found'
                  total: 0
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Expense not found'
                  total:
                    type: integer
                    example: 0
                  data:
                    type: array
                    example: []
      tags:
        - 'Expense Management'
    parameters:
      -
        in: path
        name: id
        description: 'Optional parameter. optional The ID of the expense to retrieve.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/expenses/update:
    post:
      summary: 'Update a existing expense.'
      operationId: updateAExistingExpense
      description: 'This endpoint update existing expense item with the specified title, expense_type_id,user_id,amount,expense_date,note. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n\"error\": false,\n\"message\": \"Expense created successfully.\",\n\"id\": 36,\n\"data\": {\n          'id' => '1',\n          'title' => 'Expense Title',\n          'expense_type_id' => '1',\n          'user_id' => '1',\n          'amount' => '100.00',\n          'expense_date' => '2023-10-01',\n          'note' => 'Expense note',\n          'created_by' => 'John Doe',\n          'created_at' => format_date($exp->created_at, true),\n         }"
        422:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": true,\n  \"message\": \"Validation errors occurred\",\n  \"errors\": {\n    \"title\": [\n      \"The title field is required.\"\n    ],\n    \"expense_type_id\": [\n      \"The expense type field is required.\"\n    ],\n   \"user_id\": [\n     \"The user id field is required.\"\n   ],\n   \"amount\": [\n     \"The amount field is required.\"\n  ],\n  \"expense_date\": [\n    \"The expense date field is required.\"\n   ],\n  }\n}"
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while creating the expense.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while creating the expense.'
      tags:
        - 'Expense Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  description: 'The id of the expense.'
                  example: '1'
                title:
                  type: string
                  description: 'The title of the expense.'
                  example: 'Finish report'
                expense_type_id:
                  type: string
                  description: 'The expense_type_id of the expense.'
                  example: '1'
                user_id:
                  type: string
                  description: 'The user_id of the expense.'
                  example: '1'
                amount:
                  type: string
                  description: 'The amount of the expense.'
                  example: 'Finish report'
                expense_date:
                  type: string
                  description: 'The expense_date of the expense.'
                  example: '2024-08-07'
                note:
                  type: string
                  description: 'The note of the expense.'
                  example: 'Finish report'
              required:
                - id
                - title
                - expense_type_id
                - user_id
                - amount
                - expense_date
                - note
  '/api/expenses/destroy/{id}':
    delete:
      summary: 'Remove the specified expense.'
      operationId: removeTheSpecifiedExpense
      description: 'This endpoint deletes a expense item based on the provided ID. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": false,\n  \"message\": \"Expense deleted successfully.\",\n  \"id\": 1,\n  \"title\": \"Expense Title\"\n  \"data\": []\n}"
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while deleting the expense.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while deleting the expense.'
      tags:
        - 'Expense Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the todo to be deleted.'
        example: 1
        required: true
        schema:
          type: integer
  /api/expenses/expense-types/store:
    post:
      summary: 'Create a new expense type.'
      operationId: createANewExpenseType
      description: 'This endpoint creates a new expense type item with the specified title, description. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n\"error\": false,\n\"message\": \"Expense Type created successfully.\",\n\"id\": 1,\n\"data\": {\n          'id' => '1',\n          'title' => 'Expense Title',\n          'description' => 'Expense Description',\n          'created_at' => 2023-10-01 12:00:00',\n         }"
        422:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": true,\n  \"message\": \"Validation errors occurred\",\n  \"errors\": {\n    \"title\": [\n      \"The title field is required.\"\n    ],\n  }\n}"
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while creating the expense type.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while creating the expense type.'
      tags:
        - 'Expense Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: 'The title of the expense.'
                  example: 'Finish report'
                description:
                  type: string
                  description: 'The description of the expense.'
                  example: 'Finish report'
              required:
                - title
                - description
  '/api/expenses/expense-types/list/{id}':
    get:
      summary: 'List or search expense types.'
      operationId: listOrSearchExpenseTypes
      description: "Retrieve a list of expense types, optionally filtered by search term or a specific ID.\nSupports sorting, pagination, and workspace scoping. Authentication is required."
      parameters:
        -
          in: query
          name: search
          description: 'optional Search term for title, description, or ID.'
          example: Travel
          required: false
          schema:
            type: string
            description: 'optional Search term for title, description, or ID.'
            example: Travel
        -
          in: query
          name: sort
          description: 'optional Field to sort by. Defaults to `id`. Sortable fields: `id`, `title`, `created_at`, `updated_at`.'
          example: title
          required: false
          schema:
            type: string
            description: 'optional Field to sort by. Defaults to `id`. Sortable fields: `id`, `title`, `created_at`, `updated_at`.'
            example: title
        -
          in: query
          name: order
          description: 'optional Sort order: `ASC` or `DESC`. Defaults to `DESC`.'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional Sort order: `ASC` or `DESC`. Defaults to `DESC`.'
            example: ASC
        -
          in: query
          name: limit
          description: 'optional Number of items per page. Default is 10.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional Number of items per page. Default is 10.'
            example: 10
        -
          in: query
          name: offset
          description: 'optional Number of items to skip (for pagination). Default is 0.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'optional Number of items to skip (for pagination). Default is 0.'
            example: 0
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: 'Single Expense Type Found'
                    type: object
                    example:
                      error: false
                      message: 'Expense type retrieved successfully'
                      total: 1
                      data:
                        -
                          id: 1
                          title: Travel
                          description: 'Travel expenses'
                          created_at: '2023-10-01'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Expense type retrieved successfully'
                      total:
                        type: integer
                        example: 1
                      data:
                        type: array
                        example:
                          -
                            id: 1
                            title: Travel
                            description: 'Travel expenses'
                            created_at: '2023-10-01'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1
                            title:
                              type: string
                              example: Travel
                            description:
                              type: string
                              example: 'Travel expenses'
                            created_at:
                              type: string
                              example: '2023-10-01'
                  -
                    description: 'Multiple Expense Types Found'
                    type: object
                    example:
                      error: false
                      message: 'Expense types retrieved successfully'
                      total: 2
                      data:
                        -
                          id: 1
                          title: Travel
                          description: 'Travel expenses'
                          created_at: '2023-10-01'
                        -
                          id: 2
                          title: 'Office Supplies'
                          description: 'Stationery and office supplies'
                          created_at: '2023-10-03'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Expense types retrieved successfully'
                      total:
                        type: integer
                        example: 2
                      data:
                        type: array
                        example:
                          -
                            id: 1
                            title: Travel
                            description: 'Travel expenses'
                            created_at: '2023-10-01'
                          -
                            id: 2
                            title: 'Office Supplies'
                            description: 'Stationery and office supplies'
                            created_at: '2023-10-03'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1
                            title:
                              type: string
                              example: Travel
                            description:
                              type: string
                              example: 'Travel expenses'
                            created_at:
                              type: string
                              example: '2023-10-01'
                  -
                    description: 'No Results Found'
                    type: object
                    example:
                      error: true
                      message: 'Expense type not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Expense type not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
      tags:
        - 'Expense Management'
    parameters:
      -
        in: path
        name: id
        description: 'Optional parameter. optional The ID of the specific expense type to retrieve.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/expenses/expense-types/update:
    post:
      summary: 'Update an existing expense type.'
      operationId: updateAnExistingExpenseType
      description: 'This endpoint update an existing expense type item with the specified title, description. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n\"error\": false,\n\"message\": \"Expense Type created successfully.\",\n\"id\": 1,\n\"data\": {\n          'id' => '1',\n          'title' => 'Expense Title',\n          'description' => 'Expense Description',\n          'created_at' => 2023-10-01 12:00:00',\n         }"
        422:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": true,\n  \"message\": \"Validation errors occurred\",\n  \"errors\": {\n    \"title\": [\n      \"The title field is required.\"\n    ],\n  }\n}"
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while creating the expense type.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while creating the expense type.'
      tags:
        - 'Expense Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  description: 'The id of the expense.'
                  example: '1'
                title:
                  type: string
                  description: 'The title of the expense.'
                  example: 'Finish report'
                description:
                  type: string
                  description: 'The description of the expense.'
                  example: 'Finish report'
              required:
                - id
                - title
                - description
  '/api/expenses/expense-types/destroy/{id}':
    delete:
      summary: 'Remove the specified expense type.'
      operationId: removeTheSpecifiedExpenseType
      description: 'This endpoint deletes a expense type item based on the provided ID. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": false,\n  \"message\": \"Expense Type deleted successfully.\",\n  \"id\": 1,\n  \"title\": \"Expense Type Title\"\n  \"data\": []\n}"
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while deleting the expense type.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while deleting the expense type.'
      tags:
        - 'Expense Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the todo to be deleted.'
        example: 1
        required: true
        schema:
          type: integer
  /api/payments/store:
    post:
      summary: 'Create a new payment.'
      operationId: createANewPayment
      description: 'This endpoint creates a new payment with the specified user_id, invoice_id,payment_method_id,amount,payment_date,note. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n\"error\": false,\n\"message\": \"Payment created successfully.\",\n\"id\": 36,\n\"data\": {\n          'id' => '1',\n          'user_id' => '1',\n          'invoice_id' => '1',\n          'payment_method_id' => '1',\n          'amount' => '100.00',\n          'payment_date' => '2023-10-01',\n          'note' => 'Payment note',\n          'created_at' => format_date($exp->created_at, true),\n         }"
        422:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": true,\n  \"message\": \"Validation errors occurred\",\n  \"errors\": {\n    \"user_id\": [\n      \"The user_id field is required.\"\n    ],\n    \"invoice_id\": [\n      \"The invoice_id field is required.\"\n    ],\n   \"payment_method_id\": [\n     \"The payment method id field is required.\"\n   ],\n   \"amount\": [\n     \"The amount field is required.\"\n  ],\n  \"payment_date\": [\n    \"The payment date field is required.\"\n   ],\n  }\n}"
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while creating the payment.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while creating the payment.'
      tags:
        - 'Payment Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                user_id:
                  type: string
                  description: 'The user_id of the payment.'
                  example: '1'
                invoice_id:
                  type: string
                  description: 'The invoice_id of the payment.'
                  example: '1'
                payment_method_id:
                  type: string
                  description: 'The payment_method_id of the payment methods.'
                  example: '1'
                amount:
                  type: string
                  description: 'The amount of the amount.'
                  example: '100'
                payment_date:
                  type: string
                  description: 'The payment_date of the payment.'
                  example: '2024-08-07'
                note:
                  type: string
                  description: 'The note of the note.'
                  example: 'Finish report'
              required:
                - user_id
                - invoice_id
                - payment_method_id
                - amount
                - payment_date
                - note
  '/api/payments/{id}':
    get:
      summary: 'List or search payments.'
      operationId: listOrSearchPayments
      description: 'This endpoint retrieves a list of payments based on various filters. The user must be authenticated to perform this action. The request allows searching and sorting by different parameters.'
      parameters:
        -
          in: query
          name: search
          description: 'optional The search term to filter tags by title or id.'
          example: Title
          required: false
          schema:
            type: string
            description: 'optional The search term to filter tags by title or id.'
            example: Title
        -
          in: query
          name: sort
          description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id,  created_at, and updated_at.'
          example: id
          required: false
          schema:
            type: string
            description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id,  created_at, and updated_at.'
            example: id
        -
          in: query
          name: order
          description: 'optional The sort order, either "ASC" or "DESC". Defaults to "DESC".'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional The sort order, either "ASC" or "DESC". Defaults to "DESC".'
            example: ASC
        -
          in: query
          name: limit
          description: 'optional The number of tags per page for pagination.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional The number of tags per page for pagination.'
            example: 10
        -
          in: query
          name: offset
          description: 'optional The offset for pagination, indicating the starting point of results.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'optional The offset for pagination, indicating the starting point of results.'
            example: 0
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Payment retrieved successfully'
                      total: 1
                      data:
                        -
                          id: 1
                          user_id: 1
                          user:
                            id: 1
                            first_name: Admin
                            last_name: User
                            email: admin@gmail.com
                            photo: 'https://dev-taskify.taskhub.company/storage/photos/C03PJmIQInts2j3O2on99Nilu45UcChrepcsIFxO.jpg'
                          invoice_id: null
                          invoice: '-'
                          payment_method_id: 1
                          payment_method: some
                          amount: '₹ 100.00'
                          payment_date: '2025-04-16'
                          note: '123'
                          created_by: 'Admin User'
                          created_at: '2025-04-16 09:41:57'
                          updated_at: '2025-04-16 09:41:57'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Payment retrieved successfully'
                      total:
                        type: integer
                        example: 1
                      data:
                        type: array
                        example:
                          -
                            id: 1
                            user_id: 1
                            user:
                              id: 1
                              first_name: Admin
                              last_name: User
                              email: admin@gmail.com
                              photo: 'https://dev-taskify.taskhub.company/storage/photos/C03PJmIQInts2j3O2on99Nilu45UcChrepcsIFxO.jpg'
                            invoice_id: null
                            invoice: '-'
                            payment_method_id: 1
                            payment_method: some
                            amount: '₹ 100.00'
                            payment_date: '2025-04-16'
                            note: '123'
                            created_by: 'Admin User'
                            created_at: '2025-04-16 09:41:57'
                            updated_at: '2025-04-16 09:41:57'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1
                            user_id:
                              type: integer
                              example: 1
                            user:
                              type: object
                              properties:
                                id:
                                  type: integer
                                  example: 1
                                first_name:
                                  type: string
                                  example: Admin
                                last_name:
                                  type: string
                                  example: User
                                email:
                                  type: string
                                  example: admin@gmail.com
                                photo:
                                  type: string
                                  example: 'https://dev-taskify.taskhub.company/storage/photos/C03PJmIQInts2j3O2on99Nilu45UcChrepcsIFxO.jpg'
                            invoice_id:
                              type: string
                              example: null
                            invoice:
                              type: string
                              example: '-'
                            payment_method_id:
                              type: integer
                              example: 1
                            payment_method:
                              type: string
                              example: some
                            amount:
                              type: string
                              example: '₹ 100.00'
                            payment_date:
                              type: string
                              example: '2025-04-16'
                            note:
                              type: string
                              example: '123'
                            created_by:
                              type: string
                              example: 'Admin User'
                            created_at:
                              type: string
                              example: '2025-04-16 09:41:57'
                            updated_at:
                              type: string
                              example: '2025-04-16 09:41:57'
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Payment not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Payment not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Payments not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Payments not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
      tags:
        - 'Payment Management'
    parameters:
      -
        in: path
        name: id
        description: 'Optional parameter. optional The ID of the tag to retrieve.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/payments/update:
    post:
      summary: 'Update an existing payment.'
      operationId: updateAnExistingPayment
      description: 'This endpoint updates an existing payment with the specified user_id, invoice_id,payment_method_id,amount,payment_date,note. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n\"error\": false,\n\"message\": \"Payment created successfully.\",\n\"id\": 36,\n\"data\": {\n          'id' => '1',\n          'user_id' => '1',\n          'invoice_id' => '1',\n          'payment_method_id' => '1',\n          'amount' => '100.00',\n          'payment_date' => '2023-10-01',\n          'note' => 'Payment note',\n          'created_at' => format_date($exp->created_at, true),\n         }"
        422:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": true,\n  \"message\": \"Validation errors occurred\",\n  \"errors\": {\n    \"user_id\": [\n      \"The user_id field is required.\"\n    ],\n    \"invoice_id\": [\n      \"The invoice_id field is required.\"\n    ],\n   \"payment_method_id\": [\n     \"The payment method id field is required.\"\n   ],\n   \"amount\": [\n     \"The amount field is required.\"\n  ],\n  \"payment_date\": [\n    \"The payment date field is required.\"\n   ],\n  }\n}"
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while creating the payment.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while creating the payment.'
      tags:
        - 'Payment Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  description: 'The id of the payment. Example : 1'
                  example: sunt
                user_id:
                  type: string
                  description: 'The user_id of the payment.'
                  example: '1'
                invoice_id:
                  type: string
                  description: 'The invoice_id of the payment.'
                  example: '1'
                payment_method_id:
                  type: string
                  description: 'The payment_method_id of the payment methods.'
                  example: '1'
                amount:
                  type: string
                  description: 'The amount of the amount.'
                  example: '100'
                payment_date:
                  type: string
                  description: 'The payment_date of the payment.'
                  example: '2024-08-07'
                note:
                  type: string
                  description: 'The note of the note.'
                  example: 'Finish report'
              required:
                - id
                - user_id
                - invoice_id
                - payment_method_id
                - amount
                - payment_date
                - note
  '/api/payments/destroy/{id}':
    delete:
      summary: 'Remove the specified payment.'
      operationId: removeTheSpecifiedPayment
      description: 'This endpoint deletes a payment based on the provided ID. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Payment deleted successfully.'
                      id: 1
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Payment deleted successfully.'
                      id:
                        type: integer
                        example: 1
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Payment not found.'
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Payment not found.'
                      data:
                        type: array
                        example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while deleting the Payment.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while deleting the Payment.'
      tags:
        - 'Payment Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the todo to be deleted.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/payment-methods/{id}':
    get:
      summary: 'List or search payments methods.'
      operationId: listOrSearchPaymentsMethods
      description: 'This endpoint retrieves a list of payments methods based on various filters. The user must be authenticated to perform this action. The request allows searching and sorting by different parameters.'
      parameters:
        -
          in: query
          name: search
          description: 'optional The search term to filter tags by title or id.'
          example: Title
          required: false
          schema:
            type: string
            description: 'optional The search term to filter tags by title or id.'
            example: Title
        -
          in: query
          name: sort
          description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id,  created_at, and updated_at.'
          example: id
          required: false
          schema:
            type: string
            description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id,  created_at, and updated_at.'
            example: id
        -
          in: query
          name: order
          description: 'optional The sort order, either "ASC" or "DESC". Defaults to "DESC".'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional The sort order, either "ASC" or "DESC". Defaults to "DESC".'
            example: ASC
        -
          in: query
          name: limit
          description: 'optional The number of tags per page for pagination.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional The number of tags per page for pagination.'
            example: 10
        -
          in: query
          name: offset
          description: 'optional The offset for pagination, indicating the starting point of results.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'optional The offset for pagination, indicating the starting point of results.'
            example: 0
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Payment Method retrieved successfully'
                      total: 1
                      data:
                        -
                          id: 1
                          title: 'Payment Method Title'
                          created_at: '2025-04-16 09:41:57'
                          updated_at: '2025-04-16 09:41:57'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Payment Method retrieved successfully'
                      total:
                        type: integer
                        example: 1
                      data:
                        type: array
                        example:
                          -
                            id: 1
                            title: 'Payment Method Title'
                            created_at: '2025-04-16 09:41:57'
                            updated_at: '2025-04-16 09:41:57'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1
                            title:
                              type: string
                              example: 'Payment Method Title'
                            created_at:
                              type: string
                              example: '2025-04-16 09:41:57'
                            updated_at:
                              type: string
                              example: '2025-04-16 09:41:57'
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Payment Method not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Payment Method not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Payment Methods not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Payment Methods not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
      tags:
        - 'Payment Method Management'
    parameters:
      -
        in: path
        name: id
        description: 'Optional parameter. optional The ID of the tag to retrieve.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/payment-methods/store:
    post:
      summary: 'Create a payment method.'
      operationId: createAPaymentMethod
      description: 'This endpoint creates a payment method. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n\"error\": false,\n\"message\": \"Payment Method created successfully.\",\n\"id\": 36,\n\"data\": {\n          'id' => '1',\n          'title' => 'Title',\n          'created_at =>'2025-04-16',\n          'updated_at' =>'2025-04-16',\n         }"
        422:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": true,\n  \"message\": \"Validation errors occurred\",\n  \"errors\": {\n    \"id\": [\n      \"The id field is required.\"\n    ],\n    \"title\": [\n      \"The title field is required.\"\n    ],\n\n  }\n}"
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while creating the payment method.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while creating the payment method.'
      tags:
        - 'Payment Method Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: 'The title of the payment method.'
                  example: Title
              required:
                - title
  /api/payment-methods/update:
    post:
      summary: 'Update an existing payment method.'
      operationId: updateAnExistingPaymentMethod
      description: 'This endpoint updates an existing payment method with the specified id. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n\"error\": false,\n\"message\": \"Payment Method created successfully.\",\n\"id\": 36,\n\"data\": {\n          'id' => '1',\n          'title' => 'Title',\n          'created_at =>'2025-04-16',\n          'updated_at' =>'2025-04-16',\n         }"
        422:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": true,\n  \"message\": \"Validation errors occurred\",\n  \"errors\": {\n    \"id\": [\n      \"The id field is required.\"\n    ],\n    \"title\": [\n      \"The title field is required.\"\n    ],\n\n  }\n}"
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while creating the payment method.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while creating the payment method.'
      tags:
        - 'Payment Method Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  description: 'The id of the payment method. Example : 1'
                  example: recusandae
                title:
                  type: string
                  description: 'The title of the payment method.'
                  example: Title
              required:
                - id
                - title
  '/api/payment-methods/destroy/{id}':
    delete:
      summary: 'Remove the specified payment method.'
      operationId: removeTheSpecifiedPaymentMethod
      description: 'This endpoint deletes a payment method based on the provided ID. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Payment Method deleted successfully.'
                      id: 1
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Payment Method deleted successfully.'
                      id:
                        type: integer
                        example: 1
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Payment Method not found.'
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Payment Method not found.'
                      data:
                        type: array
                        example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while deleting the Payment Method.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while deleting the Payment Method.'
      tags:
        - 'Payment Method Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the todo to be deleted.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/taxes/{id}':
    get:
      summary: 'List or search taxes.'
      operationId: listOrSearchTaxes
      description: "This endpoint retrieves a list of taxes based on various filters. The user must be authenticated to perform this action.\nIt supports searching, sorting, filtering by type, and pagination."
      parameters:
        -
          in: query
          name: search
          description: 'optional The term to search taxes by title, amount, percentage, type, or ID.'
          example: GST
          required: false
          schema:
            type: string
            description: 'optional The term to search taxes by title, amount, percentage, type, or ID.'
            example: GST
        -
          in: query
          name: sort
          description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id, created_at, updated_at.'
          example: created_at
          required: false
          schema:
            type: string
            description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id, created_at, updated_at.'
            example: created_at
        -
          in: query
          name: order
          description: 'optional The sorting order, either ASC or DESC. Defaults to DESC.'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional The sorting order, either ASC or DESC. Defaults to DESC.'
            example: ASC
        -
          in: query
          name: types
          description: 'optional Filter taxes by type. Accepts an array of types such as "percentage" or "fixed".'
          example:
            - percentage
          required: false
          schema:
            type: array
            description: 'optional Filter taxes by type. Accepts an array of types such as "percentage" or "fixed".'
            example:
              - percentage
            items:
              type: string
        -
          in: query
          name: limit
          description: 'optional Number of records per page. Defaults to 10.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional Number of records per page. Defaults to 10.'
            example: 10
        -
          in: query
          name: offset
          description: 'optional The offset for pagination. Defaults to 0.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'optional The offset for pagination. Defaults to 0.'
            example: 0
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Taxes retrieved successfully'
                      total: 1
                      data:
                        -
                          id: 1
                          title: GST
                          type: percentage
                          amount: null
                          percentage: 18
                          created_at: '2025-04-16'
                          updated_at: '2025-04-16'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Taxes retrieved successfully'
                      total:
                        type: integer
                        example: 1
                      data:
                        type: array
                        example:
                          -
                            id: 1
                            title: GST
                            type: percentage
                            amount: null
                            percentage: 18
                            created_at: '2025-04-16'
                            updated_at: '2025-04-16'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1
                            title:
                              type: string
                              example: GST
                            type:
                              type: string
                              example: percentage
                            amount:
                              type: string
                              example: null
                            percentage:
                              type: integer
                              example: 18
                            created_at:
                              type: string
                              example: '2025-04-16'
                            updated_at:
                              type: string
                              example: '2025-04-16'
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Tax retrieved successfully'
                      total: 1
                      data:
                        id: 1
                        title: GST
                        type: percentage
                        amount: null
                        percentage: 18
                        created_at: '2025-04-16'
                        updated_at: '2025-04-16'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Tax retrieved successfully'
                      total:
                        type: integer
                        example: 1
                      data:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 1
                          title:
                            type: string
                            example: GST
                          type:
                            type: string
                            example: percentage
                          amount:
                            type: string
                            example: null
                          percentage:
                            type: integer
                            example: 18
                          created_at:
                            type: string
                            example: '2025-04-16'
                          updated_at:
                            type: string
                            example: '2025-04-16'
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Tax not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Tax not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
      tags:
        - 'Tax Management'
    parameters:
      -
        in: path
        name: id
        description: 'Optional parameter. optional The ID of the tax to retrieve.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/taxes/store:
    post:
      summary: 'Create a tax.'
      operationId: createATax
      description: 'This endpoint creates a tax. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n\"error\": false,\n\"message\": \"Tax created successfully.\",\n\"id\": 36,\n\"data\": {\n          'id' => '1',\n          'title' => 'Title',\n          'type' => 'amount',\n          'amount' => '100',\n          'percentage' => null,\n          'created_at =>'2025-04-16',\n          'updated_at' =>'2025-04-16',\n         }"
        422:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": true,\n  \"message\": \"Validation errors occurred\",\n  \"errors\": {\n    \"id\": [\n      \"The id field is required.\"\n    ],\n    \"title\": [\n      \"The title field is required.\"\n    ],\n    \"type\": [\n      \"The type field is required.\"\n    ],\n\n  }\n}"
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while creating the tax.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while creating the tax.'
      tags:
        - 'Tax Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: 'The title of the tax.'
                  example: Title
                type:
                  type: string
                  description: 'The type of the tax.'
                  example: amount
                amount:
                  type: string
                  description: 'if type is amount The amount of the tax.'
                  example: '100'
                percentage:
                  type: string
                  description: 'if type is percentage The percentage of the tax.'
                  example: '10'
              required:
                - title
                - type
                - amount
                - percentage
  /api/taxes/update:
    post:
      summary: 'Update a tax.'
      operationId: updateATax
      description: 'This endpoint updates an existing tax. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n\"error\": false,\n\"message\": \"Tax updated successfully.\",\n\"id\": 36,\n\"data\": {\n          'id' => '1',\n          'title' => 'Title',\n          'type' => 'amount',\n          'amount' => '100',\n          'percentage' => null,\n          'created_at =>'2025-04-16',\n          'updated_at' =>'2025-04-16',\n         }"
        422:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": true,\n  \"message\": \"Validation errors occurred\",\n  \"errors\": {\n    \"id\": [\n      \"The id field is required.\"\n    ],\n    \"title\": [\n      \"The title field is required.\"\n    ],\n\n\n  }\n}"
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while updating the tax.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while updating the tax.'
      tags:
        - 'Tax Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  description: 'The id of the tax.'
                  example: '1'
                title:
                  type: string
                  description: 'The title of the tax.'
                  example: Title
              required:
                - id
                - title
  '/api/taxes/destroy/{id}':
    delete:
      summary: 'Remove the specified tax.'
      operationId: removeTheSpecifiedTax
      description: 'This endpoint deletes a tax based on the provided ID. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Tax deleted successfully.'
                      id: 1
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Tax deleted successfully.'
                      id:
                        type: integer
                        example: 1
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Tax not found.'
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Tax not found.'
                      data:
                        type: array
                        example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while deleting the Tax.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while deleting the Tax.'
      tags:
        - 'Tax Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the todo to be deleted.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/units/{id}':
    get:
      summary: 'List or search units.'
      operationId: listOrSearchUnits
      description: 'This endpoint retrieves a list of units based on various filters. The user must be authenticated to perform this action. The request allows searching and sorting by different parameters.'
      parameters:
        -
          in: query
          name: search
          description: 'optional The search term to filter tags by title or id.'
          example: Title
          required: false
          schema:
            type: string
            description: 'optional The search term to filter tags by title or id.'
            example: Title
        -
          in: query
          name: sort
          description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id,  created_at, and updated_at.'
          example: id
          required: false
          schema:
            type: string
            description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id,  created_at, and updated_at.'
            example: id
        -
          in: query
          name: order
          description: 'optional The sort order, either "ASC" or "DESC". Defaults to "DESC".'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional The sort order, either "ASC" or "DESC". Defaults to "DESC".'
            example: ASC
        -
          in: query
          name: limit
          description: 'optional The number of tags per page for pagination.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional The number of tags per page for pagination.'
            example: 10
        -
          in: query
          name: offset
          description: 'optional The offset for pagination, indicating the starting point of results.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'optional The offset for pagination, indicating the starting point of results.'
            example: 0
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Unit retrieved successfully'
                      total: 1
                      data:
                        -
                          id: 1
                          title: title
                          description: 'unit description'
                          created_at: '2025-04-16 09:41:57'
                          updated_at: '2025-04-16 09:41:57'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Unit retrieved successfully'
                      total:
                        type: integer
                        example: 1
                      data:
                        type: array
                        example:
                          -
                            id: 1
                            title: title
                            description: 'unit description'
                            created_at: '2025-04-16 09:41:57'
                            updated_at: '2025-04-16 09:41:57'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1
                            title:
                              type: string
                              example: title
                            description:
                              type: string
                              example: 'unit description'
                            created_at:
                              type: string
                              example: '2025-04-16 09:41:57'
                            updated_at:
                              type: string
                              example: '2025-04-16 09:41:57'
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Unit not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Unit not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Units not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Units not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
      tags:
        - 'Unit Management'
    parameters:
      -
        in: path
        name: id
        description: 'Optional parameter. optional The ID of the tag to retrieve.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/units/store:
    post:
      summary: 'Create an unit.'
      operationId: createAnUnit
      description: 'This endpoint creates an unit. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n\"error\": false,\n\"message\": \"Unit created successfully.\",\n\"id\": 36,\n\"data\": {\n          'id' => '1',\n          'title' => 'Title',\n          'description' => 'Unit Description',\n          'created_at =>'2025-04-16',\n          'updated_at' =>'2025-04-16',\n         }"
        422:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": true,\n  \"message\": \"Validation errors occurred\",\n  \"errors\": {\n\n    \"title\": [\n      \"The title field is required.\"\n    ],\n\n  }\n}"
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while creating the unit.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while creating the unit.'
      tags:
        - 'Unit Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: 'The title of the unit.'
                  example: Title
                description:
                  type: string
                  description: 'The description of the unit.'
                  example: amount
              required:
                - title
  /api/units/update:
    post:
      summary: 'Update an unit.'
      operationId: updateAnUnit
      description: 'This endpoint updates an unit. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n\"error\": false,\n\"message\": \"Unit created successfully.\",\n\"id\": 36,\n\"data\": {\n          'id' => '1',\n          'title' => 'Title',\n          'description' => 'Unit Description',\n          'created_at =>'2025-04-16',\n          'updated_at' =>'2025-04-16',\n         }"
        422:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": true,\n  \"message\": \"Validation errors occurred\",\n  \"errors\": {\n    \"id\": [\n      \"The title id is required.\"\n    ],\n    \"title\": [\n      \"The title field is required.\"\n    ],\n\n  }\n}"
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while creating the unit.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while creating the unit.'
      tags:
        - 'Unit Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  description: 'The id of the unit.'
                  example: '1'
                title:
                  type: string
                  description: 'The title of the unit.'
                  example: Title
                description:
                  type: string
                  description: 'The description of the unit.'
                  example: 'unit description'
              required:
                - id
                - title
  '/api/units/destroy/{id}':
    delete:
      summary: 'Remove the specified unit.'
      operationId: removeTheSpecifiedUnit
      description: 'This endpoint deletes a unit based on the provided ID. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Unit deleted successfully.'
                      id: 1
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Unit deleted successfully.'
                      id:
                        type: integer
                        example: 1
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Unit not found.'
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Unit not found.'
                      data:
                        type: array
                        example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while deleting the Unit.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while deleting the Unit.'
      tags:
        - 'Unit Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the todo to be deleted.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/items/{id}':
    get:
      summary: 'Retrieve a list of items or a specific item.'
      operationId: retrieveAListOfItemsOrASpecificItem
      description: "This endpoint fetches item records associated with the authenticated user's workspace. You can retrieve a single item by its ID or fetch a paginated list using filters such as search terms, sorting, unit filters, and pagination controls.\n\nFilters available:\n- **search**: Filter by title, description, price, unit ID, or item ID (partial match).\n- **unit_ids**: Filter by one or more unit IDs (exact match).\n- **id**: If provided, fetches a single item record with detailed fields."
      parameters:
        -
          in: query
          name: search
          description: 'optional Filter items by title, description, price, unit_id, or item ID.'
          example: 'Water Bottle'
          required: false
          schema:
            type: string
            description: 'optional Filter items by title, description, price, unit_id, or item ID.'
            example: 'Water Bottle'
        -
          in: query
          name: sort
          description: 'optional Column to sort by. Defaults to "id". Available values: id, title, price, created_at, updated_at.'
          example: title
          required: false
          schema:
            type: string
            description: 'optional Column to sort by. Defaults to "id". Available values: id, title, price, created_at, updated_at.'
            example: title
        -
          in: query
          name: order
          description: 'optional Sort direction: ASC or DESC. Defaults to "DESC".'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional Sort direction: ASC or DESC. Defaults to "DESC".'
            example: ASC
        -
          in: query
          name: unit_ids
          description: 'optional Filter items by one or more unit IDs.'
          example:
            - 1
            - 2
            - 3
          required: false
          schema:
            type: array
            description: 'optional Filter items by one or more unit IDs.'
            example:
              - 1
              - 2
              - 3
            items:
              type: string
        -
          in: query
          name: limit
          description: 'optional Number of items to return. Default is 10.'
          example: 15
          required: false
          schema:
            type: integer
            description: 'optional Number of items to return. Default is 10.'
            example: 15
        -
          in: query
          name: offset
          description: 'optional Offset for paginated data. Default is 0.'
          example: 20
          required: false
          schema:
            type: integer
            description: 'optional Offset for paginated data. Default is 0.'
            example: 20
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": false,\n  \"message\": \"Items Retrieved Successfully\",\n  \"total\": 2,\n  \"data\": [\n    {\n      \"id\": 1,\n      \"title\": \"Notebook\",\n      \"price\": \"₹100.00\",\n      \"unit_id\": 2,\n      \"unit_name\": \"Piece\",\n      \"description\": \"A ruled notebook\",\n      \"created_at\": \"2025-05-01\",\n      \"updated_at\": \"2025-05-04\"\n    },\n    ...\n  ]\n}"
      tags:
        - 'Item Management'
    parameters:
      -
        in: path
        name: id
        description: 'Optional parameter. optional The ID of the item to retrieve a single record. If not provided, a list will be returned.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 5
  /api/items/store:
    post:
      summary: 'Create an item.'
      operationId: createAnItem
      description: 'This endpoint creates an item. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n\"error\": false,\n\"message\": \"Item created successfully.\",\n\"id\": 36,\n\"data\": {\n          \"id\": 1,\n\"title\": \"title\",\n\"price\" : 100,\n\"unit_id\": 1,\n\"description\" : \"description\",\n\"created_at\": \"2025-04-16 09:41:57\",\n\"updated_at\": \"2025-04-16 09:41:57\"\n         }"
        422:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": true,\n  \"message\": \"Validation errors occurred\",\n  \"errors\": {\n    \"id\": [\n      \"The  id field is required.\"\n    ],\n    \"title\": [\n      \"The title field is required.\"\n    ],\n\n  }\n}"
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while creating the item.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while creating the item.'
      tags:
        - 'Item Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  description: 'The id of the item.'
                  example: '1'
                title:
                  type: string
                  description: 'The title of the item.'
                  example: Title
                description:
                  type: string
                  description: 'The description of the item.'
                  example: description
                price:
                  type: string
                  description: 'The price of the item.'
                  example: '400'
                unit_id:
                  type: string
                  description: 'The unit_id of the item.'
                  example: '4'
              required:
                - id
                - title
  /api/items/update:
    post:
      summary: 'Update an item.'
      operationId: updateAnItem
      description: 'This endpoint updates an item. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n\"error\": false,\n\"message\": \"Item updated successfully.\",\n\"id\": 36,\n\"data\": {\n          \"id\": 1,\n\"title\": \"title\",\n\"price\" : 100,\n\"unit_id\": 1,\n\"description\" : \"description\",\n\"created_at\": \"2025-04-16 09:41:57\",\n\"updated_at\": \"2025-04-16 09:41:57\"\n         }"
        422:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": true,\n  \"message\": \"Validation errors occurred\",\n  \"errors\": {\n    \"id\": [\n      \"The  id field is required.\"\n    ],\n    \"title\": [\n      \"The title field is required.\"\n    ],\n\n  }\n}"
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while updating the item.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while updating the item.'
      tags:
        - 'Item Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  description: 'The id of the item.'
                  example: '1'
                title:
                  type: string
                  description: 'The title of the item.'
                  example: Title
                description:
                  type: string
                  description: 'The description of the item.'
                  example: description
                price:
                  type: string
                  description: 'The price of the item.'
                  example: '400'
                unit_id:
                  type: string
                  description: 'The unit_id of the item.'
                  example: '4'
              required:
                - id
                - title
  '/api/items/destroy/{id}':
    delete:
      summary: 'Remove the specified item.'
      operationId: removeTheSpecifiedItem
      description: 'This endpoint deletes a item based on the provided ID. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Item deleted successfully.'
                      id: 1
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Item deleted successfully.'
                      id:
                        type: integer
                        example: 1
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Item not found.'
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Item not found.'
                      data:
                        type: array
                        example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while deleting the Item.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while deleting the Item.'
      tags:
        - 'Item Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the item to be deleted.'
        example: 1
        required: true
        schema:
          type: integer
  /api/estimates-invoices:
    get:
      summary: 'List or search estimate invoices.'
      operationId: listOrSearchEstimateInvoices
      description: 'This endpoint retrieves a list of estimate invoices based on various filters. The user must be authenticated to perform this action. The request allows searching and sorting by different parameters.'
      parameters:
        -
          in: query
          name: search
          description: 'optional The search term to filter invoices by id or note.'
          example: INVC-1001
          required: false
          schema:
            type: string
            description: 'optional The search term to filter invoices by id or note.'
            example: INVC-1001
        -
          in: query
          name: sort
          description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id, created_at, and updated_at.'
          example: id
          required: false
          schema:
            type: string
            description: 'optional The field to sort by. Defaults to "id". Sortable fields include: id, created_at, and updated_at.'
            example: id
        -
          in: query
          name: order
          description: 'optional The sort order, either "ASC" or "DESC". Defaults to "DESC".'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional The sort order, either "ASC" or "DESC". Defaults to "DESC".'
            example: ASC
        -
          in: query
          name: limit
          description: 'optional The number of items per page for pagination.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional The number of items per page for pagination.'
            example: 10
        -
          in: query
          name: offset
          description: 'optional The offset for pagination.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'optional The offset for pagination.'
            example: 0
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Estimate invoice retrieved successfully'
                      total: 1
                      data:
                        -
                          id: 1
                          client:
                            id: 2
                            name: 'John Doe'
                            email: client@example.com
                            photo: 'https://example.com/storage/photos/client.jpg'
                          total: '₹ 1,000.00'
                          status: Pending
                          due_date: '2025-04-30'
                          created_by: 'Admin User'
                          created_at: '2025-04-15'
                          updated_at: '2025-04-15'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Estimate invoice retrieved successfully'
                      total:
                        type: integer
                        example: 1
                      data:
                        type: array
                        example:
                          -
                            id: 1
                            client:
                              id: 2
                              name: 'John Doe'
                              email: client@example.com
                              photo: 'https://example.com/storage/photos/client.jpg'
                            total: '₹ 1,000.00'
                            status: Pending
                            due_date: '2025-04-30'
                            created_by: 'Admin User'
                            created_at: '2025-04-15'
                            updated_at: '2025-04-15'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1
                            client:
                              type: object
                              properties:
                                id:
                                  type: integer
                                  example: 2
                                name:
                                  type: string
                                  example: 'John Doe'
                                email:
                                  type: string
                                  example: client@example.com
                                photo:
                                  type: string
                                  example: 'https://example.com/storage/photos/client.jpg'
                            total:
                              type: string
                              example: '₹ 1,000.00'
                            status:
                              type: string
                              example: Pending
                            due_date:
                              type: string
                              example: '2025-04-30'
                            created_by:
                              type: string
                              example: 'Admin User'
                            created_at:
                              type: string
                              example: '2025-04-15'
                            updated_at:
                              type: string
                              example: '2025-04-15'
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Estimate invoice not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Estimate invoice not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Estimate invoices not found'
                      total: 0
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Estimate invoices not found'
                      total:
                        type: integer
                        example: 0
                      data:
                        type: array
                        example: []
      tags:
        - 'Estimate Invoice Management'
    parameters:
      -
        in: path
        name: id
        description: 'Optional parameter. optional The ID of the estimate invoice to retrieve.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/estimates-invoices/store:
    post:
      summary: 'Store a new invoice or estimate.'
      operationId: storeANewInvoiceOrEstimate
      description: "This endpoint allows the creation of a new invoice or estimate by providing details such as client, dates, items, amount, and tax info.\nThe user must be authenticated to perform this action."
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": false,\n  \"message\": \"Estimate/Invoice created successfully.\",\n  \"data\": {\n    \"id\": 1,\n    \"type\": \"invoice\",\n    \"client_id\": 1,\n    \"from_date\": \"2024-01-01\",\n    \"to_date\": \"2024-01-31\",\n    \"total\": \"1000.00\",\n    \"tax_amount\": \"100.00\",\n    \"final_total\": \"1100.00\",\n    \"status\": \"draft\",\n    \"created_at\": \"2024-01-01T10:00:00.000000Z\",\n    \"items\": [...]\n  }\n}"
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred'
                  errors:
                    type:
                      - 'The type field is required.'
                    client_id:
                      - 'The client field is required.'
                    from_date:
                      - 'The from date field is required and must be before the to date.'
                    to_date:
                      - 'The to date field is required and must be after the from date.'
                    final_total:
                      - 'The final total field is required and must be a valid currency format.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred'
                  errors:
                    type: object
                    properties:
                      type:
                        type: array
                        example:
                          - 'The type field is required.'
                        items:
                          type: string
                      client_id:
                        type: array
                        example:
                          - 'The client field is required.'
                        items:
                          type: string
                      from_date:
                        type: array
                        example:
                          - 'The from date field is required and must be before the to date.'
                        items:
                          type: string
                      to_date:
                        type: array
                        example:
                          - 'The to date field is required and must be after the from date.'
                        items:
                          type: string
                      final_total:
                        type: array
                        example:
                          - 'The final total field is required and must be a valid currency format.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while creating the estimate/invoice.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while creating the estimate/invoice.'
      tags:
        - 'Estimate Invoice Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  description: 'Type of the document. Accepted values: estimate, invoice.'
                  example: invoice
                client_id:
                  type: integer
                  description: 'The ID of the client.'
                  example: 1
                name:
                  type: string
                  description: 'The name/title of the estimate or invoice.'
                  example: 'Website Development'
                address:
                  type: string
                  description: 'optional The address for the client.'
                  example: '123 Main St.'
                city:
                  type: string
                  description: 'optional The city of the client.'
                  example: 'New York'
                state:
                  type: string
                  description: 'optional The state of the client.'
                  example: NY
                country:
                  type: string
                  description: 'optional The country of the client.'
                  example: USA
                zip_code:
                  type: string
                  description: 'optional The postal code.'
                  example: '10001'
                phone:
                  type: string
                  description: 'optional The phone number.'
                  example: '+1234567890'
                note:
                  type: string
                  description: 'optional General note.'
                  example: 'Handle with urgency'
                personal_note:
                  type: string
                  description: 'optional Internal note.'
                  example: 'Discussed pricing'
                from_date:
                  type: date
                  description: 'Start date. Format: Y-m-d.'
                  example: '2024-01-01'
                to_date:
                  type: date
                  description: 'End date. Format: Y-m-d.'
                  example: '2024-01-31'
                status:
                  type: string
                  description: 'optional Status of the document. Accepted values for invoice: not_specified, partially_paid, fully_paid, draft, cancelled, due. For estimate: not_specified, sent, accepted, draft, declined, expired.'
                  example: draft
                total:
                  type: string
                  description: 'Sub total amount. Format: currency.'
                  example: '1000.00'
                tax_amount:
                  type: string
                  description: 'optional Tax amount. Format: currency.'
                  example: '100.00'
                final_total:
                  type: string
                  description: 'Final total after taxes. Format: currency.'
                  example: '1100.00'
                item_ids:
                  type: array
                  description: 'optional IDs of selected items.'
                  example:
                    - 1
                    - 2
                  items:
                    type: string
                item:
                  type: array
                  description: 'Item IDs.'
                  example:
                    - 1
                    - 2
                  items:
                    type: string
                quantity:
                  type: array
                  description: 'Quantity per item.'
                  example:
                    - 2
                    - 1
                  items:
                    type: string
                unit:
                  type: array
                  description: 'optional Unit IDs for each item.'
                  example:
                    - 1
                    - 2
                  items:
                    type: string
                rate:
                  type: array
                  description: 'Rate per item.'
                  example:
                    - '500.00'
                    - '1000.00'
                  items:
                    type: string
                tax:
                  type: array
                  description: 'optional Tax ID per item.'
                  example:
                    - 1
                    - 2
                  items:
                    type: string
                amount:
                  type: array
                  description: 'Total amount per item.'
                  example:
                    - '1000.00'
                    - '1000.00'
                  items:
                    type: string
              required:
                - type
                - client_id
                - name
                - from_date
                - to_date
                - total
                - final_total
                - item
                - quantity
                - rate
                - amount
  /api/estimates-invoices/update:
    post:
      summary: 'Update an existing estimate or invoice.'
      operationId: updateAnExistingEstimateOrInvoice
      description: "This endpoint updates an existing estimate or invoice record with provided details including type, client, date range, financials, items, and notes.\nThe request must be authenticated."
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Estimate/Invoice updated successfully.'
                  data:
                    id: 5
                    type: invoice
                    client_id: 2
                    from_date: '2024-04-01'
                    to_date: '2024-04-30'
                    total: '1000.00'
                    tax_amount: '100.00'
                    final_total: '1100.00'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Estimate/Invoice updated successfully.'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 5
                      type:
                        type: string
                        example: invoice
                      client_id:
                        type: integer
                        example: 2
                      from_date:
                        type: string
                        example: '2024-04-01'
                      to_date:
                        type: string
                        example: '2024-04-30'
                      total:
                        type: string
                        example: '1000.00'
                      tax_amount:
                        type: string
                        example: '100.00'
                      final_total:
                        type: string
                        example: '1100.00'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation errors occurred.'
                  errors:
                    client_id:
                      - 'The client field is required.'
                    from_date:
                      - 'The from date must be a valid date.'
                    to_date:
                      - 'The to date must be a valid date.'
                    total:
                      - 'The total format is invalid.'
                    final_total:
                      - 'The final total format is invalid.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation errors occurred.'
                  errors:
                    type: object
                    properties:
                      client_id:
                        type: array
                        example:
                          - 'The client field is required.'
                        items:
                          type: string
                      from_date:
                        type: array
                        example:
                          - 'The from date must be a valid date.'
                        items:
                          type: string
                      to_date:
                        type: array
                        example:
                          - 'The to date must be a valid date.'
                        items:
                          type: string
                      total:
                        type: array
                        example:
                          - 'The total format is invalid.'
                        items:
                          type: string
                      final_total:
                        type: array
                        example:
                          - 'The final total format is invalid.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while updating the estimate or invoice.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while updating the estimate or invoice.'
      tags:
        - 'Estimate Invoice Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  description: 'The ID of the estimate or invoice to update.'
                  example: 5
                type:
                  type: string
                  description: 'The type of the document. Accepted values: estimate, invoice.'
                  example: invoice
                client_id:
                  type: integer
                  description: 'The client ID associated with this document.'
                  example: 2
                name:
                  type: string
                  description: 'The name or title of the document.'
                  example: 'Invoice April 2024'
                address:
                  type: string
                  description: 'The billing address.'
                  example: '123 Main St'
                city:
                  type: string
                  description: 'The city name.'
                  example: 'New York'
                state:
                  type: string
                  description: 'The state name.'
                  example: NY
                country:
                  type: string
                  description: 'The country name.'
                  example: USA
                zip_code:
                  type: string
                  description: 'The postal/zip code.'
                  example: '10001'
                phone:
                  type: string
                  description: 'The phone number.'
                  example: '+1 1234567890'
                note:
                  type: string
                  description: 'Additional notes.'
                  example: 'Payment due within 15 days'
                personal_note:
                  type: string
                  description: 'A personal/internal note.'
                  example: 'Send reminder after 10 days'
                from_date:
                  type: date
                  description: 'The start date for the invoice or estimate.'
                  example: '2024-04-01'
                to_date:
                  type: date
                  description: 'The end date for the invoice or estimate.'
                  example: '2024-04-30'
                status:
                  type: string
                  description: 'The status of the document depending on its type. For invoice: not_specified, partially_paid, fully_paid, draft, cancelled, due. For estimate: not_specified, sent, accepted, draft, declined, expired.'
                  example: due
                total:
                  type: string
                  description: 'The total before tax.'
                  example: '1000.00'
                tax_amount:
                  type: string
                  description: 'The tax amount.'
                  example: '100.00'
                final_total:
                  type: string
                  description: 'The final total after tax.'
                  example: '1100.00'
                item:
                  type: array
                  description: 'List of item IDs.'
                  example:
                    - 1
                    - 2
                    - 3
                  items:
                    type: string
                quantity:
                  type: object
                  description: ''
                  example:
                    '*': '[2, 1, 3]'
                  properties:
                    '*':
                      type: numeric
                      description: 'Quantity for each item.'
                      example: '[2, 1, 3]'
                unit:
                  type: object
                  description: ''
                  example:
                    '*': 0
                  properties:
                    '*':
                      type: integer
                      description: 'Unit ID for each item.'
                      example: 0
                rate:
                  type: object
                  description: ''
                  example:
                    '*': '["500.00", "200.00", "100.00"]'
                  properties:
                    '*':
                      type: string
                      description: 'Rate for each item.'
                      example: '["500.00", "200.00", "100.00"]'
                tax:
                  type: object
                  description: ''
                  example:
                    '*': 0
                  properties:
                    '*':
                      type: integer
                      description: 'Tax ID for each item.'
                      example: 0
                amount:
                  type: object
                  description: ''
                  example:
                    '*': '["1000.00", "200.00", "300.00"]'
                  properties:
                    '*':
                      type: string
                      description: 'Calculated amount for each item.'
                      example: '["1000.00", "200.00", "300.00"]'
              required:
                - id
                - type
                - client_id
                - name
                - from_date
                - to_date
                - total
                - final_total
  '/api/estimates-invoices/destroy/{id}':
    delete:
      summary: 'Remove the specified estimate invoice.'
      operationId: removeTheSpecifiedEstimateInvoice
      description: 'This endpoint deletes a estimate invoice based on the provided ID. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Estimate Invoice deleted successfully.'
                      id: 1
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Estimate Invoice deleted successfully.'
                      id:
                        type: integer
                        example: 1
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Estimate Invoice not found.'
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Estimate Invoice not found.'
                      data:
                        type: array
                        example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while deleting the Estimate Invoice.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while deleting the Estimate Invoice.'
      tags:
        - 'Estimate Invoice Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the todo to be deleted.'
        example: 1
        required: true
        schema:
          type: integer
  /api/allowances/store:
    post:
      summary: 'Create a new allowance.'
      operationId: createANewAllowance
      description: 'This endpoint creates a new allowance with the given title and amount. The user must be authenticated to perform this action. The request can be made via API or non-API calls, with an optional `isApi` parameter to format the response accordingly.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Allowance created successfully.'
                  data:
                    id: 6
                    title: 'Transport Allowance'
                    amount: '$1,500.00'
                    created_at: '01 Dec 2024'
                    updated_at: '15:45:22'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Allowance created successfully.'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 6
                      title:
                        type: string
                        example: 'Transport Allowance'
                      amount:
                        type: string
                        example: '$1,500.00'
                      created_at:
                        type: string
                        example: '01 Dec 2024'
                      updated_at:
                        type: string
                        example: '15:45:22'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    title:
                      - 'The title field is required.'
                    amount:
                      - 'The amount format is invalid.'
                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
                      amount:
                        type: array
                        example:
                          - 'The amount format is invalid.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: "Allowance couldn't created."
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: "Allowance couldn't created."
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'An error occurred'
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'An error occurred'
                      data:
                        type: array
                        example: []
      tags:
        - 'Allowance Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: 'The title of the allowance. Must be unique.'
                  example: 'Transport Allowance'
                amount:
                  type: string
                  description: 'The amount in currency format.'
                  example: '1500.00'
              required:
                - title
                - amount
  /api/allowances/update:
    post:
      summary: 'Update an existing allowance.'
      operationId: updateAnExistingAllowance
      description: 'This endpoint allows you to update the title and amount of an existing allowance. The user must be authenticated and authorized to perform this action. The title must remain unique across all allowances. The request can be made via API or non-API calls, with an optional `isApi` parameter to format the response accordingly.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Allowance updated successfully.'
                  data:
                    id: 5
                    title: 'Housing Allowance'
                    amount: '$1,200.00'
                    created_at: '01 Dec 2024'
                    updated_at: '16:30:45'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Allowance updated successfully.'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 5
                      title:
                        type: string
                        example: 'Housing Allowance'
                      amount:
                        type: string
                        example: '$1,200.00'
                      created_at:
                        type: string
                        example: '01 Dec 2024'
                      updated_at:
                        type: string
                        example: '16:30:45'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Allowance not found!'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Allowance not found!'
                  data:
                    type: array
                    example: []
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    title:
                      - 'The title has already been taken.'
                    amount:
                      - 'The amount format is invalid.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      title:
                        type: array
                        example:
                          - 'The title has already been taken.'
                        items:
                          type: string
                      amount:
                        type: array
                        example:
                          - 'The amount format is invalid.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: "Allowance couldn't updated."
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: "Allowance couldn't updated."
                      data:
                        type: array
                        example: []
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'An error occurred'
                      data: []
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'An error occurred'
                      data:
                        type: array
                        example: []
      tags:
        - 'Allowance Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  description: 'The ID of the allowance to update. Must exist in the `allowances` table.'
                  example: 5
                title:
                  type: string
                  description: 'The title of the allowance. Must be unique in the `allowances` table.'
                  example: 'Housing Allowance'
                amount:
                  type: string
                  description: 'The amount of the allowance. Must be a valid currency format.'
                  example: '1200.00'
              required:
                - id
                - title
                - amount
  /api/allowances/list:
    get:
      summary: 'Get allowances list'
      operationId: getAllowancesList
      description: 'This endpoint returns a filtered and limited list of allowances, specifically formatted for API use. The user must be authenticated to perform this action. This endpoint provides search, sort, and limit functionality optimized for API consumers.'
      parameters:
        -
          in: query
          name: search
          description: 'optional Search by ID, title, or amount.'
          example: Bonus
          required: false
          schema:
            type: string
            description: 'optional Search by ID, title, or amount.'
            example: Bonus
        -
          in: query
          name: sort
          description: 'optional Column to sort by. Defaults to "id".'
          example: amount
          required: false
          schema:
            type: string
            description: 'optional Column to sort by. Defaults to "id".'
            example: amount
        -
          in: query
          name: order
          description: 'optional Sort order: ASC or DESC. Defaults to "DESC".'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional Sort order: ASC or DESC. Defaults to "DESC".'
            example: ASC
        -
          in: query
          name: limit
          description: 'optional Maximum number of records to return. Defaults to 10.'
          example: 5
          required: false
          schema:
            type: integer
            description: 'optional Maximum number of records to return. Defaults to 10.'
            example: 5
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Allowances retrieved successfully.'
                  total: 2
                  data:
                    -
                      id: 1
                      title: Bonus
                      amount: $500.00
                      created_at: '01 Dec 2024'
                      updated_at: '10:30:15'
                    -
                      id: 2
                      title: Medical
                      amount: $300.00
                      created_at: '01 Dec 2024'
                      updated_at: '11:45:22'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Allowances retrieved successfully.'
                  total:
                    type: integer
                    example: 2
                  data:
                    type: array
                    example:
                      -
                        id: 1
                        title: Bonus
                        amount: $500.00
                        created_at: '01 Dec 2024'
                        updated_at: '10:30:15'
                      -
                        id: 2
                        title: Medical
                        amount: $300.00
                        created_at: '01 Dec 2024'
                        updated_at: '11:45:22'
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        title:
                          type: string
                          example: Bonus
                        amount:
                          type: string
                          example: $500.00
                        created_at:
                          type: string
                          example: '01 Dec 2024'
                        updated_at:
                          type: string
                          example: '10:30:15'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred'
                  data:
                    type: array
                    example: []
      tags:
        - 'Allowance Management'
  '/api/allowances/get/{id}':
    get:
      summary: "Retrieve an allowance's details."
      operationId: retrieveAnAllowancesDetails
      description: 'This endpoint fetches detailed information about a specific allowance by its ID. The user must be authenticated to perform this action. The request can be made via API or non-API calls, with an optional `isApi` parameter to format the response accordingly.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Allowance retrieved successfully.'
                  data:
                    id: 5
                    title: 'Fuel Allowance'
                    amount: $200.00
                    created_at: '01 Dec 2024'
                    updated_at: '10:30:15'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Allowance retrieved successfully.'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 5
                      title:
                        type: string
                        example: 'Fuel Allowance'
                      amount:
                        type: string
                        example: $200.00
                      created_at:
                        type: string
                        example: '01 Dec 2024'
                      updated_at:
                        type: string
                        example: '10:30:15'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Allowance not found!'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Allowance not found!'
                  data:
                    type: array
                    example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred'
                  data:
                    type: array
                    example: []
      tags:
        - 'Allowance Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the allowance to retrieve. Must exist in the `allowances` table.'
        example: 5
        required: true
        schema:
          type: integer
  '/api/allowances/destroy/{id}':
    delete:
      summary: 'Delete an allowance.'
      operationId: deleteAnAllowance
      description: 'This endpoint deletes a specific allowance by its ID and automatically detaches any related payslips. The user must be authenticated and authorized to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Allowance deleted successfully.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Allowance deleted successfully.'
                  data:
                    type: array
                    example: []
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Allowance not found!'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Allowance not found!'
                  data:
                    type: array
                    example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred'
                  data:
                    type: array
                    example: []
      tags:
        - 'Allowance Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the allowance to delete. Must exist in the `allowances` table.'
        example: 7
        required: true
        schema:
          type: integer
  /api/candidate/store:
    post:
      summary: 'Create a new candidate.'
      operationId: createANewCandidate
      description: 'This endpoint creates a new candidate record with optional file attachments. The user must be authenticated to perform this action. The request validates candidate details and ensures the email is unique.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Candidate Created Successfully!'
                  data:
                    id: 101
                    name: 'John Doe'
                    email: john.doe@example.com
                    phone: '+1234567890'
                    position: 'Software Engineer'
                    source: LinkedIn
                    status_id: 1
                    created_at: '2025-05-15 15:55:00'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Candidate Created Successfully!'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 101
                      name:
                        type: string
                        example: 'John Doe'
                      email:
                        type: string
                        example: john.doe@example.com
                      phone:
                        type: string
                        example: '+1234567890'
                      position:
                        type: string
                        example: 'Software Engineer'
                      source:
                        type: string
                        example: LinkedIn
                      status_id:
                        type: integer
                        example: 1
                      created_at:
                        type: string
                        example: '2025-05-15 15:55:00'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'A candidate with this email already exists.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'A candidate with this email already exists.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while creating the candidate.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while creating the candidate.'
      tags:
        - 'Candidate Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The name of the candidate. Maximum length is 255 characters.'
                  example: 'John Doe'
                email:
                  type: string
                  description: 'The email address of the candidate. Must be a valid email and unique in the `candidates` table.'
                  example: john.doe@example.com
                phone:
                  type: string
                  description: 'nullable The phone number of the candidate. Maximum length is 15 characters.'
                  example: '+1234567890'
                position:
                  type: string
                  description: 'The position the candidate is applying for. Maximum length is 255 characters.'
                  example: 'Software Engineer'
                source:
                  type: string
                  description: 'The source of the candidate (e.g., LinkedIn, Job Board). Maximum length is 255 characters.'
                  example: LinkedIn
                status_id:
                  type: integer
                  description: "The ID of the candidate's status. Must exist in the `candidate_statuses` table."
                  example: 1
                attachments:
                  type: array
                  description: 'nullable An array of files to upload. Each file must be a valid type (pdf, doc, docx, jpg, jpeg, png) and not exceed the maximum size (configured in media-library.max_file_size).'
                  example: null
                  items:
                    type: string
              required:
                - name
                - email
                - position
                - source
                - status_id
  '/api/candidate/update/{id}':
    post:
      summary: "Update a candidate's details."
      operationId: updateACandidatesDetails
      description: 'This endpoint updates the details of an existing candidate, with optional file attachments. The user must be authenticated to perform this action. The request validates candidate details and ensures the email remains unique.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Candidate Created Successfully!'
                  data:
                    id: 101
                    name: 'John Doe'
                    email: john.doe@example.com
                    phone: '+1234567890'
                    position: 'Software Engineer'
                    source: LinkedIn
                    status_id: 1
                    updated_at: '2025-05-15 16:00:00'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Candidate Created Successfully!'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 101
                      name:
                        type: string
                        example: 'John Doe'
                      email:
                        type: string
                        example: john.doe@example.com
                      phone:
                        type: string
                        example: '+1234567890'
                      position:
                        type: string
                        example: 'Software Engineer'
                      source:
                        type: string
                        example: LinkedIn
                      status_id:
                        type: integer
                        example: 1
                      updated_at:
                        type: string
                        example: '2025-05-15 16:00:00'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Candidate not found'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Candidate not found'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'The email field must be a valid email address.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'The email field must be a valid email address.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while updating the candidate.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while updating the candidate.'
      tags:
        - 'Candidate Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The name of the candidate. Maximum length is 255 characters.'
                  example: 'John Doe'
                email:
                  type: string
                  description: 'The email address of the candidate. Must be a valid email and unique in the `candidates` table (except for the current candidate).'
                  example: john.doe@example.com
                phone:
                  type: string
                  description: 'nullable The phone number of the candidate. Maximum length is 15 characters.'
                  example: '+1234567890'
                position:
                  type: string
                  description: 'The position the candidate is applying for. Maximum length is 255 characters.'
                  example: 'Software Engineer'
                source:
                  type: string
                  description: 'The source of the candidate (e.g., LinkedIn, Job Board). Maximum length is 255 characters.'
                  example: LinkedIn
                status_id:
                  type: integer
                  description: "The ID of the candidate's status. Must exist in the `candidate_statuses` table."
                  example: 1
                attachments:
                  type: array
                  description: 'nullable An array of files to upload. Each file must be a valid type (pdf, doc, docx, jpg, jpeg, png) and not exceed the maximum size (configured in media-library.max_file_size).'
                  example: null
                  items:
                    type: string
              required:
                - name
                - email
                - position
                - source
                - status_id
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the candidate to update. Must exist in the `candidates` table.'
        example: 101
        required: true
        schema:
          type: integer
  '/api/candidate/{id}/update_status':
    post:
      summary: "Update a candidate's status."
      operationId: updateACandidatesStatus
      description: 'This endpoint updates the status of a specific candidate. The user must be authenticated to perform this action. The request requires a valid status ID.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Candidate Status Updated Successfully!'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Candidate Status Updated Successfully!'
                  data:
                    type: array
                    example: []
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Candidate not found'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Candidate not found'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'The status_id field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'The status_id field is required.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while updating the candidate status.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while updating the candidate status.'
      tags:
        - 'Candidate Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                status_id:
                  type: integer
                  description: 'The ID of the new status. Must exist in the `candidate_statuses` table.'
                  example: 2
              required:
                - status_id
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the candidate to update. Must exist in the `candidates` table.'
        example: 101
        required: true
        schema:
          type: integer
  '/api/candidate/destroy/{id}':
    delete:
      summary: 'Delete a candidate.'
      operationId: deleteACandidate
      description: 'This endpoint deletes a specific candidate record. The user must be authenticated and have appropriate permissions to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Candidate deleted successfully!'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Candidate deleted successfully!'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Candidate not found'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Candidate not found'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while deleting the candidate.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while deleting the candidate.'
      tags:
        - 'Candidate Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the candidate to delete. Must exist in the `candidates` table.'
        example: 101
        required: true
        schema:
          type: integer
  '/api/candidate/list/{id}':
    get:
      summary: 'List candidates or retrieve a single candidate.'
      operationId: listCandidatesOrRetrieveASingleCandidate
      description: 'This endpoint retrieves a paginated list of candidates or a single candidate by ID, with optional search, sorting, and status filtering. The user must be authenticated to perform this action. The response includes permission details for editing and deletion.'
      parameters:
        -
          in: query
          name: search
          description: 'optional Filters candidates by name, position, source, or status name.'
          example: John
          required: false
          schema:
            type: string
            description: 'optional Filters candidates by name, position, source, or status name.'
            example: John
        -
          in: query
          name: sort
          description: 'optional The field to sort by (id, newest, oldest, recently-updated, earliest-updated). Defaults to id.'
          example: newest
          required: false
          schema:
            type: string
            description: 'optional The field to sort by (id, newest, oldest, recently-updated, earliest-updated). Defaults to id.'
            example: newest
        -
          in: query
          name: limit
          description: 'optional The number of candidates per page (1-100). Defaults to 10.'
          example: 20
          required: false
          schema:
            type: integer
            description: 'optional The number of candidates per page (1-100). Defaults to 10.'
            example: 20
        -
          in: query
          name: offset
          description: 'optional The number of candidates to skip. Defaults to 0.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional The number of candidates to skip. Defaults to 0.'
            example: 10
        -
          in: query
          name: candidate_status
          description: 'optional Filters candidates by status IDs. Each ID must exist in the `candidate_statuses` table.'
          example:
            - 1
            - 2
          required: false
          schema:
            type: array
            description: 'optional Filters candidates by status IDs. Each ID must exist in the `candidate_statuses` table.'
            example:
              - 1
              - 2
            items:
              type: string
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Candidates retrieved successfully.'
                  total: 50
                  data:
                    -
                      id: 101
                      name: 'John Doe'
                      email: john.doe@example.com
                      phone: '+1234567890'
                      position: 'Software Engineer'
                      source: LinkedIn
                      status:
                        id: 1
                        name: Applied
                      can_edit: true
                      can_delete: true
                  permissions:
                    can_edit: true
                    can_delete: true
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Candidates retrieved successfully.'
                  total:
                    type: integer
                    example: 50
                  data:
                    type: array
                    example:
                      -
                        id: 101
                        name: 'John Doe'
                        email: john.doe@example.com
                        phone: '+1234567890'
                        position: 'Software Engineer'
                        source: LinkedIn
                        status:
                          id: 1
                          name: Applied
                        can_edit: true
                        can_delete: true
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 101
                        name:
                          type: string
                          example: 'John Doe'
                        email:
                          type: string
                          example: john.doe@example.com
                        phone:
                          type: string
                          example: '+1234567890'
                        position:
                          type: string
                          example: 'Software Engineer'
                        source:
                          type: string
                          example: LinkedIn
                        status:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1
                            name:
                              type: string
                              example: Applied
                        can_edit:
                          type: boolean
                          example: true
                        can_delete:
                          type: boolean
                          example: true
                  permissions:
                    type: object
                    properties:
                      can_edit:
                        type: boolean
                        example: true
                      can_delete:
                        type: boolean
                        example: true
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Candidate not found.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Candidate not found.'
                  data:
                    type: array
                    example: []
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation failed: The search field must be a string.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation failed: The search field must be a string.'
                  data:
                    type: array
                    example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred.'
                  data:
                    type: array
                    example: []
      tags:
        - 'Candidate Management'
    parameters:
      -
        in: path
        name: id
        description: 'Optional parameter. optional The ID of the candidate to retrieve. If provided, returns a single candidate. Must exist in the `candidates` table.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 101
  '/api/candidate/{id}/interviews':
    get:
      summary: "Retrieve a candidate's interview details."
      operationId: retrieveACandidatesInterviewDetails
      description: 'This endpoint fetches the interview details for a specific candidate, including a rendered HTML partial for display. The user must be authenticated to perform this action. The request can be made via API or non-API calls, with an optional `isApi` parameter to format the response.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Interview details retrieved successfully!'
                  data:
                    candidate:
                      id: 101
                      name: 'John Doe'
                      email: john.doe@example.com
                      phone: '+1234567890'
                      position: 'Software Engineer'
                      source: LinkedIn
                      status_id: 1
                    html: '<div>...</div>'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Interview details retrieved successfully!'
                  data:
                    type: object
                    properties:
                      candidate:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 101
                          name:
                            type: string
                            example: 'John Doe'
                          email:
                            type: string
                            example: john.doe@example.com
                          phone:
                            type: string
                            example: '+1234567890'
                          position:
                            type: string
                            example: 'Software Engineer'
                          source:
                            type: string
                            example: LinkedIn
                          status_id:
                            type: integer
                            example: 1
                      html:
                        type: string
                        example: '<div>...</div>'
        400:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Invalid candidate ID!'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Invalid candidate ID!'
                  data:
                    type: array
                    example: []
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Candidate not found!'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Candidate not found!'
                  data:
                    type: array
                    example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred!'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred!'
                  data:
                    type: array
                    example: []
      tags:
        - 'Candidate Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the candidate whose interview details are to be retrieved. Must exist in the `candidates` table.'
        example: 101
        required: true
        schema:
          type: integer
  '/api/candidate/{id}/upload-attachment':
    post:
      summary: 'Upload attachments for a candidate.'
      operationId: uploadAttachmentsForACandidate
      description: 'This endpoint allows uploading one or more files as attachments for a specific candidate. The user must be authenticated to perform this action. The files must be of allowed types (PDF, DOC, DOCX, JPG, JPEG, PNG) and within the configured size limit.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Files uploaded successfully!'
                  data:
                    -
                      id: 1
                      name: resume-1623456789_1234.pdf
                      collection_name: candidate-media
                      mime_type: application/pdf
                      size: 512
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Files uploaded successfully!'
                  data:
                    type: array
                    example:
                      -
                        id: 1
                        name: resume-1623456789_1234.pdf
                        collection_name: candidate-media
                        mime_type: application/pdf
                        size: 512
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        name:
                          type: string
                          example: resume-1623456789_1234.pdf
                        collection_name:
                          type: string
                          example: candidate-media
                        mime_type:
                          type: string
                          example: application/pdf
                        size:
                          type: integer
                          example: 512
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Candidate not found'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Candidate not found'
                  data:
                    type: array
                    example: []
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation failed: The attachments must be a file of type: pdf, doc, docx, jpg, jpeg, png.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation failed: The attachments must be a file of type: pdf, doc, docx, jpg, jpeg, png.'
                  data:
                    type: array
                    example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred'
                  data:
                    type: array
                    example: []
      tags:
        - 'Candidate Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                attachments:
                  type: array
                  description: 'An array of files to upload. Each file must be a valid type (pdf, doc, docx, jpg, jpeg, png) and not exceed the maximum size (configured in media-library.max_file_size).'
                  example: null
                  items:
                    type: string
              required:
                - attachments
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the candidate to associate the attachments with. Must exist in the `candidates` table.'
        example: 101
        required: true
        schema:
          type: integer
  '/api/candidate/candidate-media/destroy/{id}':
    delete:
      summary: "Delete a candidate's attachment."
      operationId: deleteACandidatesAttachment
      description: 'This endpoint deletes a specific media attachment associated with a candidate. The user must be authenticated and have appropriate permissions to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Attachment deleted successfully!'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Attachment deleted successfully!'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Attachment not found'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Attachment not found'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while deleting the attachment.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while deleting the attachment.'
      tags:
        - 'Candidate Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the media attachment to delete. Must exist in the `media` table.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/candidate/{id}/attachments/list':
    get:
      summary: 'List attachments for a candidate.'
      operationId: listAttachmentsForACandidate
      description: 'This endpoint retrieves a paginated list of media attachments for a specific candidate, with optional search, sorting, and pagination parameters. The user must be authenticated to perform this action. The response includes permission details for deletion.'
      parameters:
        -
          in: query
          name: search
          description: 'optional Filters attachments by name or mime type.'
          example: resume
          required: false
          schema:
            type: string
            description: 'optional Filters attachments by name or mime type.'
            example: resume
        -
          in: query
          name: sort
          description: 'optional The field to sort by (id, name, mime_type, size, created_at). Defaults to id.'
          example: name
          required: false
          schema:
            type: string
            description: 'optional The field to sort by (id, name, mime_type, size, created_at). Defaults to id.'
            example: name
        -
          in: query
          name: order
          description: 'optional The sort order (ASC, DESC). Defaults to DESC.'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional The sort order (ASC, DESC). Defaults to DESC.'
            example: ASC
        -
          in: query
          name: limit
          description: 'optional The number of attachments per page (1-100). Defaults to 10.'
          example: 20
          required: false
          schema:
            type: integer
            description: 'optional The number of attachments per page (1-100). Defaults to 10.'
            example: 20
        -
          in: query
          name: offset
          description: 'optional The number of attachments to skip. Defaults to 0.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional The number of attachments to skip. Defaults to 0.'
            example: 10
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Attachments retrieved successfully.'
                  data:
                    total: 2
                    data:
                      -
                        id: 1
                        name: resume.pdf
                        mime_type: application/pdf
                        size: '512.34 KB'
                        created_at: '15 May 2025'
                        download_url: 'https://example.com/candidate/101/attachment/1/download'
                        view_url: 'https://example.com/candidate/101/attachment/1/view'
                        can_delete: true
                    permissions:
                      can_delete: true
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Attachments retrieved successfully.'
                  data:
                    type: object
                    properties:
                      total:
                        type: integer
                        example: 2
                      data:
                        type: array
                        example:
                          -
                            id: 1
                            name: resume.pdf
                            mime_type: application/pdf
                            size: '512.34 KB'
                            created_at: '15 May 2025'
                            download_url: 'https://example.com/candidate/101/attachment/1/download'
                            view_url: 'https://example.com/candidate/101/attachment/1/view'
                            can_delete: true
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1
                            name:
                              type: string
                              example: resume.pdf
                            mime_type:
                              type: string
                              example: application/pdf
                            size:
                              type: string
                              example: '512.34 KB'
                            created_at:
                              type: string
                              example: '15 May 2025'
                            download_url:
                              type: string
                              example: 'https://example.com/candidate/101/attachment/1/download'
                            view_url:
                              type: string
                              example: 'https://example.com/candidate/101/attachment/1/view'
                            can_delete:
                              type: boolean
                              example: true
                      permissions:
                        type: object
                        properties:
                          can_delete:
                            type: boolean
                            example: true
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Candidate not found.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Candidate not found.'
                  data:
                    type: array
                    example: []
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation failed: The search field must be a string.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation failed: The search field must be a string.'
                  data:
                    type: array
                    example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred.'
                  data:
                    type: array
                    example: []
      tags:
        - 'Candidate Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the candidate whose attachments are to be listed. Must exist in the `candidates` table.'
        example: 101
        required: true
        schema:
          type: integer
  '/api/candidate/{candidateId}/attachment/{mediaId}/download':
    get:
      summary: "Download a candidate's attachment."
      operationId: downloadACandidatesAttachment
      description: 'This endpoint allows downloading a specific media attachment associated with a candidate. The user must be authenticated to perform this action. The response is a file download stream.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Indicates if the response should be formatted for API use (returns JSON error if applicable). Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Indicates if the response should be formatted for API use (returns JSON error if applicable). Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  content_type: application/pdf
                  disposition: 'attachment; filename=resume.pdf'
                properties:
                  content_type:
                    type: string
                    example: application/pdf
                  disposition:
                    type: string
                    example: 'attachment; filename=resume.pdf'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Candidate not found'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Candidate not found'
                  data:
                    type: array
                    example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred'
                  data:
                    type: array
                    example: []
      tags:
        - 'Candidate Management'
    parameters:
      -
        in: path
        name: candidateId
        description: 'The ID of the candidate associated with the attachment. Must exist in the `candidates` table.'
        example: 101
        required: true
        schema:
          type: integer
      -
        in: path
        name: mediaId
        description: 'The ID of the media attachment to download. Must exist in the `media` table.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/candidate/{candidateId}/attachment/{mediaId}/view':
    get:
      summary: "View a candidate's attachment."
      operationId: viewACandidatesAttachment
      description: 'This endpoint allows viewing a specific media attachment associated with a candidate, if the file type is supported (PDF, DOC, DOCX, JPG, JPEG, PNG). The user must be authenticated to perform this action. The response is a file stream for viewable files or an error for unsupported types.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Indicates if the response should be formatted for API use (returns JSON error if applicable). Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Indicates if the response should be formatted for API use (returns JSON error if applicable). Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  content_type: application/pdf
                  disposition: inline
                properties:
                  content_type:
                    type: string
                    example: application/pdf
                  disposition:
                    type: string
                    example: inline
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Candidate not found'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Candidate not found'
                  data:
                    type: array
                    example: []
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'File type not supported for viewing'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'File type not supported for viewing'
                  data:
                    type: array
                    example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred'
                  data:
                    type: array
                    example: []
      tags:
        - 'Candidate Management'
    parameters:
      -
        in: path
        name: candidateId
        description: 'The ID of the candidate associated with the attachment. Must exist in the `candidates` table.'
        example: 101
        required: true
        schema:
          type: integer
      -
        in: path
        name: mediaId
        description: 'The ID of the media attachment to view. Must exist in the `media` table.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/candidate/{id}/quick-view':
    get:
      summary: "Retrieve a candidate's details."
      operationId: retrieveACandidatesDetails
      description: 'This endpoint fetches detailed information about a specific candidate, including their status, interviews, and media attachments. The user must be authenticated to perform this action. The request can be made via API or non-API calls, with an optional `isApi` parameter to format the response accordingly.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Candidate details retrieved successfully!'
                  data:
                    candidate:
                      id: 101
                      name: 'John Doe'
                      email: john.doe@example.com
                      phone: '+1234567890'
                      position: 'Software Engineer'
                      source: LinkedIn
                      status: Applied
                      created_at: '15 May 2025'
                      avatar: 'https://example.com/storage/candidate-media/avatar.jpg'
                    attachments:
                      -
                        id: 1
                        name: resume.pdf
                        type: application/pdf
                        size: '512.34 KB'
                        created_at: '15 May 2025'
                        url: 'https://example.com/storage/candidate-media/resume.pdf'
                        is_image: false
                    interviews:
                      -
                        id: 1
                        candidate_name: 'John Doe'
                        interviewer: 'Jane Smith'
                        round: Technical
                        scheduled_at: '2025-05-20 10:00:00'
                        status: Scheduled
                        location: Online
                        mode: Video
                        created_at: '15 May 2025'
                        updated_at: '15 May 2025'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Candidate details retrieved successfully!'
                  data:
                    type: object
                    properties:
                      candidate:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 101
                          name:
                            type: string
                            example: 'John Doe'
                          email:
                            type: string
                            example: john.doe@example.com
                          phone:
                            type: string
                            example: '+1234567890'
                          position:
                            type: string
                            example: 'Software Engineer'
                          source:
                            type: string
                            example: LinkedIn
                          status:
                            type: string
                            example: Applied
                          created_at:
                            type: string
                            example: '15 May 2025'
                          avatar:
                            type: string
                            example: 'https://example.com/storage/candidate-media/avatar.jpg'
                      attachments:
                        type: array
                        example:
                          -
                            id: 1
                            name: resume.pdf
                            type: application/pdf
                            size: '512.34 KB'
                            created_at: '15 May 2025'
                            url: 'https://example.com/storage/candidate-media/resume.pdf'
                            is_image: false
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1
                            name:
                              type: string
                              example: resume.pdf
                            type:
                              type: string
                              example: application/pdf
                            size:
                              type: string
                              example: '512.34 KB'
                            created_at:
                              type: string
                              example: '15 May 2025'
                            url:
                              type: string
                              example: 'https://example.com/storage/candidate-media/resume.pdf'
                            is_image:
                              type: boolean
                              example: false
                      interviews:
                        type: array
                        example:
                          -
                            id: 1
                            candidate_name: 'John Doe'
                            interviewer: 'Jane Smith'
                            round: Technical
                            scheduled_at: '2025-05-20 10:00:00'
                            status: Scheduled
                            location: Online
                            mode: Video
                            created_at: '15 May 2025'
                            updated_at: '15 May 2025'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1
                            candidate_name:
                              type: string
                              example: 'John Doe'
                            interviewer:
                              type: string
                              example: 'Jane Smith'
                            round:
                              type: string
                              example: Technical
                            scheduled_at:
                              type: string
                              example: '2025-05-20 10:00:00'
                            status:
                              type: string
                              example: Scheduled
                            location:
                              type: string
                              example: Online
                            mode:
                              type: string
                              example: Video
                            created_at:
                              type: string
                              example: '15 May 2025'
                            updated_at:
                              type: string
                              example: '15 May 2025'
        400:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Candidate ID not found.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Candidate ID not found.'
                  data:
                    type: array
                    example: []
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Candidate not found!'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Candidate not found!'
                  data:
                    type: array
                    example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred'
                  data:
                    type: array
                    example: []
      tags:
        - 'Candidate Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the candidate to retrieve. Must exist in the `candidates` table.'
        example: 101
        required: true
        schema:
          type: integer
  /api/candidate_status/store:
    post:
      summary: 'Create a new candidate status.'
      operationId: createANewCandidateStatus
      description: 'This endpoint creates a new candidate status with a specified name and color. The user must be authenticated to perform this action. The status is automatically assigned an order based on the highest existing order plus one.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Candidate status retrieved successfully!'
                  data:
                    id: 1
                    name: Interviewing
                    color: primary
                    order: 1
                    created_at: '2025-05-15 16:11:00'
                    updated_at: '2025-05-15 16:11:00'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Candidate status retrieved successfully!'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: Interviewing
                      color:
                        type: string
                        example: primary
                      order:
                        type: integer
                        example: 1
                      created_at:
                        type: string
                        example: '2025-05-15 16:11:00'
                      updated_at:
                        type: string
                        example: '2025-05-15 16:11:00'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'The name field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'The name field is required.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while creating the candidate status.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while creating the candidate status.'
      tags:
        - 'Candidate Status Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The name of the candidate status. Maximum length is 255 characters.'
                  example: Interviewing
                color:
                  type: string
                  description: 'The color associated with the status (e.g., primary, success).'
                  example: primary
              required:
                - name
                - color
  '/api/candidate_status/update/{id}':
    post:
      summary: 'Update a candidate status.'
      operationId: updateACandidateStatus
      description: 'This endpoint updates the name and color of an existing candidate status. The user must be authenticated to perform this action.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Candidate status updated successfully!'
                  data:
                    id: 1
                    name: Interviewing
                    color: success
                    order: 1
                    created_at: '2025-05-15 16:11:00'
                    updated_at: '2025-05-15 16:12:00'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Candidate status updated successfully!'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: Interviewing
                      color:
                        type: string
                        example: success
                      order:
                        type: integer
                        example: 1
                      created_at:
                        type: string
                        example: '2025-05-15 16:11:00'
                      updated_at:
                        type: string
                        example: '2025-05-15 16:12:00'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Candidate status not found'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Candidate status not found'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'The name field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'The name field is required.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while updating the candidate status.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while updating the candidate status.'
      tags:
        - 'Candidate Status Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The name of the candidate status. Maximum length is 255 characters.'
                  example: Interviewing
                color:
                  type: string
                  description: 'optional The color associated with the status (e.g., primary, success).'
                  example: success
              required:
                - name
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the candidate status to update. Must exist in the `candidate_statuses` table.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/candidate_status/destroy/{id}':
    delete:
      summary: 'Delete a candidate status.'
      operationId: deleteACandidateStatus
      description: 'This endpoint deletes a specific candidate status. The user must be authenticated and have appropriate permissions. The status cannot be deleted if it is assigned to one or more candidates.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Candidate Status deleted successfully!'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Candidate Status deleted successfully!'
        400:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Cannot delete. This status is assigned to one or more candidates.'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Cannot delete. This status is assigned to one or more candidates.'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Candidate status not found'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Candidate status not found'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while deleting the candidate status.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while deleting the candidate status.'
      tags:
        - 'Candidate Status Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the candidate status to delete. Must exist in the `candidate_statuses` table.'
        example: 1
        required: true
        schema:
          type: integer
  /api/candidate_status/reorder:
    post:
      summary: 'Reorder candidate statuses.'
      operationId: reorderCandidateStatuses
      description: 'This endpoint updates the order of candidate statuses based on the provided array of IDs and positions. The user must be authenticated to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Order updated successfully!'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Order updated successfully!'
                  data:
                    type: array
                    example: []
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'The order field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'The order field is required.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while reordering the candidate statuses.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while reordering the candidate statuses.'
      tags:
        - 'Candidate Status Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                order:
                  type: array
                  description: 'An array of objects containing status IDs and their new positions.'
                  example:
                    -
                      id: 1
                      position: 1
                    -
                      id: 2
                      position: 2
                  items:
                    type: string
              required:
                - order
  '/api/candidate_status/list/{id}':
    get:
      summary: 'List candidate statuses or retrieve a single status.'
      operationId: listCandidateStatusesOrRetrieveASingleStatus
      description: 'This endpoint retrieves a paginated list of candidate statuses or a single status by ID, with optional search, sorting, and pagination parameters. The user must be authenticated to perform this action. The response includes permission details for editing and deletion.'
      parameters:
        -
          in: query
          name: search
          description: 'optional Filters statuses by name.'
          example: Interview
          required: false
          schema:
            type: string
            description: 'optional Filters statuses by name.'
            example: Interview
        -
          in: query
          name: sort
          description: 'optional The field to sort by (id, name, color, order, created_at, updated_at). Defaults to id.'
          example: name
          required: false
          schema:
            type: string
            description: 'optional The field to sort by (id, name, color, order, created_at, updated_at). Defaults to id.'
            example: name
        -
          in: query
          name: order
          description: 'optional The sort order (ASC, DESC). Defaults to DESC.'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional The sort order (ASC, DESC). Defaults to DESC.'
            example: ASC
        -
          in: query
          name: limit
          description: 'optional The number of statuses per page (1-100). Defaults to 10.'
          example: 20
          required: false
          schema:
            type: integer
            description: 'optional The number of statuses per page (1-100). Defaults to 10.'
            example: 20
        -
          in: query
          name: offset
          description: 'optional The number of statuses to skip. Defaults to 0.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional The number of statuses to skip. Defaults to 0.'
            example: 10
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Candidate statuses retreived successfully!'
                  data:
                    total: 5
                    data:
                      -
                        id: 1
                        name: Interviewing
                        color: primary
                        order: 1
                        created_at: '2025-05-15 16:11:00'
                        updated_at: '2025-05-15 16:11:00'
                        can_edit: true
                        can_delete: true
                    permissions:
                      can_edit: true
                      can_delete: true
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Candidate statuses retreived successfully!'
                  data:
                    type: object
                    properties:
                      total:
                        type: integer
                        example: 5
                      data:
                        type: array
                        example:
                          -
                            id: 1
                            name: Interviewing
                            color: primary
                            order: 1
                            created_at: '2025-05-15 16:11:00'
                            updated_at: '2025-05-15 16:11:00'
                            can_edit: true
                            can_delete: true
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1
                            name:
                              type: string
                              example: Interviewing
                            color:
                              type: string
                              example: primary
                            order:
                              type: integer
                              example: 1
                            created_at:
                              type: string
                              example: '2025-05-15 16:11:00'
                            updated_at:
                              type: string
                              example: '2025-05-15 16:11:00'
                            can_edit:
                              type: boolean
                              example: true
                            can_delete:
                              type: boolean
                              example: true
                      permissions:
                        type: object
                        properties:
                          can_edit:
                            type: boolean
                            example: true
                          can_delete:
                            type: boolean
                            example: true
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Candidate stutus not found.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Candidate stutus not found.'
                  data:
                    type: array
                    example: []
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation failed: The search field must be a string.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation failed: The search field must be a string.'
                  data:
                    type: array
                    example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred.'
                  data:
                    type: array
                    example: []
      tags:
        - 'Candidate Status Management'
    parameters:
      -
        in: path
        name: id
        description: 'Optional parameter. optional The ID of the candidate status to retrieve. If provided, returns a single status. Must exist in the `candidate_statuses` table.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/contracts/store:
    post:
      summary: 'Create a new contract.'
      operationId: createANewContract
      description: 'This endpoint creates a new contract with the specified details. The user must be authenticated to perform this action. If the user is a client, the client_id will be automatically set to their ID.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Contract created successfully.'
                  data:
                    id: 15
                    title: 'Web Development Contract'
                    value: '15000.00'
                    formatted_value: '$15,000.00'
                    start_date: '2024-01-01'
                    end_date: '2024-12-31'
                    client:
                      id: 5
                      name: 'John Doe'
                    project:
                      id: 12
                      title: 'Company Website'
                    contract_type:
                      id: 3
                      type: 'Fixed Price'
                    description: 'Full-stack web development project'
                    status: not_signed
                    created_at: '2024-01-15T10:30:00Z'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Contract created successfully.'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 15
                      title:
                        type: string
                        example: 'Web Development Contract'
                      value:
                        type: string
                        example: '15000.00'
                      formatted_value:
                        type: string
                        example: '$15,000.00'
                      start_date:
                        type: string
                        example: '2024-01-01'
                      end_date:
                        type: string
                        example: '2024-12-31'
                      client:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 5
                          name:
                            type: string
                            example: 'John Doe'
                      project:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 12
                          title:
                            type: string
                            example: 'Company Website'
                      contract_type:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 3
                          type:
                            type: string
                            example: 'Fixed Price'
                      description:
                        type: string
                        example: 'Full-stack web development project'
                      status:
                        type: string
                        example: not_signed
                      created_at:
                        type: string
                        example: '2024-01-15T10:30:00Z'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation failed.'
                  data:
                    title:
                      - 'The title field is required.'
                    value:
                      - 'The value field is required.'
                    start_date:
                      - 'The start date must be before end date.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation failed.'
                  data:
                    type: object
                    properties:
                      title:
                        type: array
                        example:
                          - 'The title field is required.'
                        items:
                          type: string
                      value:
                        type: array
                        example:
                          - 'The value field is required.'
                        items:
                          type: string
                      start_date:
                        type: array
                        example:
                          - 'The start date must be before end date.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred.'
                  data:
                    type: array
                    example: []
      tags:
        - 'Contract Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: 'The title of the contract.'
                  example: 'Web Development Contract'
                value:
                  type: string
                  description: 'The contract value in currency format. Must be a valid currency format.'
                  example: '15,000.00'
                start_date:
                  type: string
                  description: 'The start date of the contract. Format depends on API usage (Y-m-d for API, system format for web).'
                  example: '2024-01-01'
                end_date:
                  type: string
                  description: 'The end date of the contract. Must be after start_date.'
                  example: '2024-12-31'
                client_id:
                  type: integer
                  description: 'The ID of the client. Must exist in the clients table.'
                  example: 5
                project_id:
                  type: integer
                  description: 'The ID of the project. Must exist in the projects table.'
                  example: 12
                contract_type_id:
                  type: integer
                  description: 'The ID of the contract type. Must exist in the contract_types table.'
                  example: 3
                description:
                  type: string
                  description: 'optional Description of the contract.'
                  example: 'Full-stack web development project'
                isApi:
                  type: boolean
                  description: 'optional Set to true for API requests to handle date format properly.'
                  example: true
              required:
                - title
                - value
                - start_date
                - end_date
                - client_id
                - project_id
                - contract_type_id
  /api/contracts/update:
    post:
      summary: 'Update an existing contract.'
      operationId: updateAnExistingContract
      description: 'This endpoint updates an existing contract with new details. The user must be authenticated and have permission to edit contracts.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Contract updated successfully.'
                  data:
                    id: 15
                    title: 'Updated Web Development Contract'
                    value: '18000.00'
                    formatted_value: '$18,000.00'
                    start_date: '2024-01-01'
                    end_date: '2024-12-31'
                    client:
                      id: 5
                      name: 'John Doe'
                    project:
                      id: 12
                      title: 'Company Website'
                    contract_type:
                      id: 3
                      type: 'Fixed Price'
                    description: 'Updated full-stack web development project'
                    status: partially_signed
                    signed_pdf_url: storage/contracts/signed_contract_123.pdf
                    updated_at: '2024-01-20T14:45:00Z'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Contract updated successfully.'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 15
                      title:
                        type: string
                        example: 'Updated Web Development Contract'
                      value:
                        type: string
                        example: '18000.00'
                      formatted_value:
                        type: string
                        example: '$18,000.00'
                      start_date:
                        type: string
                        example: '2024-01-01'
                      end_date:
                        type: string
                        example: '2024-12-31'
                      client:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 5
                          name:
                            type: string
                            example: 'John Doe'
                      project:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 12
                          title:
                            type: string
                            example: 'Company Website'
                      contract_type:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 3
                          type:
                            type: string
                            example: 'Fixed Price'
                      description:
                        type: string
                        example: 'Updated full-stack web development project'
                      status:
                        type: string
                        example: partially_signed
                      signed_pdf_url:
                        type: string
                        example: storage/contracts/signed_contract_123.pdf
                      updated_at:
                        type: string
                        example: '2024-01-20T14:45:00Z'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Contract not found.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Contract not found.'
                  data:
                    type: array
                    example: []
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation failed.'
                  data:
                    signed_pdf:
                      - 'The file must be a PDF.'
                      - 'The file size must be less than 10 MB.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation failed.'
                  data:
                    type: object
                    properties:
                      signed_pdf:
                        type: array
                        example:
                          - 'The file must be a PDF.'
                          - 'The file size must be less than 10 MB.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred.'
                  data:
                    type: array
                    example: []
      tags:
        - 'Contract Management'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  description: 'The ID of the contract to update. Must exist in the contracts table.'
                  example: 15
                title:
                  type: string
                  description: 'The title of the contract.'
                  example: 'Updated Web Development Contract'
                value:
                  type: string
                  description: 'The contract value in currency format. Must be a valid currency format.'
                  example: '18,000.00'
                start_date:
                  type: string
                  description: 'The start date of the contract. Format depends on API usage.'
                  example: '2024-01-01'
                end_date:
                  type: string
                  description: 'The end date of the contract. Must be after start_date.'
                  example: '2024-12-31'
                client_id:
                  type: integer
                  description: 'The ID of the client. Must exist in the clients table.'
                  example: 5
                project_id:
                  type: integer
                  description: 'The ID of the project. Must exist in the projects table.'
                  example: 12
                contract_type_id:
                  type: integer
                  description: 'The ID of the contract type. Must exist in the contract_types table.'
                  example: 3
                description:
                  type: string
                  description: 'optional Description of the contract.'
                  example: 'Updated full-stack web development project'
                signed_pdf:
                  type: string
                  format: binary
                  description: 'optional The signed PDF file. Must be a PDF file, max 10MB. No example required.'
                isApi:
                  type: boolean
                  description: 'optional Set to true for API requests to handle date format properly.'
                  example: true
              required:
                - id
                - title
                - value
                - start_date
                - end_date
                - client_id
                - project_id
                - contract_type_id
  /api/contracts/list:
    get:
      summary: 'List contracts with filtering and pagination.'
      operationId: listContractsWithFilteringAndPagination
      description: 'This endpoint retrieves a paginated list of contracts with optional search, sorting, and filtering capabilities. The user must be authenticated to perform this action. Access is restricted based on user permissions.'
      parameters:
        -
          in: query
          name: search
          description: 'optional Filters contracts by title, value, description, or contract ID.'
          example: 'Web Development'
          required: false
          schema:
            type: string
            description: 'optional Filters contracts by title, value, description, or contract ID.'
            example: 'Web Development'
        -
          in: query
          name: sort
          description: 'optional The field to sort by (id, title, value, start_date, end_date, created_at). Defaults to id.'
          example: start_date
          required: false
          schema:
            type: string
            description: 'optional The field to sort by (id, title, value, start_date, end_date, created_at). Defaults to id.'
            example: start_date
        -
          in: query
          name: order
          description: 'optional The sort order (ASC or DESC). Defaults to DESC.'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional The sort order (ASC or DESC). Defaults to DESC.'
            example: ASC
        -
          in: query
          name: limit
          description: 'optional The number of contracts per page (1-100). Defaults to 10.'
          example: 20
          required: false
          schema:
            type: integer
            description: 'optional The number of contracts per page (1-100). Defaults to 10.'
            example: 20
        -
          in: query
          name: statuses
          description: 'optional Filters contracts by status (signed, partially_signed, not_signed).'
          example:
            - signed
            - partially_signed
          required: false
          schema:
            type: array
            description: 'optional Filters contracts by status (signed, partially_signed, not_signed).'
            example:
              - signed
              - partially_signed
            items:
              type: string
        -
          in: query
          name: type_ids
          description: 'optional Filters contracts by contract type IDs. Each ID must exist in contract_types table.'
          example:
            - 1
            - 3
            - 5
          required: false
          schema:
            type: array
            description: 'optional Filters contracts by contract type IDs. Each ID must exist in contract_types table.'
            example:
              - 1
              - 3
              - 5
            items:
              type: string
        -
          in: query
          name: project_ids
          description: 'optional Filters contracts by project IDs. Each ID must exist in projects table.'
          example:
            - 12
            - 15
            - 18
          required: false
          schema:
            type: array
            description: 'optional Filters contracts by project IDs. Each ID must exist in projects table.'
            example:
              - 12
              - 15
              - 18
            items:
              type: string
        -
          in: query
          name: client_ids
          description: 'optional Filters contracts by client IDs. Each ID must exist in clients table.'
          example:
            - 5
            - 8
          required: false
          schema:
            type: array
            description: 'optional Filters contracts by client IDs. Each ID must exist in clients table.'
            example:
              - 5
              - 8
            items:
              type: string
        -
          in: query
          name: date_between_from
          description: 'optional Filter contracts that start on or after this date. Format: Y-m-d.'
          example: '2024-01-01'
          required: false
          schema:
            type: string
            description: 'optional Filter contracts that start on or after this date. Format: Y-m-d.'
            example: '2024-01-01'
        -
          in: query
          name: date_between_to
          description: 'optional Filter contracts that end on or before this date. Format: Y-m-d.'
          example: '2024-12-31'
          required: false
          schema:
            type: string
            description: 'optional Filter contracts that end on or before this date. Format: Y-m-d.'
            example: '2024-12-31'
        -
          in: query
          name: start_date_from
          description: 'optional Filter contracts with start date from this date. Format: Y-m-d.'
          example: '2024-01-01'
          required: false
          schema:
            type: string
            description: 'optional Filter contracts with start date from this date. Format: Y-m-d.'
            example: '2024-01-01'
        -
          in: query
          name: start_date_to
          description: 'optional Filter contracts with start date until this date. Format: Y-m-d.'
          example: '2024-06-30'
          required: false
          schema:
            type: string
            description: 'optional Filter contracts with start date until this date. Format: Y-m-d.'
            example: '2024-06-30'
        -
          in: query
          name: end_date_from
          description: 'optional Filter contracts with end date from this date. Format: Y-m-d.'
          example: '2024-06-01'
          required: false
          schema:
            type: string
            description: 'optional Filter contracts with end date from this date. Format: Y-m-d.'
            example: '2024-06-01'
        -
          in: query
          name: end_date_to
          description: 'optional Filter contracts with end date until this date. Format: Y-m-d.'
          example: '2024-12-31'
          required: false
          schema:
            type: string
            description: 'optional Filter contracts with end date until this date. Format: Y-m-d.'
            example: '2024-12-31'
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Contracts retrieved successfully!'
                  total: 25
                  data:
                    -
                      id: 15
                      title: 'Web Development Contract'
                      value: '15000.00'
                      formatted_value: '$15,000.00'
                      start_date: '2024-01-01'
                      end_date: '2024-12-31'
                      duration: 'Jan 01, 2024 To Dec 31, 2024'
                      client:
                        id: 5
                        name: 'John Doe'
                        email: john@example.com
                      project:
                        id: 12
                        title: 'Company Website'
                      contract_type:
                        id: 3
                        type: 'Fixed Price'
                      description: 'Full-stack web development project'
                      status: signed
                      promisor_signed: true
                      promisee_signed: true
                      signed_pdf_url: storage/contracts/signed_contract_123.pdf
                      created_by:
                        id: 1
                        name: 'Admin User'
                        type: user
                      created_at: '2024-01-15T10:30:00Z'
                      updated_at: '2024-01-20T14:45:00Z'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Contracts retrieved successfully!'
                  total:
                    type: integer
                    example: 25
                  data:
                    type: array
                    example:
                      -
                        id: 15
                        title: 'Web Development Contract'
                        value: '15000.00'
                        formatted_value: '$15,000.00'
                        start_date: '2024-01-01'
                        end_date: '2024-12-31'
                        duration: 'Jan 01, 2024 To Dec 31, 2024'
                        client:
                          id: 5
                          name: 'John Doe'
                          email: john@example.com
                        project:
                          id: 12
                          title: 'Company Website'
                        contract_type:
                          id: 3
                          type: 'Fixed Price'
                        description: 'Full-stack web development project'
                        status: signed
                        promisor_signed: true
                        promisee_signed: true
                        signed_pdf_url: storage/contracts/signed_contract_123.pdf
                        created_by:
                          id: 1
                          name: 'Admin User'
                          type: user
                        created_at: '2024-01-15T10:30:00Z'
                        updated_at: '2024-01-20T14:45:00Z'
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 15
                        title:
                          type: string
                          example: 'Web Development Contract'
                        value:
                          type: string
                          example: '15000.00'
                        formatted_value:
                          type: string
                          example: '$15,000.00'
                        start_date:
                          type: string
                          example: '2024-01-01'
                        end_date:
                          type: string
                          example: '2024-12-31'
                        duration:
                          type: string
                          example: 'Jan 01, 2024 To Dec 31, 2024'
                        client:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 5
                            name:
                              type: string
                              example: 'John Doe'
                            email:
                              type: string
                              example: john@example.com
                        project:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 12
                            title:
                              type: string
                              example: 'Company Website'
                        contract_type:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 3
                            type:
                              type: string
                              example: 'Fixed Price'
                        description:
                          type: string
                          example: 'Full-stack web development project'
                        status:
                          type: string
                          example: signed
                        promisor_signed:
                          type: boolean
                          example: true
                        promisee_signed:
                          type: boolean
                          example: true
                        signed_pdf_url:
                          type: string
                          example: storage/contracts/signed_contract_123.pdf
                        created_by:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1
                            name:
                              type: string
                              example: 'Admin User'
                            type:
                              type: string
                              example: user
                        created_at:
                          type: string
                          example: '2024-01-15T10:30:00Z'
                        updated_at:
                          type: string
                          example: '2024-01-20T14:45:00Z'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation failed.'
                  data:
                    limit:
                      - 'The limit must be between 1 and 100.'
                    start_date_from:
                      - 'The start date from must be a valid date.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation failed.'
                  data:
                    type: object
                    properties:
                      limit:
                        type: array
                        example:
                          - 'The limit must be between 1 and 100.'
                        items:
                          type: string
                      start_date_from:
                        type: array
                        example:
                          - 'The start date from must be a valid date.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred.'
                  data:
                    type: array
                    example: []
      tags:
        - 'Contract Management'
  '/api/contracts/get/{id}':
    get:
      summary: 'Retrieve a single contract by ID.'
      operationId: retrieveASingleContractByID
      description: 'This endpoint retrieves detailed information about a specific contract. The user must be authenticated and have access to the contract based on their permissions.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Set to true for API requests.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Set to true for API requests.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Contract retrieved successfully.'
                  data:
                    id: 15
                    title: 'Web Development Contract'
                    value: '15000.00'
                    formatted_value: '$15,000.00'
                    start_date: '2024-01-01'
                    end_date: '2024-12-31'
                    client:
                      id: 5
                      name: 'John Doe'
                      email: john@example.com
                      phone: '+1234567890'
                    project:
                      id: 12
                      title: 'Company Website'
                      description: 'Modern responsive website'
                    contract_type:
                      id: 3
                      type: 'Fixed Price'
                    description: 'Full-stack web development project'
                    status: signed
                    promisor_signed: true
                    promisee_signed: true
                    promisor_sign_date: '2024-01-18T09:15:00Z'
                    promisee_sign_date: '2024-01-19T14:22:00Z'
                    signed_pdf_url: storage/contracts/signed_contract_123.pdf
                    created_by:
                      id: 1
                      name: 'Admin User'
                      type: user
                    workspace_id: 1
                    created_at: '2024-01-15T10:30:00Z'
                    updated_at: '2024-01-20T14:45:00Z'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Contract retrieved successfully.'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 15
                      title:
                        type: string
                        example: 'Web Development Contract'
                      value:
                        type: string
                        example: '15000.00'
                      formatted_value:
                        type: string
                        example: '$15,000.00'
                      start_date:
                        type: string
                        example: '2024-01-01'
                      end_date:
                        type: string
                        example: '2024-12-31'
                      client:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 5
                          name:
                            type: string
                            example: 'John Doe'
                          email:
                            type: string
                            example: john@example.com
                          phone:
                            type: string
                            example: '+1234567890'
                      project:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 12
                          title:
                            type: string
                            example: 'Company Website'
                          description:
                            type: string
                            example: 'Modern responsive website'
                      contract_type:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 3
                          type:
                            type: string
                            example: 'Fixed Price'
                      description:
                        type: string
                        example: 'Full-stack web development project'
                      status:
                        type: string
                        example: signed
                      promisor_signed:
                        type: boolean
                        example: true
                      promisee_signed:
                        type: boolean
                        example: true
                      promisor_sign_date:
                        type: string
                        example: '2024-01-18T09:15:00Z'
                      promisee_sign_date:
                        type: string
                        example: '2024-01-19T14:22:00Z'
                      signed_pdf_url:
                        type: string
                        example: storage/contracts/signed_contract_123.pdf
                      created_by:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 1
                          name:
                            type: string
                            example: 'Admin User'
                          type:
                            type: string
                            example: user
                      workspace_id:
                        type: integer
                        example: 1
                      created_at:
                        type: string
                        example: '2024-01-15T10:30:00Z'
                      updated_at:
                        type: string
                        example: '2024-01-20T14:45:00Z'
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Access denied.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Access denied.'
                  data:
                    type: array
                    example: []
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Contract not found.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Contract not found.'
                  data:
                    type: array
                    example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred.'
                  data:
                    type: array
                    example: []
      tags:
        - 'Contract Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the contract to retrieve. Must exist in the contracts table.'
        example: 15
        required: true
        schema:
          type: integer
  /api/contracts/create-sign:
    post:
      summary: 'Sign a contract with a base64 image.'
      operationId: signAContractWithABase64Image
      description: 'This endpoint allows an authenticated user to sign a contract by uploading a base64-encoded signature image. The user must have appropriate permissions based on their role (admin or client). The image is saved, and the corresponding signature field in the contract is updated.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional If true, returns a formatted API response instead of a regular JSON response.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional If true, returns a formatted API response instead of a regular JSON response.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  id: 12
                  activity_message: 'John Doe signed contract NDA Agreement'
                properties:
                  error:
                    type: boolean
                    example: false
                  id:
                    type: integer
                    example: 12
                  activity_message:
                    type: string
                    example: 'John Doe signed contract NDA Agreement'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'The id field is required. (and 1 more error)'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'The id field is required. (and 1 more error)'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred.'
                  data:
                    type: array
                    example: []
      tags:
        - 'Contract Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  description: 'The ID of the contract to sign.'
                  example: 12
                signatureImage:
                  type: string
                  description: 'A base64-encoded PNG image string of the signature. Must include the data URI prefix (e.g., "data:image/png;base64,...").'
                  example: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...'
              required:
                - id
                - signatureImage
  '/api/contracts/destroy/{id}':
    delete:
      summary: 'Delete a contract and associated files.'
      operationId: deleteAContractAndAssociatedFiles
      description: 'This endpoint deletes a contract by its ID, including associated signature images and the signed PDF file (if any). Only authorized users can perform this operation.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Contract deleted successfully!'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Contract deleted successfully!'
                  data:
                    type: array
                    example: []
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Contract not found.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Contract not found.'
                  data:
                    type: array
                    example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred'
                  data:
                    type: array
                    example: []
      tags:
        - 'Contract Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the contract to delete.'
        example: 15
        required: true
        schema:
          type: integer
  '/api/contracts/delete-sign/{id}':
    delete:
      summary: 'Remove signature from a contract.'
      operationId: removeSignatureFromAContract
      description: 'This endpoint allows authorized users to remove their signature from a contract, effectively "unsigned" the contract.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Set to true for API requests.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Set to true for API requests.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'John Doe unsigned contract Web Development Contract'
                  id: 15
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'John Doe unsigned contract Web Development Contract'
                  id:
                    type: integer
                    example: 15
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Unauthorized access.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Unauthorized access.'
                  data:
                    type: array
                    example: []
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Contract not found.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Contract not found.'
                  data:
                    type: array
                    example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred.'
                  data:
                    type: array
                    example: []
      tags:
        - 'Contract Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the contract to remove signature from. Must exist in the contracts table.'
        example: 15
        required: true
        schema:
          type: integer
  /api/contracts/store-contract-type:
    post:
      summary: 'Create a new contract type.'
      operationId: createANewContractType
      description: 'This endpoint creates a new contract type that can be used when creating contracts. The user must be authenticated and have permission to create contract types.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Contract type created successfully.'
                  data:
                    id: 5
                    type: 'Hourly Rate'
                    workspace_id: 1
                    created_at: '2024-01-15T10:30:00Z'
                    updated_at: '2024-01-15T10:30:00Z'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Contract type created successfully.'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 5
                      type:
                        type: string
                        example: 'Hourly Rate'
                      workspace_id:
                        type: integer
                        example: 1
                      created_at:
                        type: string
                        example: '2024-01-15T10:30:00Z'
                      updated_at:
                        type: string
                        example: '2024-01-15T10:30:00Z'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation failed.'
                  data:
                    type:
                      - 'The type field is required.'
                      - 'The type has already been taken.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation failed.'
                  data:
                    type: object
                    properties:
                      type:
                        type: array
                        example:
                          - 'The type field is required.'
                          - 'The type has already been taken.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred.'
                  data:
                    type: array
                    example: []
      tags:
        - 'Contract Type Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  description: 'The name of the contract type. Must be unique.'
                  example: 'Hourly Rate'
                isApi:
                  type: boolean
                  description: 'optional Set to true for API requests.'
                  example: true
              required:
                - type
  /api/contracts/update-contract-type:
    post:
      summary: 'Update an existing contract type.'
      operationId: updateAnExistingContractType
      description: 'This endpoint updates an existing contract type with new details. The user must be authenticated and have permission to edit contract types.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Contract type updated successfully.'
                  data:
                    id: 3
                    type: 'Updated Monthly Retainer'
                    workspace_id: 1
                    created_at: '2024-01-03T10:30:00Z'
                    updated_at: '2024-01-20T15:45:00Z'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Contract type updated successfully.'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 3
                      type:
                        type: string
                        example: 'Updated Monthly Retainer'
                      workspace_id:
                        type: integer
                        example: 1
                      created_at:
                        type: string
                        example: '2024-01-03T10:30:00Z'
                      updated_at:
                        type: string
                        example: '2024-01-20T15:45:00Z'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Contract type not found.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Contract type not found.'
                  data:
                    type: array
                    example: []
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation failed.'
                  data:
                    type:
                      - 'The type field is required.'
                      - 'The type has already been taken.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation failed.'
                  data:
                    type: object
                    properties:
                      type:
                        type: array
                        example:
                          - 'The type field is required.'
                          - 'The type has already been taken.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred.'
                  data:
                    type: array
                    example: []
      tags:
        - 'Contract Type Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  description: 'The ID of the contract type to update. Must exist in the contract_types table.'
                  example: 3
                type:
                  type: string
                  description: 'The updated name of the contract type. Must be unique (excluding current record).'
                  example: 'Updated Monthly Retainer'
                isApi:
                  type: boolean
                  description: 'optional Set to true for API requests.'
                  example: true
              required:
                - id
                - type
  /api/contracts/contract-types-list:
    get:
      summary: 'List contract types with filtering and pagination.'
      operationId: listContractTypesWithFilteringAndPagination
      description: 'This endpoint retrieves a paginated list of contract types with optional search and sorting capabilities. The user must be authenticated to perform this action.'
      parameters:
        -
          in: query
          name: search
          description: 'optional Filters contract types by type name or ID.'
          example: Fixed
          required: false
          schema:
            type: string
            description: 'optional Filters contract types by type name or ID.'
            example: Fixed
        -
          in: query
          name: sort
          description: 'optional The field to sort by (id, type, created_at, updated_at). Defaults to id.'
          example: type
          required: false
          schema:
            type: string
            description: 'optional The field to sort by (id, type, created_at, updated_at). Defaults to id.'
            example: type
        -
          in: query
          name: order
          description: 'optional The sort order (ASC or DESC). Defaults to DESC.'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional The sort order (ASC or DESC). Defaults to DESC.'
            example: ASC
        -
          in: query
          name: limit
          description: 'optional The number of contract types per page (1-100). Defaults to 10.'
          example: 20
          required: false
          schema:
            type: integer
            description: 'optional The number of contract types per page (1-100). Defaults to 10.'
            example: 20
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Contract types retrieved successfully.'
                  total: 8
                  data:
                    -
                      id: 1
                      type: 'Fixed Price'
                      workspace_id: 1
                      created_at: '2024-01-01T08:00:00Z'
                      updated_at: '2024-01-01T08:00:00Z'
                    -
                      id: 2
                      type: 'Time & Materials'
                      workspace_id: 1
                      created_at: '2024-01-02T09:15:00Z'
                      updated_at: '2024-01-02T09:15:00Z'
                    -
                      id: 3
                      type: 'Monthly Retainer'
                      workspace_id: 1
                      created_at: '2024-01-03T10:30:00Z'
                      updated_at: '2024-01-03T10:30:00Z'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Contract types retrieved successfully.'
                  total:
                    type: integer
                    example: 8
                  data:
                    type: array
                    example:
                      -
                        id: 1
                        type: 'Fixed Price'
                        workspace_id: 1
                        created_at: '2024-01-01T08:00:00Z'
                        updated_at: '2024-01-01T08:00:00Z'
                      -
                        id: 2
                        type: 'Time & Materials'
                        workspace_id: 1
                        created_at: '2024-01-02T09:15:00Z'
                        updated_at: '2024-01-02T09:15:00Z'
                      -
                        id: 3
                        type: 'Monthly Retainer'
                        workspace_id: 1
                        created_at: '2024-01-03T10:30:00Z'
                        updated_at: '2024-01-03T10:30:00Z'
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        type:
                          type: string
                          example: 'Fixed Price'
                        workspace_id:
                          type: integer
                          example: 1
                        created_at:
                          type: string
                          example: '2024-01-01T08:00:00Z'
                        updated_at:
                          type: string
                          example: '2024-01-01T08:00:00Z'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation failed.'
                  data:
                    limit:
                      - 'The limit must be between 1 and 100.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation failed.'
                  data:
                    type: object
                    properties:
                      limit:
                        type: array
                        example:
                          - 'The limit must be between 1 and 100.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred.'
                  data:
                    type: array
                    example: []
      tags:
        - 'Contract Type Management'
  '/api/contracts/get-contract-type/{id}':
    get:
      summary: 'Retrieve a single contract type by ID.'
      operationId: retrieveASingleContractTypeByID
      description: 'This endpoint retrieves detailed information about a specific contract type. The user must be authenticated and have access to the contract type.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Set to true for API requests.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Set to true for API requests.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Contract type retrieved successfully.'
                  data:
                    id: 3
                    type: 'Monthly Retainer'
                    workspace_id: 1
                    created_at: '2024-01-03T10:30:00Z'
                    updated_at: '2024-01-03T10:30:00Z'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Contract type retrieved successfully.'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 3
                      type:
                        type: string
                        example: 'Monthly Retainer'
                      workspace_id:
                        type: integer
                        example: 1
                      created_at:
                        type: string
                        example: '2024-01-03T10:30:00Z'
                      updated_at:
                        type: string
                        example: '2024-01-03T10:30:00Z'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Contract type not found.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Contract type not found.'
                  data:
                    type: array
                    example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred.'
                  data:
                    type: array
                    example: []
      tags:
        - 'Contract Type Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the contract type to retrieve. Must exist in the contract_types table.'
        example: 3
        required: true
        schema:
          type: integer
  '/api/contracts/delete-contract-type/{id}':
    delete:
      summary: 'Delete a contract type.'
      operationId: deleteAContractType
      description: 'This endpoint deletes a contract type. Any contracts using this type will be updated to use the default contract type (ID: 0). The user must be authenticated and have permission to delete contract types.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Set to true for API requests.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Set to true for API requests.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Contract type deleted successfully.'
                  data:
                    id: 5
                    type: 'Hourly Rate'
                    workspace_id: 1
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Contract type deleted successfully.'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 5
                      type:
                        type: string
                        example: 'Hourly Rate'
                      workspace_id:
                        type: integer
                        example: 1
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Default contract type cannot be deleted.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Default contract type cannot be deleted.'
                  data:
                    type: array
                    example: []
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Contract type not found.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Contract type not found.'
                  data:
                    type: array
                    example: []
        409:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Cannot delete contract type as it is being used by existing contracts.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Cannot delete contract type as it is being used by existing contracts.'
                  data:
                    type: array
                    example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred.'
                  data:
                    type: array
                    example: []
      tags:
        - 'Contract Type Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the contract type to delete. Must exist in the contract_types table and cannot be the default type (ID: 0).'
        example: 5
        required: true
        schema:
          type: integer
  /api/custom-fields:
    post:
      summary: 'Create a new custom field.'
      operationId: createANewCustomField
      description: "This endpoint allows the creation of a new custom field for either the project or task module.\nDepending on the field type, options may be required (for example: radio, checkbox, select).\nUser must be authenticated."
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Custom Field Created Successfully'
                  data:
                    id: 12
                    type: custom_field
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Custom Field Created Successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 12
                      type:
                        type: string
                        example: custom_field
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation failed.'
                  data:
                    field_label:
                      - 'The field label field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation failed.'
                  data:
                    type: object
                    properties:
                      field_label:
                        type: array
                        example:
                          - 'The field label field is required.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "Custom Field Couldn't Created."
                  data:
                    error: 'Exception message'
                    line: 85
                    file: /var/www/html/app/Http/Controllers/CustomFieldController.php
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "Custom Field Couldn't Created."
                  data:
                    type: object
                    properties:
                      error:
                        type: string
                        example: 'Exception message'
                      line:
                        type: integer
                        example: 85
                      file:
                        type: string
                        example: /var/www/html/app/Http/Controllers/CustomFieldController.php
      tags:
        - 'Custom Field Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                module:
                  type: string
                  description: 'The module this custom field belongs to. Must be one of: `project`, `task`.'
                  example: task
                field_label:
                  type: string
                  description: 'The label for the custom field.'
                  example: Priority
                field_type:
                  type: string
                  description: 'The type of the custom field. Must be one of: `text`, `number`, `password`, `textarea`, `radio`, `date`, `checkbox`, `select`.'
                  example: select
                options:
                  type: string
                  description: 'optional Required if field_type is `radio`, `checkbox`, or `select`. Provide one option per line.'
                  example: High\nMedium\nLow
                required:
                  type: string
                  description: 'optional Whether this field is required.'
                  example: '1'
                visibility:
                  type: string
                  description: 'optional Whether this field is visible to end users.'
                  example: '1'
              required:
                - module
                - field_label
                - field_type
  /api/custom-fields/list:
    get:
      summary: 'List custom fields or retrieve a single custom field.'
      operationId: listCustomFieldsOrRetrieveASingleCustomField
      description: "This endpoint retrieves a paginated list of custom fields or a single custom field by ID.\nSupports optional search, sorting, pagination, and filtering by module, label, or field type.\nUser must be authenticated to access this endpoint."
      parameters:
        -
          in: query
          name: search
          description: 'optional Filter custom fields by module, field label, or field type.'
          example: priority
          required: false
          schema:
            type: string
            description: 'optional Filter custom fields by module, field label, or field type.'
            example: priority
        -
          in: query
          name: sort
          description: 'optional Field to sort by. Default is id.'
          example: field_label
          required: false
          schema:
            type: string
            description: 'optional Field to sort by. Default is id.'
            example: field_label
        -
          in: query
          name: order
          description: 'optional Sort direction: ASC or DESC. Default is DESC.'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional Sort direction: ASC or DESC. Default is DESC.'
            example: ASC
        -
          in: query
          name: limit
          description: 'optional Number of custom fields to return per page. Default is 10.'
          example: 20
          required: false
          schema:
            type: integer
            description: 'optional Number of custom fields to return per page. Default is 10.'
            example: 20
        -
          in: query
          name: offset
          description: 'optional The number of custom fields to skip. Default is 0.'
          example: 5
          required: false
          schema:
            type: integer
            description: 'optional The number of custom fields to skip. Default is 0.'
            example: 5
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'CustomFields retrieved successfully!'
                  data:
                    total: 2
                    data:
                      -
                        id: 3
                        module: task
                        field_type: select
                        field_label: Priority
                        options:
                          - High
                          - Medium
                          - Low
                        required: '1'
                        visibility: '1'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'CustomFields retrieved successfully!'
                  data:
                    type: object
                    properties:
                      total:
                        type: integer
                        example: 2
                      data:
                        type: array
                        example:
                          -
                            id: 3
                            module: task
                            field_type: select
                            field_label: Priority
                            options:
                              - High
                              - Medium
                              - Low
                            required: '1'
                            visibility: '1'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 3
                            module:
                              type: string
                              example: task
                            field_type:
                              type: string
                              example: select
                            field_label:
                              type: string
                              example: Priority
                            options:
                              type: array
                              example:
                                - High
                                - Medium
                                - Low
                              items:
                                type: string
                            required:
                              type: string
                              example: '1'
                            visibility:
                              type: string
                              example: '1'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'CustomField not found'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'CustomField not found'
                  data:
                    type: array
                    example: []
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation failed: The search field must be a string.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation failed: The search field must be a string.'
                  data:
                    type: array
                    example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred.'
                  data:
                    type: array
                    example: []
      tags:
        - 'Custom Field Management'
    parameters:
      -
        in: path
        name: id
        description: 'Optional parameter. optional The ID of the custom field to retrieve. If provided, returns a single custom field.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 3
  '/api/custom-fields/update/{id}':
    post:
      summary: 'Update an existing custom field.'
      operationId: updateAnExistingCustomField
      description: "This endpoint updates the details of a custom field identified by its ID.\nOptions are required if the field type is `radio`, `checkbox`, or `select`.\nUser must be authenticated."
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Custom field updated successfully'
                  data:
                    id: 12
                    type: custom_field
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Custom field updated successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 12
                      type:
                        type: string
                        example: custom_field
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation failed.'
                  data:
                    field_label:
                      - 'The field label field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation failed.'
                  data:
                    type: object
                    properties:
                      field_label:
                        type: array
                        example:
                          - 'The field label field is required.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred.'
                  data:
                    error: 'Exception message'
                    line: 78
                    file: /var/www/html/app/Http/Controllers/CustomFieldController.php
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred.'
                  data:
                    type: object
                    properties:
                      error:
                        type: string
                        example: 'Exception message'
                      line:
                        type: integer
                        example: 78
                      file:
                        type: string
                        example: /var/www/html/app/Http/Controllers/CustomFieldController.php
      tags:
        - 'Custom Field Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                module:
                  type: string
                  description: 'The module this custom field belongs to. Must be one of: `project`, `task`.'
                  example: project
                field_label:
                  type: string
                  description: 'The label for the custom field.'
                  example: Status
                field_type:
                  type: string
                  description: 'The type of the custom field. Must be one of: `text`, `number`, `password`, `textarea`, `radio`, `date`, `checkbox`, `select`.'
                  example: radio
                options:
                  type: string
                  description: 'optional Required if field_type is `radio`, `checkbox`, or `select`. Provide one option per line.'
                  example: Active\nInactive
                required:
                  type: string
                  description: 'optional Whether this field is required.'
                  example: '1'
                visibility:
                  type: string
                  description: 'optional Whether this field is visible to end users.'
                  example: '0'
              required:
                - module
                - field_label
                - field_type
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the custom field to update.'
        example: 12
        required: true
        schema:
          type: integer
  '/api/custom-fields/destroy/{id}':
    delete:
      summary: 'Delete a custom field.'
      operationId: deleteACustomField
      description: "This endpoint deletes a specific custom field by ID.\nUser must be authenticated."
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'CustomField deleted successfully'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'CustomField deleted successfully'
                  data:
                    type: array
                    example: []
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'CustomField not found.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'CustomField not found.'
                  data:
                    type: array
                    example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred.'
                  data:
                    type: array
                    example: []
      tags:
        - 'Custom Field Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the custom field to delete.'
        example: 15
        required: true
        schema:
          type: integer
  /api/deductions/store:
    post:
      summary: 'Create a new deduction.'
      operationId: createANewDeduction
      description: 'Creates a deduction in the current workspace. Deductions can be of type `amount` or `percentage`.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Deduction created successfully.'
                  data:
                    id: 9
                    title: 'Income Tax'
                    type: Percentage
                    percentage: 5
                    amount: '0.00'
                    created_at: '30 May, 2025'
                    updated_at: '30 May, 2025'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Deduction created successfully.'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 9
                      title:
                        type: string
                        example: 'Income Tax'
                      type:
                        type: string
                        example: Percentage
                      percentage:
                        type: integer
                        example: 5
                      amount:
                        type: string
                        example: '0.00'
                      created_at:
                        type: string
                        example: '30 May, 2025'
                      updated_at:
                        type: string
                        example: '30 May, 2025'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'The given data was invalid.'
                  data:
                    errors:
                      title:
                        - 'The title field is required.'
                      type:
                        - 'The type field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  data:
                    type: object
                    properties:
                      errors:
                        type: object
                        properties:
                          title:
                            type: array
                            example:
                              - 'The title field is required.'
                            items:
                              type: string
                          type:
                            type: array
                            example:
                              - 'The type field is required.'
                            items:
                              type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred'
                  data:
                    type: array
                    example: []
      tags:
        - 'Deduction Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: 'The name/title of the deduction. Must be unique.'
                  example: 'Income Tax'
                type:
                  type: string
                  description: 'The type of deduction. Either "amount" or "percentage".'
                  example: percentage
                amount:
                  type: string
                  description: 'The fixed amount for the deduction. Required if type is "amount".'
                  example: '150.00'
                percentage:
                  type: numeric
                  description: 'The percentage value of the deduction. Required if type is "percentage".'
                  example: '5'
                isApi:
                  type: boolean
                  description: 'optional Whether to return a formatted API response. Defaults to false.'
                  example: true
              required:
                - title
                - type
      security: []
  '/api/deductions/get/{id}':
    get:
      summary: 'Get a deduction by ID.'
      operationId: getADeductionByID
      description: 'Retrieves a specific deduction using its ID.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Whether to return a formatted API response. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Whether to return a formatted API response. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Deduction retrieved successfully.'
                  data:
                    id: 1
                    title: 'Income Tax'
                    type: Percentage
                    percentage: 5
                    amount: '0.00'
                    created_at: '30 May, 2025'
                    updated_at: '30 May, 2025'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Deduction retrieved successfully.'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      title:
                        type: string
                        example: 'Income Tax'
                      type:
                        type: string
                        example: Percentage
                      percentage:
                        type: integer
                        example: 5
                      amount:
                        type: string
                        example: '0.00'
                      created_at:
                        type: string
                        example: '30 May, 2025'
                      updated_at:
                        type: string
                        example: '30 May, 2025'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'No query results for model [App\Models\Deduction] 9999'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'No query results for model [App\Models\Deduction] 9999'
                  data:
                    type: array
                    example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred'
                  data:
                    type: array
                    example: []
      tags:
        - 'Deduction Management'
      security: []
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the deduction to retrieve. Must exist in the `deductions` table.'
        example: 1
        required: true
        schema:
          type: integer
  /api/deductions/list:
    get:
      summary: 'Get list of deductions.'
      operationId: getListOfDeductions
      description: 'Returns a list of deductions for the current workspace in API format, with optional filtering and sorting.'
      parameters:
        -
          in: query
          name: search
          description: 'optional Search keyword to filter deductions.'
          example: Tax
          required: false
          schema:
            type: string
            description: 'optional Search keyword to filter deductions.'
            example: Tax
        -
          in: query
          name: sort
          description: 'optional Field to sort by. Defaults to "id".'
          example: title
          required: false
          schema:
            type: string
            description: 'optional Field to sort by. Defaults to "id".'
            example: title
        -
          in: query
          name: order
          description: 'optional Sort order: ASC or DESC. Defaults to DESC.'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional Sort order: ASC or DESC. Defaults to DESC.'
            example: ASC
        -
          in: query
          name: limit
          description: 'optional Number of records to return. Defaults to 10.'
          example: 25
          required: false
          schema:
            type: integer
            description: 'optional Number of records to return. Defaults to 10.'
            example: 25
        -
          in: query
          name: 'types[]'
          description: 'optional Filter by deduction types. Options: amount, percentage.'
          example:
            - percentage
          required: false
          schema:
            type: array
            description: 'optional Filter by deduction types. Options: amount, percentage.'
            example:
              - percentage
            items:
              type: string
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": false,\n  \"message\": \"Deductions retrieved successfully.\",\n    \"total\": 1,\n    \"data\": [\n      {\n        \"id\": 1\n        \"title\": \"Income Tax\",\n        \"type\": \"Percentage\",\n        \"percentage\": 5,\n        \"amount\": \"0.00\",\n        \"created_at\": \"30 May, 2025\",\n        \"updated_at\": \"30 May, 2025\"\n      }\n    ]\n}"
      tags:
        - 'Deduction Management'
      security: []
  /api/deductions/update:
    post:
      summary: 'Update an existing deduction.'
      operationId: updateAnExistingDeduction
      description: 'Updates the specified deduction in the current workspace.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Deduction updated successfully.'
                  data:
                    id: 1
                    title: 'Updated Income Tax'
                    type: Amount
                    percentage: null
                    amount: '100.00'
                    created_at: '30 May, 2025'
                    updated_at: '30 May, 2025'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Deduction updated successfully.'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      title:
                        type: string
                        example: 'Updated Income Tax'
                      type:
                        type: string
                        example: Amount
                      percentage:
                        type: string
                        example: null
                      amount:
                        type: string
                        example: '100.00'
                      created_at:
                        type: string
                        example: '30 May, 2025'
                      updated_at:
                        type: string
                        example: '30 May, 2025'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'No query results for model [App\Models\Deduction] 9999'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'No query results for model [App\Models\Deduction] 9999'
                  data:
                    type: array
                    example: []
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'The given data was invalid.'
                  data:
                    errors:
                      title:
                        - 'The title has already been taken.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  data:
                    type: object
                    properties:
                      errors:
                        type: object
                        properties:
                          title:
                            type: array
                            example:
                              - 'The title has already been taken.'
                            items:
                              type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred'
                  data:
                    type: array
                    example: []
      tags:
        - 'Deduction Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  description: 'The ID of the deduction to update. Must exist in the `deductions` table.'
                  example: 1
                title:
                  type: string
                  description: 'The name/title of the deduction. Must be unique.'
                  example: 'Updated Income Tax'
                type:
                  type: string
                  description: 'The type of deduction. Either "amount" or "percentage".'
                  example: amount
                amount:
                  type: string
                  description: 'optional The fixed amount for the deduction. Required if type is "amount".'
                  example: '100.00'
                percentage:
                  type: numeric
                  description: 'optional The percentage value of the deduction. Required if type is "percentage".'
                  example: '10'
                isApi:
                  type: boolean
                  description: 'optional Whether to return a formatted API response. Defaults to false.'
                  example: true
              required:
                - id
                - title
                - type
      security: []
  '/api/deductions/destroy/{id}':
    delete:
      summary: 'Delete a deduction.'
      operationId: deleteADeduction
      description: 'Deletes the deduction with the given ID and detaches associated payslips.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Deduction deleted successfully.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Deduction deleted successfully.'
                  data:
                    type: array
                    example: []
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Deduction not found.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Deduction not found.'
                  data:
                    type: array
                    example: []
      tags:
        - 'Deduction Management'
      security: []
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the deduction to delete. Must exist in the `deductions` table.'
        example: 2
        required: true
        schema:
          type: integer
  /api/emails/preview:
    post:
      summary: 'Generate a preview of an email.'
      operationId: generateAPreviewOfAnEmail
      description: 'This endpoint generates a preview of an email by replacing placeholders in the provided subject and body, and listing any attachments. The user must be authenticated to perform this action. The content can be base64-encoded if specified.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'preview generated successfully!'
                  data: '<div><p>Hello John Doe!</p></div><hr><div><strong>Attachments:</strong><ul><li>attachment.pdf</li></ul></div>'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'preview generated successfully!'
                  data:
                    type: string
                    example: '<div><p>Hello John Doe!</p></div><hr><div><strong>Attachments:</strong><ul><li>attachment.pdf</li></ul></div>'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Failed to generate preview'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Failed to generate preview'
      tags:
        - 'Email Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                subject:
                  type: string
                  description: "optional The subject of the email. Defaults to 'No Subject'."
                  example: 'Welcome Email'
                body:
                  type: string
                  description: 'The body of the email, optionally base64-encoded.'
                  example: '<p>Hello USER_NAME!</p>'
                placeholders:
                  type: array
                  description: 'optional Key-value pairs of placeholders to replace in the subject and body.'
                  example: null
                  items:
                    type: string
                attachments:
                  type: array
                  description: 'optional An array of files to include as attachments. Each file must not exceed the configured size limit.'
                  example: null
                  items:
                    type: string
                is_encoded:
                  type: string
                  description: "optional Indicates if the body is base64-encoded (value: '1'). Defaults to false."
                  example: '1'
              required:
                - body
  /api/emails/store:
    post:
      summary: 'Send or schedule emails.'
      operationId: sendOrScheduleEmails
      description: 'This endpoint sends or schedules emails to one or more recipients, using either a template or custom content. The user must be authenticated to perform this action. Attachments are supported, and scheduling is optional. Certain file extensions (e.g., zip, exe) are blocked for security.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Emails sent successfully.'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Emails sent successfully.'
                  -
                    description: ''
                    type: object
                    example:
                      error: false
                      message: 'Emails scheduled successfully!'
                    properties:
                      error:
                        type: boolean
                        example: false
                      message:
                        type: string
                        example: 'Emails scheduled successfully!'
        422:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'The emails field is required.'
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'The emails field is required.'
                  -
                    description: ''
                    type: object
                    example:
                      error: true
                      message: 'Attachments with .zip, .exe and similar file types are not allowed for security reasons.'
                    properties:
                      error:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: 'Attachments with .zip, .exe and similar file types are not allowed for security reasons.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An unexpected error occurred while sending/scheduling the emails.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An unexpected error occurred while sending/scheduling the emails.'
      tags:
        - 'Email Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                emails:
                  type: array
                  description: 'An array of recipient email addresses. Each must be a valid email.'
                  example:
                    - john.doe@example.com
                  items:
                    type: string
                email_template_id:
                  type: integer
                  description: 'nullable The ID of the email template to use. Required if not sending a custom email. Must exist in the `email_templates` table.'
                  example: 1
                placeholders:
                  type: array
                  description: 'nullable Key-value pairs of placeholders to replace in the template. Required if using a template.'
                  example: null
                  items:
                    type: string
                subject:
                  type: string
                  description: 'nullable The subject of the email. Required if not using a template. Maximum length is 255 characters.'
                  example: 'Welcome Email'
                body:
                  type: string
                  description: 'nullable The body of the email. Required if not using a template.'
                  example: '<p>Hello!</p>'
                attachments:
                  type: array
                  description: 'nullable An array of files to attach. Each file must not exceed the configured size limit and must not have blocked extensions (e.g., zip, exe).'
                  example: null
                  items:
                    type: string
                scheduled_at:
                  type: string
                  description: 'nullable The date and time to schedule the email (format: YYYY-MM-DD HH:MM:SS). Must be in the future.'
                  example: '2025-05-16 10:00:00'
              required:
                - emails
  '/api/emails/historyList/{id}':
    get:
      summary: 'List scheduled emails or retrieve a single email.'
      operationId: listScheduledEmailsOrRetrieveASingleEmail
      description: 'This endpoint retrieves a paginated list of scheduled emails or a single email by ID, with optional search, sorting, and pagination parameters. The user must be authenticated, and access is restricted based on permissions (admin/all-data-access or user-owned emails). The response includes permission details for editing and deletion.'
      parameters:
        -
          in: query
          name: search
          description: 'optional Filters emails by recipient email or subject.'
          example: john.doe
          required: false
          schema:
            type: string
            description: 'optional Filters emails by recipient email or subject.'
            example: john.doe
        -
          in: query
          name: sort
          description: 'optional The field to sort by (id, to_email, subject, scheduled_at, created_at, updated_at). Defaults to id.'
          example: subject
          required: false
          schema:
            type: string
            description: 'optional The field to sort by (id, to_email, subject, scheduled_at, created_at, updated_at). Defaults to id.'
            example: subject
        -
          in: query
          name: order
          description: 'optional The sort order (ASC, DESC). Defaults to DESC.'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional The sort order (ASC, DESC). Defaults to DESC.'
            example: ASC
        -
          in: query
          name: limit
          description: 'optional The number of emails per page (1-100). Defaults to 10.'
          example: 20
          required: false
          schema:
            type: integer
            description: 'optional The number of emails per page (1-100). Defaults to 10.'
            example: 20
        -
          in: query
          name: offset
          description: 'optional The number of emails to skip. Defaults to 0.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional The number of emails to skip. Defaults to 0.'
            example: 10
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Emails retrieved successfully.'
                  data:
                    total: 5
                    data:
                      -
                        id: 1
                        to_email: john.doe@example.com
                        subject: 'Welcome Email'
                        body: '<p>Hello John!</p>'
                        status: sent
                        scheduled_at: '2025-05-15 16:30:00'
                        created_at: '2025-05-15 16:30:00'
                        updated_at: '2025-05-15 16:30:00'
                        user_id: 7
                        can_edit: true
                        can_delete: true
                    permissions:
                      can_edit: true
                      can_delete: true
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Emails retrieved successfully.'
                  data:
                    type: object
                    properties:
                      total:
                        type: integer
                        example: 5
                      data:
                        type: array
                        example:
                          -
                            id: 1
                            to_email: john.doe@example.com
                            subject: 'Welcome Email'
                            body: '<p>Hello John!</p>'
                            status: sent
                            scheduled_at: '2025-05-15 16:30:00'
                            created_at: '2025-05-15 16:30:00'
                            updated_at: '2025-05-15 16:30:00'
                            user_id: 7
                            can_edit: true
                            can_delete: true
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1
                            to_email:
                              type: string
                              example: john.doe@example.com
                            subject:
                              type: string
                              example: 'Welcome Email'
                            body:
                              type: string
                              example: '<p>Hello John!</p>'
                            status:
                              type: string
                              example: sent
                            scheduled_at:
                              type: string
                              example: '2025-05-15 16:30:00'
                            created_at:
                              type: string
                              example: '2025-05-15 16:30:00'
                            updated_at:
                              type: string
                              example: '2025-05-15 16:30:00'
                            user_id:
                              type: integer
                              example: 7
                            can_edit:
                              type: boolean
                              example: true
                            can_delete:
                              type: boolean
                              example: true
                      permissions:
                        type: object
                        properties:
                          can_edit:
                            type: boolean
                            example: true
                          can_delete:
                            type: boolean
                            example: true
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Email not found.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Email not found.'
                  data:
                    type: array
                    example: []
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation failed: The search field must be a string.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation failed: The search field must be a string.'
                  data:
                    type: array
                    example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred.'
                  data:
                    type: array
                    example: []
      tags:
        - 'Email Management'
    parameters:
      -
        in: path
        name: id
        description: 'Optional parameter. optional The ID of the scheduled email to retrieve. If provided, returns a single email. Must exist in the `scheduled_emails` table.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  '/api/emails/history/destroy/{id}':
    delete:
      summary: 'Delete a scheduled email.'
      operationId: deleteAScheduledEmail
      description: 'This endpoint deletes a specific scheduled email record. The user must be authenticated and have appropriate permissions to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Scheduled Email deleted successfully!'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Scheduled Email deleted successfully!'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Scheduled Email not found'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Scheduled Email not found'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while deleting the scheduled email.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while deleting the scheduled email.'
      tags:
        - 'Email Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the scheduled email to delete. Must exist in the `scheduled_emails` table.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/emails/template-data/{id}':
    get:
      summary: 'Retrieve email template data.'
      operationId: retrieveEmailTemplateData
      description: 'This endpoint fetches the details of a specific email template, including its subject, body, and placeholders (excluding default ones like CURRENT_YEAR, COMPANY_TITLE). The user must be authenticated to perform this action.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Template data retrieved successfully!'
                  data:
                    id: 1
                    subject: 'Welcome Email'
                    body: '<p>Hello USER_NAME, welcome to COMPANY_TITLE!</p>'
                    placeholders:
                      - USER_NAME
                    created_at: '2025-05-15 16:30:00'
                    updated_at: '2025-05-15 16:30:00'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Template data retrieved successfully!'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      subject:
                        type: string
                        example: 'Welcome Email'
                      body:
                        type: string
                        example: '<p>Hello USER_NAME, welcome to COMPANY_TITLE!</p>'
                      placeholders:
                        type: array
                        example:
                          - USER_NAME
                        items:
                          type: string
                      created_at:
                        type: string
                        example: '2025-05-15 16:30:00'
                      updated_at:
                        type: string
                        example: '2025-05-15 16:30:00'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Template not found'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Template not found'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while retrieving the template data.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while retrieving the template data.'
      tags:
        - 'Email Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the email template to retrieve. Must exist in the `email_templates` table.'
        example: 1
        required: true
        schema:
          type: integer
  /api/email-templates/store:
    post:
      summary: 'Create a new email template.'
      operationId: createANewEmailTemplate
      description: 'This endpoint creates a new email template with a specified name, subject, and body. The user must be authenticated to perform this action. The body can be base64-encoded if specified. Placeholders are automatically extracted from the body, excluding system constants like COMPANY_LOGO.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Email Template Created Successfully!'
                  data:
                    id: 1
                    name: 'Welcome Template'
                    subject: 'Welcome to Our Company'
                    body: '<p>Hello USER_NAME!</p>'
                    placeholders:
                      - USER_NAME
                    workspace_id: 1
                    created_at: '2025-05-15 17:00:00'
                    updated_at: '2025-05-15 17:00:00'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Email Template Created Successfully!'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: 'Welcome Template'
                      subject:
                        type: string
                        example: 'Welcome to Our Company'
                      body:
                        type: string
                        example: '<p>Hello USER_NAME!</p>'
                      placeholders:
                        type: array
                        example:
                          - USER_NAME
                        items:
                          type: string
                      workspace_id:
                        type: integer
                        example: 1
                      created_at:
                        type: string
                        example: '2025-05-15 17:00:00'
                      updated_at:
                        type: string
                        example: '2025-05-15 17:00:00'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'The name field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'The name field is required.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 'Detailed error message'
                  message: 'Failed to create email template'
                  code: 0
                  file: path/to/file.php
                  line: 123
                  trace: 'Stack trace'
                properties:
                  error:
                    type: string
                    example: 'Detailed error message'
                  message:
                    type: string
                    example: 'Failed to create email template'
                  code:
                    type: integer
                    example: 0
                  file:
                    type: string
                    example: path/to/file.php
                  line:
                    type: integer
                    example: 123
                  trace:
                    type: string
                    example: 'Stack trace'
      tags:
        - 'Email Template Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The name of the email template. Maximum length is 255 characters.'
                  example: 'Welcome Template'
                subject:
                  type: string
                  description: 'The subject of the email template. Maximum length is 255 characters.'
                  example: 'Welcome to Our Company'
                body:
                  type: string
                  description: 'nullable The body of the email template, optionally base64-encoded.'
                  example: '<p>Hello USER_NAME!</p>'
                is_encoded:
                  type: string
                  description: "optional Indicates if the body is base64-encoded (value: '1'). Defaults to false."
                  example: '1'
                content:
                  type: string
                  description: "optional The base64-encoded body content, used if is_encoded is '1'."
                  example: PGh0bWw+PHA+SGVsbG8ge1VTRVJfTkFNRX0hPC9wPjwvaHRtbD4=
              required:
                - name
                - subject
  '/api/email-templates/update/{id}':
    post:
      summary: 'Update an existing email template.'
      operationId: updateAnExistingEmailTemplate
      description: 'This endpoint updates the name, subject, and body of an existing email template. The user must be authenticated to perform this action. The body can be base64-encoded if specified. Placeholders are automatically extracted from the body, excluding system constants like COMPANY_LOGO.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Email Template Updated Successfully!'
                  data:
                    id: 1
                    name: 'Welcome Template'
                    subject: 'Welcome to Our Company'
                    body: '<p>Hello USER_NAME!</p>'
                    placeholders:
                      - USER_NAME
                    workspace_id: 1
                    created_at: '2025-05-15 17:00:00'
                    updated_at: '2025-05-15 17:05:00'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Email Template Updated Successfully!'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: 'Welcome Template'
                      subject:
                        type: string
                        example: 'Welcome to Our Company'
                      body:
                        type: string
                        example: '<p>Hello USER_NAME!</p>'
                      placeholders:
                        type: array
                        example:
                          - USER_NAME
                        items:
                          type: string
                      workspace_id:
                        type: integer
                        example: 1
                      created_at:
                        type: string
                        example: '2025-05-15 17:00:00'
                      updated_at:
                        type: string
                        example: '2025-05-15 17:05:00'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Email template not found'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Email template not found'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'The name field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'The name field is required.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Something went wrong.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Something went wrong.'
      tags:
        - 'Email Template Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The name of the email template. Maximum length is 255 characters.'
                  example: 'Welcome Template'
                subject:
                  type: string
                  description: 'The subject of the email template. Maximum length is 255 characters.'
                  example: 'Welcome to Our Company'
                body:
                  type: string
                  description: 'The body of the email template, optionally base64-encoded.'
                  example: '<p>Hello USER_NAME!</p>'
                is_encoded:
                  type: string
                  description: "optional Indicates if the body is base64-encoded (value: '1'). Defaults to false."
                  example: '1'
                content:
                  type: string
                  description: "optional The base64-encoded body content, used if is_encoded is '1'."
                  example: PGh0bWw+PHA+SGVsbG8ge1VTRVJfTkFNRX0hPC9wPjwvaHRtbD4=
              required:
                - name
                - subject
                - body
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the email template to update. Must exist in the `email_templates` table.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/email-templates/destroy/{id}':
    delete:
      summary: 'Delete an email template.'
      operationId: deleteAnEmailTemplate
      description: 'This endpoint deletes a specific email template. The user must be authenticated and have appropriate permissions to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Email Template deleted successfully!'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Email Template deleted successfully!'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Email template not found'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Email template not found'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Something went wrong.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Something went wrong.'
      tags:
        - 'Email Template Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the email template to delete. Must exist in the `email_templates` table.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/email-templates/list/{id}':
    get:
      summary: 'List email templates or retrieve a single template.'
      operationId: listEmailTemplatesOrRetrieveASingleTemplate
      description: 'This endpoint retrieves a paginated list of email templates or a single template by ID, with optional search, sorting, and pagination parameters. The user must be authenticated to perform this action. The response includes permission details for editing and deletion.'
      parameters:
        -
          in: query
          name: search
          description: 'optional Filters templates by name, subject, or body.'
          example: Welcome
          required: false
          schema:
            type: string
            description: 'optional Filters templates by name, subject, or body.'
            example: Welcome
        -
          in: query
          name: sort
          description: 'optional The field to sort by (id, name, subject, created_at, updated_at). Defaults to id.'
          example: name
          required: false
          schema:
            type: string
            description: 'optional The field to sort by (id, name, subject, created_at, updated_at). Defaults to id.'
            example: name
        -
          in: query
          name: order
          description: 'optional The sort order (ASC, DESC). Defaults to DESC.'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional The sort order (ASC, DESC). Defaults to DESC.'
            example: ASC
        -
          in: query
          name: limit
          description: 'optional The number of templates per page (1-100). Defaults to 10.'
          example: 20
          required: false
          schema:
            type: integer
            description: 'optional The number of templates per page (1-100). Defaults to 10.'
            example: 20
        -
          in: query
          name: offset
          description: 'optional The number of templates to skip. Defaults to 0.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional The number of templates to skip. Defaults to 0.'
            example: 10
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Email templates retrieved successfully.'
                  data:
                    total: 5
                    data:
                      -
                        id: 1
                        name: 'Welcome Template'
                        subject: 'Welcome to Our Company'
                        body: '<p>Hello USER_NAME!</p>'
                        placeholders:
                          - USER_NAME
                        workspace_id: 1
                        created_at: '2025-05-15 17:00:00'
                        updated_at: '2025-05-15 17:00:00'
                        can_edit: true
                        can_delete: true
                    permissions:
                      can_edit: true
                      can_delete: true
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Email templates retrieved successfully.'
                  data:
                    type: object
                    properties:
                      total:
                        type: integer
                        example: 5
                      data:
                        type: array
                        example:
                          -
                            id: 1
                            name: 'Welcome Template'
                            subject: 'Welcome to Our Company'
                            body: '<p>Hello USER_NAME!</p>'
                            placeholders:
                              - USER_NAME
                            workspace_id: 1
                            created_at: '2025-05-15 17:00:00'
                            updated_at: '2025-05-15 17:00:00'
                            can_edit: true
                            can_delete: true
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1
                            name:
                              type: string
                              example: 'Welcome Template'
                            subject:
                              type: string
                              example: 'Welcome to Our Company'
                            body:
                              type: string
                              example: '<p>Hello USER_NAME!</p>'
                            placeholders:
                              type: array
                              example:
                                - USER_NAME
                              items:
                                type: string
                            workspace_id:
                              type: integer
                              example: 1
                            created_at:
                              type: string
                              example: '2025-05-15 17:00:00'
                            updated_at:
                              type: string
                              example: '2025-05-15 17:00:00'
                            can_edit:
                              type: boolean
                              example: true
                            can_delete:
                              type: boolean
                              example: true
                      permissions:
                        type: object
                        properties:
                          can_edit:
                            type: boolean
                            example: true
                          can_delete:
                            type: boolean
                            example: true
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Email template not found.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Email template not found.'
                  data:
                    type: array
                    example: []
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation failed: The search field must be a string.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation failed: The search field must be a string.'
                  data:
                    type: array
                    example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred.'
                  data:
                    type: array
                    example: []
      tags:
        - 'Email Template Management'
    parameters:
      -
        in: path
        name: id
        description: 'Optional parameter. optional The ID of the email template to retrieve. If provided, returns a single template. Must exist in the `email_templates` table.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/interviews/store:
    post:
      summary: 'Create a new interview.'
      operationId: createANewInterview
      description: 'This endpoint creates a new interview record for a candidate, with details such as the interviewer, round, schedule, mode, and status. The user must be authenticated to perform this action. A notification is triggered to inform the candidate and interviewer.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Interview Created Successfully!'
                  data:
                    id: 1
                    candidate_id: 101
                    interviewer_id: 7
                    round: Technical
                    scheduled_at: '2025-05-20 10:00:00'
                    mode: Online
                    location: Zoom
                    status: scheduled
                    created_at: '2025-05-15 16:15:00'
                    updated_at: '2025-05-15 16:15:00'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Interview Created Successfully!'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      candidate_id:
                        type: integer
                        example: 101
                      interviewer_id:
                        type: integer
                        example: 7
                      round:
                        type: string
                        example: Technical
                      scheduled_at:
                        type: string
                        example: '2025-05-20 10:00:00'
                      mode:
                        type: string
                        example: Online
                      location:
                        type: string
                        example: Zoom
                      status:
                        type: string
                        example: scheduled
                      created_at:
                        type: string
                        example: '2025-05-15 16:15:00'
                      updated_at:
                        type: string
                        example: '2025-05-15 16:15:00'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'The candidate_id field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'The candidate_id field is required.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while creating the interview.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while creating the interview.'
      tags:
        - 'Interview Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                candidate_id:
                  type: integer
                  description: 'The ID of the candidate for the interview. Must exist in the `candidates` table.'
                  example: 101
                interviewer_id:
                  type: integer
                  description: 'The ID of the interviewer. Must exist in the `users` table.'
                  example: 7
                round:
                  type: string
                  description: 'The interview round (e.g., Technical, HR). Maximum length is 255 characters.'
                  example: Technical
                scheduled_at:
                  type: string
                  description: 'The date and time of the interview (format: YYYY-MM-DD HH:MM:SS).'
                  example: '2025-05-20 10:00:00'
                mode:
                  type: string
                  description: 'The mode of the interview (e.g., Online, In-Person). Maximum length is 255 characters.'
                  example: Online
                location:
                  type: string
                  description: 'nullable The location of the interview (if applicable). Maximum length is 255 characters.'
                  example: Zoom
                status:
                  type: string
                  description: 'The status of the interview. Must be one of: scheduled, completed, cancelled.'
                  example: scheduled
              required:
                - candidate_id
                - interviewer_id
                - round
                - scheduled_at
                - mode
                - status
  '/api/interviews/update/{id}':
    post:
      summary: 'Update an interview.'
      operationId: updateAnInterview
      description: 'This endpoint updates the details of an existing interview, such as the candidate, interviewer, round, schedule, mode, location, or status. The user must be authenticated to perform this action. A notification is triggered if the status changes.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Interview Updated Successfully!'
                  data:
                    id: 1
                    candidate_id: 101
                    interviewer_id: 7
                    round: Technical
                    scheduled_at: '2025-05-20 10:00:00'
                    mode: Online
                    location: Zoom
                    status: completed
                    created_at: '2025-05-15 16:15:00'
                    updated_at: '2025-05-15 16:20:00'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Interview Updated Successfully!'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      candidate_id:
                        type: integer
                        example: 101
                      interviewer_id:
                        type: integer
                        example: 7
                      round:
                        type: string
                        example: Technical
                      scheduled_at:
                        type: string
                        example: '2025-05-20 10:00:00'
                      mode:
                        type: string
                        example: Online
                      location:
                        type: string
                        example: Zoom
                      status:
                        type: string
                        example: completed
                      created_at:
                        type: string
                        example: '2025-05-15 16:15:00'
                      updated_at:
                        type: string
                        example: '2025-05-15 16:20:00'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Interview not found'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Interview not found'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'The candidate_id field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'The candidate_id field is required.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while updating the interview.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while updating the interview.'
      tags:
        - 'Interview Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                candidate_id:
                  type: integer
                  description: 'The ID of the candidate for the interview. Must exist in the `candidates` table.'
                  example: 101
                interviewer_id:
                  type: integer
                  description: 'The ID of the interviewer. Must exist in the `users` table.'
                  example: 7
                round:
                  type: string
                  description: 'The interview round (e.g., Technical, HR). Maximum length is 255 characters.'
                  example: Technical
                scheduled_at:
                  type: string
                  description: 'The date and time of the interview (format: YYYY-MM-DD HH:MM:SS).'
                  example: '2025-05-20 10:00:00'
                mode:
                  type: string
                  description: 'The mode of the interview (e.g., Online, In-Person). Maximum length is 255 characters.'
                  example: Online
                location:
                  type: string
                  description: 'nullable The location of the interview (if applicable). Maximum length is 255 characters.'
                  example: Zoom
                status:
                  type: string
                  description: 'The status of the interview. Must be one of: scheduled, completed, cancelled.'
                  example: completed
              required:
                - candidate_id
                - interviewer_id
                - round
                - scheduled_at
                - mode
                - status
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the interview to update. Must exist in the `interviews` table.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/interviews/destroy/{id}':
    delete:
      summary: 'Delete an interview.'
      operationId: deleteAnInterview
      description: 'This endpoint deletes a specific interview record. The user must be authenticated and have appropriate permissions to perform this action.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Interview deleted successfully!'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Interview deleted successfully!'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Interview not found'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Interview not found'
                  data:
                    type: array
                    example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while deleting the interview.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while deleting the interview.'
      tags:
        - 'Interview Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the interview to delete. Must exist in the `interviews` table.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/interviews/list/{id}':
    get:
      summary: 'List interviews or retrieve a single interview.'
      operationId: listInterviewsOrRetrieveASingleInterview
      description: 'This endpoint retrieves a paginated list of interviews or a single interview by ID, with optional search, sorting, and status filtering. The user must be authenticated to perform this action. The response includes permission details for editing and deletion.'
      parameters:
        -
          in: query
          name: search
          description: 'optional Filters interviews by candidate name, interviewer name, round, status, location, or mode.'
          example: Technical
          required: false
          schema:
            type: string
            description: 'optional Filters interviews by candidate name, interviewer name, round, status, location, or mode.'
            example: Technical
        -
          in: query
          name: sort
          description: 'optional The field to sort by (id, newest, oldest, recently-updated, earliest-updated). Defaults to id.'
          example: newest
          required: false
          schema:
            type: string
            description: 'optional The field to sort by (id, newest, oldest, recently-updated, earliest-updated). Defaults to id.'
            example: newest
        -
          in: query
          name: limit
          description: 'optional The number of interviews per page (1-100). Defaults to 10.'
          example: 20
          required: false
          schema:
            type: integer
            description: 'optional The number of interviews per page (1-100). Defaults to 10.'
            example: 20
        -
          in: query
          name: offset
          description: 'optional The number of interviews to skip. Defaults to 0.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional The number of interviews to skip. Defaults to 0.'
            example: 10
        -
          in: query
          name: status
          description: 'optional Filters interviews by status (e.g., scheduled, completed, cancelled).'
          example: scheduled
          required: false
          schema:
            type: string
            description: 'optional Filters interviews by status (e.g., scheduled, completed, cancelled).'
            example: scheduled
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Interviews retrieved successfully'
                  data:
                    total: 10
                    data:
                      -
                        id: 1
                        candidate_id: 101
                        candidate_name: 'John Doe'
                        interviewer_id: 7
                        interviewer_name: 'Jane Smith'
                        round: Technical
                        scheduled_at: '2025-05-20 10:00:00'
                        mode: Online
                        location: Zoom
                        status: scheduled
                        created_at: '2025-05-15 16:15:00'
                        updated_at: '2025-05-15 16:15:00'
                        can_edit: true
                        can_delete: true
                    permissions:
                      can_edit: true
                      can_delete: true
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Interviews retrieved successfully'
                  data:
                    type: object
                    properties:
                      total:
                        type: integer
                        example: 10
                      data:
                        type: array
                        example:
                          -
                            id: 1
                            candidate_id: 101
                            candidate_name: 'John Doe'
                            interviewer_id: 7
                            interviewer_name: 'Jane Smith'
                            round: Technical
                            scheduled_at: '2025-05-20 10:00:00'
                            mode: Online
                            location: Zoom
                            status: scheduled
                            created_at: '2025-05-15 16:15:00'
                            updated_at: '2025-05-15 16:15:00'
                            can_edit: true
                            can_delete: true
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1
                            candidate_id:
                              type: integer
                              example: 101
                            candidate_name:
                              type: string
                              example: 'John Doe'
                            interviewer_id:
                              type: integer
                              example: 7
                            interviewer_name:
                              type: string
                              example: 'Jane Smith'
                            round:
                              type: string
                              example: Technical
                            scheduled_at:
                              type: string
                              example: '2025-05-20 10:00:00'
                            mode:
                              type: string
                              example: Online
                            location:
                              type: string
                              example: Zoom
                            status:
                              type: string
                              example: scheduled
                            created_at:
                              type: string
                              example: '2025-05-15 16:15:00'
                            updated_at:
                              type: string
                              example: '2025-05-15 16:15:00'
                            can_edit:
                              type: boolean
                              example: true
                            can_delete:
                              type: boolean
                              example: true
                      permissions:
                        type: object
                        properties:
                          can_edit:
                            type: boolean
                            example: true
                          can_delete:
                            type: boolean
                            example: true
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Interview not found.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Interview not found.'
                  data:
                    type: array
                    example: []
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation failed: The search field must be a string.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation failed: The search field must be a string.'
                  data:
                    type: array
                    example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred.'
                  data:
                    type: array
                    example: []
      tags:
        - 'Interview Management'
    parameters:
      -
        in: path
        name: id
        description: 'Optional parameter. optional The ID of the interview to retrieve. If provided, returns a single interview. Must exist in the `interviews` table.'
        required: true
        schema:
          type: integer
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: 1
  /api/lead-forms/store:
    post:
      summary: 'Create a new lead form.'
      operationId: createANewLeadForm
      description: "This endpoint creates a new lead form with dynamic, mappable fields for capturing leads, mapping them to lead sources, stages, and assigned users within the current workspace.\nThe user must be authenticated and authorized to manage lead forms."
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Lead form created successfully!'
                  form:
                    id: 12
                    title: 'Website Leads'
                    description: 'Capture leads from website visitors'
                    created_by: 1
                    workspace_id: 1
                    source_id: 2
                    stage_id: 2
                    assigned_to: 11
                    lead_form_fields:
                      -
                        id: 45
                        label: 'First Name'
                        name: first_name
                        type: text
                        is_required: true
                        is_mapped: true
                        options: null
                        order: 1
                      -
                        id: 46
                        label: 'Last Name'
                        name: last_name
                        type: text
                        is_required: true
                        is_mapped: true
                        options: null
                        order: 2
                      -
                        id: 47
                        label: Email
                        name: email
                        type: text
                        is_required: true
                        is_mapped: true
                        options: null
                        order: 3
                      -
                        id: 48
                        label: Phone
                        name: phone
                        type: number
                        is_required: true
                        is_mapped: true
                        options: null
                        order: 4
                      -
                        id: 49
                        label: Company
                        name: company
                        type: text
                        is_required: true
                        is_mapped: true
                        options: null
                        order: 5
                      -
                        id: 50
                        label: 'Interested Service'
                        name: null
                        type: select
                        is_required: true
                        is_mapped: false
                        options:
                          - 'Web Development'
                          - SEO
                          - 'UI/UX Design'
                        order: 6
                  public_url: 'https://yourapp.com/forms/website-leads'
                  embed_code: "<iframe src='https://yourapp.com/forms/embed/website-leads'></iframe>"
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Lead form created successfully!'
                  form:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 12
                      title:
                        type: string
                        example: 'Website Leads'
                      description:
                        type: string
                        example: 'Capture leads from website visitors'
                      created_by:
                        type: integer
                        example: 1
                      workspace_id:
                        type: integer
                        example: 1
                      source_id:
                        type: integer
                        example: 2
                      stage_id:
                        type: integer
                        example: 2
                      assigned_to:
                        type: integer
                        example: 11
                      lead_form_fields:
                        type: array
                        example:
                          -
                            id: 45
                            label: 'First Name'
                            name: first_name
                            type: text
                            is_required: true
                            is_mapped: true
                            options: null
                            order: 1
                          -
                            id: 46
                            label: 'Last Name'
                            name: last_name
                            type: text
                            is_required: true
                            is_mapped: true
                            options: null
                            order: 2
                          -
                            id: 47
                            label: Email
                            name: email
                            type: text
                            is_required: true
                            is_mapped: true
                            options: null
                            order: 3
                          -
                            id: 48
                            label: Phone
                            name: phone
                            type: number
                            is_required: true
                            is_mapped: true
                            options: null
                            order: 4
                          -
                            id: 49
                            label: Company
                            name: company
                            type: text
                            is_required: true
                            is_mapped: true
                            options: null
                            order: 5
                          -
                            id: 50
                            label: 'Interested Service'
                            name: null
                            type: select
                            is_required: true
                            is_mapped: false
                            options:
                              - 'Web Development'
                              - SEO
                              - 'UI/UX Design'
                            order: 6
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 45
                            label:
                              type: string
                              example: 'First Name'
                            name:
                              type: string
                              example: first_name
                            type:
                              type: string
                              example: text
                            is_required:
                              type: boolean
                              example: true
                            is_mapped:
                              type: boolean
                              example: true
                            options:
                              type: string
                              example: null
                            order:
                              type: integer
                              example: 1
                  public_url:
                    type: string
                    example: 'https://yourapp.com/forms/website-leads'
                  embed_code:
                    type: string
                    example: "<iframe src='https://yourapp.com/forms/embed/website-leads'></iframe>"
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation failed.'
                  errors:
                    title:
                      - 'Form title is required.'
                    fields.0.label:
                      - 'Field label is required.'
                    fields.0.type:
                      - 'Field type is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation failed.'
                  errors:
                    type: object
                    properties:
                      title:
                        type: array
                        example:
                          - 'Form title is required.'
                        items:
                          type: string
                      fields.0.label:
                        type: array
                        example:
                          - 'Field label is required.'
                        items:
                          type: string
                      fields.0.type:
                        type: array
                        example:
                          - 'Field type is required.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Failed to create form: An unexpected error occurred.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Failed to create form: An unexpected error occurred.'
      tags:
        - 'Lead Form Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: 'The title of the lead form. Max 255 characters.'
                  example: 'Website Leads'
                description:
                  type: string
                  description: 'optional The description of the lead form.'
                  example: 'Capture leads from website visitors'
                source_id:
                  type: integer
                  description: 'The ID of the lead source. Must exist in lead_sources.'
                  example: 2
                stage_id:
                  type: integer
                  description: 'The ID of the lead stage. Must exist in lead_stages.'
                  example: 2
                assigned_to:
                  type: integer
                  description: 'The ID of the user to assign leads to. Must exist in users.'
                  example: 11
                redirect_url:
                  type: string
                  description: 'Must be a valid URL.'
                  example: 'https://altenwerth.org/nam-occaecati-voluptates-culpa-nisi-molestias.html'
                fields:
                  type: array
                  description: 'An array of field definitions for the form.'
                  example:
                    - corrupti
                  items:
                    type: string
                'fields[0][label]':
                  type: string
                  description: 'Default required field in all forms.'
                  example: 'First Name'
                'fields[0][type]':
                  type: string
                  description: ''
                  example: text
                'fields[0][is_required]':
                  type: boolean
                  description: ''
                  example: true
                'fields[0][is_mapped]':
                  type: boolean
                  description: ''
                  example: true
                'fields[0][name]':
                  type: string
                  description: ''
                  example: first_name
                'fields[0][placeholder]':
                  type: string
                  description: optional
                  example: 'Enter your first name'
                'fields[1][label]':
                  type: string
                  description: 'Default required field in all forms.'
                  example: 'Last Name'
                'fields[1][type]':
                  type: string
                  description: ''
                  example: text
                'fields[1][is_required]':
                  type: boolean
                  description: ''
                  example: true
                'fields[1][is_mapped]':
                  type: boolean
                  description: ''
                  example: true
                'fields[1][name]':
                  type: string
                  description: ''
                  example: last_name
                'fields[1][placeholder]':
                  type: string
                  description: optional
                  example: 'Enter your last name'
                'fields[2][label]':
                  type: string
                  description: 'Default required field in all forms.'
                  example: Email
                'fields[2][type]':
                  type: string
                  description: ''
                  example: text
                'fields[2][is_required]':
                  type: boolean
                  description: ''
                  example: true
                'fields[2][is_mapped]':
                  type: boolean
                  description: ''
                  example: true
                'fields[2][name]':
                  type: string
                  description: ''
                  example: email
                'fields[2][placeholder]':
                  type: string
                  description: optional
                  example: 'Enter your email'
                'fields[3][label]':
                  type: string
                  description: 'Default required field in all forms.'
                  example: Phone
                'fields[3][type]':
                  type: string
                  description: ''
                  example: number
                'fields[3][is_required]':
                  type: boolean
                  description: ''
                  example: true
                'fields[3][is_mapped]':
                  type: boolean
                  description: ''
                  example: true
                'fields[3][name]':
                  type: string
                  description: ''
                  example: phone
                'fields[3][placeholder]':
                  type: string
                  description: optional
                  example: 'Enter your phone number'
                'fields[4][label]':
                  type: string
                  description: 'Default required field in all forms.'
                  example: Company
                'fields[4][type]':
                  type: string
                  description: ''
                  example: text
                'fields[4][is_required]':
                  type: boolean
                  description: ''
                  example: true
                'fields[4][is_mapped]':
                  type: boolean
                  description: ''
                  example: true
                'fields[4][name]':
                  type: string
                  description: ''
                  example: company
                'fields[4][placeholder]':
                  type: string
                  description: optional
                  example: 'Enter your company name'
              required:
                - title
                - source_id
                - stage_id
                - assigned_to
                - fields
                - 'fields[0][label]'
                - 'fields[0][type]'
                - 'fields[0][is_required]'
                - 'fields[0][is_mapped]'
                - 'fields[0][name]'
                - 'fields[1][label]'
                - 'fields[1][type]'
                - 'fields[1][is_required]'
                - 'fields[1][is_mapped]'
                - 'fields[1][name]'
                - 'fields[2][label]'
                - 'fields[2][type]'
                - 'fields[2][is_required]'
                - 'fields[2][is_mapped]'
                - 'fields[2][name]'
                - 'fields[3][label]'
                - 'fields[3][type]'
                - 'fields[3][is_required]'
                - 'fields[3][is_mapped]'
                - 'fields[3][name]'
                - 'fields[4][label]'
                - 'fields[4][type]'
                - 'fields[4][is_required]'
                - 'fields[4][is_mapped]'
                - 'fields[4][name]'
  '/api/lead-forms/update/{id}':
    post:
      summary: 'Update an existing lead form.'
      operationId: updateAnExistingLeadForm
      description: "This endpoint updates an existing lead form, including its title, description, source, stage, assigned user, and associated fields.\nThe user must be authenticated and authorized to manage lead forms."
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Lead form updated successfully'
                  data:
                    id: 5
                    form:
                      id: 5
                      title: 'Website Leads'
                      description: 'Capture leads from website visitors'
                      source: Website
                      stage: New
                      assigned_to:
                        id: 11
                        first_name: Dimpal
                        last_name: Shah
                        email: dimpal@example.com
                      is_active: true
                      fields:
                        -
                          label: 'First Name'
                          type: text
                          is_required: true
                          is_mapped: true
                          name: first_name
                          options: null
                          placeholder: 'Enter your first name'
                        -
                          label: 'Interested Service'
                          type: select
                          is_required: true
                          is_mapped: false
                          options:
                            - 'Web Development'
                            - SEO
                            - 'UI/UX Design'
                          placeholder: null
                      created_at: '2025-07-21T12:00:00.000000Z'
                      updated_at: '2025-07-21T13:00:00.000000Z'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Lead form updated successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 5
                      form:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 5
                          title:
                            type: string
                            example: 'Website Leads'
                          description:
                            type: string
                            example: 'Capture leads from website visitors'
                          source:
                            type: string
                            example: Website
                          stage:
                            type: string
                            example: New
                          assigned_to:
                            type: object
                            properties:
                              id:
                                type: integer
                                example: 11
                              first_name:
                                type: string
                                example: Dimpal
                              last_name:
                                type: string
                                example: Shah
                              email:
                                type: string
                                example: dimpal@example.com
                          is_active:
                            type: boolean
                            example: true
                          fields:
                            type: array
                            example:
                              -
                                label: 'First Name'
                                type: text
                                is_required: true
                                is_mapped: true
                                name: first_name
                                options: null
                                placeholder: 'Enter your first name'
                              -
                                label: 'Interested Service'
                                type: select
                                is_required: true
                                is_mapped: false
                                options:
                                  - 'Web Development'
                                  - SEO
                                  - 'UI/UX Design'
                                placeholder: null
                            items:
                              type: object
                              properties:
                                label:
                                  type: string
                                  example: 'First Name'
                                type:
                                  type: string
                                  example: text
                                is_required:
                                  type: boolean
                                  example: true
                                is_mapped:
                                  type: boolean
                                  example: true
                                name:
                                  type: string
                                  example: first_name
                                options:
                                  type: string
                                  example: null
                                placeholder:
                                  type: string
                                  example: 'Enter your first name'
                          created_at:
                            type: string
                            example: '2025-07-21T12:00:00.000000Z'
                          updated_at:
                            type: string
                            example: '2025-07-21T13:00:00.000000Z'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation failed'
                  errors:
                    title:
                      - 'The title field is required.'
                    fields.0.label:
                      - 'The field label is required.'
                    fields.0.type:
                      - 'The field type is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation failed'
                  errors:
                    type: object
                    properties:
                      title:
                        type: array
                        example:
                          - 'The title field is required.'
                        items:
                          type: string
                      fields.0.label:
                        type: array
                        example:
                          - 'The field label is required.'
                        items:
                          type: string
                      fields.0.type:
                        type: array
                        example:
                          - 'The field type is required.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Failed to update form'
                  data:
                    error: 'SQLSTATE[HY000]: General error: ...'
                    line: 120
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Failed to update form'
                  data:
                    type: object
                    properties:
                      error:
                        type: string
                        example: 'SQLSTATE[HY000]: General error: ...'
                      line:
                        type: integer
                        example: 120
      tags:
        - 'Lead Form Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: 'The title of the lead form. Max 255 characters.'
                  example: 'Website Leads'
                description:
                  type: string
                  description: 'optional The description of the lead form.'
                  example: 'Capture leads from website visitors'
                source_id:
                  type: integer
                  description: 'The ID of the lead source. Must exist in lead_sources.'
                  example: 2
                stage_id:
                  type: integer
                  description: 'The ID of the lead stage. Must exist in lead_stages.'
                  example: 2
                assigned_to:
                  type: integer
                  description: 'The ID of the user to assign leads to. Must exist in users.'
                  example: 11
                fields:
                  type: array
                  description: 'An array of at least 5 field objects for the form.'
                  example:
                    - ut
                  items:
                    type: string
                'fields[0][label]':
                  type: string
                  description: 'Default required field in all forms.'
                  example: 'First Name'
                'fields[0][type]':
                  type: string
                  description: ''
                  example: text
                'fields[0][is_required]':
                  type: boolean
                  description: ''
                  example: true
                'fields[0][is_mapped]':
                  type: boolean
                  description: ''
                  example: true
                'fields[0][name]':
                  type: string
                  description: ''
                  example: first_name
                'fields[0][placeholder]':
                  type: string
                  description: optional
                  example: 'Enter your first name'
                'fields[1][label]':
                  type: string
                  description: 'Default required field in all forms.'
                  example: 'Last Name'
                'fields[1][type]':
                  type: string
                  description: ''
                  example: text
                'fields[1][is_required]':
                  type: boolean
                  description: ''
                  example: true
                'fields[1][is_mapped]':
                  type: boolean
                  description: ''
                  example: true
                'fields[1][name]':
                  type: string
                  description: ''
                  example: last_name
                'fields[1][placeholder]':
                  type: string
                  description: optional
                  example: 'Enter your last name'
                'fields[2][label]':
                  type: string
                  description: 'Default required field in all forms.'
                  example: Email
                'fields[2][type]':
                  type: string
                  description: ''
                  example: text
                'fields[2][is_required]':
                  type: boolean
                  description: ''
                  example: true
                'fields[2][is_mapped]':
                  type: boolean
                  description: ''
                  example: true
                'fields[2][name]':
                  type: string
                  description: ''
                  example: email
                'fields[2][placeholder]':
                  type: string
                  description: optional
                  example: 'Enter your email'
                'fields[3][label]':
                  type: string
                  description: 'Default required field in all forms.'
                  example: Phone
                'fields[3][type]':
                  type: string
                  description: ''
                  example: number
                'fields[3][is_required]':
                  type: boolean
                  description: ''
                  example: true
                'fields[3][is_mapped]':
                  type: boolean
                  description: ''
                  example: true
                'fields[3][name]':
                  type: string
                  description: ''
                  example: phone
                'fields[3][placeholder]':
                  type: string
                  description: optional
                  example: 'Enter your phone number'
                'fields[4][label]':
                  type: string
                  description: 'Default required field in all forms.'
                  example: Company
                'fields[4][type]':
                  type: string
                  description: ''
                  example: text
                'fields[4][is_required]':
                  type: boolean
                  description: ''
                  example: true
                'fields[4][is_mapped]':
                  type: boolean
                  description: ''
                  example: true
                'fields[4][name]':
                  type: string
                  description: ''
                  example: company
                'fields[4][placeholder]':
                  type: string
                  description: optional
                  example: 'Enter your company name'
              required:
                - title
                - source_id
                - stage_id
                - assigned_to
                - fields
                - 'fields[0][label]'
                - 'fields[0][type]'
                - 'fields[0][is_required]'
                - 'fields[0][is_mapped]'
                - 'fields[0][name]'
                - 'fields[1][label]'
                - 'fields[1][type]'
                - 'fields[1][is_required]'
                - 'fields[1][is_mapped]'
                - 'fields[1][name]'
                - 'fields[2][label]'
                - 'fields[2][type]'
                - 'fields[2][is_required]'
                - 'fields[2][is_mapped]'
                - 'fields[2][name]'
                - 'fields[3][label]'
                - 'fields[3][type]'
                - 'fields[3][is_required]'
                - 'fields[3][is_mapped]'
                - 'fields[3][name]'
                - 'fields[4][label]'
                - 'fields[4][type]'
                - 'fields[4][is_required]'
                - 'fields[4][is_mapped]'
                - 'fields[4][name]'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the lead form to update.'
        example: 5
        required: true
        schema:
          type: integer
  '/api/lead-forms/destroy/{id}':
    delete:
      summary: 'Delete a Lead Form.'
      operationId: deleteALeadForm
      description: "This endpoint allows authenticated users to delete a specific status. Before deletion,\nall associated projects and tasks will be updated to have a default status ID of `0`."
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": false,\n  \"message\": \"Lead Form deleted successfully.\",\n  \"id\": 101,\n\n}"
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Lead Form not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Lead Form not found.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "Lead Form couldn't be deleted."
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "Lead Form couldn't be deleted."
      tags:
        - 'Lead Form Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the status to delete.'
        example: 14
        required: true
        schema:
          type: integer
  /api/lead-forms/api-list:
    get:
      summary: 'List lead forms with optional filters, sorting, and pagination.'
      operationId: listLeadFormsWithOptionalFiltersSortingAndPagination
      description: 'This endpoint retrieves a paginated list of lead forms or a specific lead form by ID, with optional search, sorting, and pagination parameters. The response includes permission details for editing and deletion. The user must be authenticated and authorized to manage lead forms.'
      parameters:
        -
          in: query
          name: id
          description: 'optional The ID of a specific lead form to retrieve.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'optional The ID of a specific lead form to retrieve.'
            example: 1
        -
          in: query
          name: search
          description: 'optional Filters lead forms by title or description.'
          example: Website
          required: false
          schema:
            type: string
            description: 'optional Filters lead forms by title or description.'
            example: Website
        -
          in: query
          name: sort
          description: 'optional The column to sort by (id, title, created_at, updated_at). Defaults to id.'
          example: created_at
          required: false
          schema:
            type: string
            description: 'optional The column to sort by (id, title, created_at, updated_at). Defaults to id.'
            example: created_at
        -
          in: query
          name: order
          description: 'optional The sort order (ASC, DESC). Defaults to DESC.'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional The sort order (ASC, DESC). Defaults to DESC.'
            example: ASC
        -
          in: query
          name: limit
          description: 'optional Number of lead forms per page (1-100). Defaults to 10.'
          example: 20
          required: false
          schema:
            type: integer
            description: 'optional Number of lead forms per page (1-100). Defaults to 10.'
            example: 20
        -
          in: query
          name: offset
          description: 'optional Number of lead forms to skip. Defaults to 0.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional Number of lead forms to skip. Defaults to 0.'
            example: 10
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": false,\n  \"message\": \"Lead forms retrieved successfully.\",\n  \"total\": 5,\n  \"data\": [\n    {\n      \"id\": 1,\n      \"title\": \"Website Lead Form\",\n      \"description\": \"Lead form for website captures.\",\n      \"source\": { \"id\": 2, \"name\": \"Website\" },\n      \"stage\": { \"id\": 3, \"name\": \"New\", \"color\": \"primary\" },\n      \"assigned_to\": { \"id\": 5, \"first_name\": \"John\", \"last_name\": \"Doe\", \"email\": \"john@example.com\", \"photo\": \"...\" },\n      \"fields\": [...],\n      \"public_url\": \"https://...\",\n      \"embed_code\": \"<iframe ...>\",\n      \"leads_count\": 15,\n      \"created_at\": \"2025-07-21 10:15:00\",\n      \"updated_at\": \"2025-07-21 10:15:00\",\n      \"sent_time\": \"2 hours ago\"\n    }\n  ],\n  \"permissions\": {\n    \"can_edit\": true,\n    \"can_delete\": true\n  }\n}"
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Lead form(s) not found.'
                  total: 0
                  data: []
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Lead form(s) not found.'
                  total:
                    type: integer
                    example: 0
                  data:
                    type: array
                    example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while retrieving the lead forms.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while retrieving the lead forms.'
      tags:
        - 'Lead Form Management'
  '/api/lead-forms/{leadForm_id}/toggle':
    post:
      summary: 'Toggle lead form active/inactive status.'
      operationId: toggleLeadFormActiveinactiveStatus
      description: "This endpoint toggles the `is_active` status of a lead form between active (1) and inactive (0).\nThe user must be authenticated and authorized to manage lead forms."
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: true
                  message: 'Form status updated successfully!'
                  status: true
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Form status updated successfully!'
                  status:
                    type: boolean
                    example: true
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Lead form not found.'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Lead form not found.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while updating the lead form status.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while updating the lead form status.'
      tags:
        - 'Lead Form Management'
    parameters:
      -
        in: path
        name: leadForm_id
        description: 'The ID of the leadForm.'
        example: 6
        required: true
        schema:
          type: integer
      -
        in: path
        name: lead_form
        description: 'The ID of the lead form to toggle status for.'
        example: 12
        required: true
        schema:
          type: integer
  '/api/lead-forms/responses/api-list/{id}':
    get:
      summary: 'List lead form responses with optional filters, sorting, and pagination.'
      operationId: listLeadFormResponsesWithOptionalFiltersSortingAndPagination
      description: "This endpoint retrieves a paginated list of responses (leads) for a specific lead form, with optional search, sorting, and pagination parameters.\nThe user must be authenticated and authorized to view lead form responses."
      parameters:
        -
          in: query
          name: search
          description: 'optional Filters responses by first name, last name, email, or company.'
          example: John
          required: false
          schema:
            type: string
            description: 'optional Filters responses by first name, last name, email, or company.'
            example: John
        -
          in: query
          name: sort
          description: 'optional The column to sort by (id, first_name, last_name, email, created_at). Defaults to id.'
          example: created_at
          required: false
          schema:
            type: string
            description: 'optional The column to sort by (id, first_name, last_name, email, created_at). Defaults to id.'
            example: created_at
        -
          in: query
          name: order
          description: 'optional The sort order (ASC, DESC). Defaults to DESC.'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional The sort order (ASC, DESC). Defaults to DESC.'
            example: ASC
        -
          in: query
          name: limit
          description: 'optional Number of responses per page (1-100). Defaults to 10.'
          example: 20
          required: false
          schema:
            type: integer
            description: 'optional Number of responses per page (1-100). Defaults to 10.'
            example: 20
        -
          in: query
          name: offset
          description: 'optional Number of responses to skip. Defaults to 0.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional Number of responses to skip. Defaults to 0.'
            example: 10
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Lead form responses retrieved successfully.'
                  total: 2
                  data:
                    -
                      id: 5
                      name: 'John Doe'
                      email: john@example.com
                      phone: '9876543210'
                      company: 'Example Corp'
                      submitted_at: '2025-07-21'
                      sent_time: '2 hours ago'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Lead form responses retrieved successfully.'
                  total:
                    type: integer
                    example: 2
                  data:
                    type: array
                    example:
                      -
                        id: 5
                        name: 'John Doe'
                        email: john@example.com
                        phone: '9876543210'
                        company: 'Example Corp'
                        submitted_at: '2025-07-21'
                        sent_time: '2 hours ago'
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 5
                        name:
                          type: string
                          example: 'John Doe'
                        email:
                          type: string
                          example: john@example.com
                        phone:
                          type: string
                          example: '9876543210'
                        company:
                          type: string
                          example: 'Example Corp'
                        submitted_at:
                          type: string
                          example: '2025-07-21'
                        sent_time:
                          type: string
                          example: '2 hours ago'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Lead form responses not found.'
                  total: 0
                  data: []
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Lead form responses not found.'
                  total:
                    type: integer
                    example: 0
                  data:
                    type: array
                    example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while retrieving the lead form responses.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while retrieving the lead form responses.'
      tags:
        - 'Lead Form Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the lead form for which to retrieve responses.'
        example: 1
        required: true
        schema:
          type: integer
  /api/leads/store:
    post:
      summary: 'Create a new lead.'
      operationId: createANewLead
      description: 'This endpoint creates a new lead in the system. The user must be authenticated and belong to the workspace. All required fields must be provided, and the email must be unique.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Lead created successfully!'
                  data:
                    id: 1
                    first_name: John
                    last_name: Doe
                    email: john.doe@example.com
                    phone: '1234567890'
                    company: 'Acme Corp'
                    stage_id: 2
                    source_id: 3
                    assigned_to: 7
                    created_at: '2025-05-15T10:00:00.000000Z'
                    updated_at: '2025-05-15T10:00:00.000000Z'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Lead created successfully!'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      first_name:
                        type: string
                        example: John
                      last_name:
                        type: string
                        example: Doe
                      email:
                        type: string
                        example: john.doe@example.com
                      phone:
                        type: string
                        example: '1234567890'
                      company:
                        type: string
                        example: 'Acme Corp'
                      stage_id:
                        type: integer
                        example: 2
                      source_id:
                        type: integer
                        example: 3
                      assigned_to:
                        type: integer
                        example: 7
                      created_at:
                        type: string
                        example: '2025-05-15T10:00:00.000000Z'
                      updated_at:
                        type: string
                        example: '2025-05-15T10:00:00.000000Z'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation failed.'
                  errors:
                    email:
                      - 'The email field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation failed.'
                  errors:
                    type: object
                    properties:
                      email:
                        type: array
                        example:
                          - 'The email field is required.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while creating the lead.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while creating the lead.'
      tags:
        - 'Leads Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                first_name:
                  type: string
                  description: 'The first name of the lead. Max 255 characters.'
                  example: John
                last_name:
                  type: string
                  description: 'The last name of the lead. Max 255 characters.'
                  example: Doe
                email:
                  type: string
                  description: 'The email address of the lead. Must be unique.'
                  example: john.doe@example.com
                phone:
                  type: string
                  description: 'The phone number of the lead. Max 20 characters.'
                  example: '1234567890'
                country_code:
                  type: string
                  description: 'The country code for the phone number. Max 5 characters.'
                  example: '+1'
                country_iso_code:
                  type: string
                  description: 'The ISO 2-letter country code.'
                  example: US
                source_id:
                  type: integer
                  description: 'The ID of the lead source. Must exist in `lead_sources`.'
                  example: 3
                stage_id:
                  type: integer
                  description: 'The ID of the lead stage. Must exist in `lead_stages`.'
                  example: 2
                assigned_to:
                  type: integer
                  description: 'The ID of the user assigned to this lead. Must exist in `users`.'
                  example: 7
                job_title:
                  type: string
                  description: 'optional The lead’s job title. Max 255 characters.'
                  example: 'Marketing Manager'
                industry:
                  type: string
                  description: 'optional The industry the lead belongs to. Max 255 characters.'
                  example: Technology
                company:
                  type: string
                  description: 'The company name. Max 255 characters.'
                  example: 'Acme Corp'
                website:
                  type: string
                  description: 'optional The company website URL. Must be a valid URL.'
                  example: 'https://acme.com'
                linkedin:
                  type: string
                  description: 'optional The LinkedIn profile URL. Must be a valid URL.'
                  example: 'https://linkedin.com/in/johndoe'
                instagram:
                  type: string
                  description: 'optional The Instagram profile URL. Must be a valid URL.'
                  example: 'https://instagram.com/johndoe'
                facebook:
                  type: string
                  description: 'optional The Facebook profile URL. Must be a valid URL.'
                  example: 'https://facebook.com/johndoe'
                pinterest:
                  type: string
                  description: 'optional The Pinterest profile URL. Must be a valid URL.'
                  example: 'https://pinterest.com/johndoe'
                city:
                  type: string
                  description: 'optional The city of the lead. Max 255 characters.'
                  example: 'New York'
                state:
                  type: string
                  description: 'optional The state of the lead. Max 255 characters.'
                  example: NY
                zip:
                  type: string
                  description: 'optional The zip/postal code. Max 20 characters.'
                  example: '10001'
                country:
                  type: string
                  description: 'optional The country of the lead. Max 255 characters.'
                  example: 'United States'
              required:
                - first_name
                - last_name
                - email
                - phone
                - country_code
                - country_iso_code
                - source_id
                - stage_id
                - assigned_to
                - company
  '/api/leads/get/{id}':
    get:
      summary: 'Retrieve a specific lead.'
      operationId: retrieveASpecificLead
      description: 'This endpoint retrieves the details of a specific lead by its ID. The user must be authenticated and authorized to access the lead.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Lead retrieved successfully!'
                  data:
                    id: 5
                    first_name: John
                    last_name: Doe
                    email: john.doe@example.com
                    phone: '1234567890'
                    company: 'Acme Corp'
                    stage_id: 2
                    source_id: 3
                    assigned_to: 7
                    created_at: '2025-05-10T12:30:00.000000Z'
                    updated_at: '2025-05-15T09:12:00.000000Z'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Lead retrieved successfully!'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 5
                      first_name:
                        type: string
                        example: John
                      last_name:
                        type: string
                        example: Doe
                      email:
                        type: string
                        example: john.doe@example.com
                      phone:
                        type: string
                        example: '1234567890'
                      company:
                        type: string
                        example: 'Acme Corp'
                      stage_id:
                        type: integer
                        example: 2
                      source_id:
                        type: integer
                        example: 3
                      assigned_to:
                        type: integer
                        example: 7
                      created_at:
                        type: string
                        example: '2025-05-10T12:30:00.000000Z'
                      updated_at:
                        type: string
                        example: '2025-05-15T09:12:00.000000Z'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Lead not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Lead not found.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while retrieving the lead.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while retrieving the lead.'
      tags:
        - 'Leads Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the lead to retrieve. Must exist in the `leads` table.'
        example: 5
        required: true
        schema:
          type: integer
  /api/leads/list:
    get:
      summary: 'List leads with optional filters, sorting, and pagination.'
      operationId: listLeadsWithOptionalFiltersSortingAndPagination
      description: 'This endpoint retrieves a paginated list of leads accessible to the authenticated user, with optional search, source and stage filters, date range filtering, and sorting. Permissions for editing and deleting are included in the response.'
      parameters:
        -
          in: query
          name: search
          description: 'optional Filters leads by first name, last name, email, phone, company, job title, or ID.'
          example: John
          required: false
          schema:
            type: string
            description: 'optional Filters leads by first name, last name, email, phone, company, job title, or ID.'
            example: John
        -
          in: query
          name: source_ids
          description: 'optional Filters leads by one or more source IDs.'
          example:
            - 1
            - 2
          required: false
          schema:
            type: array
            description: 'optional Filters leads by one or more source IDs.'
            example:
              - 1
              - 2
            items:
              type: string
        -
          in: query
          name: stage_ids
          description: 'optional Filters leads by one or more stage IDs.'
          example:
            - 3
            - 4
          required: false
          schema:
            type: array
            description: 'optional Filters leads by one or more stage IDs.'
            example:
              - 3
              - 4
            items:
              type: string
        -
          in: query
          name: start_date
          description: 'optional Filters leads created on or after this date (YYYY-MM-DD).'
          example: '2025-01-01'
          required: false
          schema:
            type: string
            description: 'optional Filters leads created on or after this date (YYYY-MM-DD).'
            example: '2025-01-01'
        -
          in: query
          name: end_date
          description: 'optional Filters leads created on or before this date (YYYY-MM-DD).'
          example: '2025-05-01'
          required: false
          schema:
            type: string
            description: 'optional Filters leads created on or before this date (YYYY-MM-DD).'
            example: '2025-05-01'
        -
          in: query
          name: sort
          description: 'optional Sorts leads by criteria (newest, oldest, recently-updated, earliest-updated). Defaults to newest.'
          example: newest
          required: false
          schema:
            type: string
            description: 'optional Sorts leads by criteria (newest, oldest, recently-updated, earliest-updated). Defaults to newest.'
            example: newest
        -
          in: query
          name: limit
          description: 'optional Number of leads per page (1-100). Defaults to 10.'
          example: 20
          required: false
          schema:
            type: integer
            description: 'optional Number of leads per page (1-100). Defaults to 10.'
            example: 20
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Leads retrieved successfully!'
                  data:
                    total: 50
                    data:
                      -
                        id: 1
                        first_name: John
                        last_name: Doe
                        email: john.doe@example.com
                        phone: '1234567890'
                        company: 'Acme Corp'
                        job_title: Manager
                        source:
                          id: 1
                          name: Website
                        stage:
                          id: 2
                          name: Negotiation
                          color: primary
                        assigned_user:
                          id: 5
                          name: 'Jane Smith'
                        created_at: '2025-01-10T12:00:00.000000Z'
                        updated_at: '2025-05-15T10:00:00.000000Z'
                        can_edit: true
                        can_delete: true
                    permissions:
                      can_edit: true
                      can_delete: true
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Leads retrieved successfully!'
                  data:
                    type: object
                    properties:
                      total:
                        type: integer
                        example: 50
                      data:
                        type: array
                        example:
                          -
                            id: 1
                            first_name: John
                            last_name: Doe
                            email: john.doe@example.com
                            phone: '1234567890'
                            company: 'Acme Corp'
                            job_title: Manager
                            source:
                              id: 1
                              name: Website
                            stage:
                              id: 2
                              name: Negotiation
                              color: primary
                            assigned_user:
                              id: 5
                              name: 'Jane Smith'
                            created_at: '2025-01-10T12:00:00.000000Z'
                            updated_at: '2025-05-15T10:00:00.000000Z'
                            can_edit: true
                            can_delete: true
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1
                            first_name:
                              type: string
                              example: John
                            last_name:
                              type: string
                              example: Doe
                            email:
                              type: string
                              example: john.doe@example.com
                            phone:
                              type: string
                              example: '1234567890'
                            company:
                              type: string
                              example: 'Acme Corp'
                            job_title:
                              type: string
                              example: Manager
                            source:
                              type: object
                              properties:
                                id:
                                  type: integer
                                  example: 1
                                name:
                                  type: string
                                  example: Website
                            stage:
                              type: object
                              properties:
                                id:
                                  type: integer
                                  example: 2
                                name:
                                  type: string
                                  example: Negotiation
                                color:
                                  type: string
                                  example: primary
                            assigned_user:
                              type: object
                              properties:
                                id:
                                  type: integer
                                  example: 5
                                name:
                                  type: string
                                  example: 'Jane Smith'
                            created_at:
                              type: string
                              example: '2025-01-10T12:00:00.000000Z'
                            updated_at:
                              type: string
                              example: '2025-05-15T10:00:00.000000Z'
                            can_edit:
                              type: boolean
                              example: true
                            can_delete:
                              type: boolean
                              example: true
                      permissions:
                        type: object
                        properties:
                          can_edit:
                            type: boolean
                            example: true
                          can_delete:
                            type: boolean
                            example: true
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while retrieving the leads.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while retrieving the leads.'
      tags:
        - 'Leads Management'
  '/api/leads/update/{id}':
    post:
      summary: 'Update a specific lead.'
      operationId: updateASpecificLead
      description: 'This endpoint updates the details of an existing lead. The user must be authenticated and belong to the workspace. The email must remain unique among other leads.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Lead updated successfully!'
                  data:
                    id: 5
                    first_name: John
                    last_name: Doe
                    email: john.doe@example.com
                    phone: '1234567890'
                    company: 'Acme Corp'
                    stage_id: 2
                    source_id: 3
                    assigned_to: 7
                    created_at: '2025-05-10T12:30:00.000000Z'
                    updated_at: '2025-05-15T09:12:00.000000Z'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Lead updated successfully!'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 5
                      first_name:
                        type: string
                        example: John
                      last_name:
                        type: string
                        example: Doe
                      email:
                        type: string
                        example: john.doe@example.com
                      phone:
                        type: string
                        example: '1234567890'
                      company:
                        type: string
                        example: 'Acme Corp'
                      stage_id:
                        type: integer
                        example: 2
                      source_id:
                        type: integer
                        example: 3
                      assigned_to:
                        type: integer
                        example: 7
                      created_at:
                        type: string
                        example: '2025-05-10T12:30:00.000000Z'
                      updated_at:
                        type: string
                        example: '2025-05-15T09:12:00.000000Z'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Lead not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Lead not found.'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation failed.'
                  errors:
                    email:
                      - 'The email has already been taken.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation failed.'
                  errors:
                    type: object
                    properties:
                      email:
                        type: array
                        example:
                          - 'The email has already been taken.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while updating the lead.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while updating the lead.'
      tags:
        - 'Leads Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                first_name:
                  type: string
                  description: 'The first name of the lead. Max 255 characters.'
                  example: John
                last_name:
                  type: string
                  description: 'The last name of the lead. Max 255 characters.'
                  example: Doe
                email:
                  type: string
                  description: 'The email address. Must be unique except for this lead.'
                  example: john.doe@example.com
                phone:
                  type: string
                  description: 'The phone number. Max 20 characters.'
                  example: '1234567890'
                country_code:
                  type: string
                  description: 'The country code for the phone number. Max 5 characters.'
                  example: '+1'
                country_iso_code:
                  type: string
                  description: 'The ISO 2-letter country code.'
                  example: US
                source_id:
                  type: integer
                  description: 'The ID of the lead source. Must exist in `lead_sources`.'
                  example: 3
                stage_id:
                  type: integer
                  description: 'The ID of the lead stage. Must exist in `lead_stages`.'
                  example: 2
                assigned_to:
                  type: integer
                  description: 'The ID of the user assigned to this lead. Must exist in `users`.'
                  example: 7
                job_title:
                  type: string
                  description: 'optional The lead’s job title. Max 255 characters.'
                  example: CTO
                industry:
                  type: string
                  description: 'optional The industry the lead belongs to. Max 255 characters.'
                  example: SaaS
                company:
                  type: string
                  description: 'The company name. Max 255 characters.'
                  example: 'Acme Corp'
                website:
                  type: string
                  description: 'optional The company website URL. Must be a valid URL.'
                  example: 'https://acme.com'
                linkedin:
                  type: string
                  description: 'optional The LinkedIn profile URL. Must be a valid URL.'
                  example: 'https://linkedin.com/in/johndoe'
                instagram:
                  type: string
                  description: 'optional The Instagram profile URL. Must be a valid URL.'
                  example: 'https://instagram.com/johndoe'
                facebook:
                  type: string
                  description: 'optional The Facebook profile URL. Must be a valid URL.'
                  example: 'https://facebook.com/johndoe'
                pinterest:
                  type: string
                  description: 'optional The Pinterest profile URL. Must be a valid URL.'
                  example: 'https://pinterest.com/johndoe'
                city:
                  type: string
                  description: 'optional The city of the lead. Max 255 characters.'
                  example: 'San Francisco'
                state:
                  type: string
                  description: 'optional The state of the lead. Max 255 characters.'
                  example: CA
                zip:
                  type: string
                  description: 'optional The zip/postal code. Max 20 characters.'
                  example: '94107'
                country:
                  type: string
                  description: 'optional The country of the lead. Max 255 characters.'
                  example: 'United States'
              required:
                - first_name
                - last_name
                - email
                - phone
                - country_code
                - country_iso_code
                - source_id
                - stage_id
                - assigned_to
                - company
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the lead to update. Must exist in the `leads` table.'
        example: 5
        required: true
        schema:
          type: integer
  '/api/leads/destroy/{id}':
    delete:
      summary: 'Delete a specific lead.'
      operationId: deleteASpecificLead
      description: 'This endpoint deletes a specific lead by its ID. The user must be authenticated and have appropriate permissions to perform the deletion.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Lead deleted successfully!'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Lead deleted successfully!'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Lead not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Lead not found.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while deleting the lead.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while deleting the lead.'
      tags:
        - 'Leads Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the lead to delete. Must exist in the `leads` table.'
        example: 5
        required: true
        schema:
          type: integer
  /api/leads/follow-up/store:
    post:
      summary: 'Create a new lead follow-up.'
      operationId: createANewLeadFollowUp
      description: 'This endpoint creates a follow-up activity (such as call, email, or meeting) for a specific lead. The date and time are converted to UTC before storing.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Follow Up Created Successfully'
                  data:
                    id: 101
                    type: lead_follow_up
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Follow Up Created Successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 101
                      type:
                        type: string
                        example: lead_follow_up
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'The given data was invalid.'
                  errors:
                    lead_id:
                      - 'The lead id field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      lead_id:
                        type: array
                        example:
                          - 'The lead id field is required.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "Follow Up Couldn't Created."
                  data:
                    error: ...
                    line: 123
                    file: /app/Http/Controllers/LeadFollowUpController.php
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "Follow Up Couldn't Created."
                  data:
                    type: object
                    properties:
                      error:
                        type: string
                        example: ...
                      line:
                        type: integer
                        example: 123
                      file:
                        type: string
                        example: /app/Http/Controllers/LeadFollowUpController.php
      tags:
        - 'Leads Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                lead_id:
                  type: integer
                  description: 'The ID of the lead to associate the follow-up with.'
                  example: 12
                assigned_to:
                  type: integer
                  description: 'The ID of the user assigned to the follow-up.'
                  example: 5
                type:
                  type: string
                  description: 'The type of follow-up. One of: email, sms, call, meeting, other.'
                  example: call
                status:
                  type: string
                  description: 'The current status of the follow-up. One of: pending, completed, rescheduled.'
                  example: pending
                follow_up_at:
                  type: string
                  description: 'The follow-up date and time in local format (Y-m-d\TH:i).'
                  example: '2025-06-20T14:30'
                note:
                  type: string
                  description: 'optional Additional notes for the follow-up. Max 255 characters.'
                  example: 'Call scheduled with client to discuss proposal.'
              required:
                - lead_id
                - assigned_to
                - type
                - status
                - follow_up_at
  '/api/leads/follow-up/get/{id}':
    get:
      summary: 'Retrieve a specific lead follow-up.'
      operationId: retrieveASpecificLeadFollowUp
      description: 'This endpoint fetches the details of a lead follow-up for editing or displaying, including the related lead and assigned user.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Follow Up Retrived Successfully'
                  follow_up:
                    id: 101
                    lead_id: 12
                    assigned_to: 5
                    type: call
                    status: pending
                    follow_up_at: '2025-06-20T09:00:00.000000Z'
                    note: 'Discuss proposal'
                    lead:
                      id: 12
                      first_name: John
                      last_name: Doe
                    assigned_to_user:
                      id: 5
                      name: 'Jane Smith'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Follow Up Retrived Successfully'
                  follow_up:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 101
                      lead_id:
                        type: integer
                        example: 12
                      assigned_to:
                        type: integer
                        example: 5
                      type:
                        type: string
                        example: call
                      status:
                        type: string
                        example: pending
                      follow_up_at:
                        type: string
                        example: '2025-06-20T09:00:00.000000Z'
                      note:
                        type: string
                        example: 'Discuss proposal'
                      lead:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 12
                          first_name:
                            type: string
                            example: John
                          last_name:
                            type: string
                            example: Doe
                      assigned_to_user:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 5
                          name:
                            type: string
                            example: 'Jane Smith'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'No query results for model [App\Models\LeadFollowUp] 101'
                properties:
                  message:
                    type: string
                    example: 'No query results for model [App\Models\LeadFollowUp] 101'
      tags:
        - 'Leads Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the follow-up to retrieve.'
        example: 101
        required: true
        schema:
          type: integer
  /api/leads/follow-up/update:
    post:
      summary: 'Update an existing lead follow-up.'
      operationId: updateAnExistingLeadFollowUp
      description: 'This endpoint updates the details of an existing follow-up activity for a lead, including reassignment, type, and follow-up date.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Follow Up Updated Successfully'
                  data:
                    id: 101
                    type: lead_follow_up
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Follow Up Updated Successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 101
                      type:
                        type: string
                        example: lead_follow_up
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'The given data was invalid.'
                  errors:
                    follow_up_at:
                      - 'The follow up at must be a valid date.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      follow_up_at:
                        type: array
                        example:
                          - 'The follow up at must be a valid date.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "Follow Up Couldn't Be Updated."
                  data:
                    error: ...
                    line: 123
                    file: /app/Http/Controllers/LeadFollowUpController.php
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "Follow Up Couldn't Be Updated."
                  data:
                    type: object
                    properties:
                      error:
                        type: string
                        example: ...
                      line:
                        type: integer
                        example: 123
                      file:
                        type: string
                        example: /app/Http/Controllers/LeadFollowUpController.php
      tags:
        - 'Leads Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  description: 'The ID of the follow-up to update.'
                  example: 101
                assigned_to:
                  type: integer
                  description: 'The ID of the user assigned to the follow-up.'
                  example: 6
                type:
                  type: string
                  description: 'The type of follow-up. One of: email, sms, call, meeting, other.'
                  example: email
                status:
                  type: string
                  description: 'The current status. One of: pending, completed, rescheduled.'
                  example: completed
                follow_up_at:
                  type: string
                  description: 'The updated follow-up datetime in local format (Y-m-d\TH:i).'
                  example: '2025-06-21T16:00'
                note:
                  type: string
                  description: 'optional Optional follow-up notes. Max 255 characters.'
                  example: 'Follow-up completed.'
              required:
                - id
                - assigned_to
                - type
                - status
                - follow_up_at
  '/api/leads/follow-up/destroy/{id}':
    delete:
      summary: 'Delete a lead follow-up.'
      operationId: deleteALeadFollowUp
      description: 'This endpoint deletes a follow-up record permanently from the system.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Lead Follow Up deleted successfully'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Lead Follow Up deleted successfully'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Lead Follow Up not found'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Lead Follow Up not found'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while deleting Lead Follow Up.'
                  data:
                    error: ...
                    line: 123
                    file: /app/Services/DeletionService.php
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while deleting Lead Follow Up.'
                  data:
                    type: object
                    properties:
                      error:
                        type: string
                        example: ...
                      line:
                        type: integer
                        example: 123
                      file:
                        type: string
                        example: /app/Services/DeletionService.php
      tags:
        - 'Leads Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the follow-up to delete.'
        example: 101
        required: true
        schema:
          type: integer
  /api/leads/stage-change:
    post:
      summary: 'Change the stage of a lead.'
      operationId: changeTheStageOfALead
      description: 'This endpoint updates the stage of a specific lead by its ID. The user must be authenticated and authorized to modify the lead.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Lead stage updated successfully!'
                  data:
                    id: 123
                    type: lead
                    activity_message: 'Lead Stage Changed to Negotiation'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Lead stage updated successfully!'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 123
                      type:
                        type: string
                        example: lead
                      activity_message:
                        type: string
                        example: 'Lead Stage Changed to Negotiation'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Lead not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Lead not found.'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation failed.'
                  errors:
                    stage_id:
                      - 'The selected stage_id is invalid.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation failed.'
                  errors:
                    type: object
                    properties:
                      stage_id:
                        type: array
                        example:
                          - 'The selected stage_id is invalid.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while updating the lead stage.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while updating the lead stage.'
      tags:
        - 'Leads Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  description: 'The ID of the lead to update. Must exist in the `leads` table.'
                  example: 123
                stage_id:
                  type: integer
                  description: 'The ID of the new lead stage. Must exist in the `lead_stages` table.'
                  example: 5
              required:
                - id
                - stage_id
  '/api/leads/{lead_id}/convert-to-client':
    post:
      summary: 'Convert a lead to a client.'
      operationId: convertALeadToAClient
      description: "This endpoint converts a lead to a client by creating a new client record with the lead's data. The user must be authenticated, and the lead must not already be converted."
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Lead converted to client successfully!'
                  data:
                    id: 5
                    first_name: John
                    last_name: Doe
                    email: john.doe@example.com
                    company: 'Acme Corp'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Lead converted to client successfully!'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 5
                      first_name:
                        type: string
                        example: John
                      last_name:
                        type: string
                        example: Doe
                      email:
                        type: string
                        example: john.doe@example.com
                      company:
                        type: string
                        example: 'Acme Corp'
        400:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Lead is already converted to the client.'
                  id: 5
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Lead is already converted to the client.'
                  id:
                    type: integer
                    example: 5
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Lead not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Lead not found.'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation failed.'
                  errors:
                    email:
                      - 'The email has already been taken.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation failed.'
                  errors:
                    type: object
                    properties:
                      email:
                        type: array
                        example:
                          - 'The email has already been taken.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while converting the lead.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while converting the lead.'
      tags:
        - 'Leads Management'
    parameters:
      -
        in: path
        name: lead_id
        description: 'The ID of the lead.'
        example: 11
        required: true
        schema:
          type: integer
      -
        in: path
        name: lead
        description: 'The ID of the lead to convert. Must exist in the `leads` table.'
        example: 5
        required: true
        schema:
          type: integer
  /api/save-leads-view-preference:
    put:
      summary: 'Save the default view preference for leads.'
      operationId: saveTheDefaultViewPreferenceForLeads
      description: 'This endpoint sets the default view preference (e.g., list or Kanban) for the authenticated user or client when viewing leads.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Default view set successfully!'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Default view set successfully!'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while setting the default view.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while setting the default view.'
      tags:
        - 'Leads Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                view:
                  type: string
                  description: 'The preferred view type (e.g., list, kanban).'
                  example: kanban
              required:
                - view
  /api/lead-sources/store:
    post:
      summary: 'Create a new lead source.'
      operationId: createANewLeadSource
      description: 'This endpoint creates a new lead source with the provided name under the current workspace. The user must be authenticated and authorized to manage lead sources.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Lead source created successfully!'
                  data:
                    id: 1
                    name: Referral
                    workspace_id: 10
                    created_at: '2025-05-20T10:00:00.000000Z'
                    updated_at: '2025-05-20T10:00:00.000000Z'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Lead source created successfully!'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: Referral
                      workspace_id:
                        type: integer
                        example: 10
                      created_at:
                        type: string
                        example: '2025-05-20T10:00:00.000000Z'
                      updated_at:
                        type: string
                        example: '2025-05-20T10:00:00.000000Z'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation failed.'
                  errors:
                    name:
                      - 'The name field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation failed.'
                  errors:
                    type: object
                    properties:
                      name:
                        type: array
                        example:
                          - 'The name field is required.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while creating the lead source.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while creating the lead source.'
      tags:
        - 'Leads Source Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The name of the lead source. Max 255 characters.'
                  example: Referral
              required:
                - name
  '/api/lead-sources/get/{id}':
    get:
      summary: 'Retrieve a specific lead source.'
      operationId: retrieveASpecificLeadSource
      description: 'This endpoint retrieves the details of a specific lead source by its ID. The user must be authenticated and authorized to manage lead sources.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Lead source retrieved successfully!'
                  data:
                    id: 1
                    name: Referral
                    workspace_id: 10
                    created_at: '2025-05-20T10:00:00.000000Z'
                    updated_at: '2025-05-20T10:00:00.000000Z'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Lead source retrieved successfully!'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: Referral
                      workspace_id:
                        type: integer
                        example: 10
                      created_at:
                        type: string
                        example: '2025-05-20T10:00:00.000000Z'
                      updated_at:
                        type: string
                        example: '2025-05-20T10:00:00.000000Z'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Lead source not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Lead source not found.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while retrieving the lead source.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while retrieving the lead source.'
      tags:
        - 'Leads Source Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the lead source to retrieve. Must exist in the `lead_sources` table.'
        example: 1
        required: true
        schema:
          type: integer
  /api/lead-sources/list:
    get:
      summary: 'List lead sources with optional filters, sorting, and pagination.'
      operationId: listLeadSourcesWithOptionalFiltersSortingAndPagination
      description: 'This endpoint retrieves a paginated list of lead sources or a specific lead source by ID, with optional search, sorting, and pagination parameters. The response includes permission details for editing and deletion. The user must be authenticated and authorized to manage lead sources.'
      parameters:
        -
          in: query
          name: id
          description: 'optional The ID of a specific lead source to retrieve.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'optional The ID of a specific lead source to retrieve.'
            example: 1
        -
          in: query
          name: search
          description: 'optional Filters lead sources by name or ID.'
          example: Referral
          required: false
          schema:
            type: string
            description: 'optional Filters lead sources by name or ID.'
            example: Referral
        -
          in: query
          name: sort
          description: 'optional The column to sort by (id, name, created_at, updated_at). Defaults to id.'
          example: name
          required: false
          schema:
            type: string
            description: 'optional The column to sort by (id, name, created_at, updated_at). Defaults to id.'
            example: name
        -
          in: query
          name: order
          description: 'optional The sort order (ASC, DESC). Defaults to DESC.'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional The sort order (ASC, DESC). Defaults to DESC.'
            example: ASC
        -
          in: query
          name: limit
          description: 'optional Number of lead sources per page (1-100). Defaults to 10.'
          example: 20
          required: false
          schema:
            type: integer
            description: 'optional Number of lead sources per page (1-100). Defaults to 10.'
            example: 20
        -
          in: query
          name: offset
          description: 'optional Number of lead sources to skip. Defaults to 0.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional Number of lead sources to skip. Defaults to 0.'
            example: 10
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Lead sources retrieved successfully!'
                  total: 25
                  data:
                    -
                      id: 1
                      name: Referral
                      workspace_id: 10
                      created_at: '2025-05-20T10:00:00.000000Z'
                      updated_at: '2025-05-20T10:00:00.000000Z'
                      can_edit: true
                      can_delete: true
                  permissions:
                    can_edit: true
                    can_delete: true
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Lead sources retrieved successfully!'
                  total:
                    type: integer
                    example: 25
                  data:
                    type: array
                    example:
                      -
                        id: 1
                        name: Referral
                        workspace_id: 10
                        created_at: '2025-05-20T10:00:00.000000Z'
                        updated_at: '2025-05-20T10:00:00.000000Z'
                        can_edit: true
                        can_delete: true
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        name:
                          type: string
                          example: Referral
                        workspace_id:
                          type: integer
                          example: 10
                        created_at:
                          type: string
                          example: '2025-05-20T10:00:00.000000Z'
                        updated_at:
                          type: string
                          example: '2025-05-20T10:00:00.000000Z'
                        can_edit:
                          type: boolean
                          example: true
                        can_delete:
                          type: boolean
                          example: true
                  permissions:
                    type: object
                    properties:
                      can_edit:
                        type: boolean
                        example: true
                      can_delete:
                        type: boolean
                        example: true
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Lead source(s) not found.'
                  total: 0
                  data: []
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Lead source(s) not found.'
                  total:
                    type: integer
                    example: 0
                  data:
                    type: array
                    example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while retrieving the lead sources.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while retrieving the lead sources.'
      tags:
        - 'Leads Source Management'
  /api/lead-sources/update:
    post:
      summary: 'Update a specific lead source.'
      operationId: updateASpecificLeadSource
      description: 'This endpoint updates the name of an existing lead source identified by its ID. The user must be authenticated and authorized to manage lead sources.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Lead source updated successfully!'
                  data:
                    id: 1
                    name: Referral
                    workspace_id: 10
                    created_at: '2025-05-20T10:00:00.000000Z'
                    updated_at: '2025-05-20T10:05:00.000000Z'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Lead source updated successfully!'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: Referral
                      workspace_id:
                        type: integer
                        example: 10
                      created_at:
                        type: string
                        example: '2025-05-20T10:00:00.000000Z'
                      updated_at:
                        type: string
                        example: '2025-05-20T10:05:00.000000Z'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Lead source not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Lead source not found.'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation failed.'
                  errors:
                    id:
                      - 'The selected id is invalid.'
                    name:
                      - 'The name field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation failed.'
                  errors:
                    type: object
                    properties:
                      id:
                        type: array
                        example:
                          - 'The selected id is invalid.'
                        items:
                          type: string
                      name:
                        type: array
                        example:
                          - 'The name field is required.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while updating the lead source.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while updating the lead source.'
      tags:
        - 'Leads Source Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  description: 'The ID of the lead source to update. Must exist in the `lead_sources` table.'
                  example: 1
                name:
                  type: string
                  description: 'The new name for the lead source. Max 255 characters.'
                  example: Referral
              required:
                - id
                - name
  '/api/lead-sources/destroy/{id}':
    delete:
      summary: 'Delete a specific lead source.'
      operationId: deleteASpecificLeadSource
      description: 'This endpoint deletes a specific lead source by its ID. The user must be authenticated and authorized to manage lead sources.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Lead source deleted successfully!'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Lead source deleted successfully!'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Lead source not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Lead source not found.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while deleting the lead source.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while deleting the lead source.'
      tags:
        - 'Leads Source Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the lead source to delete. Must exist in the `lead_sources` table.'
        example: 1
        required: true
        schema:
          type: integer
  /api/lead-stages/store:
    post:
      summary: 'Create a new lead stage.'
      operationId: createANewLeadStage
      description: 'This endpoint creates a new lead stage within the current workspace. It assigns a unique slug, sets the display order, and saves the provided name and color. The user must be authenticated and authorized to manage lead stages.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Lead stage created successfully!'
                  data:
                    id: 12
                    name: Contacted
                    slug: contacted
                    color: success
                    order: 3
                    workspace_id: 1
                    created_at: '2025-05-15T10:00:00.000000Z'
                    updated_at: '2025-05-15T10:00:00.000000Z'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Lead stage created successfully!'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 12
                      name:
                        type: string
                        example: Contacted
                      slug:
                        type: string
                        example: contacted
                      color:
                        type: string
                        example: success
                      order:
                        type: integer
                        example: 3
                      workspace_id:
                        type: integer
                        example: 1
                      created_at:
                        type: string
                        example: '2025-05-15T10:00:00.000000Z'
                      updated_at:
                        type: string
                        example: '2025-05-15T10:00:00.000000Z'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation failed.'
                  errors:
                    name:
                      - 'The name field is required.'
                    color:
                      - 'The color field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation failed.'
                  errors:
                    type: object
                    properties:
                      name:
                        type: array
                        example:
                          - 'The name field is required.'
                        items:
                          type: string
                      color:
                        type: array
                        example:
                          - 'The color field is required.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while creating the lead stage.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while creating the lead stage.'
      tags:
        - 'Leads Stage Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The name of the lead stage. Max 255 characters.'
                  example: Contacted
                color:
                  type: string
                  description: 'The color badge for the lead stage. Must be one of: primary, secondary, success, danger, info, dark, warning.'
                  example: success
              required:
                - name
                - color
  /api/lead-stages/list:
    get:
      summary: 'List lead stages with optional filters, sorting, and pagination.'
      operationId: listLeadStagesWithOptionalFiltersSortingAndPagination
      description: 'This endpoint retrieves a paginated list of lead stages for the current workspace, with optional search, sorting, and pagination parameters. The response includes permission details for editing and deletion. The user must be authenticated and authorized to manage lead stages.'
      parameters:
        -
          in: query
          name: search
          description: 'optional Filters lead stages by name or ID.'
          example: Proposal
          required: false
          schema:
            type: string
            description: 'optional Filters lead stages by name or ID.'
            example: Proposal
        -
          in: query
          name: sort
          description: 'optional The column to sort by (id, name, order). Defaults to id.'
          example: name
          required: false
          schema:
            type: string
            description: 'optional The column to sort by (id, name, order). Defaults to id.'
            example: name
        -
          in: query
          name: order
          description: 'optional The sort order (ASC, DESC). Defaults to DESC.'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional The sort order (ASC, DESC). Defaults to DESC.'
            example: ASC
        -
          in: query
          name: limit
          description: 'optional Number of lead stages per page (1-100). Defaults to 10.'
          example: 20
          required: false
          schema:
            type: integer
            description: 'optional Number of lead stages per page (1-100). Defaults to 10.'
            example: 20
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Lead stages retrieved successfully!'
                  data:
                    total: 3
                    data:
                      -
                        id: 1
                        name: 'New Lead'
                        slug: new-lead
                        color: primary
                        order: 1
                        workspace_id: 1
                        created_at: '2025-05-10T12:30:00.000000Z'
                        updated_at: '2025-05-15T09:12:00.000000Z'
                        can_edit: true
                        can_delete: true
                      -
                        id: 2
                        name: Qualified
                        slug: qualified
                        color: success
                        order: 2
                        workspace_id: 1
                        created_at: '2025-05-10T12:30:00.000000Z'
                        updated_at: '2025-05-15T09:12:00.000000Z'
                        can_edit: true
                        can_delete: true
                    permissions:
                      can_edit: true
                      can_delete: true
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Lead stages retrieved successfully!'
                  data:
                    type: object
                    properties:
                      total:
                        type: integer
                        example: 3
                      data:
                        type: array
                        example:
                          -
                            id: 1
                            name: 'New Lead'
                            slug: new-lead
                            color: primary
                            order: 1
                            workspace_id: 1
                            created_at: '2025-05-10T12:30:00.000000Z'
                            updated_at: '2025-05-15T09:12:00.000000Z'
                            can_edit: true
                            can_delete: true
                          -
                            id: 2
                            name: Qualified
                            slug: qualified
                            color: success
                            order: 2
                            workspace_id: 1
                            created_at: '2025-05-10T12:30:00.000000Z'
                            updated_at: '2025-05-15T09:12:00.000000Z'
                            can_edit: true
                            can_delete: true
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1
                            name:
                              type: string
                              example: 'New Lead'
                            slug:
                              type: string
                              example: new-lead
                            color:
                              type: string
                              example: primary
                            order:
                              type: integer
                              example: 1
                            workspace_id:
                              type: integer
                              example: 1
                            created_at:
                              type: string
                              example: '2025-05-10T12:30:00.000000Z'
                            updated_at:
                              type: string
                              example: '2025-05-15T09:12:00.000000Z'
                            can_edit:
                              type: boolean
                              example: true
                            can_delete:
                              type: boolean
                              example: true
                      permissions:
                        type: object
                        properties:
                          can_edit:
                            type: boolean
                            example: true
                          can_delete:
                            type: boolean
                            example: true
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while retrieving the lead stages.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while retrieving the lead stages.'
      tags:
        - 'Leads Stage Management'
  /api/lead-stages/update:
    post:
      summary: 'Update a specific lead stage.'
      operationId: updateASpecificLeadStage
      description: 'This endpoint updates the details of an existing lead stage, including its name, slug, and color. The user must be authenticated and authorized to manage lead stages.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Lead stage updated successfully!'
                  data:
                    id: 3
                    name: 'Proposal Sent'
                    slug: proposal-sent
                    color: warning
                    order: 2
                    workspace_id: 1
                    created_at: '2025-05-10T12:30:00.000000Z'
                    updated_at: '2025-05-15T09:12:00.000000Z'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Lead stage updated successfully!'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 3
                      name:
                        type: string
                        example: 'Proposal Sent'
                      slug:
                        type: string
                        example: proposal-sent
                      color:
                        type: string
                        example: warning
                      order:
                        type: integer
                        example: 2
                      workspace_id:
                        type: integer
                        example: 1
                      created_at:
                        type: string
                        example: '2025-05-10T12:30:00.000000Z'
                      updated_at:
                        type: string
                        example: '2025-05-15T09:12:00.000000Z'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Lead stage not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Lead stage not found.'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation failed.'
                  errors:
                    id:
                      - 'The selected id is invalid.'
                    name:
                      - 'The name field is required.'
                    color:
                      - 'The selected color is invalid.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation failed.'
                  errors:
                    type: object
                    properties:
                      id:
                        type: array
                        example:
                          - 'The selected id is invalid.'
                        items:
                          type: string
                      name:
                        type: array
                        example:
                          - 'The name field is required.'
                        items:
                          type: string
                      color:
                        type: array
                        example:
                          - 'The selected color is invalid.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while updating the lead stage.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while updating the lead stage.'
      tags:
        - 'Leads Stage Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  description: 'The ID of the lead stage to update. Must exist in the `lead_stages` table.'
                  example: 3
                name:
                  type: string
                  description: 'The name of the lead stage. Max 255 characters.'
                  example: 'Proposal Sent'
                color:
                  type: string
                  description: 'The color badge for the lead stage. Must be one of: primary, secondary, success, danger, info, dark, warning.'
                  example: warning
              required:
                - id
                - name
                - color
  '/api/lead-stages/destroy/{id}':
    delete:
      summary: 'Delete a specific lead stage.'
      operationId: deleteASpecificLeadStage
      description: 'This endpoint deletes a specific lead stage by its ID and reorders the remaining stages to maintain sequence. The user must be authenticated and authorized to manage lead stages.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Lead stage deleted successfully!'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Lead stage deleted successfully!'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Lead stage not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Lead stage not found.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while deleting the lead stage.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while deleting the lead stage.'
      tags:
        - 'Leads Stage Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the lead stage to delete. Must exist in the `lead_stages` table.'
        example: 4
        required: true
        schema:
          type: integer
  /api/lead-stages/reorder:
    post:
      summary: 'Reorder lead stages.'
      operationId: reorderLeadStages
      description: 'This endpoint updates the order of lead stages based on the provided array of IDs and positions. The user must be authenticated and authorized to manage lead stages.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Indicates if the response should be formatted for API use. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Lead stages reordered successfully!'
                  data:
                    -
                      id: 1
                      name: Qualified
                      slug: qualified
                      color: success
                      order: 1
                      workspace_id: 1
                      created_at: '2025-05-10T12:30:00.000000Z'
                      updated_at: '2025-05-15T09:12:00.000000Z'
                    -
                      id: 2
                      name: Contacted
                      slug: contacted
                      color: info
                      order: 2
                      workspace_id: 1
                      created_at: '2025-05-10T12:30:00.000000Z'
                      updated_at: '2025-05-15T09:12:00.000000Z'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Lead stages reordered successfully!'
                  data:
                    type: array
                    example:
                      -
                        id: 1
                        name: Qualified
                        slug: qualified
                        color: success
                        order: 1
                        workspace_id: 1
                        created_at: '2025-05-10T12:30:00.000000Z'
                        updated_at: '2025-05-15T09:12:00.000000Z'
                      -
                        id: 2
                        name: Contacted
                        slug: contacted
                        color: info
                        order: 2
                        workspace_id: 1
                        created_at: '2025-05-10T12:30:00.000000Z'
                        updated_at: '2025-05-15T09:12:00.000000Z'
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        name:
                          type: string
                          example: Qualified
                        slug:
                          type: string
                          example: qualified
                        color:
                          type: string
                          example: success
                        order:
                          type: integer
                          example: 1
                        workspace_id:
                          type: integer
                          example: 1
                        created_at:
                          type: string
                          example: '2025-05-10T12:30:00.000000Z'
                        updated_at:
                          type: string
                          example: '2025-05-15T09:12:00.000000Z'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Validation failed.'
                  errors:
                    order:
                      - 'The order field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Validation failed.'
                  errors:
                    type: object
                    properties:
                      order:
                        type: array
                        example:
                          - 'The order field is required.'
                        items:
                          type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred while reordering the lead stages.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred while reordering the lead stages.'
      tags:
        - 'Leads Stage Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                order:
                  type: array
                  description: 'An array of objects containing lead stage IDs and their new positions.'
                  example:
                    -
                      id: 1
                      position: 1
                    -
                      id: 2
                      position: 2
                  items:
                    type: string
              required:
                - order
  /api/payslips/store:
    post:
      summary: 'Create a new payslip.'
      operationId: createANewPayslip
      description: 'Creates a new payslip with salary details, allowances, and deductions. Requires valid user ID, salary components, and optional payment information if marked as paid.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Payslip created successfully.'
                  data:
                    id: 10
                    user_id: 3
                    user_name: 'John Doe'
                    month: '2025-05-01'
                    basic_salary: 50000.0
                    working_days: 22
                    lop_days: 2
                    paid_days: 20
                    bonus: 2000.0
                    incentives: 1500.0
                    leave_deduction: 500.0
                    ot_hours: 5
                    ot_rate: 100.0
                    ot_payment: 500.0
                    total_allowance: 3500.0
                    total_deductions: 500.0
                    total_earnings: 53500.0
                    net_pay: 53000.0
                    status: 1
                    status_label: Paid
                    payment_method_id: 2
                    payment_method: 'Bank Transfer'
                    payment_date: '2025-05-20'
                    note: 'Bonus included for performance.'
                    created_at: '2025-05-15'
                    updated_at: '2025-05-15'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Payslip created successfully.'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 10
                      user_id:
                        type: integer
                        example: 3
                      user_name:
                        type: string
                        example: 'John Doe'
                      month:
                        type: string
                        example: '2025-05-01'
                      basic_salary:
                        type: number
                        example: 50000.0
                      working_days:
                        type: integer
                        example: 22
                      lop_days:
                        type: integer
                        example: 2
                      paid_days:
                        type: integer
                        example: 20
                      bonus:
                        type: number
                        example: 2000.0
                      incentives:
                        type: number
                        example: 1500.0
                      leave_deduction:
                        type: number
                        example: 500.0
                      ot_hours:
                        type: integer
                        example: 5
                      ot_rate:
                        type: number
                        example: 100.0
                      ot_payment:
                        type: number
                        example: 500.0
                      total_allowance:
                        type: number
                        example: 3500.0
                      total_deductions:
                        type: number
                        example: 500.0
                      total_earnings:
                        type: number
                        example: 53500.0
                      net_pay:
                        type: number
                        example: 53000.0
                      status:
                        type: integer
                        example: 1
                      status_label:
                        type: string
                        example: Paid
                      payment_method_id:
                        type: integer
                        example: 2
                      payment_method:
                        type: string
                        example: 'Bank Transfer'
                      payment_date:
                        type: string
                        example: '2025-05-20'
                      note:
                        type: string
                        example: 'Bonus included for performance.'
                      created_at:
                        type: string
                        example: '2025-05-15'
                      updated_at:
                        type: string
                        example: '2025-05-15'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'The given data was invalid.'
                  data:
                    errors:
                      user_id:
                        - 'The user field is required.'
                      basic_salary:
                        - 'The basic salary must be a valid number with or without decimals.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  data:
                    type: object
                    properties:
                      errors:
                        type: object
                        properties:
                          user_id:
                            type: array
                            example:
                              - 'The user field is required.'
                            items:
                              type: string
                          basic_salary:
                            type: array
                            example:
                              - 'The basic salary must be a valid number with or without decimals.'
                            items:
                              type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred.'
                  data:
                    type: array
                    example: []
      tags:
        - 'Payslip Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                user_id:
                  type: integer
                  description: 'The user ID.'
                  example: 3
                month:
                  type: string
                  description: 'Month of payslip. Format: YYYY-MM.'
                  example: 2025-05
                basic_salary:
                  type: number
                  description: 'Basic salary.'
                  example: 50000.0
                working_days:
                  type: integer
                  description: 'Working days in the month.'
                  example: 22
                lop_days:
                  type: integer
                  description: 'Loss of pay days.'
                  example: 2
                paid_days:
                  type: integer
                  description: 'Paid days.'
                  example: 20
                bonus:
                  type: number
                  description: 'Bonus amount.'
                  example: 2000.0
                incentives:
                  type: number
                  description: 'Incentives amount.'
                  example: 1500.0
                leave_deduction:
                  type: number
                  description: 'Leave deduction amount.'
                  example: 500.0
                ot_hours:
                  type: integer
                  description: 'Overtime hours.'
                  example: 5
                ot_rate:
                  type: number
                  description: 'Overtime rate per hour.'
                  example: 100.0
                ot_payment:
                  type: number
                  description: 'Overtime payment.'
                  example: 500.0
                total_allowance:
                  type: number
                  description: 'Total allowance amount.'
                  example: 3500.0
                total_deductions:
                  type: number
                  description: 'Total deductions.'
                  example: 500.0
                total_earnings:
                  type: number
                  description: 'Total earnings.'
                  example: 53500.0
                net_pay:
                  type: number
                  description: 'Final payable amount.'
                  example: 53000.0
                payment_method_id:
                  type: integer
                  description: 'optional Required if status is 1 (paid).'
                  example: 2
                payment_date:
                  type: date
                  description: 'optional Required if status is 1 (paid). Format: Y-m-d.'
                  example: '2025-05-20'
                status:
                  type: integer
                  description: 'Payslip status (0 = Unpaid, 1 = Paid).'
                  example: 1
                note:
                  type: string
                  description: 'optional Additional notes.'
                  example: 'Bonus included for performance.'
                allowances:
                  type: array
                  description: 'optional Array of allowance IDs to associate with the payslip.'
                  example:
                    - 1
                    - 2
                  items:
                    type: string
                deductions:
                  type: array
                  description: 'optional Array of deduction IDs to associate with the payslip.'
                  example:
                    - 3
                    - 4
                  items:
                    type: string
                isApi:
                  type: boolean
                  description: 'optional Whether to return a formatted API response. Defaults to false.'
                  example: true
              required:
                - user_id
                - month
                - basic_salary
                - working_days
                - lop_days
                - paid_days
                - bonus
                - incentives
                - leave_deduction
                - ot_hours
                - ot_rate
                - ot_payment
                - total_allowance
                - total_deductions
                - total_earnings
                - net_pay
                - status
      security: []
  /api/payslips/update:
    post:
      summary: 'Update an existing payslip.'
      operationId: updateAnExistingPayslip
      description: 'Updates an existing payslip by ID with revised salary and payment details. Fields must be validated as in creation.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Payslip updated successfully.'
                  data:
                    id: 7
                    user_id: 3
                    user_name: 'John Doe'
                    month: '2025-05-01'
                    basic_salary: 50000.0
                    working_days: 22
                    lop_days: 2
                    paid_days: 20
                    bonus: 2000.0
                    incentives: 1500.0
                    leave_deduction: 500.0
                    ot_hours: 5
                    ot_rate: 100.0
                    ot_payment: 500.0
                    total_allowance: 3500.0
                    total_deductions: 500.0
                    total_earnings: 53500.0
                    net_pay: 53000.0
                    status: 1
                    status_label: Paid
                    payment_method_id: 2
                    payment_method: 'Bank Transfer'
                    payment_date: '2025-05-20'
                    note: 'Updated after bonus revision.'
                    created_at: '2025-05-15'
                    updated_at: '2025-05-15'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Payslip updated successfully.'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 7
                      user_id:
                        type: integer
                        example: 3
                      user_name:
                        type: string
                        example: 'John Doe'
                      month:
                        type: string
                        example: '2025-05-01'
                      basic_salary:
                        type: number
                        example: 50000.0
                      working_days:
                        type: integer
                        example: 22
                      lop_days:
                        type: integer
                        example: 2
                      paid_days:
                        type: integer
                        example: 20
                      bonus:
                        type: number
                        example: 2000.0
                      incentives:
                        type: number
                        example: 1500.0
                      leave_deduction:
                        type: number
                        example: 500.0
                      ot_hours:
                        type: integer
                        example: 5
                      ot_rate:
                        type: number
                        example: 100.0
                      ot_payment:
                        type: number
                        example: 500.0
                      total_allowance:
                        type: number
                        example: 3500.0
                      total_deductions:
                        type: number
                        example: 500.0
                      total_earnings:
                        type: number
                        example: 53500.0
                      net_pay:
                        type: number
                        example: 53000.0
                      status:
                        type: integer
                        example: 1
                      status_label:
                        type: string
                        example: Paid
                      payment_method_id:
                        type: integer
                        example: 2
                      payment_method:
                        type: string
                        example: 'Bank Transfer'
                      payment_date:
                        type: string
                        example: '2025-05-20'
                      note:
                        type: string
                        example: 'Updated after bonus revision.'
                      created_at:
                        type: string
                        example: '2025-05-15'
                      updated_at:
                        type: string
                        example: '2025-05-15'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Payslip not found.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Payslip not found.'
                  data:
                    type: array
                    example: []
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'The given data was invalid.'
                  data:
                    errors:
                      user_id:
                        - 'The user field is required.'
                      basic_salary:
                        - 'The basic salary must be a valid number with or without decimals.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  data:
                    type: object
                    properties:
                      errors:
                        type: object
                        properties:
                          user_id:
                            type: array
                            example:
                              - 'The user field is required.'
                            items:
                              type: string
                          basic_salary:
                            type: array
                            example:
                              - 'The basic salary must be a valid number with or without decimals.'
                            items:
                              type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred.'
                  data:
                    type: array
                    example: []
      tags:
        - 'Payslip Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  description: 'The ID of the payslip to update. Must exist in the `payslips` table.'
                  example: 7
                user_id:
                  type: integer
                  description: 'The user ID.'
                  example: 3
                month:
                  type: string
                  description: 'Month of payslip. Format: YYYY-MM.'
                  example: 2025-05
                basic_salary:
                  type: number
                  description: 'Basic salary.'
                  example: 50000.0
                working_days:
                  type: integer
                  description: 'Working days in the month.'
                  example: 22
                lop_days:
                  type: integer
                  description: 'Loss of pay days.'
                  example: 2
                paid_days:
                  type: integer
                  description: 'Paid days.'
                  example: 20
                bonus:
                  type: number
                  description: 'Bonus amount.'
                  example: 2000.0
                incentives:
                  type: number
                  description: 'Incentives amount.'
                  example: 1500.0
                leave_deduction:
                  type: number
                  description: 'Leave deduction.'
                  example: 500.0
                ot_hours:
                  type: integer
                  description: 'Overtime hours.'
                  example: 5
                ot_rate:
                  type: number
                  description: 'Overtime rate.'
                  example: 100.0
                ot_payment:
                  type: number
                  description: 'Overtime payment.'
                  example: 500.0
                total_allowance:
                  type: number
                  description: 'Allowance total.'
                  example: 3500.0
                total_deductions:
                  type: number
                  description: 'Deductions total.'
                  example: 500.0
                total_earnings:
                  type: number
                  description: 'Earnings total.'
                  example: 53500.0
                net_pay:
                  type: number
                  description: 'Net pay.'
                  example: 53000.0
                payment_method_id:
                  type: integer
                  description: 'optional Required if status is 1 (paid).'
                  example: 2
                payment_date:
                  type: date
                  description: 'optional Required if status is 1 (paid). Format: Y-m-d.'
                  example: '2025-05-20'
                status:
                  type: integer
                  description: 'Status (0 = Unpaid, 1 = Paid).'
                  example: 1
                note:
                  type: string
                  description: 'optional Note text.'
                  example: 'Updated after bonus revision.'
                allowances:
                  type: array
                  description: 'optional Array of allowance IDs to associate with the payslip.'
                  example:
                    - 1
                    - 2
                  items:
                    type: string
                deductions:
                  type: array
                  description: 'optional Array of deduction IDs to associate with the payslip.'
                  example:
                    - 3
                    - 4
                  items:
                    type: string
                isApi:
                  type: boolean
                  description: 'optional Whether to return a formatted API response. Defaults to false.'
                  example: true
              required:
                - id
                - user_id
                - month
                - basic_salary
                - working_days
                - lop_days
                - paid_days
                - bonus
                - incentives
                - leave_deduction
                - ot_hours
                - ot_rate
                - ot_payment
                - total_allowance
                - total_deductions
                - total_earnings
                - net_pay
                - status
      security: []
  '/api/payslips/destroy/{id}':
    delete:
      summary: 'Delete a payslip.'
      operationId: deleteAPayslip
      description: 'This endpoint deletes the specified payslip and detaches all associated allowances and deductions.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Payslip deleted successfully.'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Payslip deleted successfully.'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Payslip not found.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Payslip not found.'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred.'
      tags:
        - 'Payslip Management'
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the payslip to delete.'
        example: 10
        required: true
        schema:
          type: integer
  /api/payslips/list:
    get:
      summary: 'List payslips with filtering (API format).'
      operationId: listPayslipsWithFilteringAPIFormat
      description: 'Retrieves a list of payslips in API format with support for searching, filtering by user, status, and month.'
      parameters:
        -
          in: query
          name: search
          description: 'optional Search term to filter payslips by ID, note, or payment method.'
          example: PSL-5
          required: false
          schema:
            type: string
            description: 'optional Search term to filter payslips by ID, note, or payment method.'
            example: PSL-5
        -
          in: query
          name: sort
          description: 'optional Field to sort by. Defaults to id.'
          example: month
          required: false
          schema:
            type: string
            description: 'optional Field to sort by. Defaults to id.'
            example: month
        -
          in: query
          name: order
          description: 'optional Sort order: ASC or DESC. Defaults to DESC.'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional Sort order: ASC or DESC. Defaults to DESC.'
            example: ASC
        -
          in: query
          name: limit
          description: 'optional Number of records to return. Default: 10.'
          example: 20
          required: false
          schema:
            type: integer
            description: 'optional Number of records to return. Default: 10.'
            example: 20
        -
          in: query
          name: statuses
          description: 'optional Filter by status values (0 = Unpaid, 1 = Paid).'
          example:
            - 0
            - 1
          required: false
          schema:
            type: array
            description: 'optional Filter by status values (0 = Unpaid, 1 = Paid).'
            example:
              - 0
              - 1
            items:
              type: string
        -
          in: query
          name: user_ids
          description: 'optional Filter by user IDs.'
          example:
            - 3
            - 4
          required: false
          schema:
            type: array
            description: 'optional Filter by user IDs.'
            example:
              - 3
              - 4
            items:
              type: string
        -
          in: query
          name: created_by_user_ids
          description: 'optional Filter by user IDs who created the payslip.'
          example:
            - 2
          required: false
          schema:
            type: array
            description: 'optional Filter by user IDs who created the payslip.'
            example:
              - 2
            items:
              type: string
        -
          in: query
          name: created_by_client_ids
          description: 'optional Filter by client IDs who created the payslip.'
          example:
            - 1
          required: false
          schema:
            type: array
            description: 'optional Filter by client IDs who created the payslip.'
            example:
              - 1
            items:
              type: string
        -
          in: query
          name: month
          description: 'optional Filter by month. Format: YYYY-MM.'
          example: 2025-05
          required: false
          schema:
            type: string
            description: 'optional Filter by month. Format: YYYY-MM.'
            example: 2025-05
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Payslips retrieved successfully.'
                  data:
                    total: 5
                    data:
                      -
                        id: 7
                        user_id: 3
                        user_name: 'John Doe'
                        month: '2025-05-01'
                        basic_salary: 50000.0
                        working_days: 22
                        lop_days: 2
                        paid_days: 20
                        bonus: 2000.0
                        incentives: 1500.0
                        leave_deduction: 500.0
                        ot_hours: 5
                        ot_rate: 100.0
                        ot_payment: 500.0
                        total_allowance: 3500.0
                        total_deductions: 500.0
                        total_earnings: 53500.0
                        net_pay: 53000.0
                        status: 1
                        status_label: Paid
                        payment_method_id: 2
                        payment_method: 'Bank Transfer'
                        payment_date: '2025-05-20'
                        note: 'Bonus included for performance.'
                        created_at: '2025-05-15'
                        updated_at: '2025-05-15'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Payslips retrieved successfully.'
                  data:
                    type: object
                    properties:
                      total:
                        type: integer
                        example: 5
                      data:
                        type: array
                        example:
                          -
                            id: 7
                            user_id: 3
                            user_name: 'John Doe'
                            month: '2025-05-01'
                            basic_salary: 50000
                            working_days: 22
                            lop_days: 2
                            paid_days: 20
                            bonus: 2000
                            incentives: 1500
                            leave_deduction: 500
                            ot_hours: 5
                            ot_rate: 100
                            ot_payment: 500
                            total_allowance: 3500
                            total_deductions: 500
                            total_earnings: 53500
                            net_pay: 53000
                            status: 1
                            status_label: Paid
                            payment_method_id: 2
                            payment_method: 'Bank Transfer'
                            payment_date: '2025-05-20'
                            note: 'Bonus included for performance.'
                            created_at: '2025-05-15'
                            updated_at: '2025-05-15'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 7
                            user_id:
                              type: integer
                              example: 3
                            user_name:
                              type: string
                              example: 'John Doe'
                            month:
                              type: string
                              example: '2025-05-01'
                            basic_salary:
                              type: number
                              example: 50000.0
                            working_days:
                              type: integer
                              example: 22
                            lop_days:
                              type: integer
                              example: 2
                            paid_days:
                              type: integer
                              example: 20
                            bonus:
                              type: number
                              example: 2000.0
                            incentives:
                              type: number
                              example: 1500.0
                            leave_deduction:
                              type: number
                              example: 500.0
                            ot_hours:
                              type: integer
                              example: 5
                            ot_rate:
                              type: number
                              example: 100.0
                            ot_payment:
                              type: number
                              example: 500.0
                            total_allowance:
                              type: number
                              example: 3500.0
                            total_deductions:
                              type: number
                              example: 500.0
                            total_earnings:
                              type: number
                              example: 53500.0
                            net_pay:
                              type: number
                              example: 53000.0
                            status:
                              type: integer
                              example: 1
                            status_label:
                              type: string
                              example: Paid
                            payment_method_id:
                              type: integer
                              example: 2
                            payment_method:
                              type: string
                              example: 'Bank Transfer'
                            payment_date:
                              type: string
                              example: '2025-05-20'
                            note:
                              type: string
                              example: 'Bonus included for performance.'
                            created_at:
                              type: string
                              example: '2025-05-15'
                            updated_at:
                              type: string
                              example: '2025-05-15'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred.'
                  data:
                    type: array
                    example: []
      tags:
        - 'Payslip Management'
      security: []
  /api/task-lists/store:
    post:
      summary: 'Create a new task list.'
      operationId: createANewTaskList
      description: 'Creates a new task list associated with a specific project.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Whether to return a JSON API response. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Whether to return a JSON API response. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Task list created successfully.'
                  data:
                    id: 1
                    name: 'UI Tasks'
                    project: 'Website Redesign'
                    created_at: '30 May, 2025'
                    updated_at: '30 May, 2025'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Task list created successfully.'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: 'UI Tasks'
                      project:
                        type: string
                        example: 'Website Redesign'
                      created_at:
                        type: string
                        example: '30 May, 2025'
                      updated_at:
                        type: string
                        example: '30 May, 2025'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'The given data was invalid.'
                  data:
                    errors:
                      name:
                        - 'The name field is required.'
                      project_id:
                        - 'The selected project id is invalid.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  data:
                    type: object
                    properties:
                      errors:
                        type: object
                        properties:
                          name:
                            type: array
                            example:
                              - 'The name field is required.'
                            items:
                              type: string
                          project_id:
                            type: array
                            example:
                              - 'The selected project id is invalid.'
                            items:
                              type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "Task list couldn't be created."
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "Task list couldn't be created."
                  data:
                    type: array
                    example: []
      tags:
        - 'Task List Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The name of the task list. Max 255 characters.'
                  example: 'UI Tasks'
                project_id:
                  type: integer
                  description: 'The ID of the project this task list belongs to. Must exist in the `projects` table.'
                  example: 5
              required:
                - name
                - project_id
      security: []
  /api/task-lists/update:
    post:
      summary: 'Update a task list.'
      operationId: updateATaskList
      description: 'Updates the name of an existing task list.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Whether to return a JSON API response. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Whether to return a JSON API response. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Task list updated successfully.'
                  data:
                    id: 1
                    name: 'Backend Tasks'
                    project: 'Website Redesign'
                    created_at: '30 May, 2025'
                    updated_at: '30 May, 2025'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Task list updated successfully.'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: 'Backend Tasks'
                      project:
                        type: string
                        example: 'Website Redesign'
                      created_at:
                        type: string
                        example: '30 May, 2025'
                      updated_at:
                        type: string
                        example: '30 May, 2025'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Task list not found.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Task list not found.'
                  data:
                    type: array
                    example: []
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'The given data was invalid.'
                  data:
                    errors:
                      id:
                        - 'The selected id is invalid.'
                      name:
                        - 'The name field is required.'
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  data:
                    type: object
                    properties:
                      errors:
                        type: object
                        properties:
                          id:
                            type: array
                            example:
                              - 'The selected id is invalid.'
                            items:
                              type: string
                          name:
                            type: array
                            example:
                              - 'The name field is required.'
                            items:
                              type: string
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: "Task lists couldn't be updated."
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: "Task lists couldn't be updated."
                  data:
                    type: array
                    example: []
      tags:
        - 'Task List Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  description: 'The ID of the task list to update. Must exist in the `task_lists` table.'
                  example: 1
                name:
                  type: string
                  description: 'The new name for the task list. Max 255 characters.'
                  example: 'Backend Tasks'
              required:
                - id
                - name
      security: []
  '/api/task-lists/get/{id}':
    get:
      summary: 'Retrieve a specific task list.'
      operationId: retrieveASpecificTaskList
      description: 'Fetches a task list by its ID, including associated project details.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Whether to return a JSON API response. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Whether to return a JSON API response. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Task list retrieved successfully.'
                  data:
                    id: 1
                    name: 'UI Tasks'
                    project: 'Website Redesign'
                    created_at: '30 May, 2025'
                    updated_at: '30 May, 2025'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Task list retrieved successfully.'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: 'UI Tasks'
                      project:
                        type: string
                        example: 'Website Redesign'
                      created_at:
                        type: string
                        example: '30 May, 2025'
                      updated_at:
                        type: string
                        example: '30 May, 2025'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Task list not found.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Task list not found.'
                  data:
                    type: array
                    example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred.'
                  data:
                    type: array
                    example: []
      tags:
        - 'Task List Management'
      security: []
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the task list to retrieve. Must exist in the `task_lists` table.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/task-lists/destroy/{id}':
    delete:
      summary: 'Delete a task list.'
      operationId: deleteATaskList
      description: 'Permanently deletes a task list by its ID.'
      parameters:
        -
          in: query
          name: isApi
          description: 'optional Whether to return a JSON API response. Defaults to false.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional Whether to return a JSON API response. Defaults to false.'
            example: true
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Task list deleted successfully.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Task list deleted successfully.'
                  data:
                    type: array
                    example: []
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'Task list not found.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'Task list not found.'
                  data:
                    type: array
                    example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred.'
                  data:
                    type: array
                    example: []
      tags:
        - 'Task List Management'
      security: []
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the task list to delete. Must exist in the `task_lists` table.'
        example: 1
        required: true
        schema:
          type: integer
  /api/task-lists/list:
    get:
      summary: 'Get list of task lists (API format).'
      operationId: getListOfTaskListsAPIFormat
      description: 'Returns a list of task lists for the current workspace in API format, with optional filtering and sorting.'
      parameters:
        -
          in: query
          name: search
          description: 'optional Search keyword to filter task lists by name, ID, or project title.'
          example: UI
          required: false
          schema:
            type: string
            description: 'optional Search keyword to filter task lists by name, ID, or project title.'
            example: UI
        -
          in: query
          name: sort
          description: 'optional Field to sort by. Defaults to id.'
          example: name
          required: false
          schema:
            type: string
            description: 'optional Field to sort by. Defaults to id.'
            example: name
        -
          in: query
          name: order
          description: 'optional Sort order: ASC or DESC. Defaults to DESC.'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional Sort order: ASC or DESC. Defaults to DESC.'
            example: ASC
        -
          in: query
          name: limit
          description: 'optional Number of records to return. Defaults to 10.'
          example: 20
          required: false
          schema:
            type: integer
            description: 'optional Number of records to return. Defaults to 10.'
            example: 20
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Task lists retrieved successfully.'
                  total: 1
                  data:
                    -
                      id: 1
                      name: 'UI Tasks'
                      project: 'Website Redesign'
                      created_at: '30 May, 2025'
                      updated_at: '30 May, 2025'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Task lists retrieved successfully.'
                  total:
                    type: integer
                    example: 1
                  data:
                    type: array
                    example:
                      -
                        id: 1
                        name: 'UI Tasks'
                        project: 'Website Redesign'
                        created_at: '30 May, 2025'
                        updated_at: '30 May, 2025'
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        name:
                          type: string
                          example: 'UI Tasks'
                        project:
                          type: string
                          example: 'Website Redesign'
                        created_at:
                          type: string
                          example: '30 May, 2025'
                        updated_at:
                          type: string
                          example: '30 May, 2025'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred.'
                  data:
                    type: array
                    example: []
      tags:
        - 'Task List Management'
      security: []
  /api/time-tracker/store:
    post:
      summary: 'Start a new time tracker.'
      operationId: startANewTimeTracker
      description: 'Creates a new time tracking record for the authenticated user with the current start time and an optional message.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Timer has been started successfully.'
                  data:
                    id: 1
                    user: '<a href="/users/3">John Doe</a>'
                    start_date_time: '30 May, 2025 14:34:00'
                    end_date_time: '-'
                    message: 'Working on project X'
                    created_at: '30 May, 2025'
                    updated_at: '30 May, 2025'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Timer has been started successfully.'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      user:
                        type: string
                        example: '<a href="/users/3">John Doe</a>'
                      start_date_time:
                        type: string
                        example: '30 May, 2025 14:34:00'
                      end_date_time:
                        type: string
                        example: '-'
                      message:
                        type: string
                        example: 'Working on project X'
                      created_at:
                        type: string
                        example: '30 May, 2025'
                      updated_at:
                        type: string
                        example: '30 May, 2025'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred.'
                  data:
                    type: array
                    example: []
      tags:
        - 'Time Tracker Management'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                message:
                  type: string
                  description: 'optional A description or note for the time tracking session.'
                  example: 'Working on project X'
                isApi:
                  type: boolean
                  description: 'optional Whether to return a formatted API response. Defaults to false.'
                  example: true
      security: []
  /api/time-tracker/update:
    post:
      summary: 'Stop an existing time tracker.'
      operationId: stopAnExistingTimeTracker
      description: 'Updates an existing time tracking record with the current end time and an optional message.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Timer has been stopped successfully.'
                  data:
                    id: 1
                    user: '<a href="/users/3">John Doe</a>'
                    start_date_time: '30 May, 2025 14:34:00'
                    end_date_time: '30 May, 2025 16:34:00'
                    message: 'Completed project X task'
                    created_at: '30 May, 2025'
                    updated_at: '30 May, 2025'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Timer has been stopped successfully.'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      user:
                        type: string
                        example: '<a href="/users/3">John Doe</a>'
                      start_date_time:
                        type: string
                        example: '30 May, 2025 14:34:00'
                      end_date_time:
                        type: string
                        example: '30 May, 2025 16:34:00'
                      message:
                        type: string
                        example: 'Completed project X task'
                      created_at:
                        type: string
                        example: '30 May, 2025'
                      updated_at:
                        type: string
                        example: '30 May, 2025'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'No query results for model [App\Models\TimeTracker] 9999'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'No query results for model [App\Models\TimeTracker] 9999'
                  data:
                    type: array
                    example: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred.'
                  data:
                    type: array
                    example: []
      tags:
        - 'Time Tracker Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                record_id:
                  type: integer
                  description: 'The ID of the time tracker to stop. Must exist in the `time_trackers` table.'
                  example: 1
                message:
                  type: string
                  description: 'optional A description or note for the time tracking session.'
                  example: 'Completed project X task'
                isApi:
                  type: boolean
                  description: 'optional Whether to return a formatted API response. Defaults to false.'
                  example: true
              required:
                - record_id
      security: []
  /api/time-tracker/list:
    get:
      summary: 'Get list of time trackers.'
      operationId: getListOfTimeTrackers
      description: 'Returns a list of time tracking records for the current workspace in API format, with optional filtering and sorting.'
      parameters:
        -
          in: query
          name: search
          description: 'optional Search term to filter time trackers by message.'
          example: project
          required: false
          schema:
            type: string
            description: 'optional Search term to filter time trackers by message.'
            example: project
        -
          in: query
          name: sort
          description: 'optional Field to sort by. Defaults to id.'
          example: start_date_time
          required: false
          schema:
            type: string
            description: 'optional Field to sort by. Defaults to id.'
            example: start_date_time
        -
          in: query
          name: order
          description: 'optional Sort order: ASC or DESC. Defaults to DESC.'
          example: ASC
          required: false
          schema:
            type: string
            description: 'optional Sort order: ASC or DESC. Defaults to DESC.'
            example: ASC
        -
          in: query
          name: limit
          description: 'optional Number of records to return. Defaults to 10.'
          example: 20
          required: false
          schema:
            type: integer
            description: 'optional Number of records to return. Defaults to 10.'
            example: 20
        -
          in: query
          name: offset
          description: 'optional Number of records to skip. Defaults to 0.'
          example: 10
          required: false
          schema:
            type: integer
            description: 'optional Number of records to skip. Defaults to 0.'
            example: 10
        -
          in: query
          name: user_id
          description: 'optional Filter by user ID.'
          example: 3
          required: false
          schema:
            type: integer
            description: 'optional Filter by user ID.'
            example: 3
        -
          in: query
          name: date_between_from
          description: 'optional Start date for filtering records (YYYY-MM-DD).'
          example: '2025-05-01'
          required: false
          schema:
            type: string
            description: 'optional Start date for filtering records (YYYY-MM-DD).'
            example: '2025-05-01'
        -
          in: query
          name: date_between_to
          description: 'optional End date for filtering records (YYYY-MM-DD).'
          example: '2025-05-31'
          required: false
          schema:
            type: string
            description: 'optional End date for filtering records (YYYY-MM-DD).'
            example: '2025-05-31'
        -
          in: query
          name: start_date_from
          description: 'optional Start date for filtering start_date_time (YYYY-MM-DD).'
          example: '2025-05-01'
          required: false
          schema:
            type: string
            description: 'optional Start date for filtering start_date_time (YYYY-MM-DD).'
            example: '2025-05-01'
        -
          in: query
          name: start_date_to
          description: 'optional End date for filtering start_date_time (YYYY-MM-DD).'
          example: '2025-05-31'
          required: false
          schema:
            type: string
            description: 'optional End date for filtering start_date_time (YYYY-MM-DD).'
            example: '2025-05-31'
        -
          in: query
          name: end_date_from
          description: 'optional Start date for filtering end_date_time (YYYY-MM-DD).'
          example: '2025-05-01'
          required: false
          schema:
            type: string
            description: 'optional Start date for filtering end_date_time (YYYY-MM-DD).'
            example: '2025-05-01'
        -
          in: query
          name: end_date_to
          description: 'optional End date for filtering end_date_time (YYYY-MM-DD).'
          example: '2025-05-31'
          required: false
          schema:
            type: string
            description: 'optional End date for filtering end_date_time (YYYY-MM-DD).'
            example: '2025-05-31'
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: false
                  message: 'Record(s) retrieved successfully!'
                  total: 1
                  data:
                    -
                      id: 1
                      user: '<a href="/users/3">John Doe</a>'
                      start_date_time: '30 May, 2025 14:34:00'
                      end_date_time: '30 May, 2025 16:34:00'
                      message: 'Working on project X'
                      created_at: '30 May, 2025'
                      updated_at: '30 May, 2025'
                properties:
                  error:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Record(s) retrieved successfully!'
                  total:
                    type: integer
                    example: 1
                  data:
                    type: array
                    example:
                      -
                        id: 1
                        user: '<a href="/users/3">John Doe</a>'
                        start_date_time: '30 May, 2025 14:34:00'
                        end_date_time: '30 May, 2025 16:34:00'
                        message: 'Working on project X'
                        created_at: '30 May, 2025'
                        updated_at: '30 May, 2025'
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        user:
                          type: string
                          example: '<a href="/users/3">John Doe</a>'
                        start_date_time:
                          type: string
                          example: '30 May, 2025 14:34:00'
                        end_date_time:
                          type: string
                          example: '30 May, 2025 16:34:00'
                        message:
                          type: string
                          example: 'Working on project X'
                        created_at:
                          type: string
                          example: '30 May, 2025'
                        updated_at:
                          type: string
                          example: '30 May, 2025'
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: true
                  message: 'An error occurred.'
                  data: []
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: 'An error occurred.'
                  data:
                    type: array
                    example: []
      tags:
        - 'Time Tracker Management'
      security: []
  '/api/time-tracker/destroy/{id}':
    delete:
      summary: 'Delete a time tracker.'
      operationId: deleteATimeTracker
      description: 'Deletes the specified time tracking record.'
      parameters:
        -
          in: header
          name: workspace-id
          description: ''
          example: 1
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": false,\n  \"message\": \"Record deleted successfully.\",\n\n}"
        404:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": true,\n  \"message\": \"No query results for model [App\\\\Models\\\\TimeTracker] 9999\",\n\n}"
        500:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"error\": true,\n  \"message\": \"An error occurred.\",\n}"
      tags:
        - 'Time Tracker Management'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                isApi:
                  type: boolean
                  description: 'optional Whether to return a formatted API response. Defaults to false.'
                  example: true
      security: []
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the time tracker to delete. Must exist in the `time_trackers` table.'
        example: 1
        required: true
        schema:
          type: integer
tags:
  -
    name: Endpoints
    description: ''
  -
    name: 'User Authentication'
    description: ''
  -
    name: 'Profile Management'
    description: ''
  -
    name: 'Dashboard Management'
    description: ''
  -
    name: 'Project Management'
    description: ''
  -
    name: 'Milestone Management'
    description: ''
  -
    name: 'Project Comments'
    description: ''
  -
    name: 'Project Media'
    description: ''
  -
    name: 'Task Management'
    description: ''
  -
    name: 'Task Comments'
    description: ''
  -
    name: 'Task Media'
    description: ''
  -
    name: 'Income vs Expense'
    description: ''
  -
    name: 'Status Management'
    description: ''
  -
    name: 'Priority Management'
    description: ''
  -
    name: 'Tag Management'
    description: ''
  -
    name: 'User Management'
    description: ''
  -
    name: 'Client Management'
    description: ''
  -
    name: 'Workspace Management'
    description: ''
  -
    name: 'Meeting Management'
    description: ''
  -
    name: 'Todo Management'
    description: ''
  -
    name: 'Note Management'
    description: ''
  -
    name: 'Leave Request Management'
    description: ''
  -
    name: 'Notification Management'
    description: ''
  -
    name: 'Activity Log Management'
    description: ''
  -
    name: 'Role/Permission Management'
    description: ''
  -
    name: 'Setting Management'
    description: ''
  -
    name: 'Expense Management'
    description: ''
  -
    name: 'Payment Management'
    description: ''
  -
    name: 'Payment Method Management'
    description: ''
  -
    name: 'Tax Management'
    description: ''
  -
    name: 'Unit Management'
    description: ''
  -
    name: 'Item Management'
    description: ''
  -
    name: 'Estimate Invoice Management'
    description: ''
  -
    name: 'Allowance Management'
    description: ''
  -
    name: 'Candidate Management'
    description: ''
  -
    name: 'Candidate Status Management'
    description: ''
  -
    name: 'Contract Management'
    description: ''
  -
    name: 'Contract Type Management'
    description: ''
  -
    name: 'Custom Field Management'
    description: ''
  -
    name: 'Deduction Management'
    description: ''
  -
    name: 'Email Management'
    description: ''
  -
    name: 'Email Template Management'
    description: ''
  -
    name: 'Interview Management'
    description: ''
  -
    name: 'Lead Form Management'
    description: ''
  -
    name: 'Leads Management'
    description: ''
  -
    name: 'Leads Source Management'
    description: ''
  -
    name: 'Leads Stage Management'
    description: ''
  -
    name: 'Payslip Management'
    description: ''
  -
    name: 'Task List Management'
    description: ''
  -
    name: 'Time Tracker Management'
    description: ''
components:
  securitySchemes:
    default:
      type: http
      scheme: bearer
      description: ''
security:
  -
    default: []
