> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hlofiys.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Massive renewal of seats in the hall

> Updates multiple existing seats in a specific hall in a single transaction.
The request body should be an array of seat objects, each containing a `seat_id` and the fields to be updated.
This is a protected endpoint. Access is restricted to users with `admin` or `manager` roles.




## OpenAPI

````yaml api-reference/openapi.json patch /api/halls/{hall_id}/seats
openapi: 3.0.0
info:
  title: Tandem IT API
  version: 1.0.0
  description: API for tandem it backend
servers:
  - url: https://tandem.hlofiys.xyz
    description: Production server
security: []
tags:
  - name: Documentation
    description: API documentation endpoint
paths:
  /api/halls/{hall_id}/seats:
    parameters:
      - name: hall_id
        in: path
        required: true
        schema:
          type: integer
          format: int64
    patch:
      tags:
        - 'Admin: Seats'
      summary: Massive renewal of seats in the hall
      description: >
        Updates multiple existing seats in a specific hall in a single
        transaction.

        The request body should be an array of seat objects, each containing a
        `seat_id` and the fields to be updated.

        This is a protected endpoint. Access is restricted to users with `admin`
        or `manager` roles.
      operationId: updateSeats
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/UpdateSeatRequest'
            examples:
              updateMultiple:
                summary: Example of updating two different seats
                value:
                  - seat_id: 101
                    seat_type_id: 2
                  - seat_id: 102
                    x_coordinate: 35.5
                    y_coordinate: 20
      responses:
        '200':
          description: >-
            Seats have been successfully updated. An array of updated objects is
            returned
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Seat'
        '400':
          description: >
            Validation error. The request body is invalid, or one of the seat
            objects fails validation (e.g., a required `seat_id` is missing, a
            `seat_type_id` does not exist, or coordinates are negative).


            **Note on array validation:** The `errors` object keys will follow
            the format `seats[index].field_name`, where `index` is the
            zero-based position of the problematic object in the input array.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
              examples:
                validationErrorExample:
                  summary: Example of validation errors for multiple objects
                  value:
                    message: Validation failed
                    errors:
                      seats[0].seat_id: The seat_id field is required.
                      seats[2].x_coordinate: The x_coordinate cannot be negative.
        '401':
          description: >-
            Unauthorized. Authentication credentials were not provided or are
            invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Access denied. The user does not have permission to perform this
            action
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: >-
            Not Found. The hall with the specified `{hallId}` does not exist.
            Note: if a `seat_id` from the request body does not exist, a `400
            Bad Request` will be returned instead
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - BearerAuth: []
components:
  schemas:
    UpdateSeatRequest:
      type: object
      properties:
        seat_id:
          type: integer
          format: int64
          description: Unique seat ID
        row_label:
          type: string
          description: Row label (e.g. '1', 'A', 'Parterre')
          example: '12'
        seat_label:
          type: string
          description: Place label in a row (for example, '5', '10', 'VIP 1')
          example: '7'
        x_coordinate:
          type: number
          format: double
          description: X coordinate to display on the diagram
          default: 0
        y_coordinate:
          type: number
          format: double
          description: Y coordinate to display on the diagram
          default: 0
        seat_type_id:
          type: integer
          format: int64
          description: Unique seat type ID
    Seat:
      type: object
      required:
        - seat_id
        - row_label
        - seat_label
        - x_coordinate
        - y_coordinate
        - seat_type_id
        - hall_id
      properties:
        seat_id:
          type: integer
          format: int64
          description: Unique seat ID
        row_label:
          type: string
          description: Row label (e.g. '1', 'A', 'Parterre')
          example: '12'
        seat_label:
          type: string
          description: Place label in a row (for example, '5', '10', 'VIP 1')
          example: '7'
        x_coordinate:
          type: number
          format: double
          description: X coordinate to display on the diagram
          default: 0
        y_coordinate:
          type: number
          format: double
          description: Y coordinate to display on the diagram
          default: 0
        seat_type_id:
          type: integer
          format: int64
          description: Unique seat type ID
        hall_id:
          type: integer
          format: int64
          description: Unique hall ID
    ValidationError:
      type: object
      required:
        - message
      properties:
        message:
          type: string
          example: Validation failed
        errors:
          type: object
          description: A map of field names to their respective error messages.
          additionalProperties:
            type: string
          example:
            name: The name field is required.
            price: The price must be a valid number.
            hall_id: A valid hall_id is required.
    Error:
      type: object
      required:
        - message
      properties:
        message:
          type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````