openapi: 3.0.0
paths:
  /external/floorplans:
    get:
      operationId: FloorPlanController_listFloorPlans
      parameters: []
      responses:
        '200':
          description: A list all available floor plans
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/FloorPlanDto'
      summary: List floor plans
      tags:
        - Floor plan
    post:
      operationId: FloorPlanController_createFloorPlan
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAndUpdateFloorPlanDto'
      responses:
        '201':
          description: Floor plan created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FloorPlanDto'
      summary: Create a new floor plans
      tags:
        - Floor plan
  /external/floorplans/{floorPlanId}/tables:
    put:
      description: >-
        Replaces all tables in the floor plan. Combinations referencing removed
        tables are automatically deleted.
      operationId: FloorPlanController_updateFloorPlanTables
      parameters:
        - name: floorPlanId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateFloorPlanTablesDto'
      responses:
        '200':
          description: Floor plan with updated tables
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FloorPlanDto'
        '404':
          description: Floor plan not found
      summary: Update tables of a floor plan
      tags:
        - Floor plan
  /external/floorplans/{floorPlanId}:
    put:
      operationId: FloorPlanController_updateFloorPlan
      parameters:
        - name: floorPlanId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAndUpdateFloorPlanDto'
      responses:
        '200':
          description: Floor plan updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FloorPlanDto'
      summary: Update a floor plans
      tags:
        - Floor plan
    delete:
      operationId: FloorPlanController_deleteFloorPlan
      parameters:
        - name: floorPlanId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Floor plan deleted
      summary: Delete a floor plans
      tags:
        - Floor plan
  /external/gift-cards/templates:
    get:
      operationId: GiftCardController_listTemplates
      parameters: []
      responses:
        '200':
          description: Successfully retrieved gift card templates
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GiftCardTemplateDto'
      summary: List all gift card templates
      tags:
        - Gift cards
  /external/gift-cards/{giftCardId}:
    get:
      operationId: GiftCardController_getGiftCard
      parameters:
        - name: giftCardId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Successfully requests a gift card
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GiftCardDto'
        '404':
          description: Gift card doesn't exist
      summary: Request a gift card
      tags:
        - Gift cards
  /external/gift-cards:
    post:
      operationId: GiftCardController_createGiftCard
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateGiftCardRequestDto'
      responses:
        '201':
          description: Gift card successfully created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GiftCardDto'
      summary: Create a gift card
      tags:
        - Gift cards
  /external/gift-cards/{giftCardId}/transactions:
    post:
      operationId: GiftCardController_createGiftCardTransaction
      parameters:
        - name: giftCardId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateGiftCardTransactionRequestDto'
      responses:
        '201':
          description: Transaction successfully created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GiftCardTransactionDto'
      summary: Create a gift card transaction
      tags:
        - Gift cards
  /external/gift-cards/{giftCardId}/transactions/{transactionId}:
    patch:
      operationId: GiftCardController_updateGiftCardTransaction
      parameters:
        - name: giftCardId
          required: true
          in: path
          schema:
            type: string
        - name: transactionId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateGiftCardTransactionRequestDto'
      responses:
        '200':
          description: Transaction successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GiftCardTransactionDto'
      summary: Update a gift card transaction
      tags:
        - Gift cards
  /external/gift-cards/{giftCardId}/transactions/{transactionId}/refund:
    post:
      operationId: GiftCardController_refundGiftCardTransaction
      parameters:
        - name: giftCardId
          required: true
          in: path
          schema:
            type: string
        - name: transactionId
          required: true
          in: path
          schema:
            type: string
      responses:
        '201':
          description: Transaction successfully refunded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GiftCardTransactionDto'
      summary: Creates a new transaction to refund the transaction with the given id
      tags:
        - Gift cards
  /external/guests:
    get:
      operationId: GuestController_searchGuests
      parameters:
        - name: limit
          required: false
          in: query
          description: 'Maximum number of results to return (max: 100)'
          schema:
            example: 100
            type: number
        - name: page
          required: false
          in: query
          description: Page number for pagination
          schema:
            example: 1
            type: number
        - name: search
          required: false
          in: query
          description: >-
            Search query to match against guest names, email, phone, company, or
            notes
          schema:
            example: john
            type: string
        - name: email
          required: false
          in: query
          description: Filter by email address
          schema:
            example: john.doe@example.com
            type: string
        - name: phone
          required: false
          in: query
          description: Filter by phone number
          schema:
            example: '+436605512234'
            type: string
        - name: company
          required: false
          in: query
          description: Filter by company name
          schema:
            example: BestCorp Inc.
            type: string
        - name: locale
          required: false
          in: query
          description: Filter by guest locale
          schema:
            example: de
            type: string
            enum:
              - en
              - de
        - name: labelIds
          required: false
          in: query
          description: Filter by label IDs (can be array or comma-separated string)
          schema:
            example:
              - label-id-1
              - label-id-2
            type: array
            items:
              type: string
        - name: sortBy
          required: false
          in: query
          description: >-
            Sort results. Available fields: lastName, firstName, totalVisits,
            totalCovers, lastVisit.seconds, firstVisit.seconds
          schema:
            example: lastName:asc
            type: string
            enum:
              - lastName:asc
              - lastName:desc
              - firstName:asc
              - firstName:desc
              - totalVisits:asc
              - totalVisits:desc
              - totalCovers:asc
              - totalCovers:desc
              - lastVisit.seconds:asc
              - lastVisit.seconds:desc
        - name: hasEmail
          required: false
          in: query
          description: Include only guests with email addresses
          schema:
            example: true
            type: boolean
        - name: hasPhone
          required: false
          in: query
          description: Include only guests with phone numbers
          schema:
            example: true
            type: boolean
      responses:
        '200':
          description: A list of requested guests
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GuestDto'
      summary: List guests
      tags:
        - Guest
  /external/reservations:
    get:
      operationId: ReservationController_listReservations
      parameters:
        - name: from
          required: true
          in: query
          schema:
            example: '2023-01-01'
            type: string
        - name: to
          required: true
          in: query
          schema:
            example: '2023-01-31'
            type: string
        - name: status
          required: false
          in: query
          schema:
            example:
              - seated
              - booked
            type: string
            enum:
              - requested
              - unconfirmed
              - payment_pending
              - booked
              - left_message
              - wrong_number
              - no_answer
              - reconfirmed
              - arrived
              - partially_arrived
              - seated
              - ordered
              - paid
              - declined
              - finished
              - cancelled
              - no_show
              - voided
        - name: includeWalkIns
          required: false
          in: query
          schema:
            example: true
            type: boolean
      responses:
        '200':
          description: List reservations of a restaurant
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ReservationDto'
      summary: List reservations
      tags:
        - Reservations
    post:
      operationId: ReservationController_createReservation
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateReservationRequestDto'
      responses:
        '201':
          description: Reservation successfully created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReservationDto'
        '403':
          description: The selected slot is not a bookable time
      summary: Create a reservation
      tags:
        - Reservations
  /external/reservations/{reservationId}:
    get:
      operationId: ReservationController_getReservation
      parameters:
        - name: reservationId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Get a reservation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReservationDto'
        '404':
          description: Reservation doesn't exist
      summary: Load a reservation
      tags:
        - Reservations
    patch:
      description: Currently only status updates are allowed
      operationId: ReservationController_updateReservation
      parameters:
        - name: reservationId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateReservationDto'
      responses:
        '200':
          description: Reservation successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReservationDto'
        '403':
          description: The selected slot is not a bookable time
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReservationDto'
        '404':
          description: Reservation doesn't exist
      summary: Update reservation
      tags:
        - Reservations
  /external/reservations/checkin:
    post:
      description: >-
        Searches a booked reservation currently starting (+/- 15 minutes) for
        the given table. If one is found the reservation will be checked in. If
        no reservation is found a new Walk-In will be created
      operationId: ReservationController_createCheckIn
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckInOutDto'
      responses:
        '200':
          description: An existing reservation was checked in
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReservationDto'
        '201':
          description: A new walk-in for this table was created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReservationDto'
      summary: Check-In
      tags:
        - Reservations
  /external/reservations/checkout:
    post:
      description: >-
        Searches an active reservation on the current day for the given table.
        If one is found, the reservation will be set to paid and automatically
        finished after a few minutes.
      operationId: ReservationController_createCheckout
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckInOutDto'
      responses:
        '200':
          description: Checkout a reservation on a table
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReservationDto'
        '400':
          description: No active reservation was found for this reservation
      summary: Check-Out
      tags:
        - Reservations
  /external/availability/experiences:
    get:
      operationId: AvailabilityController_listExperiences
      parameters: []
      responses:
        '200':
          description: Returns a list of experiences configured for the restaurant
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ExperienceDto'
      summary: Listing experiences
      tags:
        - Availability
  /external/availability/slots:
    get:
      operationId: AvailabilityController_listSlots
      parameters:
        - name: attendees
          required: true
          in: query
          description: Number of attendees
          schema:
            example: 2
            type: number
        - name: day
          required: true
          in: query
          description: The day to query time slots
          schema:
            example: '2024-06-10'
            type: string
        - name: experienceId
          required: true
          in: query
          schema:
            example: ec4d5037e876-4ed1-a69c-9b24b75a5c45
            type: string
        - name: reservationId
          required: false
          in: query
          description: >-
            When updating a reservation send the id of the reservation to
            exclude it from the availability calculation
          schema:
            example: 9e7de48c9293-4d39-ba3f-3c74194a9af7
            type: string
      responses:
        '200':
          description: Returns the available slots for the given experience
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SlotAvailabilityResponseDto'
      summary: Listing available slots
      tags:
        - Availability
  /external/phone-calls/{phoneNumberId}:
    post:
      description: Report an status update regarding an incoming call
      operationId: PhoneCallController_reportIncomingCallStatus
      parameters:
        - name: phoneNumberId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IncomingCallRequestDto'
      responses:
        '200':
          description: Incoming call updated accepted
      summary: Incoming call
      tags:
        - Phone calls
  /external/restaurant:
    get:
      operationId: RestaurantController_getRestaurant
      parameters: []
      responses:
        '200':
          description: Get details about the restaurant
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestaurantDto'
      summary: Get restaurant details
      tags:
        - Restaurant
  /external/restaurant/labels:
    get:
      operationId: RestaurantController_listLabels
      parameters: []
      responses:
        '200':
          description: List all labels for this restaurant
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LabelDto'
      summary: List restaurant labels
      tags:
        - Restaurant
  /external/reservations/{reservationId}/receipts:
    get:
      operationId: ReceiptController_listReceipts
      parameters:
        - name: reservationId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: List of receipts for the reservation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PosOrderReceiptDto'
        '404':
          description: Reservation not found
      summary: List all receipts for a reservation
      tags:
        - Receipts
    post:
      description: >-
        Creates a new receipt for the reservation. If no ID is provided, one
        will be auto-generated. Price values must be integers representing
        cents.
      operationId: ReceiptController_createReceipt
      parameters:
        - name: reservationId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePosOrderReceiptDto'
      responses:
        '201':
          description: Receipt created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PosOrderReceiptDto'
        '400':
          description: Validation error or duplicate ID
        '404':
          description: Reservation not found
      summary: Create a new receipt
      tags:
        - Receipts
  /external/reservations/{reservationId}/receipts/{receiptId}:
    get:
      operationId: ReceiptController_getReceipt
      parameters:
        - name: reservationId
          required: true
          in: path
          schema:
            type: string
        - name: receiptId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Receipt details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PosOrderReceiptDto'
        '404':
          description: Reservation or receipt not found
      summary: Get a specific receipt
      tags:
        - Receipts
    patch:
      description: >-
        Partial update of a receipt. When products array is provided, it fully
        replaces the existing products.
      operationId: ReceiptController_updateReceipt
      parameters:
        - name: reservationId
          required: true
          in: path
          schema:
            type: string
        - name: receiptId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePosOrderReceiptDto'
      responses:
        '200':
          description: Receipt updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PosOrderReceiptDto'
        '404':
          description: Reservation or receipt not found
      summary: Update a receipt
      tags:
        - Receipts
    delete:
      operationId: ReceiptController_deleteReceipt
      parameters:
        - name: reservationId
          required: true
          in: path
          schema:
            type: string
        - name: receiptId
          required: true
          in: path
          schema:
            type: string
      responses:
        '204':
          description: Receipt deleted successfully
        '404':
          description: Reservation or receipt not found
      summary: Delete a receipt
      tags:
        - Receipts
info:
  title: Molzait API
  description: ''
  version: '1'
  contact: {}
tags:
  - name: Restaurant
    description: Interfaces for getting details about the restaurant
  - name: Floor plan
    description: Interfaces for creating, updating and deleting floor plans
  - name: Availability
    description: Interfaces for requesting currently available slots
  - name: Reservations
    description: Interfaces for interacting with restaurant reservations
  - name: Gift cards
    description: 'Interfaces to create, top up and redeem gift cards '
  - name: Phone calls
    description: Interfaces for reporting incoming calls
servers:
  - url: https://api.molzait.com
components:
  securitySchemes:
    access-token:
      scheme: bearer
      bearerFormat: JWT
      type: http
  schemas:
    FloorPlanDto:
      type: object
      properties:
        id:
          type: string
          example: 914279b7b256-428d-8c65-0adeb47e5b19
        name:
          type: string
        restaurantId:
          type: string
          example: 7cf18b050973-4ec5-b867-204724eb43e4
        sortIndex:
          type: number
        tables:
          type: object
          description: >-
            A map of available tables in this floor plan. The keys of the map
            are the ids of the table
          additionalProperties:
            $ref: '#/components/schemas/TableDto'
        combinations:
          type: object
          description: >-
            A map of available table combinations in this floor plan. The keys
            of the map are the ids of the table combination
          additionalProperties:
            $ref: '#/components/schemas/TableCombinationDto'
        elements:
          type: object
          description: A map of visible elements in this floor plan
          additionalProperties:
            oneOf:
              - $ref: '#/components/schemas/FloorPlanRectangletDto'
              - $ref: '#/components/schemas/FloorPlanTextDto'
              - $ref: '#/components/schemas/FloorPlanImageDto'
      required:
        - id
        - name
        - restaurantId
        - sortIndex
        - tables
        - combinations
        - elements
    CreateAndUpdateFloorPlanDto:
      type: object
      properties:
        name:
          type: string
        sortIndex:
          type: number
        tables:
          type: object
          description: >-
            A map of available tables in this floor plan. The keys of the map
            are the ids of the table
          additionalProperties:
            $ref: '#/components/schemas/TableDto'
        combinations:
          type: object
          description: >-
            A map of available table combinations in this floor plan. The keys
            of the map are the ids of the table combination
          additionalProperties:
            $ref: '#/components/schemas/TableCombinationDto'
        elements:
          type: object
          description: A map of visible elements in this floor plan
          additionalProperties:
            oneOf:
              - $ref: '#/components/schemas/FloorPlanRectangletDto'
              - $ref: '#/components/schemas/FloorPlanTextDto'
              - $ref: '#/components/schemas/FloorPlanImageDto'
      required:
        - name
        - sortIndex
        - tables
        - combinations
        - elements
    TableDto:
      type: object
      properties:
        id:
          type: string
          example: ab700bf88867-4b30-bb1b-30b52e0b3b06
        minPartySize:
          type: number
          example: 2
        maxPartySize:
          type: number
          example: 4
        name:
          type: string
          example: '45'
        priorityIndex:
          type: number
        reservable:
          type: boolean
        rotation:
          type: number
          example: 90
        tableCategoryIds:
          example:
            - d12436d61b8f-4ab9-90e0-a08da97ef18b
          type: array
          items:
            type: string
        type:
          type: string
          enum:
            - rect_one
            - rect_two
            - rect_three
            - rect_three_slim
            - rect_four
            - rect_four_long
            - rect_five
            - rect_six
            - rect_six2
            - rect_eight
            - square_eight
            - rect_ten
            - round_one
            - round_two
            - round_three
            - round_four
            - round_five
            - round_six
            - round_eight
            - round_ten
        x:
          type: number
          example: 100
        'y':
          type: number
          example: 250
      required:
        - id
        - minPartySize
        - maxPartySize
        - name
        - priorityIndex
        - reservable
        - rotation
        - tableCategoryIds
        - type
        - x
        - 'y'
    UpdateFloorPlanTablesDto:
      type: object
      properties:
        tables:
          description: >-
            The list of tables to set on the floor plan. Replaces all existing
            tables.
          type: array
          items:
            $ref: '#/components/schemas/TableDto'
      required:
        - tables
    StorageFileDto:
      type: object
      properties:
        path:
          type: string
        url:
          type: string
      required:
        - path
        - url
    LocalizedTextDto:
      type: object
      properties:
        de:
          type: string
        en:
          type: string
      required:
        - de
        - en
    GiftCardTemplateDto:
      type: object
      properties:
        id:
          type: string
          description: The id of the template
        type:
          type: string
          enum:
            - value
          description: The type of the gift card
          example: value
        image:
          description: The image of the template
          nullable: true
          allOf:
            - $ref: '#/components/schemas/StorageFileDto'
        archived:
          type: boolean
          description: Whether the template is archived
        expiresAfterDays:
          type: number
          description: >-
            Number of days after which gift cards created from this template
            expire
        experienceDescription:
          description: Experience description in multiple languages
          allOf:
            - $ref: '#/components/schemas/LocalizedTextDto'
        variations:
          description: Available amount variations for this template
          example:
            - amount: 5000
            - amount: 10000
          type: array
          items:
            type: object
      required:
        - id
        - type
        - archived
        - expiresAfterDays
        - variations
    GiftCardDto:
      type: object
      properties:
        id:
          type: string
          description: The code of this gift card to be used on checkout
        amount:
          type: number
          description: The initial amount when creating this gift card
        remainingAmount:
          type: number
          description: The remaining amount on this gift card
        templateId:
          type: string
          description: The template of the gift card
        image:
          description: The template of the gift card
          nullable: true
          allOf:
            - $ref: '#/components/schemas/StorageFileDto'
        email:
          type: string
          description: The customers email address
        expiresOnDay:
          type: string
          description: The day the gift card expires
          example: '2050-12-31'
        locale:
          type: string
          enum:
            - en
            - de
          description: The customers locale. Emails will be sent using this locale
        creationTimestamp:
          format: date-time
          type: string
      required:
        - id
        - amount
        - remainingAmount
        - templateId
        - expiresOnDay
        - creationTimestamp
    CreateGiftCardRequestDto:
      type: object
      properties:
        amount:
          type: number
          description: The initial amount when creating this gift card
        templateId:
          type: string
          description: The template of the gift card
        email:
          type: string
          description: The customers email address
        expiresOnDay:
          type: string
          description: The day the gift card expires
          example: '2050-12-31'
        locale:
          type: string
          enum:
            - en
            - de
          description: The customers locale. Emails will be sent using this locale
        id:
          type: string
          description: The code of this gift card. Can be left empty to generate one
        paymentReference:
          type: string
          description: >-
            A reference to the payment that created this gift card. Can be left
            empty
      required:
        - amount
        - templateId
        - expiresOnDay
    CreateGiftCardTransactionRequestDto:
      type: object
      properties:
        status:
          type: string
          enum:
            - pending
            - successful
          description: The status of the transaction
          example: successful
        amount:
          type: number
          description: >-
            Amount of the transaction in cents. Positive values top up. Negative
            values redeem the gift card.
          example: 10000
        reference:
          type: string
      required:
        - status
        - amount
    GiftCardTransactionDto:
      type: object
      properties:
        id:
          type: string
          description: The id of the transaction
        status:
          type: string
          enum:
            - pending
            - successful
          description: The status of the transaction
          example: successful
        amount:
          type: number
          description: >-
            Amount of the transaction in cents. Positive values top up. Negative
            values redeem the gift card.
          example: 10000
        timestamp:
          format: date-time
          type: string
        reference:
          type: string
      required:
        - id
        - status
        - amount
        - timestamp
    UpdateGiftCardTransactionRequestDto:
      type: object
      properties:
        status:
          type: string
          enum:
            - pending
            - successful
          description: The status of the transaction
          example: successful
        reference:
          type: string
      required:
        - status
    GuestDto:
      type: object
      properties:
        id:
          type: string
          example: f4f965e6c2eb-4376-b38c-4020e3f3add7
        firstName:
          type: string
          example: John
        lastName:
          type: string
          example: Doe
        company:
          type: string
          example: BestCorp Inc.
        locale:
          type: string
          enum:
            - en
            - de
          example: de
        phone:
          type: string
          example: '+436605512234'
        email:
          type: string
          example: john.doe@example.com
        notes:
          type: string
          example: Likes to drink red wine
        labels:
          type: array
          items:
            type: array
      required:
        - id
        - lastName
        - labels
    ReservationExperienceDto:
      type: object
      properties:
        id:
          type: string
        name:
          example:
            en: A lá carte
            de: A lá carte
          allOf:
            - $ref: '#/components/schemas/LocalizedTextDto'
        shorthand:
          type: string
      required:
        - id
        - name
        - shorthand
    LabelDto:
      type: object
      properties:
        id:
          type: string
          example: 53226d2b1794-4e78-acbf-55404d5d1c9f
        name:
          type: string
          example: VIP
        icon:
          type: string
          enum:
            - star
            - sparkles
            - cake
            - heart
            - stroller
            - dog
            - cutlery
            - sun
            - flower
            - table
            - wheelchair
            - wine_glass
            - exclamation
            - bus
        color:
          type: string
          enum:
            - red
            - orange
            - amber
            - yellow
            - lime
            - green
            - emerald
            - teal
            - cyan
            - sky
            - blue
            - indigo
            - violet
            - purple
            - fuchsia
            - pink
            - rose
        type:
          type: string
          enum:
            - reservation
            - guestbook
          example: guestbook
      required:
        - id
        - name
        - icon
        - color
        - type
    ReservationDto:
      type: object
      properties:
        id:
          type: string
        number:
          type: string
        attendees:
          type: number
        experience:
          $ref: '#/components/schemas/ReservationExperienceDto'
        startTime:
          format: date-time
          type: string
        endTime:
          format: date-time
          type: string
        checkinTime:
          format: date-time
          type: string
          nullable: true
        checkoutTime:
          format: date-time
          type: string
          nullable: true
        status:
          type: string
          enum:
            - requested
            - unconfirmed
            - payment_pending
            - booked
            - left_message
            - wrong_number
            - no_answer
            - reconfirmed
            - arrived
            - partially_arrived
            - seated
            - ordered
            - paid
            - declined
            - finished
            - cancelled
            - no_show
            - voided
        source:
          type: string
          enum:
            - app
            - website
            - google
            - pos
        restaurantId:
          type: string
        guest:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/GuestDto'
        pinnedTables:
          type: array
          items:
            $ref: '#/components/schemas/TableDto'
        labels:
          type: array
          items:
            $ref: '#/components/schemas/LabelDto'
        specialRequestNotes:
          type: string
          nullable: true
        internalNotes:
          type: string
        payment:
          oneOf:
            - $ref: '#/components/schemas/ReservationPaymentDataDto'
            - $ref: '#/components/schemas/ReservationCreditCardDataDto'
      required:
        - id
        - number
        - attendees
        - experience
        - startTime
        - endTime
        - checkinTime
        - checkoutTime
        - status
        - source
        - restaurantId
        - guest
        - pinnedTables
        - labels
    CreateReservationRequestDto:
      type: object
      properties:
        attendees:
          type: number
          example: 2
          description: The number of attendees for this reservation
        day:
          type: string
          example: '2024-01-02'
          description: The day of the reservation
          format: yyyy-mm-dd
        email:
          type: string
          example: john.doe@example.com
        experienceId:
          type: string
          example: ec4d5037e876-4ed1-a69c-9b24b75a5c45
        firstName:
          type: string
          example: John
        lastName:
          type: string
          example: Doe
        locale:
          type: string
          enum:
            - en
            - de
        minutes:
          type: number
          example: 600
          description: >-
            Minutes since the start of the day based in the restaurants
            configured timezone. 600 = 10:00
        notes:
          type: string
          nullable: true
          example: Comes with a dog
        phone:
          type: string
          example: '+436605512234'
        pinnedTableIds:
          description: >-
            Set the table ids of this reservation. When omitted, the tables will
            be selected automatically.
          example:
            - ab700bf88867-4b30-bb1b-30b52e0b3b06
          type: array
          items:
            type: string
        labelIds:
          description: Set the label ids to add to this reservation
          example:
            - 53226d2b1794-4e78-acbf-55404d5d1c9f
          type: array
          items:
            type: string
      required:
        - attendees
        - day
        - experienceId
        - lastName
        - locale
        - minutes
    UpdateReservationDto:
      type: object
      properties:
        status:
          type: string
          enum:
            - requested
            - unconfirmed
            - payment_pending
            - booked
            - left_message
            - wrong_number
            - no_answer
            - reconfirmed
            - arrived
            - partially_arrived
            - seated
            - ordered
            - paid
            - declined
            - finished
            - cancelled
            - no_show
            - voided
        day:
          type: string
        minutes:
          type: number
        attendees:
          type: number
        tableIds:
          type: array
          items:
            type: string
    CheckInOutDto:
      type: object
      properties:
        tableName:
          type: string
          example: '102'
        tableIds:
          example:
            - ab700bf88867-4b30-bb1b-30b52e0b3b06
          type: array
          items:
            type: string
    ExperienceDto:
      type: object
      properties:
        id:
          type: string
        name:
          $ref: '#/components/schemas/LocalizedTextDto'
        shortDescription:
          $ref: '#/components/schemas/LocalizedTextDto'
        descriptionHtml:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/LocalizedTextDto'
        image:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/StorageFileDto'
        orderSettings:
          type: object
        isDefault:
          type: boolean
        minPax:
          type: number
        maxPax:
          type: number
      required:
        - id
        - name
        - shortDescription
        - isDefault
        - minPax
        - maxPax
    ScoredTableAssignmentDto:
      type: object
      properties:
        floorPlanId:
          type: string
        maxPartySize:
          type: number
        minPartySize:
          type: number
        reservable:
          type: boolean
        score:
          type: number
          description: Score from 0 (best) to 1 (worst)
          example: 0.122
        tableCategoryIds:
          type: array
          items:
            type: string
        tableIds:
          type: array
          items:
            type: string
      required:
        - floorPlanId
        - maxPartySize
        - minPartySize
        - reservable
        - score
        - tableCategoryIds
        - tableIds
    OrderSettingsPaymentDto:
      type: object
      properties:
        pricing:
          oneOf:
            - $ref: '#/components/schemas/PerPaxPricingDto'
            - $ref: '#/components/schemas/PerReservationPricingDto'
        requiredFromPax:
          type: number
          nullable: true
      required:
        - pricing
        - requiredFromPax
    OrderSettingsDto:
      type: object
      properties:
        payment:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/OrderSettingsPaymentDto'
        pendingMinutes:
          type: number
        refundMinutes:
          type: number
          nullable: true
        type:
          type: string
          enum:
            - none
            - pay_now
            - credit_card_guarantee
      required:
        - payment
        - pendingMinutes
        - refundMinutes
        - type
    AvailabilitySlotDto:
      type: object
      properties:
        restaurantId:
          type: string
          example: 7cf18b050973-4ec5-b867-204724eb43e4
        experienceId:
          type: string
          example: ec4d5037e876-4ed1-a69c-9b24b75a5c45
        day:
          type: string
          description: Day of the slot
          format: '2024-01-02'
          example: '2024-01-02'
        minutes:
          type: number
          description: Minute since start of day
          example: 600
        duration:
          type: number
          description: Duration in minutes of the reservation slot
          example: 120
        attendees:
          type: number
          example: 4
        spotsTotal:
          type: number
          description: >-
            Number of spots for a group this size (attendees), disregarding
            existing reservations
          example: 10
        spotsOpen:
          type: number
          description: >-
            Number of available spots for a group this size (attendees),
            considering existing reservations
          example: 5
        seated:
          type: number
          description: Currently seated persons at this moment
          example: 45
        seatedLimit:
          type: number
          nullable: true
          example: 50
        starting:
          type: number
          description: Number of persons which start a reservation at this slot
          example: 15
        startingLimit:
          type: number
          nullable: true
          example: 20
        availableAssignments:
          description: A list of available tables or table combinations for this slot
          type: array
          items:
            $ref: '#/components/schemas/ScoredTableAssignmentDto'
        exclusionReasons:
          type: array
          items:
            type: string
            enum:
              - no_tables_found
              - above_max_seated_capacity
              - above_max_pacing_limit
              - max_pacing_limit_is_zero
              - max_seating_capacity_is_zero
              - is_in_past
              - below_min_ahead_booking_minutes
              - above_max_ahead_booking_minutes
              - online_reservations_closed
        availableFloorPlanIds:
          type: array
          items:
            type: string
        assignmentsAvailableIn:
          description: List of table category ids where tables are available
          type: array
          items:
            type: string
        confirmationMode:
          type: string
          enum:
            - instant
            - instant_ignoring_tables
            - on_request_considering_availability
            - on_request_ignoring_availability
        showEndTime:
          type: boolean
        paymentSettings:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/OrderSettingsDto'
      required:
        - restaurantId
        - experienceId
        - day
        - minutes
        - duration
        - attendees
        - spotsTotal
        - spotsOpen
        - seated
        - seatedLimit
        - starting
        - startingLimit
        - availableAssignments
        - exclusionReasons
        - availableFloorPlanIds
        - assignmentsAvailableIn
        - confirmationMode
        - showEndTime
        - paymentSettings
    SlotAvailabilityResponseDto:
      type: object
      properties:
        slots:
          type: array
          items:
            $ref: '#/components/schemas/AvailabilitySlotDto'
      required:
        - slots
    IncomingCallRequestDto:
      type: object
      properties:
        id:
          type: string
          description: >-
            An unique UUID that identifies the call in the external phone
            system. Min length is 10 characters
          example: 90e4020a-a9d1-4a06-8906-fec2126cc007
        phoneNumber:
          type: string
          description: An E.164 formatted phone number, or empty if hidden
          example: '+436601123345'
        status:
          type: string
          description: The current status of the call
          example: ringing
          enum:
            - ringing
            - picked_up
            - hung_up
            - abandoned
      required:
        - id
        - status
    AddressDto:
      type: object
      properties:
        streetAddress:
          type: string
          example: 123 Main St
          description: Street address
        city:
          type: string
          example: Vienna
          description: City
        postalCode:
          type: string
          example: '1010'
          description: Postal Code
        countryCode:
          type: string
          example: AT
          description: Country
      required:
        - streetAddress
        - city
        - postalCode
        - countryCode
    SocialUrlsDto:
      type: object
      properties:
        instagram:
          type: string
          description: Instagram profile URL
          example: https://instagram.com/restaurant
        facebook:
          type: string
          description: Facebook page URL
          example: https://facebook.com/restaurant
        tiktok:
          type: string
          description: TikTok profile URL
          example: https://tiktok.com/@restaurant
    BrandingDto:
      type: object
      properties:
        primaryColor:
          type: string
          description: Primary color hex code for branding
          example: '#FF5733'
        logoUrl:
          type: string
          description: URL for the restaurant's logo
      required:
        - primaryColor
    RestaurantDto:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the restaurant.
          example: a1b2c3d4-e5f6-7890-1234-567890abcdef
        restaurantName:
          type: string
          description: The public name of the restaurant.
          example: The Grand Bistro
        internalRestaurantName:
          type: string
          description: The internal or administrative name of the restaurant.
          example: TGB_MAIN_01
        address:
          description: The physical address of the restaurant.
          allOf:
            - $ref: '#/components/schemas/AddressDto'
        phone:
          type: string
          description: The contact phone number of the restaurant.
          example: '+431234567890'
        email:
          type: string
          description: The contact email address of the restaurant.
          format: email
          example: contact@grandbistro.com
        socialUrls:
          description: URLs for the restaurant's social media profiles.
          allOf:
            - $ref: '#/components/schemas/SocialUrlsDto'
        branding:
          description: Branding assets for the restaurant.
          allOf:
            - $ref: '#/components/schemas/BrandingDto'
        websiteUrl:
          type: object
          description: The URL of the restaurant's official website.
          format: url
          nullable: true
          example: https://grandbistro.com
        termsOfServiceUrl:
          type: object
          description: A URL to the restaurant's terms of service.
          format: url
          nullable: true
        privacyPolicyUrl:
          type: object
          description: A URL to the restaurant's privacy policy.
          format: url
          nullable: true
        timezone:
          type: string
          description: The IANA timezone identifier for the restaurant.
          example: Europe/Vienna
        description:
          description: A localized description of the restaurant.
          allOf:
            - $ref: '#/components/schemas/LocalizedTextDto'
      required:
        - id
        - restaurantName
        - address
        - email
        - branding
        - timezone
    PosOrderProductDto:
      type: object
      properties:
        id:
          type: string
          description: Unique product ID (min 8 alphanumeric characters or hyphens)
          example: prod-12345
        name:
          type: string
          description: Product name
          example: Wiener Schnitzel
        price:
          type: number
          description: Price in cents (integer, no decimals)
          example: 1850
        quantity:
          type: number
          description: Quantity ordered
          example: 2
        categoryId:
          type: string
          nullable: true
          description: Category ID or null if not categorized
          example: cat_main_dishes
        categoryName:
          type: string
          nullable: true
          description: Category name or null if not categorized
          example: Main Dishes
      required:
        - id
        - name
        - price
        - quantity
        - categoryId
        - categoryName
    WaiterDto:
      type: object
      properties:
        id:
          type: string
          description: Waiter ID
          example: waiter_001
        name:
          type: string
          description: Waiter name
          example: Max Mustermann
      required:
        - id
        - name
    PosOrderReceiptDto:
      type: object
      properties:
        id:
          type: string
          description: Receipt ID (min 8 alphanumeric characters or hyphens)
          example: receipt-12345
        products:
          description: List of ordered products
          type: array
          items:
            $ref: '#/components/schemas/PosOrderProductDto'
        waiters:
          description: Waiters who served the order
          type: array
          items:
            $ref: '#/components/schemas/WaiterDto'
        from:
          format: date-time
          type: string
          description: Receipt start time
        to:
          format: date-time
          type: string
          nullable: true
          description: Receipt end time or null if still open
        tableId:
          type: string
          description: Table ID
          example: table-123
        tableName:
          type: string
          description: Table name/number
          example: '42'
      required:
        - id
        - products
        - from
        - to
    CreatePosOrderProductDto:
      type: object
      properties:
        id:
          type: string
          description: >-
            Product ID (min 8 alphanumeric characters or hyphens).
            Auto-generated if omitted.
          example: prod-12345
        name:
          type: string
          description: Product name
          example: Wiener Schnitzel
        price:
          type: number
          description: Price in cents (must be an integer, no decimals)
          example: 1850
        quantity:
          type: number
          description: Quantity ordered (decimals allowed)
          example: 1.5
        categoryId:
          type: string
          nullable: true
          description: Category ID or null
          example: cat_main_dishes
        categoryName:
          type: string
          nullable: true
          description: Category name or null
          example: Main Dishes
      required:
        - name
        - price
        - quantity
    CreateWaiterDto:
      type: object
      properties:
        id:
          type: string
          description: Waiter ID
          example: waiter_001
        name:
          type: string
          description: Waiter name
          example: Max Mustermann
      required:
        - id
        - name
    CreatePosOrderReceiptDto:
      type: object
      properties:
        id:
          type: string
          description: >-
            Receipt ID (min 8 alphanumeric characters or hyphens).
            Auto-generated if omitted.
          example: receipt-12345
        products:
          description: List of products (at least 1 required)
          type: array
          items:
            $ref: '#/components/schemas/CreatePosOrderProductDto'
        waiters:
          description: Waiters who served the order
          type: array
          items:
            $ref: '#/components/schemas/CreateWaiterDto'
        from:
          type: string
          description: Receipt start time (ISO date string)
          example: '2024-01-15T12:00:00Z'
        to:
          type: string
          nullable: true
          description: Receipt end time (ISO date string) or null if still open
          example: '2024-01-15T13:30:00Z'
        tableId:
          type: string
          description: Table ID
          example: table-123
        tableName:
          type: string
          description: Table name/number
          example: '42'
      required:
        - products
        - from
    UpdatePosOrderReceiptDto:
      type: object
      properties:
        products:
          description: >-
            Products array (full replacement when provided, must have at least 1
            product)
          type: array
          items:
            $ref: '#/components/schemas/CreatePosOrderProductDto'
        waiters:
          description: Waiters who served the order
          type: array
          items:
            $ref: '#/components/schemas/CreateWaiterDto'
        from:
          type: string
          description: Receipt start time (ISO date string)
        to:
          type: string
          nullable: true
          description: Receipt end time (ISO date string) or null
        tableId:
          type: string
          description: Table ID
        tableName:
          type: string
          description: Table name/number
    ReservationPaymentDataDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - payment
        amount:
          type: number
        paymentIntentId:
          type: string
        invoiceUrl:
          type: object
          nullable: true
        state:
          type: string
          enum:
            - paid
            - refunded
      required:
        - type
        - amount
        - paymentIntentId
        - invoiceUrl
        - state
    ReservationCreditCardDataDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - credit_card
        stripeCustomerId:
          type: string
        charge:
          type: object
      required:
        - type
        - stripeCustomerId
        - charge
    PerPaxPricingDto:
      type: object
      properties:
        pricePerPax:
          type: number
          nullable: true
        displayPricePerPax:
          type: number
          nullable: true
        type:
          type: string
          enum:
            - per_pax
      required:
        - pricePerPax
        - displayPricePerPax
        - type
    PerReservationPricingDto:
      type: object
      properties:
        pricePerReservation:
          type: number
          nullable: true
        displayPricePerReservation:
          type: number
          nullable: true
        type:
          type: string
          enum:
            - per_reservation
      required:
        - pricePerReservation
        - displayPricePerReservation
        - type
    TableCombinationDto:
      type: object
      properties:
        id:
          type: string
          example: dfc06effee53-4159-a226-b459179f9f51
        maxPartySize:
          type: number
        minPartySize:
          type: number
        priorityIndex:
          type: number
        tableCategoryIds:
          example:
            - d12436d61b8f-4ab9-90e0-a08da97ef18b
          type: array
          items:
            type: string
        tableIds:
          type: array
          items:
            type: string
      required:
        - id
        - maxPartySize
        - minPartySize
        - priorityIndex
        - tableCategoryIds
        - tableIds
    FloorPlanRectangletDto:
      type: object
      properties:
        height:
          type: number
        rotation:
          type: number
        width:
          type: number
        x:
          type: number
        'y':
          type: number
        type:
          type: string
          enum:
            - rectangle
        backgroundColor:
          type: string
      required:
        - height
        - rotation
        - width
        - x
        - 'y'
        - type
    FloorPlanTextDto:
      type: object
      properties:
        height:
          type: number
        rotation:
          type: number
        width:
          type: number
        x:
          type: number
        'y':
          type: number
        type:
          type: string
          enum:
            - text
        scale:
          type: number
        text:
          type: string
      required:
        - height
        - rotation
        - width
        - x
        - 'y'
        - type
        - scale
        - text
    FloorPlanImageDto:
      type: object
      properties:
        height:
          type: number
        rotation:
          type: number
        width:
          type: number
        x:
          type: number
        'y':
          type: number
        type:
          type: string
          enum:
            - image
        imageType:
          type: string
          enum:
            - plant_1
            - plant_2
            - plant_3
            - plant_4
            - plant_5
            - plant_6
      required:
        - height
        - rotation
        - width
        - x
        - 'y'
        - type
        - imageType
    SpecialDayMessagePredefinedDto:
      type: object
      properties:
        messageType:
          oneOf:
            - type: closed
            - type: fully_booked
      required:
        - messageType
    SpecialDayMessageCustomDto:
      type: object
      properties:
        customMessage:
          $ref: '#/components/schemas/LocalizedTextDto'
        messageType:
          type: string
          enum:
            - custom
      required:
        - customMessage
        - messageType
