OpenAPI 3.1 – Booking API

Version: 1.0.0 | Status: DRAFT | Updated: 2026-04-22


Spec

openapi: "3.1.0"
info:
  title: Boot Gråsten Booking API
  version: "1.0.0"
  description: |
    Booking API für Boot Gråsten – Hausboot-Vermietung.
    Wraps Microsoft Graph Bookings API + REWE Concierge.

servers:
  - url: http://localhost:5174/api
    description: Local DEMO (Mock)
  - url: https://bootgrasten.dk/api
    description: Production

paths:
  /availability:
    get:
      summary: Gebuchte Zeiträume abrufen
      operationId: getAvailability
      responses:
        "200":
          description: Liste der gebuchten Zeiträume
          content:
            application/json:
              schema:
                type: object
                properties:
                  value:
                    type: array
                    items:
                      $ref: "#/components/schemas/BookedPeriod"

  /appointments:
    post:
      summary: Neue Buchung erstellen
      operationId: createAppointment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateAppointmentInput"
      responses:
        "201":
          description: Buchung erstellt
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BookingAppointment"

  /appointments/{id}/pay:
    patch:
      summary: Buchung als bezahlt markieren
      operationId: markAppointmentPaid
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                stripeTransactionId:
                  type: string
      responses:
        "200":
          description: Buchung aktualisiert
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BookingAppointment"

  /concierge/order:
    post:
      summary: REWE Concierge-Bestellung aufgeben
      operationId: placeConciergeOrder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ConciergeOrder"
      responses:
        "201":
          description: Bestellung bestätigt

components:
  schemas:
    BookedPeriod:
      type: object
      properties:
        id:
          type: string
        startDateTime:
          type: object
          properties:
            dateTime: { type: string, format: date-time }
            timeZone: { type: string }
        endDateTime:
          type: object
          properties:
            dateTime: { type: string, format: date-time }
            timeZone: { type: string }
        status:
          type: string
          enum: [booked, cancelled, pending]

    CreateAppointmentInput:
      type: object
      required: [checkIn, checkOut, customerName, customerEmail, totalPrice]
      properties:
        checkIn: { type: string, format: date }
        checkOut: { type: string, format: date }
        customerName: { type: string }
        customerEmail: { type: string, format: email }
        guests: { type: integer, minimum: 1, maximum: 8 }
        totalPrice: { type: number }

    BookingAppointment:
      type: object
      properties:
        id: { type: string }
        startDateTime:
          type: object
          properties:
            dateTime: { type: string }
            timeZone: { type: string }
        endDateTime:
          type: object
          properties:
            dateTime: { type: string }
            timeZone: { type: string }
        price: { type: number }
        paymentStatus:
          type: string
          enum: [unpaid, paid]
        status:
          type: string
          enum: [pending, confirmed, cancelled]

    ConciergeOrder:
      type: object
      required: [appointmentId, packageId, deliveryDate]
      properties:
        appointmentId: { type: string }
        packageId:
          type: string
          enum: [basic, romantik, familie]
        addonIds:
          type: array
          items: { type: string }
        deliveryDate: { type: string, format: date }

  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

security:
  - BearerAuth: []