openapi: 3.1.0
info:
  title: Augmented Operations Management API
  version: 1.0.0
  description: >-

    ## Overview


    This API provides backend services for the Augmented Decision Making
    application, focusing on the efficient scheduling and assignment of tasks
    **Operations** to a given **Resources**.


    The system models the following key entities:

    *   **Locations:** Representing physical areas

    *   **Resources:** Specific assignable assets within a location.

    *   **Tasks:** Represent individual events, jobs. Tasks include detailed
    time information (planned, expected, actual) and model uncertainty using
    statistical parameters (sigma, skew factor, distribution
    mean/earliest/latest). Tasks also support versioning to track updates.

    *   **Operations:** Represent a complete operation, linking an inbound task
    to an outbound task. Operations contain relevant metadata.

    *   **Assignments:** Link an Operation to a specific Resource for a given
    time period.

    *   **Tags:** Can be used to restrict possible assignments as well as
    indicate preferences or penalties.

    *   **Rules:** Can be used to specify preferences or penalties in
    conjunction with the tagging mechanism.


    ## Core Functionality


    The API enables users and automated systems to:


    1.  **Manage Data:** Perform CRUD operations on Locations, Resources, Tasks,
    Operations, and Assignments.

    2.  **Track Operations Times:** Handle various time representations and
    update task details, including imposing delays. Task updates create new
    versions, preserving history.

    3.  **Assignments:** Assign or reassign operation to resources.

    4.  **Detect Conflicts:** Identify situations where an assigned conflicting
    (overlapping) with another based on their expected time windows.

    5.  **Resolve Conflicts:** Offer mechanisms to resolve individual scheduling
    conflicts through AI.

    6.   **Optimize Globally:** Offer global optimization of the schedule using
    various solvers to minimize conflicts and reassignments while optimizing for
    rules.

    7.  **AI Assistance:** Interact with an AI agent (via the `/agent/`
    endpoint) using natural language to query the schedule, identify conflicts,
    request moves, or trigger conflict resolution processes. The agent utilizes
    specialized tools to interact with the system's state.

    8.  **Real-time Updates:** Delivers real-time notifications about changes to
    Assignments and Operations via WebSockets to subscribed clients.

    9.  **Virtual State Management:** Allows temporary modifications to the
    schedule (virtual assignments) for "what-if" scenarios or agent-driven
    planning before potentially persisting changes.
        
paths:
  /v1/assignments/:
    post:
      operationId: v1_assignments_create
      description: >-
        Creates a new assignment for an operation to a resource. Automatically
        deactivates any existing active assignment for the same operation.
      summary: Create Assignment
      tags:
        - Assignments
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Assignment'
        required: true
      security:
        - tokenAuth: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Assignment'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
  /v1/assignments/{id}/deactivate/:
    post:
      operationId: v1_assignments_deactivate_create
      description: >-
        Deactivates an assignment of an operation to a resource. The assignment
        is still kept for a historical record.
      summary: Deactivate an assignment
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Assignments
      security:
        - tokenAuth: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Assignment'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
  /v1/assignments/bulk/:
    post:
      operationId: v1_assignments_bulk_create
      description: Create multiple assignments in a single request.
      summary: Bulk create assignments
      tags:
        - Assignments
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkCreateAssignmentsSchema'
        required: true
      security:
        - tokenAuth: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkCreateAssignmentsResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInputType:
                  value:
                    detail: Invalid input. 'assignments' should be a list of objects.
                  summary: Error when 'assignments' is not a list
                AssignmentValidationError:
                  value:
                    detail:
                      operation:
                        - This field is required.
                  summary: Error from AssignmentSerializer validation
                ForeignKeyNotFound:
                  value:
                    detail: No Operation matches the given query.
                  summary: Invalid Operation or Resource ID
          description: >-
            Bad Request: Invalid input format for 'assignments' list, validation
            error, or missing FK.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
  /v1/locations/:
    post:
      operationId: v1_locations_create
      description: Creates a new location.
      summary: Creates a new location
      tags:
        - Locations
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Location'
        required: true
      security:
        - tokenAuth: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Location'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
  /v1/locations/{id}/:
    patch:
      operationId: v1_locations_partial_update
      description: Updates an existing location.
      summary: Updates an existing location
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Locations
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedLocation'
      security:
        - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Location'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
  /v1/operation-dependencies/:
    post:
      operationId: v1_operation_dependencies_create
      description: Associates two operations as being dependent.
      summary: Creates a new dependency between operations
      tags:
        - Dependencies
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OperationDependency'
        required: true
      security:
        - tokenAuth: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationDependency'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
  /v1/operation-dependencies/{id}/:
    get:
      operationId: v1_operation_dependencies_retrieve
      description: Get a dependency graph per operations.
      summary: Get a dependency graph
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Dependencies
      security:
        - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationDependency'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
    patch:
      operationId: v1_operation_dependencies_partial_update
      description: Updates a dependency between ops.
      summary: Update a dependency between operations
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Dependencies
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedOperationDependency'
      security:
        - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationDependency'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
    delete:
      operationId: v1_operation_dependencies_destroy
      description: >-
        Removes a dependency between operations, leaves the operations itself
        untouched
      summary: Remove a dependency between operations
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Dependencies
      security:
        - tokenAuth: []
      responses:
        '204':
          description: No Content
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
  /v1/operation-groups/:
    post:
      operationId: v1_operation_groups_create
      description: Creates a new operation group associated with a planning.
      summary: Creates a new operation group
      tags:
        - Operation Groups
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OperationGroup'
        required: true
      security:
        - tokenAuth: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationGroup'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
  /v1/operation-groups/{id}/:
    get:
      operationId: v1_operation_groups_retrieve
      description: Lists all operations in an operation group.
      summary: Get all operations in an operation group
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Operation Groups
      security:
        - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationGroup'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
    patch:
      operationId: v1_operation_groups_partial_update
      description: Updates specific fields of the operation group.
      summary: Update an operation group
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Operation Groups
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedOperationGroup'
      security:
        - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationGroup'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
    delete:
      operationId: v1_operation_groups_destroy
      description: >-
        Removes a grouping of operations. Leaves the operations itself
        untouched.
      summary: Remove an operation group
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Operation Groups
      security:
        - tokenAuth: []
      responses:
        '204':
          description: No Content
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
  /v1/operations/:
    post:
      operationId: v1_operations_create
      description: Creates operation.
      summary: Create Operation
      tags:
        - Operations
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Operation'
        required: true
      security:
        - tokenAuth: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Operation'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
  /v1/operations/{id}/:
    get:
      operationId: v1_operations_retrieve
      description: Retrieves details of a specific operation by its UUID.
      summary: Retrieve Operation
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Operations
      security:
        - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Operation'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
    patch:
      operationId: v1_operations_partial_update
      description: >-
        Updates specific fields of an operation, such as its metadata or task
        details (which creates new task versions).
      summary: Partially Update Operation
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Operations
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedOperation'
      security:
        - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Operation'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
    delete:
      operationId: v1_operations_destroy
      description: >-
        Deletes an operation and its associated tasks. Note: Also deletes
        related assignments due to cascading.
      summary: Delete Operation
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Operations
      security:
        - tokenAuth: []
      responses:
        '204':
          description: No Content
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
  /v1/operations/{id}/resolve-conflict/:
    post:
      operationId: v1_operations_resolve_conflict_create
      description: >-
        Analyzes conflicts for a specific operation within its time window and
        returns a list of potential resolution strategies (sets of moves).
        Requires virtual state context.
      summary: Resolve Conflict (Non-Streaming)
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Conflict Resolution
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConflictResolutionSchema'
        required: true
      security:
        - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConflictResolutionResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidControls:
                  value:
                    detail: Invalid controls data
                  summary: Error validating controls data
          description: 'Bad Request: Invalid ''controls'' data provided.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                OperationNotFound:
                  value:
                    detail: Operation with ID <uuid> not found.
                  summary: Specific operation ID missing
          description: 'Not Found: The specified Operation ID does not exist.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
  /v1/operations/{id}/resolve-conflict-stream/:
    post:
      operationId: v1_operations_resolve_conflict_stream_create
      description: >-
        Analyzes conflicts for a specific operation and streams potential
        resolution strategies (sets of moves) as NDJSON. Requires virtual state
        context.
      summary: Resolve Conflict (Streaming)
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Conflict Resolution
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConflictResolutionSchema'
        required: true
      security:
        - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: string
                description: >-
                  A streaming response providing solutions incrementally in
                  NDJSON format.
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidControls:
                  value:
                    detail: Invalid controls data
                  summary: Error validating controls data
          description: 'Bad Request: Invalid ''controls'' data provided.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                OperationNotFound:
                  value:
                    detail: Operation with ID <uuid> not found.
                  summary: Specific operation ID missing
          description: 'Not Found: The specified Operation ID does not exist.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
  /v1/operations/bulk/:
    patch:
      operationId: v1_operations_bulk_partial_update
      description: >-
        Perform a bulk update for multiple operations. This endpoint is atomic;
        either all updates succeed or none do.
      summary: Bulk partial update Operations
      tags:
        - Operations
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/Operation'
        required: true
      security:
        - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Operation'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
  /v1/operations/tasks/bulk/:
    patch:
      operationId: v1_operations_tasks_bulk_partial_update
      description: >-
        Perform a bulk update of tasks for multiple operations. Can be used for
        updating tasks from e.g. some external forecasting mechanism.
      summary: Bulk patch Tasks Operations
      parameters:
        - in: query
          name: end_timestamp
          schema:
            type: integer
          description: End time for filtering operations (Unix timestamp).
        - in: query
          name: start_timestamp
          schema:
            type: integer
          description: Start time for filtering operations (Unix timestamp).
        - in: query
          name: version
          schema:
            type: string
            enum:
              - first
              - latest
          description: 'Version of tasks to return. Options: ''latest'', ''first''.'
      tags:
        - Operations
        - Tasks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedBulkPatchTasksSchema'
        required: true
      security:
        - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Operation'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidTimestamp:
                  value:
                    detail: Invalid timestamp. Use Unix timestamp in seconds.
                  summary: Error for non-integer timestamp
          description: 'Bad Request: Invalid timestamp format provided for filtering.'
  /v1/organizations/:
    get:
      operationId: v1_organizations_list
      description: Get all organizations for the authenticated user.
      summary: Get all organizations for the authenticated user
      tags:
        - Organizations & Planning
      security:
        - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/OrganizationPlanning'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
  /v1/organizations/{org_pk}/plannings/:
    get:
      operationId: v1_organizations_plannings_list
      description: Get all plannings for an organization.
      summary: Get all plannings for an organization
      parameters:
        - in: path
          name: org_pk
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Organizations & Planning
      security:
        - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Planning'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
    post:
      operationId: v1_organizations_plannings_create
      description: Creates a new planning associated with an organization.
      summary: Creates a new planning for an organization
      parameters:
        - in: path
          name: org_pk
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Organizations & Planning
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Planning'
        required: true
      security:
        - tokenAuth: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Planning'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
  /v1/organizations/{org_pk}/plannings/{id}/:
    patch:
      operationId: v1_organizations_plannings_partial_update
      description: Updates an existing planning.
      summary: Updates a planning
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
        - in: path
          name: org_pk
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Organizations & Planning
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedPlanning'
      security:
        - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Planning'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
    delete:
      operationId: v1_organizations_plannings_destroy
      description: Deletes a planning and all associated resources.
      summary: Delete a planning
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
        - in: path
          name: org_pk
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Organizations & Planning
      security:
        - tokenAuth: []
      responses:
        '204':
          description: No Content
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
  /v1/organizations/{org_pk}/tags/:
    get:
      operationId: v1_organizations_tags_list
      description: Lists all tags for an organization.
      summary: Get all tags for an organization
      parameters:
        - in: path
          name: org_pk
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Tags
      security:
        - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Tag'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
  /v1/plannings/{id}/agent/:
    post:
      operationId: v1_plannings_agent_create
      description: >-
        Accepts chat history input and streams agent-generated responses in
        NDJSON format.
      summary: Generate responses using an agent
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - AI Agent
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentSchema'
        required: true
      security:
        - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: string
                description: >-
                  A streaming response providing agent-generated responses
                  incrementally.
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidJSON:
                  value:
                    detail: Invalid JSON
                  summary: Malformed JSON request body
                VirtualStateValidation:
                  value:
                    detail: 'Validation Error: virtual_state.some_field - ...'
                  summary: Error validating virtual_state data
          description: >-
            Bad Request: Invalid JSON or structure for chat_history or
            virtual_state.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
  /v1/plannings/{id}/assignments/:
    get:
      operationId: v1_plannings_assignments_list
      description: |-
        Return a list of assignments filtered by a timestamp range if provided.
        Only include assignments for operations within the given time range.
      parameters:
        - in: query
          name: active
          schema:
            type: boolean
            default: true
          description: Filter assignments by active status
        - in: query
          name: end_timestamp
          schema:
            type: integer
          description: End time for filtering assignments (Unix timestamp).
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
        - in: query
          name: limit
          schema:
            type: integer
          description: Limit the number of results
        - in: query
          name: operation
          schema:
            type: integer
          description: Filter by operation ID
        - in: query
          name: start_timestamp
          schema:
            type: integer
          description: Start time for filtering assignments (Unix timestamp).
      tags:
        - Assignments
      security:
        - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Assignment'
          description: ''
  /v1/plannings/{id}/locations/:
    get:
      operationId: v1_plannings_locations_list
      description: List a nested result of locations and resources for a planning.
      summary: Get all locations and resources for a planing
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Locations
      security:
        - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Location'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
  /v1/plannings/{id}/meta/:
    get:
      operationId: v1_plannings_meta_retrieve
      description: Gets all metadata for a planning like solvers etc.
      summary: Get all metadata for a planning
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Organizations & Planning
      security:
        - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlanningMeta'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
  /v1/plannings/{id}/operation-dependencies/:
    get:
      operationId: v1_plannings_operation_dependencies_list
      description: Lists all the dependencies in a planning.
      summary: Get all dependencies in a given planning
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Dependencies
      security:
        - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/OperationDependency'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
  /v1/plannings/{id}/operation-groups/:
    get:
      operationId: v1_plannings_operation_groups_list
      description: Gets all operations in an operation group for a given planning.
      summary: Get all operation groups for a given planning
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Operation Groups
      security:
        - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/OperationGroup'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
  /v1/plannings/{id}/operations/:
    get:
      operationId: v1_plannings_operations_list
      description: List all operations for a planning.
      summary: Get all operations for a planning
      parameters:
        - in: query
          name: end_timestamp
          schema:
            type: integer
          description: End time for filtering operations (Unix timestamp).
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
        - in: query
          name: start_timestamp
          schema:
            type: integer
          description: Start time for filtering operations (Unix timestamp).
        - in: query
          name: version
          schema:
            type: string
            enum:
              - first
              - latest
          description: 'Version of tasks to return. Options: ''latest'', ''first''.'
      tags:
        - Operations
      security:
        - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Operation'
          description: ''
  /v1/plannings/{id}/operations/bulk-upload/:
    post:
      operationId: v1_plannings_operations_bulk_upload_create
      description: >-
        Allows uploading multiple operations to an organization and linking them
        to one or more plannings via their IDs.
      summary: Bulk upload operations for one or more plannings
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Utility
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
              required:
                - file
      security:
        - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationBulkCreate'
          description: ''
        '400':
          content:
            application/json:
              schema:
                description: >-
                  Validation error (missing fields, invalid IDs, or duplicate
                  external_ids).
          description: ''
        '500':
          content:
            application/json:
              schema:
                description: Internal server error.
          description: ''
  /v1/plannings/{id}/optimizationTaskResults/:
    get:
      operationId: v1_plannings_optimizationTaskResults_list
      description: Get all tasks for a planning.
      summary: Get all tasks for a planning
      parameters:
        - in: query
          name: day
          schema:
            type: integer
          description: Start time for filtering operations (Unix timestamp).
          required: true
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Optimization
      security:
        - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/OptimizationTaskResultWrapper'
          description: Task status and result (if ready)
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
          description: 'Bad Request: Invalid input.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
  /v1/plannings/{id}/optimizationTaskResults/{task_id}/:
    delete:
      operationId: v1_plannings_optimizationTaskResults_destroy
      description: Get the status of a background optimization task.
      summary: Get task status
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
        - in: path
          name: task_id
          schema:
            type: string
          required: true
      tags:
        - Optimization
      security:
        - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OptimizationTaskResultWrapper'
          description: Task status and result (if ready)
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
          description: 'Bad Request: Invalid input.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
  /v1/plannings/{id}/optimize/:
    post:
      operationId: v1_plannings_optimize_create
      description: Start a task to optimize all assignments in a planning.
      summary: Optimize a plan
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Optimization
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VirtualStateInput'
        required: true
      security:
        - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskSubmissionResponse'
              examples:
                Success:
                  value:
                    task_id: abc123
          description: Returns task ID for polling
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
          description: 'Bad Request: Invalid input.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
  /v1/plannings/{id}/resources/:
    get:
      operationId: v1_plannings_resources_list
      description: List all resources for a planning.
      summary: Get all resources for a planning
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Resources
      security:
        - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Resource'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
  /v1/plannings/{id}/rules/:
    get:
      operationId: v1_plannings_rules_list
      description: >-
        Lists all rules for a planning. Note that while tags are bound to an
        organization, rules are planning specific. This distinction is there
        because the same resource can be used in multiple plannings.
      summary: Get all rules for a planning
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Rules
      security:
        - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Rule'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
  /v1/resources/:
    post:
      operationId: v1_resources_create
      description: Creates a new resource associated with a location.
      summary: Create Resource
      tags:
        - Resources
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Resource'
        required: true
      security:
        - tokenAuth: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Resource'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
  /v1/resources/{id}/:
    patch:
      operationId: v1_resources_partial_update
      description: Updates specific fields of a resource (e.g., name, ordering, tags).
      summary: Partially Update Resource
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Resources
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedResource'
      security:
        - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Resource'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
    delete:
      operationId: v1_resources_destroy
      description: >-
        Marks a resource as deleted (soft delete). Also deactivates any active
        assignments associated with this resource.
      summary: Delete Resource
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Resources
      security:
        - tokenAuth: []
      responses:
        '204':
          description: No Content
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
  /v1/rules/:
    post:
      operationId: v1_rules_create
      description: Creates a new rule.
      summary: Creates a new rule
      tags:
        - Rules
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Rule'
        required: true
      security:
        - tokenAuth: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Rule'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
  /v1/rules/{id}/:
    delete:
      operationId: v1_rules_destroy
      description: Deletes a rule.
      summary: Delete a rule
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Rules
      security:
        - tokenAuth: []
      responses:
        '204':
          description: No Content
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
  /v1/tags/:
    post:
      operationId: v1_tags_create
      description: Creates a new tag.
      summary: Creates a new tag
      tags:
        - Tags
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Tag'
        required: true
      security:
        - tokenAuth: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tag'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
  /v1/tags/{uuid}/:
    delete:
      operationId: v1_tags_destroy
      description: Deletes a tag.
      summary: Delete a tag
      parameters:
        - in: path
          name: uuid
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Tags
      security:
        - tokenAuth: []
      responses:
        '204':
          description: No Content
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                InvalidInput:
                  value:
                    detail: Invalid input.
                  summary: Error due to invalid input data
                ValidationError:
                  value:
                    field_name:
                      - This field is required.
                  summary: Error due to failed validation
          description: >-
            Bad Request: The request could not be understood or was missing
            required parameters/data.
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '403':
          description: 'Forbidden: You do not have permission to perform this action.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ResourceNotFound:
                  value:
                    detail: Not found.
                  summary: Generic 404 error
          description: 'Not Found: The requested resource could not be found.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
  /v1/token/:
    post:
      operationId: v1_token_create
      description: Creates authentication token for the provided credentials.
      summary: Generate Auth Token
      tags:
        - Token
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/AuthToken'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AuthToken'
          application/json:
            schema:
              $ref: '#/components/schemas/AuthToken'
        required: true
      security:
        - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthTokenResponse'
              examples:
                Success:
                  value:
                    token: abc123456789
          description: Returns auth token.
        '400':
          description: Invalid credentials.
  /v1/user/current/:
    get:
      operationId: v1_user_current_retrieve
      description: Retrieves the details of the currently authenticated user.
      summary: Get Current User
      tags:
        - Users
      security:
        - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
          description: ''
        '401':
          description: >-
            Unauthorized: Authentication credentials were not provided or were
            invalid.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                ServerError:
                  value:
                    detail: An internal server error occurred.
                  summary: Generic server error
          description: 'Internal Server Error: An unexpected error occurred on the server.'
components:
  schemas:
    AgentSchema:
      properties:
        chat_history:
          items:
            $ref: '#/components/schemas/ChatMessage'
          title: Chat History
          type: array
        virtual_state:
          anyOf:
            - $ref: '#/components/schemas/AviationVirtualStateInput'
            - $ref: '#/components/schemas/MaritimeBerthVirtualStateInput'
            - $ref: '#/components/schemas/VirtualStateInput'
          title: Virtual State
      required:
        - chat_history
        - virtual_state
      title: AgentSchema
      type: object
    Assignment:
      type: object
      properties:
        id:
          type: string
          format: uuid
        operation:
          type: string
          format: uuid
        resource:
          type: string
          format: uuid
        assignedAt:
          type: string
          format: date-time
          readOnly: true
        active:
          type: boolean
          readOnly: true
        assignedBy:
          type: string
          readOnly: true
        location:
          type: string
          readOnly: true
        planning:
          type: string
          format: uuid
        metadata:
          oneOf:
            - $ref: '#/components/schemas/MaritimeBerthAssignmentMetadataSchema'
      required:
        - active
        - assignedAt
        - assignedBy
        - location
        - operation
        - planning
        - resource
    AssignmentCreate:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        operation:
          title: Operation
          type: string
        resource:
          title: Resource
          type: string
        planning:
          title: Planning
          type: string
        active:
          title: Active
          type: boolean
        metadata:
          anyOf:
            - $ref: '#/components/schemas/MaritimeBerthAssignmentMetadataSchema'
            - type: 'null'
          default: null
          description: Metadata for the assignment, adhering to the metadata schema.
      required:
        - id
        - operation
        - resource
        - planning
        - active
      title: AssignmentCreate
      type: object
    AssignmentDiff:
      properties:
        operation:
          title: Operation
          type: string
        old_resource:
          title: Old Resource
          type: string
        new_resource:
          title: New Resource
          type: string
      required:
        - operation
        - old_resource
        - new_resource
      title: AssignmentDiff
      type: object
    AuthToken:
      type: object
      properties:
        username:
          type: string
          writeOnly: true
        password:
          type: string
          writeOnly: true
        token:
          type: string
          readOnly: true
      required:
        - password
        - token
        - username
    AuthTokenResponse:
      type: object
      properties:
        token:
          type: string
      required:
        - token
    AviationControlPanelState:
      properties:
        resolution_balance:
          description: >-
            0 strives for minimal conflicts whereas 1 strives for minimal
            overlap
          title: Resolution Balance
          type: number
        rule_adherence:
          description: >-
            0 strives for the goal of the strategy, while 1 strives for optimal
            rule value
          title: Rule Adherence
          type: number
        max_runtime:
          default: 60
          description: Maximum runtime in seconds for the solver, default is 90 seconds
          title: Max Runtime
          type: integer
        strategy:
          $ref: '#/components/schemas/AviationSolutionStrategy'
      required:
        - resolution_balance
        - rule_adherence
        - strategy
      title: AviationControlPanelState
      type: object
    AviationSolutionStrategy:
      enum:
        - least_moves
        - standard
        - minimal_resources
      title: AviationSolutionStrategy
      type: string
    AviationStandMetadataSchema:
      additionalProperties: false
      properties:
        kind:
          const: aviation_stand
          title: Kind
          type: string
        airline:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Airline
        alliance:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Alliance
        location_code:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Location Code
        origin_code:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Origin Code
        destination_code:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Destination Code
      required:
        - kind
      title: AviationStandMetadataSchema
      type: object
    AviationVirtualStateInput:
      description: >-
        This is a placeholder for the AviationStandPlanningAdapter's virtual
        state input.
      properties:
        virtual_assignments:
          items:
            $ref: '#/components/schemas/VirtualAssignment'
          title: Virtual Assignments
          type: array
        display_window_start:
          title: Display Window Start
          type: integer
        display_window_end:
          title: Display Window End
          type: integer
        selected_time:
          title: Selected Time
          type: integer
        backward_window:
          title: Backward Window
          type: integer
        forward_window:
          title: Forward Window
          type: integer
        current_time:
          title: Current Time
          type: integer
        experimental_tools_enabled:
          title: Experimental Tools Enabled
          type: boolean
        controls:
          $ref: '#/components/schemas/AviationControlPanelState'
        timezone:
          default: UTC
          title: Timezone
          type: string
        gate:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Gate
      required:
        - virtual_assignments
        - display_window_start
        - display_window_end
        - selected_time
        - backward_window
        - forward_window
        - current_time
        - experimental_tools_enabled
        - controls
      title: AviationVirtualStateInput
      type: object
    BulkCreateAssignmentsResponse:
      properties:
        created_assignments:
          items:
            $ref: '#/components/schemas/AssignmentCreate'
          title: Created Assignments
          type: array
      required:
        - created_assignments
      title: BulkCreateAssignmentsResponse
      type: object
    BulkCreateAssignmentsSchema:
      properties:
        assignments:
          items:
            $ref: '#/components/schemas/AssignmentCreate'
          title: Assignments
          type: array
      required:
        - assignments
      title: BulkCreateAssignmentsSchema
      type: object
    ChatMessage:
      properties:
        type:
          title: Type
          type: string
        content:
          title: Content
          type: string
      required:
        - type
        - content
      title: ChatMessage
      type: object
    ConflictResolutionResponse:
      properties:
        solutions:
          items:
            $ref: '#/components/schemas/ConflictResolutionSolution'
          title: Solutions
          type: array
      required:
        - solutions
      title: ConflictResolutionResponse
      type: object
    ConflictResolutionSchema:
      properties:
        virtual_state:
          anyOf:
            - $ref: '#/components/schemas/AviationVirtualStateInput'
            - $ref: '#/components/schemas/MaritimeBerthVirtualStateInput'
            - $ref: '#/components/schemas/VirtualStateInput'
          title: Virtual State
      required:
        - virtual_state
      title: ConflictResolutionSchema
      type: object
    ConflictResolutionSolution:
      properties:
        changes:
          items:
            $ref: '#/components/schemas/AssignmentDiff'
          title: Changes
          type: array
        score:
          title: Score
          type: integer
        is_resolved:
          title: Is Resolved
          type: boolean
      required:
        - changes
        - score
        - is_resolved
      title: ConflictResolutionSolution
      type: object
    ControlPanelState:
      properties:
        resolution_balance:
          description: >-
            0 strives for minimal conflicts whereas 1 strives for minimal
            overlap
          title: Resolution Balance
          type: number
        rule_adherence:
          description: >-
            0 strives for the goal of the strategy, while 1 strives for optimal
            rule value
          title: Rule Adherence
          type: number
        max_runtime:
          default: 60
          description: Maximum runtime in seconds for the solver, default is 90 seconds
          title: Max Runtime
          type: integer
        strategy:
          $ref: '#/components/schemas/SolutionStrategy'
      required:
        - resolution_balance
        - rule_adherence
        - strategy
      title: ControlPanelState
      type: object
    ErrorDetail:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
    Location:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        externalId:
          type:
            - string
            - 'null'
        name:
          type: string
          maxLength: 100
        resources:
          type: array
          items:
            $ref: '#/components/schemas/Resource'
          readOnly: true
        planning:
          type: string
          format: uuid
        metadata:
          type: object
      required:
        - id
        - name
        - planning
        - resources
    MaritimeBerthAssignmentMetadataSchema:
      additionalProperties: false
      description: Input schema for maritime berth assignment metadata.
      properties:
        kind:
          const: maritime_berth
          default: maritime_berth
          title: Kind
          type: string
        position:
          anyOf:
            - type: number
            - type: 'null'
          default: null
          title: Position
      title: MaritimeBerthAssignmentMetadataSchema
      type: object
    MaritimeBerthOperationMetadataSchema:
      additionalProperties: false
      properties:
        kind:
          const: maritime_berth
          default: maritime_berth
          title: Kind
          type: string
        vessel_name:
          title: Vessel Name
          type: string
        vessel_length:
          title: Vessel Length
          type: number
        vessel_type:
          title: Vessel Type
          type: string
        vessel_mmsi:
          title: Vessel Mmsi
          type: string
        load:
          anyOf:
            - type: number
            - type: 'null'
          default: null
          title: Load
        discharge:
          anyOf:
            - type: number
            - type: 'null'
          default: null
          title: Discharge
        restow:
          anyOf:
            - type: number
            - type: 'null'
          default: null
          title: Restow
        mooring:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Mooring
        portcall_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Portcall Id
        carrier:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Carrier
        last_port:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Last Port
        next_port:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Next Port
        tugboat_at_arrival:
          anyOf:
            - $ref: '#/components/schemas/TugboatServiceSchema'
            - type: 'null'
          default: null
        boatmen_at_arrival:
          anyOf:
            - $ref: '#/components/schemas/TugboatServiceSchema'
            - type: 'null'
          default: null
        boatmen_at_departure:
          anyOf:
            - $ref: '#/components/schemas/TugboatServiceSchema'
            - type: 'null'
          default: null
        tugboat_at_departure:
          anyOf:
            - $ref: '#/components/schemas/TugboatServiceSchema'
            - type: 'null'
          default: null
      required:
        - vessel_name
        - vessel_length
        - vessel_type
        - vessel_mmsi
      title: MaritimeBerthOperationMetadataSchema
      type: object
    MaritimeBerthResourceMetadataSchema:
      additionalProperties: false
      description: Input schema for maritime berth resource metadata.
      properties:
        kind:
          const: maritime_berth
          default: maritime_berth
          title: Kind
          type: string
        berth_length:
          title: Berth Length
          type: number
        latitude:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Latitude
        longitude:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Longitude
      required:
        - berth_length
      title: MaritimeBerthResourceMetadataSchema
      type: object
    MaritimeBerthVirtualStateInput:
      description: |-
        Virtual state input specific to maritime berth planning.
        Can be extended with maritime-specific controls or filters if needed.
      properties:
        virtual_assignments:
          items:
            $ref: '#/components/schemas/VirtualAssignment'
          title: Virtual Assignments
          type: array
        display_window_start:
          title: Display Window Start
          type: integer
        display_window_end:
          title: Display Window End
          type: integer
        selected_time:
          title: Selected Time
          type: integer
        backward_window:
          title: Backward Window
          type: integer
        forward_window:
          title: Forward Window
          type: integer
        current_time:
          title: Current Time
          type: integer
        experimental_tools_enabled:
          title: Experimental Tools Enabled
          type: boolean
        controls:
          $ref: '#/components/schemas/ControlPanelState'
        timezone:
          default: UTC
          title: Timezone
          type: string
      required:
        - virtual_assignments
        - display_window_start
        - display_window_end
        - selected_time
        - backward_window
        - forward_window
        - current_time
        - experimental_tools_enabled
        - controls
      title: MaritimeBerthVirtualStateInput
      type: object
    Operation:
      type: object
      properties:
        id:
          type: string
          format: uuid
        externalId:
          type:
            - string
            - 'null'
        inboundTask:
          $ref: '#/components/schemas/Task'
        outboundTask:
          $ref: '#/components/schemas/Task'
        metadata:
          oneOf:
            - $ref: '#/components/schemas/AviationStandMetadataSchema'
            - $ref: '#/components/schemas/MaritimeBerthOperationMetadataSchema'
        operationName:
          type: string
          readOnly: true
        isFixedToResource:
          type: boolean
        tags:
          type: array
          items:
            type: string
            format: uuid
        requiredTags:
          type: array
          items:
            type: string
          readOnly: true
        planning:
          type: string
          format: uuid
        description:
          type:
            - string
            - 'null'
        operationDependencies:
          type: array
          items:
            $ref: '#/components/schemas/OperationDependency'
          readOnly: true
        group:
          type:
            - string
            - 'null'
          format: uuid
          description: Group to which this operation belongs, e.g., a portcall.
      required:
        - inboundTask
        - isFixedToResource
        - operationDependencies
        - operationName
        - outboundTask
        - planning
        - requiredTags
        - tags
    OperationBulkCreate:
      type: object
      properties:
        createdOperations:
          type: integer
        updatedOperations:
          type: integer
        unchangedOperations:
          type: integer
      required:
        - createdOperations
        - unchangedOperations
        - updatedOperations
    OperationDependency:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        fromOperation:
          type: string
          format: uuid
        toOperation:
          type: string
          format: uuid
        type:
          $ref: '#/components/schemas/OperationDependencyTypeEnum'
        minOffset:
          type:
            - integer
            - 'null'
        maxOffset:
          type:
            - integer
            - 'null'
        createdAt:
          type: string
          format: date-time
          readOnly: true
        updatedAt:
          type: string
          format: date-time
          readOnly: true
      required:
        - createdAt
        - fromOperation
        - id
        - toOperation
        - type
        - updatedAt
    OperationDependencyTypeEnum:
      enum:
        - PRECEDENCE
        - GAP
      type: string
      description: |-
        * `PRECEDENCE` - Precedence
        * `GAP` - Gap
    OperationGroup:
      type: object
      description: >-
        Serializer for grouping Operations that belong to the same external
        entity

        (e.g. a Portbase port-call).
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        planning:
          type: string
          format: uuid
        externalId:
          type:
            - string
            - 'null'
        operations:
          type: array
          items:
            $ref: '#/components/schemas/Operation'
          readOnly: true
        metadata:
          type: object
        createdAt:
          type: string
          format: date-time
          readOnly: true
        updatedAt:
          type: string
          format: date-time
          readOnly: true
      required:
        - createdAt
        - id
        - operations
        - planning
        - updatedAt
    OperationUpdate:
      properties:
        operationId:
          title: Operationid
          type: string
        inboundTask:
          anyOf:
            - $ref: '#/components/schemas/TaskUpdate'
            - type: 'null'
        outboundTask:
          anyOf:
            - $ref: '#/components/schemas/TaskUpdate'
            - type: 'null'
      required:
        - operationId
        - inboundTask
        - outboundTask
      title: OperationUpdate
      type: object
    OptimizationTaskError:
      properties:
        error:
          title: Error
          type: string
      required:
        - error
      title: OptimizationTaskError
      type: object
    OptimizationTaskResultFailedOrRetried:
      properties:
        taskId:
          title: Taskid
          type: string
        discarded:
          title: Discarded
          type: boolean
        dateStarted:
          format: date-time
          title: Datestarted
          type: string
        dateDone:
          format: date-time
          title: Datedone
          type: string
        virtualState:
          anyOf:
            - $ref: '#/components/schemas/AviationVirtualStateInput'
            - $ref: '#/components/schemas/MaritimeBerthVirtualStateInput'
            - $ref: '#/components/schemas/VirtualStateInput'
          title: Virtualstate
        status:
          allOf:
            - $ref: >-
                #/components/schemas/OptimizationTaskResultFailedOrRetriedStatusEnum
          title: Status
        optimizationResult:
          $ref: '#/components/schemas/OptimizationTaskError'
        optimizationStatus:
          const: UNKNOWN
          title: Optimizationstatus
          type: string
      required:
        - taskId
        - discarded
        - dateStarted
        - dateDone
        - virtualState
        - status
        - optimizationResult
        - optimizationStatus
      title: OptimizationTaskResultFailedOrRetried
      type: object
    OptimizationTaskResultFailedOrRetriedStatusEnum:
      enum:
        - RETRY
        - FAILURE
      type: string
    OptimizationTaskResultNotDone:
      properties:
        taskId:
          title: Taskid
          type: string
        discarded:
          title: Discarded
          type: boolean
        dateStarted:
          format: date-time
          title: Datestarted
          type: string
        dateDone:
          format: date-time
          title: Datedone
          type: string
        virtualState:
          anyOf:
            - $ref: '#/components/schemas/AviationVirtualStateInput'
            - $ref: '#/components/schemas/MaritimeBerthVirtualStateInput'
            - $ref: '#/components/schemas/VirtualStateInput'
          title: Virtualstate
        status:
          allOf:
            - $ref: '#/components/schemas/OptimizationTaskResultNotDoneStatusEnum'
          title: Status
        optimizationResult:
          default: null
          title: Optimizationresult
          type: 'null'
        optimizationStatus:
          const: UNKNOWN
          title: Optimizationstatus
          type: string
      required:
        - taskId
        - discarded
        - dateStarted
        - dateDone
        - virtualState
        - status
        - optimizationStatus
      title: OptimizationTaskResultNotDone
      type: object
    OptimizationTaskResultNotDoneStatusEnum:
      enum:
        - PENDING
        - STARTED
        - EXPIRED
      type: string
    OptimizationTaskResultNotOptimalOrFeasible:
      properties:
        taskId:
          title: Taskid
          type: string
        discarded:
          title: Discarded
          type: boolean
        dateStarted:
          format: date-time
          title: Datestarted
          type: string
        dateDone:
          format: date-time
          title: Datedone
          type: string
        virtualState:
          anyOf:
            - $ref: '#/components/schemas/AviationVirtualStateInput'
            - $ref: '#/components/schemas/MaritimeBerthVirtualStateInput'
            - $ref: '#/components/schemas/VirtualStateInput'
          title: Virtualstate
        status:
          const: SUCCESS
          title: Status
          type: string
        optimizationResult:
          default: null
          title: Optimizationresult
          type: 'null'
        optimizationStatus:
          allOf:
            - $ref: >-
                #/components/schemas/OptimizationTaskResultNotOptimalOrFeasibleOptimizationStatusEnum
          title: Optimizationstatus
      required:
        - taskId
        - discarded
        - dateStarted
        - dateDone
        - virtualState
        - status
        - optimizationStatus
      title: OptimizationTaskResultNotOptimalOrFeasible
      type: object
    OptimizationTaskResultNotOptimalOrFeasibleOptimizationStatusEnum:
      enum:
        - INFEASIBLE
        - MODEL_INVALID
        - UNKNOWN
      type: string
    OptimizationTaskResultOptimalOrFeasible:
      properties:
        taskId:
          title: Taskid
          type: string
        discarded:
          title: Discarded
          type: boolean
        dateStarted:
          format: date-time
          title: Datestarted
          type: string
        dateDone:
          format: date-time
          title: Datedone
          type: string
        virtualState:
          anyOf:
            - $ref: '#/components/schemas/AviationVirtualStateInput'
            - $ref: '#/components/schemas/MaritimeBerthVirtualStateInput'
            - $ref: '#/components/schemas/VirtualStateInput'
          title: Virtualstate
        status:
          const: SUCCESS
          title: Status
          type: string
        optimizationResult:
          items:
            $ref: '#/components/schemas/AssignmentCreate'
          title: Optimizationresult
          type: array
        optimizationStatus:
          allOf:
            - $ref: >-
                #/components/schemas/OptimizationTaskResultOptimalOrFeasibleOptimizationStatusEnum
          title: Optimizationstatus
      required:
        - taskId
        - discarded
        - dateStarted
        - dateDone
        - virtualState
        - status
        - optimizationResult
        - optimizationStatus
      title: OptimizationTaskResultOptimalOrFeasible
      type: object
    OptimizationTaskResultOptimalOrFeasibleOptimizationStatusEnum:
      enum:
        - OPTIMAL
        - FEASIBLE
      type: string
    OptimizationTaskResultWrapper:
      anyOf:
        - $ref: '#/components/schemas/OptimizationTaskResultNotDone'
        - $ref: '#/components/schemas/OptimizationTaskResultOptimalOrFeasible'
        - $ref: '#/components/schemas/OptimizationTaskResultNotOptimalOrFeasible'
        - $ref: '#/components/schemas/OptimizationTaskResultFailedOrRetried'
      title: OptimizationTaskResultWrapper
    OrganizationPlanning:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          maxLength: 255
        plannings:
          type: array
          items:
            $ref: '#/components/schemas/PlanningSummery'
          readOnly: true
      required:
        - id
        - name
        - plannings
    PatchedBulkPatchTasksSchema:
      properties:
        operations:
          items:
            $ref: '#/components/schemas/OperationUpdate'
          title: Operations
          type: array
      required:
        - operations
      title: BulkPatchTasksSchema
      type: object
    PatchedLocation:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        externalId:
          type:
            - string
            - 'null'
        name:
          type: string
          maxLength: 100
        resources:
          type: array
          items:
            $ref: '#/components/schemas/Resource'
          readOnly: true
        planning:
          type: string
          format: uuid
        metadata:
          type: object
    PatchedOperation:
      type: object
      properties:
        id:
          type: string
          format: uuid
        externalId:
          type:
            - string
            - 'null'
        inboundTask:
          $ref: '#/components/schemas/Task'
        outboundTask:
          $ref: '#/components/schemas/Task'
        metadata:
          oneOf:
            - $ref: '#/components/schemas/AviationStandMetadataSchema'
            - $ref: '#/components/schemas/MaritimeBerthOperationMetadataSchema'
        operationName:
          type: string
          readOnly: true
        isFixedToResource:
          type: boolean
        tags:
          type: array
          items:
            type: string
            format: uuid
        requiredTags:
          type: array
          items:
            type: string
          readOnly: true
        planning:
          type: string
          format: uuid
        description:
          type:
            - string
            - 'null'
        operationDependencies:
          type: array
          items:
            $ref: '#/components/schemas/OperationDependency'
          readOnly: true
        group:
          type:
            - string
            - 'null'
          format: uuid
          description: Group to which this operation belongs, e.g., a portcall.
    PatchedOperationDependency:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        fromOperation:
          type: string
          format: uuid
        toOperation:
          type: string
          format: uuid
        type:
          $ref: '#/components/schemas/OperationDependencyTypeEnum'
        minOffset:
          type:
            - integer
            - 'null'
        maxOffset:
          type:
            - integer
            - 'null'
        createdAt:
          type: string
          format: date-time
          readOnly: true
        updatedAt:
          type: string
          format: date-time
          readOnly: true
    PatchedOperationGroup:
      type: object
      description: >-
        Serializer for grouping Operations that belong to the same external
        entity

        (e.g. a Portbase port-call).
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        planning:
          type: string
          format: uuid
        externalId:
          type:
            - string
            - 'null'
        operations:
          type: array
          items:
            $ref: '#/components/schemas/Operation'
          readOnly: true
        metadata:
          type: object
        createdAt:
          type: string
          format: date-time
          readOnly: true
        updatedAt:
          type: string
          format: date-time
          readOnly: true
    PatchedPlanning:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          maxLength: 255
        plugin:
          type: string
        created_at:
          type: string
          format: date-time
          readOnly: true
        tasks:
          type: array
          items:
            $ref: '#/components/schemas/Task'
          readOnly: true
        locations:
          type: array
          items:
            type: string
            format: uuid
        description:
          type: string
        solvers:
          type: array
          items:
            $ref: '#/components/schemas/SolverStrategy'
          readOnly: true
    PatchedResource:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        externalId:
          type:
            - string
            - 'null'
        name:
          type: string
          maxLength: 100
        ordering:
          type: number
          format: double
        tags:
          type: array
          items:
            type: string
            format: uuid
        location:
          type: string
          format: uuid
        requiredTags:
          type: array
          items:
            type: string
          readOnly: true
        metadata:
          oneOf:
            - $ref: '#/components/schemas/MaritimeBerthResourceMetadataSchema'
    Planning:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          maxLength: 255
        plugin:
          type: string
        created_at:
          type: string
          format: date-time
          readOnly: true
        tasks:
          type: array
          items:
            $ref: '#/components/schemas/Task'
          readOnly: true
        locations:
          type: array
          items:
            type: string
            format: uuid
        description:
          type: string
        solvers:
          type: array
          items:
            $ref: '#/components/schemas/SolverStrategy'
          readOnly: true
      required:
        - created_at
        - id
        - locations
        - name
        - plugin
        - solvers
        - tasks
    PlanningMeta:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        organization_id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          maxLength: 255
        created_at:
          type: string
          format: date-time
          readOnly: true
        description:
          type: string
          readOnly: true
        solvers:
          type: array
          items:
            $ref: '#/components/schemas/SolverStrategy'
          readOnly: true
        plugin:
          type: string
          readOnly: true
      required:
        - created_at
        - description
        - id
        - name
        - organization_id
        - plugin
        - solvers
    PlanningSummery:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          maxLength: 255
        createdAt:
          type: string
          format: date-time
          readOnly: true
        plugin:
          type: string
          description: Name of installed planning plug-in (e.g. 'stand', 'berth').
          maxLength: 30
      required:
        - createdAt
        - id
        - name
        - plugin
    Resource:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        externalId:
          type:
            - string
            - 'null'
        name:
          type: string
          maxLength: 100
        ordering:
          type: number
          format: double
        tags:
          type: array
          items:
            type: string
            format: uuid
        location:
          type: string
          format: uuid
        requiredTags:
          type: array
          items:
            type: string
          readOnly: true
        metadata:
          oneOf:
            - $ref: '#/components/schemas/MaritimeBerthResourceMetadataSchema'
      required:
        - id
        - location
        - name
        - requiredTags
        - tags
    Rule:
      type: object
      properties:
        uuid:
          type: string
          format: uuid
          readOnly: true
        planning:
          type: string
          format: uuid
        operationTags:
          type: array
          items:
            type: string
            format: uuid
        resourceTags:
          type: array
          items:
            type: string
            format: uuid
        type:
          $ref: '#/components/schemas/RuleTypeEnum'
        name:
          type: string
          maxLength: 512
        description:
          type: string
        value:
          type: number
          format: double
          minimum: 0
      required:
        - name
        - operationTags
        - planning
        - resourceTags
        - type
        - uuid
        - value
    RuleTypeEnum:
      enum:
        - PENALTY
        - PREFERENCE
      type: string
      description: |-
        * `PENALTY` - Penalty
        * `PREFERENCE` - Preference
    SolutionStrategy:
      enum:
        - standard
      title: SolutionStrategy
      type: string
    SolverStrategy:
      type: object
      properties:
        name:
          type: string
        displayName:
          type: string
        description:
          type: string
        isDefault:
          type: boolean
        isAvailable:
          type: boolean
        isBeta:
          type: boolean
      required:
        - description
        - displayName
        - isAvailable
        - isBeta
        - isDefault
        - name
    Tag:
      type: object
      properties:
        uuid:
          type: string
          format: uuid
          readOnly: true
        category:
          type: string
          maxLength: 256
        value:
          type: string
          maxLength: 256
        organization:
          type: string
          format: uuid
        required:
          type: boolean
      required:
        - category
        - organization
        - uuid
        - value
    Task:
      type: object
      properties:
        taskName:
          type: string
        plannedTime:
          type: string
          format: date-time
        expectedTime:
          type: string
          format: date-time
        sigma:
          type: number
          format: double
          minimum: 0
        skewFactor:
          type: number
          format: double
        actualTime:
          type:
            - string
            - 'null'
          format: date-time
        distributionMean:
          type:
            - string
            - 'null'
          format: date-time
        distributionEarliest:
          type: string
          format: date-time
          readOnly: true
        distributionLatest:
          type: string
          format: date-time
          readOnly: true
        createdAt:
          type: string
          format: date-time
          readOnly: true
        updatedAt:
          type: string
          format: date-time
          readOnly: true
        validFrom:
          type: string
          format: date-time
          readOnly: true
        validTo:
          type: string
          format: date-time
          readOnly: true
        imposedDelayInSeconds:
          type: integer
        derivedExpectedTime:
          type: string
          format: date-time
          readOnly: true
        isMock:
          type: boolean
          default: false
      required:
        - actualTime
        - createdAt
        - derivedExpectedTime
        - distributionEarliest
        - distributionLatest
        - distributionMean
        - expectedTime
        - plannedTime
        - sigma
        - skewFactor
        - taskName
        - updatedAt
        - validFrom
        - validTo
    TaskSubmissionResponse:
      properties:
        task_id:
          title: Task Id
          type: string
      required:
        - task_id
      title: TaskSubmissionResponse
      type: object
    TaskUpdate:
      properties:
        plannedTime:
          anyOf:
            - type: string
            - type: 'null'
          title: Plannedtime
        expectedTime:
          anyOf:
            - type: string
            - type: 'null'
          title: Expectedtime
        sigma:
          anyOf:
            - minimum: 0
              type: number
            - type: 'null'
          default: null
          title: Sigma
        skewFactor:
          anyOf:
            - type: number
            - type: 'null'
          title: Skewfactor
        distributionMean:
          anyOf:
            - type: string
            - type: 'null'
          title: Distributionmean
        actualTime:
          anyOf:
            - type: string
            - type: 'null'
          title: Actualtime
      required:
        - plannedTime
        - expectedTime
        - skewFactor
        - distributionMean
        - actualTime
      title: TaskUpdate
      type: object
    TugboatServiceSchema:
      description: Schema for tugboat service metadata.
      properties:
        required:
          title: Required
          type: boolean
        remarks:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Remarks
      required:
        - required
      title: TugboatServiceSchema
      type: object
    User:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        username:
          type: string
          description: >-
            Required. 150 characters or fewer. Letters, digits and @/./+/-/_
            only.
          pattern: ^[\w.@+-]+$
          maxLength: 150
        password:
          type: string
          writeOnly: true
        is_staff:
          type: boolean
          title: Staff status
          description: Designates whether the user can log into this admin site.
      required:
        - id
        - password
        - username
    VirtualAssignment:
      properties:
        id:
          format: uuid4
          title: Id
          type: string
        operation:
          format: uuid4
          title: Operation
          type: string
        planning:
          format: uuid4
          title: Planning
          type: string
        resource:
          format: uuid4
          title: Resource
          type: string
        metadata:
          anyOf:
            - type: object
            - type: 'null'
          title: Metadata
        active:
          title: Active
          type: boolean
      required:
        - id
        - operation
        - planning
        - resource
        - active
      title: VirtualAssignment
      type: object
    VirtualStateInput:
      description: Public-facing input model used for validation and schema generation.
      properties:
        virtual_assignments:
          items:
            $ref: '#/components/schemas/VirtualAssignment'
          title: Virtual Assignments
          type: array
        display_window_start:
          title: Display Window Start
          type: integer
        display_window_end:
          title: Display Window End
          type: integer
        selected_time:
          title: Selected Time
          type: integer
        backward_window:
          title: Backward Window
          type: integer
        forward_window:
          title: Forward Window
          type: integer
        current_time:
          title: Current Time
          type: integer
        experimental_tools_enabled:
          title: Experimental Tools Enabled
          type: boolean
        controls:
          $ref: '#/components/schemas/ControlPanelState'
        timezone:
          default: UTC
          title: Timezone
          type: string
      required:
        - virtual_assignments
        - display_window_start
        - display_window_end
        - selected_time
        - backward_window
        - forward_window
        - current_time
        - experimental_tools_enabled
        - controls
      title: VirtualStateInput
      type: object
  securitySchemes:
    tokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Token-based authentication with required prefix "Token"
servers:
  - description: Acceptance Environment
    url: https://api.acc.adm.wearetransformers.nl
tags:
  - name: Users
    description: User management (authentication, current user details).
  - name: Locations
    description: Managing locations and viewing their associated resources.
  - name: Resources
    description: Managing resources (CRUD, listing).
  - name: Operations
    description: Managing operations. Includes CRUD and listing with time/version filters.
  - name: Tasks
    description: >-
      Updating details (time, uncertainty) of individual tasks within
      operations.
  - name: Assignments
    description: >-
      Managing the assignment of operations to resources (CRUD, bulk operations,
      deactivation, listing per operation).
  - name: Conflict Resolution
    description: >-
      Resolving specific scheduling conflicts using heuristic search methods
      (streaming and non-streaming).
  - name: Optimization
    description: >-
      Globally optimizing the schedule using one of the solvers to minimize
      conflicts and reassignments while optimizing for rules.
  - name: Organizations & Planning
    description: Managing the plannings and organizations you have access to.
  - name: AI Agent
    description: Interacting with the conversational AI assistant for planning and queries.
  - name: Utility
    description: Utility endpoints, such as generating schedule visualizations.
  - name: Token
    description: API authentication token management (e.g., obtaining auth tokens).
  - name: Tags
    description: Our mechanism for indicating constraints, penalties or preferences.
  - name: Rules
    description: Can be used together with Tags to specify preferences or penalties.
