openapi: 3.0.1
info:
  title: FL3XX API
  version: 2.3.0
  description: |
    <div class="api-wrapper">

      <!-- Beta Banner -->
      <div class="api-beta-banner">
        <div class="api-beta-content">
          <div class="api-beta-icon">
            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
              <path d="M12 2L2 7l10 5 10-5-10-5z"></path>
              <path d="M2 17l10 5 10-5"></path>
              <path d="M2 12l10 5 10-5"></path>
            </svg>
          </div>
          <div class="api-beta-text">
            <h3 class="api-beta-title">FL3XX API v2.0 - Beta Release</h3>
            <p class="api-beta-subtitle">Currently in active development with our trusted beta partners. Experience the next generation of aviation API technology.</p>
          </div>
          <div class="api-beta-badge">BETA</div>
        </div>
      </div>
    </div>

    <style>
      /* Beta Banner */
      .api-beta-banner {
        background: linear-gradient(135deg, rgba(241, 90, 42, 0.05), rgba(241, 90, 42, 0.02));
        border: 2px solid rgba(241, 90, 42, 0.2);
        border-radius: 12px;
        padding: 20px;
        margin-bottom: 40px;
      }

      .api-beta-content {
        display: flex;
        align-items: center;
        gap: 16px;
      }

      .api-beta-icon {
        width: 48px;
        height: 48px;
        background: rgba(241, 90, 42, 0.1);
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #f15a2a;
        flex-shrink: 0;
      }

      .api-beta-text {
        flex: 1;
      }

      .api-beta-title {
        font-size: 18px;
        font-weight: 700;
        color: var(--text-color-primary);
        margin: 0 0 6px 0;
      }

      .api-beta-subtitle {
        font-size: 14px;
        color: #6B7280;
        margin: 0;
        line-height: 1.4;
      }

      .api-beta-badge {
        background: #f15a2a;
        color: white;
        font-size: 12px;
        font-weight: 700;
        padding: 6px 12px;
        border-radius: 16px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        flex-shrink: 0;
      }
    </style>
  contact:
    name: FL3XX Integration Support
    email: integrations@fl3xx.com
    url: https://www.fl3xx.com
  x-audience: external-partner
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://test.fl3xx.com
    description: Test Server
security:
  - X-Api-Client-Id: []
    X-Auth-Token: []
tags:
  - name: Airports
    description: >
      Access comprehensive airport information.


      **Business Value**

      - Filter airports by various criteria including ICAO, IATA, FAA codes and
      local identifiers

      - Support high-performance applications with optimized data retrieval


      <br/>


      **Use Cases**

      - Filter airports by specific codes for targeted data retrieval

      - Integrate airport data into flight planning and scheduling systems

      - Build airport selection interfaces with efficient pagination


      <br/>
  - name: Airport Fuel Prices
    description: >
      Manage and optimize airport fuel pricing data for your organization. These
      endpoints enable operators to efficiently update, remove, and bulk-manage
      fuel prices, supporting streamlined fuel order workflows and provider
      management.


      **Business Value**

      - Ensure accurate and up-to-date fuel pricing for all airport operations.

      - Reduce manual effort and errors by enabling bulk updates and deletions.

      - Support cost control and negotiation with providers through transparent
      pricing data.

      - Enhance operational planning and financial forecasting with reliable
      fuel cost data.


      <br/>


      **Use Cases**

      - Update fuel prices for a specific airport to reflect new agreements or
      market changes.

      - Remove outdated or incorrect fuel prices for compliance and data
      integrity.

      - Perform bulk deletions to quickly adapt to network-wide pricing changes.

      - Integrate with internal systems to automate fuel price management and
      reporting.

        <br/>

      **Note:**  

      > The data managed by the Airport Fuel Prices endpoints is strictly bound
      to the context of the operator associated with the calling authentication
      token. All operations—creating, updating, or deleting airport fuel
      prices—apply only to the operator for which the provided token is valid.
  - name: Webhooks
    description: >
      Manage webhook subscriptions for near real-time event notifications. These
      endpoints enable partners to create, manage, and monitor webhook
      subscriptions for receiving flight-related events and updates.


      **Business Value**

      - Receive near real-time notifications for flight events and updates.

      - Automate integration workflows with external systems.

      - Monitor flight operations and passenger changes in near real-time.

      - Reduce polling overhead by using event-driven architecture.


      <br/>


      **Use Cases**

      - Subscribe to flight updates to sync data with external booking systems.

      - Monitor passenger count changes for catering and ground service
      coordination.

      - Track aircraft changes for maintenance and operational planning.

      - Receive notifications for flight cancellations and time updates.


      <br/>


      **Available Event Types:**

      - `FLIGHT_CREATE`: New flight creation

      - `FLIGHT_CANCEL`: Flight cancellation

      - `FLIGHT_TIME_UPDATE`: Flight time changes

      - `FLIGHT_AIRCRAFT_UPDATE`: Aircraft assignment changes

      - `FLIGHT_AIRPORT_UPDATE`: Airport(s) changes

      - `FLIGHT_POST_FLIGHT_STATUS`: Post-flight status updates

      - `FLIGHT_MOVEMENT_UPDATE`: Flight movement updates

      - `FLIGHT_PAX_COUNT_UPDATE`: Passenger count changes

      - `FLIGHT_PAX_LIST_UPDATE`: Passenger list changes (e.g. new passengers,
      updated list, passenger document changes, etc.)
  - name: Crew Qualifications
    description: >
      Manage crew qualifications and certifications. These endpoints enable
      partners to assign, update, and manage crew member qualifications
      including licenses, certifications, and associated documents.


      **Business Value**

      - Maintain accurate crew qualification records for compliance and safety.

      - Streamline qualification assignment and management processes.

      - Support document management for qualification certificates and licenses.

      - Ensure crew members meet operational requirements and regulations.


      <br/>


      **Use Cases**

      - Assign new qualifications to crew members with license details and
      expiration dates.

      - Update existing qualification information including license numbers and
      issuing authorities.

      - Upload and manage qualification documents such as certificates and
      licenses.

      - Retrieve qualification information for crew members and compliance
      reporting.

      - Delete obsolete qualifications and associated documents.


      <br/>


      **Note:**  

      > All crew qualification operations are bound to the operator context
      associated with the authentication token. Partners can only manage
      qualifications for crew members within their organization.
x-tagGroups:
  - name: Airports
    tags:
      - Airports
  - name: Fuel Providers
    tags:
      - Airport Fuel Prices
  - name: Webhooks
    tags:
      - Webhooks
  - name: Crew Management
    tags:
      - Crew Qualifications
paths:
  /api/v2/airports/{airportCode}:
    get:
      summary: Get airport
      description: |
        This endpoint provides efficient access to airport data.

        **Features:**
        - Multiple filter options (ICAO, IATA, FAA, local identifier)
        - Automatic exclusion of deleted/inactive airports
      tags:
        - Airports
      parameters:
        - name: airportCode
          in: path
          required: true
          schema:
            type: string
          description: >
            Airport reference code (FL3XX ID, IATA, ICAO, FAA, or Local
            Identifier).
          example: LMML
      responses:
        '200':
          description: Successfully retrieved airports
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AirportV2Dto'
        '400':
          description: Bad request - invalid parameters
        '401':
          description: Unauthorized - invalid authentication
        '403':
          description: Forbidden - insufficient permissions
  /api/v2/partners/airports/{airportCode}/fuel-prices:
    get:
      summary: Get fuel prices for an airport
      description: >
        Retrieve all fuel prices for a specific airport that were submitted by
        the partner associated with the authentication token.


        **Note:** Only fuel prices associated with the operator linked to the
        authentication token will be returned.
      tags:
        - Airport Fuel Prices
      parameters:
        - name: airportCode
          in: path
          required: true
          schema:
            type: string
          description: >
            The airport code for which fuel prices are being retrieved. This can
            be an IATA, ICAO, FAA code, or airport ID.

            <br/>

            Valid examples during demo include: AGAT, AGGR, EBCR, EGSK, EHPC,
            EPJA, DAOS
          example: AGAT
      responses:
        '200':
          description: Successfully retrieved fuel prices
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AirportFuelPriceDto'
        '400':
          description: Bad request - invalid airport code
        '401':
          description: Unauthorized - invalid authentication
        '403':
          description: Forbidden - insufficient permissions
    put:
      summary: Update fuel prices for an airport
      description: >
        Update or set fuel prices for a specific airport. This endpoint allows
        partners to submit fuel pricing information that will be used for
        operational and financial processes.


        **Note:** Only fuel prices associated with the operator linked to the
        authentication token can be updated.


        **Example Use Case:** An operations manager needs to update the fuel
        price for a particular airport after receiving new rates from a
        provider. By using this endpoint, they can ensure that all future fuel
        orders and cost calculations use the most current pricing data.
      tags:
        - Airport Fuel Prices
      parameters:
        - name: airportCode
          in: path
          required: true
          schema:
            type: string
          description: >
            The airport code for which fuel prices are being updated. This can
            be an IATA, ICAO, FAA code, or airport ID.

            <br/>

            Valid examples during demo include: AGAT, AGGR, EBCR, EGSK, EHPC,
            EPJA, DAOS
          example: AGGR
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              minItems: 1
              maxItems: 10
              items:
                $ref: '#/components/schemas/AirportFuelPriceCreateDto'
      responses:
        '200':
          description: Successfully updated fuel prices
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AirportFuelPriceDto'
        '400':
          description: Bad request - validation error
        '401':
          description: Unauthorized - invalid authentication
        '403':
          description: Forbidden - insufficient permissions
    delete:
      summary: Delete all fuel prices for an airport
      description: >
        Delete all fuel prices for a specific airport that were submitted by the
        partner associated with the authentication token.


        **Note:** Only fuel prices associated with the operator linked to the
        authentication token can be deleted.


        **Example Use Case:** An operations manager needs to remove all fuel
        prices for an airport after a provider contract ends or when prices are
        no longer valid. Using this endpoint ensures that no obsolete pricing
        data is used in future fuel orders or cost calculations.
      tags:
        - Airport Fuel Prices
      parameters:
        - name: airportCode
          in: path
          required: true
          schema:
            type: string
          description: >
            The airport code for which fuel prices are being deleted. This can
            be an IATA, ICAO, FAA code, or airport ID.

            <br/>

            Valid examples during demo include: AGAT, AGGR, EBCR, EGSK, EHPC,
            EPJA, DAOS
          example: AGGR
      responses:
        '204':
          description: Successfully deleted fuel prices
        '400':
          description: Bad request - invalid airport code
        '401':
          description: Unauthorized - invalid authentication
        '403':
          description: Forbidden - insufficient permissions
  /api/v2/partners/airport-fuel-prices:
    delete:
      summary: Delete all fuel prices
      description: >
        Delete all fuel prices submitted by the partner associated with the
        authentication token across all airports.


        **Note:** Only fuel prices associated with the operator linked to the
        authentication token can be deleted in bulk.


        **Example Use Case:** An operations manager needs to remove fuel prices
        for several airports after a system-wide update or contract changes.
        Using this endpoint ensures that obsolete pricing data is quickly
        cleared from all affected locations.
      tags:
        - Airport Fuel Prices
      responses:
        '204':
          description: Successfully deleted all fuel prices
        '401':
          description: Unauthorized - invalid authentication
        '403':
          description: Forbidden - insufficient permissions
  /api/v2/partners/airport-fuel-prices/{fuelPriceId}:
    put:
      summary: Update individual fuel price
      description: >
        Update a specific fuel price by its ID. This endpoint allows partners to
        modify individual fuel pricing records.


        **Note:** Only fuel prices associated with the operator linked to the
        authentication token can be updated.
      tags:
        - Airport Fuel Prices
      parameters:
        - name: fuelPriceId
          in: path
          required: true
          schema:
            type: string
          description: The unique identifier of the fuel price to update
          example: '12345'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AirportFuelPriceCreateDto'
      responses:
        '200':
          description: Successfully updated fuel price
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AirportFuelPriceDto'
        '400':
          description: Bad request - validation error or fuel price not found
        '401':
          description: Unauthorized - invalid authentication
        '403':
          description: Forbidden - insufficient permissions
    delete:
      summary: Delete individual fuel price
      description: >
        Delete a specific fuel price by its ID. This endpoint allows partners to
        remove individual fuel pricing records.


        **Note:** Only fuel prices associated with the operator linked to the
        authentication token can be deleted.
      tags:
        - Airport Fuel Prices
      parameters:
        - name: fuelPriceId
          in: path
          required: true
          schema:
            type: string
          description: The unique identifier of the fuel price to delete
          example: '12345'
      responses:
        '204':
          description: Successfully deleted fuel price
        '400':
          description: Bad request - fuel price not found
        '401':
          description: Unauthorized - invalid authentication
        '403':
          description: Forbidden - insufficient permissions
  /api/v2/webhooks/subscriptions:
    get:
      operationId: getWebhookSubscriptions
      summary: Get webhook subscriptions
      description: >
        Retrieve all webhook subscriptions for the authenticated partner and
        operator.


        **Features:**

        - Returns all active and inactive webhook subscriptions

        - Filtered by partner and operator context
      tags:
        - Webhooks
      responses:
        '200':
          description: Successfully retrieved webhook subscriptions
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/WebhookSubscriptionResponse'
        '401':
          description: Unauthorized - invalid authentication
        '403':
          description: Forbidden - insufficient permissions
    post:
      operationId: createWebhookSubscription
      summary: Create a new webhook subscription
      description: >
        Create a new webhook subscription for receiving near real-time event
        notifications.


        **Features:**

        - Validates callback URL format, only https is supported

        - Sets automatic expiration date (1 month) for subscriptions


        **Example Use Case:** An operations manager needs to receive near
        real-time notifications when flight times change. By creating a webhook
        subscription for `FLIGHT_TIME_UPDATE` events, they can automatically
        sync flight data with external systems.
      tags:
        - Webhooks
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookSubscriptionCreateDto'
      responses:
        '201':
          description: Successfully created webhook subscription
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookSubscriptionResponse'
        '400':
          description: Bad request - validation error
        '401':
          description: Unauthorized - invalid authentication
        '403':
          description: >-
            Forbidden - insufficient permissions or event not allowed in API
            plan
  /api/v2/webhooks/subscriptions/{subscriptionId}:
    get:
      operationId: getWebhookSubscriptionById
      summary: Get webhook subscription by ID
      description: |
        Retrieve a specific webhook subscription by its unique identifier.

        **Features:**
        - Returns detailed subscription information
      tags:
        - Webhooks
      parameters:
        - name: subscriptionId
          in: path
          required: true
          schema:
            type: string
          description: |
            The unique identifier of the webhook subscription to retrieve.
          example: webhook-sub-12345
      responses:
        '200':
          description: Successfully retrieved webhook subscription
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookSubscriptionResponse'
        '400':
          description: Bad request - invalid subscription ID
        '401':
          description: Unauthorized - invalid authentication
        '403':
          description: Forbidden - insufficient permissions
        '404':
          description: Not found - subscription does not exist
    patch:
      operationId: updateWebhookSubscription
      summary: Update webhook subscription callback URL or status
      description: >
        Update the callback URL for an existing webhook subscription.


        **Features:**

        - Validates new callback URL format, only https is supported

        - Updates subscription status to active or inactive


        **Example Use Case:** An operations manager needs to change the webhook
        endpoint URL after migrating to a new server. Using this endpoint, they
        can update the callback URL without recreating the entire subscription.
      tags:
        - Webhooks
      parameters:
        - name: subscriptionId
          in: path
          required: true
          schema:
            type: string
          description: |
            The unique identifier of the webhook subscription to update.
          example: webhook-sub-12345
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookSubscriptionPatchDto'
      responses:
        '200':
          description: Successfully updated webhook subscription
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookSubscriptionResponse'
        '400':
          description: Bad request - validation error
        '401':
          description: Unauthorized - invalid authentication
        '403':
          description: Forbidden - insufficient permissions
        '404':
          description: Not found - subscription does not exist
    delete:
      operationId: deleteWebhookSubscription
      summary: Delete a webhook subscription
      description: >
        Delete a webhook subscription and stop receiving notifications for the
        associated event type.


        **Features:**

        - Immediately stops webhook deliveries


        **Example Use Case:** An operations manager needs to stop receiving
        flight update notifications after completing a system migration. Using
        this endpoint, they can cleanly remove the webhook subscription.
      tags:
        - Webhooks
      parameters:
        - name: subscriptionId
          in: path
          required: true
          schema:
            type: string
          description: |
            The unique identifier of the webhook subscription to delete.
          example: webhook-sub-12345
      responses:
        '204':
          description: Successfully deleted webhook subscription
        '400':
          description: Bad request - invalid subscription ID
        '401':
          description: Unauthorized - invalid authentication
        '403':
          description: Forbidden - insufficient permissions
        '404':
          description: Not found - subscription does not exist
  /api/v2/webhooks/subscriptions/{subscriptionId}/renewals:
    post:
      operationId: renewWebhookSubscription
      summary: Renew a webhook subscription
      description: >
        Renew an existing webhook subscription to extend its expiration date.


        **Features:**

        - Extends subscription expiration by 1 month from current expiration
        date.

        - Subscriptions can only be renewed 5 days before expiration.


        **Example Use Case:** An operations manager wants to continue receiving
        webhook notifications for an existing subscription. Using this endpoint,
        they can extend the subscription without recreating it.
      tags:
        - Webhooks
      parameters:
        - name: subscriptionId
          in: path
          required: true
          schema:
            type: string
          description: |
            The unique identifier of the webhook subscription to renew.
          example: webhook-sub-12345
      responses:
        '200':
          description: Successfully renewed webhook subscription
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookSubscriptionResponse'
        '400':
          description: Bad request - invalid subscription ID
        '401':
          description: Unauthorized - invalid authentication
        '403':
          description: Forbidden - insufficient permissions
        '404':
          description: Not found - subscription does not exist
  /api/v2/webhooks/deliveries:
    get:
      operationId: getWebhookDeliveries
      summary: Get webhook deliveries
      description: >
        Retrieve paginated webhook delivery history for the authenticated
        partner and operator.


        `Note: Only failed deliveries are supported at this time.`


        **Features:**

        - Returns paginated delivery history with filtering and sorting

        - Supports filtering by issue date and status

        - Default sorting by issue date (descending)

        <br/> <br/>

        **Example Use Case:** An operations manager needs to monitor webhook
        delivery to troubleshoot failed deliveries. Using this endpoint, they
        can review delivery history and identify patterns in webhook failures.
      tags:
        - Webhooks
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 10
            maximum: 50
            default: 10
          description: Maximum number of records to return.
          example: 20
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
          description: Number of records to skip before starting to return results.
          example: 6
        - name: filter
          in: query
          required: true
          schema:
            type: string
          description: |
            Filter by issueDate and status.

            **Required filters:**
            - `issueDate` with `GTE` operator (greater than or equal)
              - Date Constraints: Can be up to 2 months in the past.
              - Date format: YYYY-MM-DDTHH:mm:ss.SSSZ
              - Date value must be url encoded. Example: the following value `issueDate,GTE,2025-01-01T10:23:57.980Z&filter=status,EQ,FAILED` would be encoded and sent as `issueDate%2CGTE%2C2025-01-01T10%3A23%3A57.980Z&filter=status%2CEQ%2CFAILED`.
            - `status` with `EQ` operator (equal)
              - Supported values: `FAILED`
          example: >-
            issueDate%2CGTE%2C2025-01-01T10%3A23%3A57.980Z&filter=status%2CEQ%2CFAILED
        - name: sort
          in: query
          required: false
          schema:
            type: string
            default: issueDate desc
          description: |
            Sort criteria in the format: field direction

            Supported sort fields:
            - `issueDate` (default: desc)
          example: issueDate,desc
      responses:
        '200':
          description: Successfully retrieved webhook deliveries
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PageResult'
        '400':
          description: Bad request - invalid parameters or missing required filters
        '401':
          description: Unauthorized - invalid authentication
        '403':
          description: Forbidden - insufficient permissions
  /api/v2/external/crew-qualifications:
    get:
      operationId: getCrewQualifications
      summary: Get crew qualifications
      description: >
        Retrieve crew qualifications with pagination and filtering capabilities.


        **Features:**

        - Filter by crew ID (required)

        - Paginated results


        **Example Use Case:** An operations manager needs to retrieve all
        qualifications for a specific crew member to verify compliance status
        and upcoming expiration dates.
      tags:
        - Crew Qualifications
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 10
            maximum: 50
            default: 10
          description: Maximum number of records to return.
          example: 20
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
          description: Number of records to skip before starting to return results.
          example: 0
        - name: filter
          in: query
          required: true
          schema:
            type: string
          description: |
            Filter by crewId (required).

            **Required filters:**
            - `crewId` with `EQ` operator (equal)
              - Example: `crewId,EQ,12345`
          example: crewId,EQ,12345
      responses:
        '200':
          description: Successfully retrieved crew qualifications
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PageResult'
        '400':
          description: Bad request - invalid parameters or missing required filters
        '401':
          description: Unauthorized - invalid authentication
        '403':
          description: Forbidden - insufficient permissions
    post:
      operationId: assignQualificationToCrew
      summary: Assign a qualification to a crew member
      description: >
        Assign a new qualification to a crew member with license details,
        expiration dates, and other relevant information.


        **Features:**

        - Validates required fields including crew ID and qualification ID

        - Supports license numbers, issuing authorities, and country information

        - Handles pilot-in-command designations and base month calculations


        **Example Use Case:** An operations manager needs to assign a new type
        rating qualification to a pilot after completing training. This endpoint
        allows them to create the qualification record with all necessary
        details.
      tags:
        - Crew Qualifications
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CrewQualificationCreateDto'
      responses:
        '200':
          description: Successfully assigned qualification to crew member
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CrewQualificationSimplifiedDto'
        '400':
          description: Bad request - validation error
        '401':
          description: Unauthorized - invalid authentication
        '403':
          description: Forbidden - insufficient permissions
  /api/v2/external/crew-qualifications/{crewQualificationId}:
    get:
      operationId: getCrewQualificationById
      summary: Get a crew qualification by ID
      description: >
        Retrieve detailed information about a specific crew qualification
        including associated documents.


        **Features:**

        - Returns complete qualification details including document references

        - Includes creation and update timestamps


        **Example Use Case:** An operations manager needs to review the complete
        details of a specific qualification, including any uploaded documents,
        to verify compliance or prepare for audits.
      tags:
        - Crew Qualifications
      parameters:
        - name: crewQualificationId
          in: path
          required: true
          schema:
            type: string
          description: The unique identifier of the crew qualification to retrieve
          example: qual-12345
      responses:
        '200':
          description: Successfully retrieved crew qualification
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CrewQualificationDto'
        '400':
          description: Bad request - invalid qualification ID
        '401':
          description: Unauthorized - invalid authentication
        '403':
          description: Forbidden - insufficient permissions
        '404':
          description: Not found - qualification does not exist
    patch:
      operationId: updateCrewQualificationById
      summary: Update a crew qualification by ID
      description: >
        Update an existing crew qualification with new information.


        **Features:**

        - Updates qualification details including license numbers and dates

        - Supports partial updates of qualification information


        **Example Use Case:** An operations manager needs to update a
        qualification after a license renewal or when additional information
        becomes available.
      tags:
        - Crew Qualifications
      parameters:
        - name: crewQualificationId
          in: path
          required: true
          schema:
            type: string
          description: The unique identifier of the crew qualification to update
          example: qual-12345
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CrewQualificationPatchDto'
      responses:
        '200':
          description: Successfully updated crew qualification
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CrewQualificationDto'
        '400':
          description: Bad request - validation error or qualification not found
        '401':
          description: Unauthorized - invalid authentication
        '403':
          description: Forbidden - insufficient permissions
        '404':
          description: Not found - qualification does not exist
    delete:
      operationId: deleteCrewQualificationById
      summary: Delete a crew qualification by ID
      description: >
        Delete a crew qualification and remove it from the system.


        **Features:**

        - Permanently removes the qualification record

        - Returns confirmation of deletion


        **Example Use Case:** An operations manager needs to remove an obsolete
        qualification that is no longer valid or relevant for a crew member.
      tags:
        - Crew Qualifications
      parameters:
        - name: crewQualificationId
          in: path
          required: true
          schema:
            type: string
          description: The unique identifier of the crew qualification to delete
          example: qual-12345
      responses:
        '200':
          description: Successfully deleted crew qualification
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeletedDto'
        '400':
          description: Bad request - qualification not found
        '401':
          description: Unauthorized - invalid authentication
        '403':
          description: Forbidden - insufficient permissions
        '404':
          description: Not found - qualification does not exist
  /api/v2/external/crew-qualifications/{crewQualificationId}/documents/{documentUuid}:
    get:
      operationId: getCrewQualificationDocument
      summary: Get document associated with a crew qualification
      description: >
        Download a document associated with a crew qualification.


        **Features:**

        - Downloads the actual document file

        - Validates document ownership and access permissions


        **Example Use Case:** An operations manager needs to download a
        qualification certificate or license document for verification or
        compliance purposes.
      tags:
        - Crew Qualifications
      parameters:
        - name: crewQualificationId
          in: path
          required: true
          schema:
            type: string
          description: The unique identifier of the crew qualification
          example: qual-12345
        - name: documentUuid
          in: path
          required: true
          schema:
            type: string
          description: The unique identifier of the document to download
          example: doc-uuid-67890
      responses:
        '200':
          description: Successfully retrieved document
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '400':
          description: Bad request - invalid qualification ID or document UUID
        '401':
          description: Unauthorized - invalid authentication
        '403':
          description: Forbidden - insufficient permissions
        '404':
          description: Not found - qualification or document does not exist
  /api/v2/external/crew-qualifications/{crewQualificationId}/documents:
    post:
      operationId: uploadCrewQualificationDocument
      summary: Upload document associated with a crew qualification
      description: >
        Upload a document file to be associated with a crew qualification.


        **Features:**

        - Supports various document formats

        - Associates the document with the specific qualification

        - Returns document metadata including UUID for future access


        **Example Use Case:** An operations manager needs to upload a scanned
        copy of a pilot's license or certificate to maintain digital records for
        compliance and verification.
      tags:
        - Crew Qualifications
      parameters:
        - name: crewQualificationId
          in: path
          required: true
          schema:
            type: string
          description: The unique identifier of the crew qualification
          example: qual-12345
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: The document file to upload
              required:
                - file
      responses:
        '200':
          description: Successfully uploaded document
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/B2CBinaryReferenceDto'
        '400':
          description: Bad request - invalid file or qualification ID
        '401':
          description: Unauthorized - invalid authentication
        '403':
          description: Forbidden - insufficient permissions
        '404':
          description: Not found - qualification does not exist
  /api/v2/external/crew-qualifications/{crewQualificationId}/documents/{uuid}:
    delete:
      operationId: deleteCrewQualificationDocument
      summary: Delete document associated with a crew qualification
      description: >
        Delete a document associated with a crew qualification.


        **Features:**

        - Permanently removes the document file

        - Returns confirmation of deletion


        **Example Use Case:** An operations manager needs to remove an outdated
        or incorrect document that was previously uploaded for a qualification.
      tags:
        - Crew Qualifications
      parameters:
        - name: crewQualificationId
          in: path
          required: true
          schema:
            type: string
          description: The unique identifier of the crew qualification
          example: qual-12345
        - name: uuid
          in: path
          required: true
          schema:
            type: string
          description: The unique identifier of the document to delete
          example: doc-uuid-67890
      responses:
        '200':
          description: Successfully deleted document
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeletedDto'
        '400':
          description: Bad request - invalid qualification ID or document UUID
        '401':
          description: Unauthorized - invalid authentication
        '403':
          description: Forbidden - insufficient permissions
        '404':
          description: Not found - qualification or document does not exist
  /api/v2/external/qualification-types:
    get:
      operationId: getQualificationTypes
      summary: Get qualification types
      description: >
        Retrieve available qualification types and their details for use in crew
        qualification assignments.


        **Features:**

        - Returns paginated list of available qualifications

        - Includes qualification metadata and configuration


        **Example Use Case:** An operations manager needs to see all available
        qualification types in the system to properly assign qualifications to
        crew members.
      tags:
        - Crew Qualifications
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 10
            maximum: 50
            default: 10
          description: Maximum number of records to return.
          example: 20
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
          description: Number of records to skip before starting to return results.
          example: 0
      responses:
        '200':
          description: Successfully retrieved qualifications
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedQualificationDto'
        '401':
          description: Unauthorized - invalid authentication
        '403':
          description: Forbidden - insufficient permissions
  /api/v2/external/qualification-types/{id}:
    get:
      operationId: getQualificationTypeById
      summary: Get qualification type by ID
      description: >
        Retrieve detailed information about a specific qualification type.


        **Features:**

        - Returns complete qualification configuration and metadata

        - Includes validity periods, grace periods, and relation information


        **Example Use Case:** An operations manager needs to understand the
        specific requirements and configuration of a qualification type before
        assigning it to a crew member.
      tags:
        - Crew Qualifications
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The unique identifier of the qualification to retrieve
          example: qual-type-12345
      responses:
        '200':
          description: Successfully retrieved qualification
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QualificationDto'
        '400':
          description: Bad request - invalid qualification ID
        '401':
          description: Unauthorized - invalid authentication
        '403':
          description: Forbidden - insufficient permissions
        '404':
          description: Not found - qualification does not exist
components:
  securitySchemes:
    X-Api-Client-Id:
      type: apiKey
      in: header
      name: X-Api-Client-Id
    X-Auth-Token:
      type: apiKey
      in: header
      name: X-Auth-Token
  schemas:
    AirportV2Dto:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the airport
          example: '123'
        name:
          type: string
          description: Full name of the airport
          example: Vienna International Airport
        icao:
          type: string
          description: ICAO code of the airport
          example: LOWW
        iata:
          type: string
          description: IATA code of the airport
          example: VIE
        faa:
          type: string
          description: FAA code of the airport (US airports only)
          example: KJFK
        localIdentifier:
          type: string
          description: Local identifier code for the airport
          example: ABC
        servedCity:
          type: string
          description: City served by the airport
          example: Vienna
        timezone:
          type: string
          description: Timezone of the airport
          example: Europe/Vienna
        location:
          $ref: '#/components/schemas/AirportLocation'
    AirportLocation:
      type: object
      properties:
        country:
          type: string
          description: Country name where the airport is located
          example: Austria
        countryCode:
          type: string
          description: ISO country code alpha-3
          example: AUT
    AirportFuelPriceDto:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the fuel price record
          example: '12345'
        fboName:
          type: string
          description: Name of the Fixed Base Operator (FBO)
          example: Jet FBO
        contractorName:
          type: string
          description: Name of the fuel contractor
          example: Shell Aviation
        currency:
          type: string
          description: Currency code for the fuel prices
          example: EUR
        volumeFrom:
          type: number
          format: double
          description: Minimum volume for this price tier
          example: 1000
        volumeTo:
          type: number
          format: double
          description: Maximum volume for this price tier
          example: 5000
        unit:
          $ref: '#/components/schemas/UnitVolume'
        pricingPrivate:
          $ref: '#/components/schemas/FuelPrice'
        pricingCommercial:
          $ref: '#/components/schemas/FuelPrice'
        preArrivalRemarks:
          type: string
          description: Remarks for pre-arrival fuel services
          example: 24-hour notice required
        paymentMethod:
          type: string
          description: Accepted payment methods
          example: Credit Card, Invoice
        phone:
          type: string
          description: Contact phone number
          example: +1-555-123-4567
        email:
          type: string
          format: email
          description: Contact email address
          example: fuel@jetfbo.com
        remarks:
          type: string
          description: Additional remarks or notes
          example: Preferred fuel provider
        airport:
          $ref: '#/components/schemas/AirportMinimalDto'
        source:
          type: string
          description: Source of the fuel price data
          example: Partner API
        vendorId:
          type: string
          description: Vendor identifier
          example: vendor123
        vendorName:
          type: string
          description: Vendor name
          example: Fuel Provider Inc
        expirationDateTime:
          type: string
          format: date-time
          description: Expiration date and time for the fuel price
          example: '2024-12-31T23:59:59.000Z'
        createdAtDateTime:
          type: string
          format: date-time
          description: Creation date and time
          example: '2024-12-31T23:59:59.000Z'
        updatedAtDateTime:
          type: string
          format: date-time
          description: Last update date and time
          example: '2024-12-31T23:59:59.000Z'
    AirportFuelPriceCreateDto:
      type: object
      required:
        - fboName
        - contractorName
        - currency
        - unit
      properties:
        fboName:
          type: string
          description: >
            The name of the Fixed Base Operator (FBO) at the airport. This is
            the entity responsible for providing fuel services.
          example: Jet FBO
        contractorName:
          type: string
          description: >
            The name of the contractor providing the fuel services. This could
            be a fuel supplier or service provider.
          example: Shell Aviation
        currency:
          $ref: '#/components/schemas/Currency'
        volumeFrom:
          type: number
          format: double
          minimum: 0
          description: >
            The minimum volume (inclusive) for which this fuel price applies.
            Used to define the lower bound of the applicable volume range.
          example: 1000
        volumeTo:
          type: number
          format: double
          minimum: 0
          description: >
            The maximum volume (inclusive) for which this fuel price applies.
            Used to define the upper bound of the applicable volume range.
          example: 5000
        unit:
          $ref: '#/components/schemas/UnitVolume'
        pricingPrivate:
          $ref: '#/components/schemas/FuelPrice'
        pricingCommercial:
          $ref: '#/components/schemas/FuelPrice'
        preArrivalRemarks:
          type: string
          description: >
            Remarks or instructions for pre-arrival fuel services. This could
            include special handling instructions or requirements.
          example: 24-hour notice required
        paymentMethod:
          type: string
          description: >
            The method of payment for the fuel services. This could include
            options like credit card, invoice, or cash.
          example: Credit Card, Invoice
        phone:
          type: string
          description: >
            The contact phone number for the FBO or fuel provider. This is used
            for communication regarding fuel services.
          example: +1-555-123-4567
        email:
          type: string
          format: email
          description: >
            The contact email address for the FBO or fuel provider. This is used
            for communication regarding fuel services.
          example: fuel@jetfbo.com
        remarks:
          type: string
          description: >
            Additional remarks or comments regarding the fuel services. This
            could include special requests or notes for the fuel provider.
          example: Preferred fuel provider
        expirationDateTime:
          type: string
          format: date-time
          description: >
            The expiration date and time for the fuel price offer. After this
            time, the offer may no longer be valid.
          example: '2024-12-31T23:59:59.000Z'
    FuelPrice:
      type: object
      properties:
        price:
          type: number
          format: double
          minimum: 0
          description: >
            The price of the fuel per unit. Specified in the currency defined in
            the `currency` field.
          example: 1.85
        priceIndex:
          type: number
          format: double
          minimum: 0
          description: >
            Price in the given location divided by the Price Private in the base
            location multiplied by 100
          example: 105.5
    AirportMinimalDto:
      type: object
      properties:
        id:
          type: string
          description: Airport identifier
          example: '123'
        name:
          type: string
          description: Airport name
          example: Vienna International Airport
        icao:
          type: string
          description: ICAO code
          example: LOWW
        iata:
          type: string
          description: IATA code
          example: VIE
    Currency:
      type: string
      enum:
        - EUR
        - USD
      description: >
        The currency in which the fuel prices are specified. This is a
        three-letter ISO currency code, such as EUR for Euro or USD for US
        Dollar.
    UnitVolume:
      type: string
      enum:
        - LITER
        - GALLON_USA
      description: >
        The unit of volume for the fuel prices. This indicates whether the
        prices are specified per liter or per US gallon. The options are:
          - `LITER`: Prices are specified per liter.
          - `GALLON_USA`: Prices are specified per US gallon.
    WebhookSubscriptionResponse:
      type: object
      properties:
        id:
          type: string
          description: |
            Unique identifier for the webhook subscription.
          example: webhook-sub-12345
        event:
          type: string
          description: |
            The event type that this subscription is listening for.
          example: FLIGHT_UPDATE
        callbackUrl:
          type: string
          format: uri
          description: |
            The URL where webhook notifications will be sent.
          example: https://example.com/webhooks
        status:
          $ref: '#/components/schemas/DbStatusType'
        createdAtDateTime:
          type: string
          format: date-time
          description: |
            The date and time when the webhook subscription was created.
          example: '2024-01-15T10:30:00.000Z'
        updatedAtDateTime:
          type: string
          format: date-time
          description: |
            The date and time when the webhook subscription was last updated.
          example: '2024-01-15T10:30:00.000Z'
        expirationDateTime:
          type: string
          format: date-time
          description: |
            The date and time when the webhook subscription will expire.
          example: '2024-02-15T10:30:00.000Z'
    WebhookSubscriptionCreateDto:
      type: object
      required:
        - event
        - callbackUrl
        - signingKey
      properties:
        event:
          $ref: '#/components/schemas/WebhookEventType'
        callbackUrl:
          type: string
          format: uri
          description: >
            The URL where webhook notifications will be sent. Must be a valid
            HTTPS URL.
          example: https://example.com/webhooks/flight-updates
        signingKey:
          type: string
          description: >
            A secret key used to verify webhook authenticity. This key will be
            used to sign webhook payloads.
          example: your-secret-signing-key-123
    WebhookSubscriptionPatchDto:
      type: object
      properties:
        callbackUrl:
          type: string
          format: uri
          description: >
            The new URL where webhook notifications will be sent. Must be a
            valid HTTPS URL.
          example: https://new-example.com/webhooks
        status:
          $ref: '#/components/schemas/DbStatusType'
    WebhookEventType:
      type: string
      enum:
        - FLIGHT_CREATE
        - FLIGHT_CANCEL
        - FLIGHT_TIME_UPDATE
        - FLIGHT_AIRCRAFT_UPDATE
        - FLIGHT_AIRPORT_UPDATE
        - FLIGHT_POST_FLIGHT_STATUS
        - FLIGHT_MOVEMENT_UPDATE
        - FLIGHT_PAX_COUNT_UPDATE
        - FLIGHT_PAX_LIST_UPDATE
      description: >
        The type of event that triggers the webhook notification. Each event
        type corresponds to specific flight-related changes or operations.
    DbStatusType:
      type: string
      enum:
        - ACTIVE
        - INACTIVE
      description: >
        Status of the webhook subscription indicating whether it is active and
        receiving notifications or inactive.
    WebhookDeliveryDto:
      type: object
      properties:
        id:
          type: string
          description: |
            Unique identifier for the webhook delivery attempt.
          example: delivery-12345
        resourceType:
          type: string
          description: |
            The type of resource that triggered the webhook delivery.
          enum:
            - FLIGHT
        resourceId:
          type: string
          description: >
            The unique identifier of the resource that triggered the webhook
            delivery.
          example: flight-67890
        event:
          type: string
          description: >
            The event type that triggered this webhook delivery.


            - `FLIGHT_UPDATE` is a main group for when the more than one of the
            following events are triggered:
              - FLIGHT_CREATE
              - FLIGHT_CANCEL
              - FLIGHT_TIME_UPDATE
              - FLIGHT_AIRCRAFT_UPDATE
              - FLIGHT_AIRPORT_UPDATE
              - FLIGHT_POST_FLIGHT_STATUS
              - FLIGHT_MOVEMENT_UPDATE
            - `FLIGHT_PASSENGER_UPDATE` is a main group for when the more than
            one of the following events are triggered:
              - FLIGHT_PAX_COUNT_UPDATE
              - FLIGHT_PAX_LIST_UPDATE
          enum:
            - FLIGHT_CREATE
            - FLIGHT_CANCEL
            - FLIGHT_TIME_UPDATE
            - FLIGHT_AIRCRAFT_UPDATE
            - FLIGHT_AIRPORT_UPDATE
            - FLIGHT_POST_FLIGHT_STATUS
            - FLIGHT_MOVEMENT_UPDATE
            - FLIGHT_PAX_COUNT_UPDATE
            - FLIGHT_PAX_LIST_UPDATE
            - FLIGHT_UPDATE
            - FLIGHT_PASSENGER_UPDATE
        status:
          type: string
          description: >
            The delivery status indicating whether the webhook was successfully
            delivered.
          enum:
            - FAILED
        completedAtDateTime:
          type: string
          format: date-time
          description: >
            The date and time (UTC) when the webhook delivery attempt was
            completed.
          example: '2024-01-15T10:30:00.000Z'
    PageResult:
      type: object
      description: Paginated list of webhook deliveries
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/WebhookDeliveryDto'
          description: |
            The list of webhook deliveries for the current page.
        pagination:
          $ref: '#/components/schemas/Pagination'
    Pagination:
      type: object
      description: Pagination details
      properties:
        offset:
          type: integer
          description: Number of records skipped
          example: 0
        limit:
          type: integer
          description: Maximum number of records returned
          example: 20
        totalItems:
          type: integer
          description: Total number of items available
          example: 150
        sortItems:
          type: array
          items:
            type: string
          description: List of fields used for sorting
          example:
            - issueDate desc
        filters:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
                description: Field name to filter by
                example: issueDate
              operator:
                type: string
                description: Filter operator
                example: gte
              value:
                type: string
                description: Filter value
                example: '2024-01-01T00:00:00.000Z'
          description: List of applied filters
    CrewQualificationDto:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the crew qualification
          example: qual-12345
        crewId:
          type: string
          description: Unique identifier of the crew member
          example: crew-67890
        qualificationId:
          type: string
          description: Unique identifier of the qualification type
          example: qual-type-12345
        licenseNumber:
          type: string
          description: License or certificate number
          example: ATP-123456
        issuingAuthority:
          type: string
          description: Authority that issued the license or certificate
          example: FAA
        country:
          type: string
          description: Country where the license was issued (ISO 3166-1 alpha-3)
          example: AUT
        issueDate:
          type: string
          format: date
          description: Date when the license was issued
          example: '2023-01-15'
        expiryDate:
          type: string
          format: date
          description: Date when the license expires
          example: '2025-01-15'
        trainingStartDate:
          type: string
          format: date
          description: Date when training for this qualification started
          example: '2022-12-01'
        notes:
          type: string
          description: Additional notes or comments about the qualification
          example: Completed simulator training
        isPilotInCommand:
          type: boolean
          description: Whether this qualification allows pilot-in-command privileges
          example: true
        baseMonth:
          type: string
          enum:
            - JANUARY
            - FEBRUARY
            - MARCH
            - APRIL
            - MAY
            - JUNE
            - JULY
            - AUGUST
            - SEPTEMBER
            - OCTOBER
            - NOVEMBER
            - DECEMBER
          description: Base month for qualification calculations
          example: JANUARY
        document:
          $ref: '#/components/schemas/BinaryDocumentDto'
        createdAtDateTime:
          type: string
          format: date-time
          description: Date and time when the qualification was created
          example: '2024-01-15T10:30:00.000Z'
        updatedAtDateTime:
          type: string
          format: date-time
          description: Date and time when the qualification was last updated
          example: '2024-01-15T10:30:00.000Z'
    CrewQualificationSimplifiedDto:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the crew qualification
          example: qual-12345
        crewId:
          type: string
          description: Unique identifier of the crew member
          example: crew-67890
        qualificationId:
          type: string
          description: Unique identifier of the qualification type
          example: qual-type-12345
        licenseNumber:
          type: string
          description: License or certificate number
          example: ATP-123456
        issuingAuthority:
          type: string
          description: Authority that issued the license or certificate
          example: FAA
        country:
          type: string
          description: Country where the license was issued (ISO 3166-1 alpha-3)
          example: AUT
        issueDate:
          type: string
          format: date
          description: Date when the license was issued
          example: '2023-01-15'
        expiryDate:
          type: string
          format: date
          description: Date when the license expires
          example: '2025-01-15'
        trainingStartDate:
          type: string
          format: date
          description: Date when training for this qualification started
          example: '2022-12-01'
        notes:
          type: string
          description: Additional notes or comments about the qualification
          example: Completed simulator training
        isPilotInCommand:
          type: boolean
          description: Whether this qualification allows pilot-in-command privileges
          example: true
        baseMonth:
          type: string
          enum:
            - JANUARY
            - FEBRUARY
            - MARCH
            - APRIL
            - MAY
            - JUNE
            - JULY
            - AUGUST
            - SEPTEMBER
            - OCTOBER
            - NOVEMBER
            - DECEMBER
          description: Base month for qualification calculations
          example: JANUARY
        createdAtDateTime:
          type: string
          format: date-time
          description: Date and time when the qualification was created
          example: '2024-01-15T10:30:00.000Z'
        updatedAtDateTime:
          type: string
          format: date-time
          description: Date and time when the qualification was last updated
          example: '2024-01-15T10:30:00.000Z'
    CrewQualificationCreateDto:
      type: object
      required:
        - crewId
        - qualificationId
      properties:
        crewId:
          type: string
          description: Unique identifier of the crew member
          example: crew-67890
        qualificationId:
          type: string
          description: Unique identifier of the qualification type
          example: qual-type-12345
        licenseNumber:
          type: string
          description: License or certificate number
          example: ATP-123456
        issuingAuthority:
          type: string
          description: Authority that issued the license or certificate
          example: FAA
        country:
          type: string
          description: Country where the license was issued (ISO 3166-1 alpha-3)
          example: AUT
        issueDate:
          type: string
          format: date
          description: Date when the license was issued
          example: '2023-01-15'
        expiryDate:
          type: string
          format: date
          description: Date when the license expires
          example: '2025-01-15'
        trainingStartDate:
          type: string
          format: date
          description: Date when training for this qualification started
          example: '2022-12-01'
        notes:
          type: string
          description: Additional notes or comments about the qualification
          example: Completed simulator training
        isPilotInCommand:
          type: boolean
          description: Whether this qualification allows pilot-in-command privileges
          example: true
        baseMonth:
          type: string
          enum:
            - JANUARY
            - FEBRUARY
            - MARCH
            - APRIL
            - MAY
            - JUNE
            - JULY
            - AUGUST
            - SEPTEMBER
            - OCTOBER
            - NOVEMBER
            - DECEMBER
          description: Base month for qualification calculations
          example: JANUARY
    CrewQualificationPatchDto:
      type: object
      properties:
        qualificationId:
          type: string
          description: Unique identifier of the qualification type
          example: qual-type-12345
        licenseNumber:
          type: string
          description: License or certificate number
          example: ATP-123456
        issuingAuthority:
          type: string
          description: Authority that issued the license or certificate
          example: FAA
        country:
          type: string
          description: Country where the license was issued (ISO 3166-1 alpha-3)
          example: AUT
        issueDate:
          type: string
          format: date
          description: Date when the license was issued
          example: '2023-01-15'
        expiryDate:
          type: string
          format: date
          description: Date when the license expires
          example: '2025-01-15'
        trainingStartDate:
          type: string
          format: date
          description: Date when training for this qualification started
          example: '2022-12-01'
        notes:
          type: string
          description: Additional notes or comments about the qualification
          example: Completed simulator training
        isPilotInCommand:
          type: boolean
          description: Whether this qualification allows pilot-in-command privileges
          example: true
        baseMonth:
          type: string
          enum:
            - JANUARY
            - FEBRUARY
            - MARCH
            - APRIL
            - MAY
            - JUNE
            - JULY
            - AUGUST
            - SEPTEMBER
            - OCTOBER
            - NOVEMBER
            - DECEMBER
          description: Base month for qualification calculations
          example: JANUARY
    BinaryDocumentDto:
      type: object
      properties:
        id:
          type: integer
          format: int64
          description: Unique identifier for the document
          example: 12345
        uuid:
          type: string
          description: Unique identifier for the document file
          example: doc-uuid-67890
        originalName:
          type: string
          description: Original filename of the uploaded document
          example: pilot_license.pdf
        fileSize:
          type: number
          format: double
          description: Size of the document file in bytes
          example: 1024000
        createdAtDateTime:
          type: string
          format: date-time
          description: Date and time when the document was uploaded
          example: '2024-01-15T10:30:00.000Z'
        customName:
          type: string
          description: Custom name assigned to the document
          example: Captain License
        imageSizeX:
          type: number
          format: double
          description: Width of the image in pixels (if applicable)
          example: 1920
        imageSizeY:
          type: number
          format: double
          description: Height of the image in pixels (if applicable)
          example: 1080
        isThumbnail:
          type: boolean
          description: Whether this is a thumbnail version of the document
          example: false
    B2CBinaryReferenceDto:
      type: object
      properties:
        id:
          type: integer
          format: int64
          description: Unique identifier for the document
          example: 12345
        uuid:
          type: string
          description: Unique identifier for the document file
          example: doc-uuid-67890
        originalName:
          type: string
          description: Original filename of the uploaded document
          example: pilot_license.pdf
        fileSize:
          type: integer
          format: int64
          description: Size of the document file in bytes
          example: 1024000
        creationDate:
          type: string
          format: date-time
          description: Date and time when the document was uploaded
          example: '2024-01-15T10:30:00.000Z'
        customName:
          type: string
          description: Custom name assigned to the document
          example: Captain License
        imageSizeX:
          type: integer
          description: Width of the image in pixels (if applicable)
          example: 1920
        imageSizeY:
          type: integer
          description: Height of the image in pixels (if applicable)
          example: 1080
        isThumbnail:
          type: boolean
          description: Whether this is a thumbnail version of the document
          example: false
    DeletedDto:
      type: object
      properties:
        deleted:
          type: boolean
          description: Indicates whether the deletion was successful
          example: true
    QualificationDto:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the qualification type
          example: qual-type-12345
        name:
          type: string
          description: Name of the qualification type
          example: Airline Transport Pilot License
        abbreviation:
          type: string
          description: Abbreviated name of the qualification
          example: ATPL
        warning:
          type: string
          description: Warning message associated with the qualification
          example: Requires medical certificate
        notes:
          type: string
          description: Additional notes about the qualification
          example: Valid for commercial operations
        parentId:
          type: string
          description: Identifier of the parent qualification (if applicable)
          example: parent-qual-123
        appliesTo:
          type: string
          enum:
            - FLIGHT_DECK
            - PIC
            - SIC
            - CREW_CABIN
            - CREW_POSITIONS_AND_ROLES
          description: Specifies which crew positions this qualification applies to
          example: FLIGHT_DECK
        type:
          type: string
          enum:
            - LICENSE
            - CERTIFICATE
            - RATING
            - ENDORSEMENT
            - TRAINING
            - MEDICAL
            - OTHER
          description: Type of qualification
          example: LICENSE
        trainingType:
          type: string
          enum:
            - INITIAL
            - RECURRENT
            - REFRESHER
            - CONVERSION
            - OTHER
          description: Type of training required for this qualification
          example: INITIAL
        isActive:
          type: boolean
          description: Whether this qualification type is currently active
          example: true
        validity:
          $ref: '#/components/schemas/ValidityDto'
        gracePeriod:
          $ref: '#/components/schemas/GracePeriodDto'
        relations:
          type: array
          items:
            $ref: '#/components/schemas/QualificationRelationDto'
          description: Relations to other entities (aircraft, airports, etc.)
        alternativeQualificationIds:
          type: array
          items:
            type: string
          description: List of alternative qualification IDs
          example:
            - alt-qual-1
            - alt-qual-2
        createdAtDateTime:
          type: string
          format: date-time
          description: Date and time when the qualification type was created
          example: '2024-01-15T10:30:00.000Z'
        updatedAtDateTime:
          type: string
          format: date-time
          description: Date and time when the qualification type was last updated
          example: '2024-01-15T10:30:00.000Z'
    QualificationSimplifiedDto:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the qualification type
          example: qual-type-12345
        name:
          type: string
          description: Name of the qualification type
          example: Airline Transport Pilot License
        abbreviation:
          type: string
          description: Abbreviated name of the qualification
          example: ATPL
        warning:
          type: string
          description: Warning message associated with the qualification
          example: Requires medical certificate
        notes:
          type: string
          description: Additional notes about the qualification
          example: Valid for commercial operations
        parentId:
          type: string
          description: Identifier of the parent qualification (if applicable)
          example: parent-qual-123
        appliesTo:
          type: string
          enum:
            - FLIGHT_DECK
            - PIC
            - SIC
            - CREW_CABIN
            - CREW_POSITIONS_AND_ROLES
          description: Specifies which crew positions this qualification applies to
          example: FLIGHT_DECK
        type:
          type: string
          enum:
            - LICENSE
            - CERTIFICATE
            - RATING
            - ENDORSEMENT
            - TRAINING
            - MEDICAL
            - OTHER
          description: Type of qualification
          example: LICENSE
        trainingType:
          type: string
          enum:
            - INITIAL
            - RECURRENT
            - REFRESHER
            - CONVERSION
            - OTHER
          description: Type of training required for this qualification
          example: INITIAL
        isActive:
          type: boolean
          description: Whether this qualification type is currently active
          example: true
        createdAtDateTime:
          type: string
          format: date-time
          description: Date and time when the qualification type was created
          example: '2024-01-15T10:30:00.000Z'
        updatedAtDateTime:
          type: string
          format: date-time
          description: Date and time when the qualification type was last updated
          example: '2024-01-15T10:30:00.000Z'
    ValidityDto:
      type: object
      properties:
        unit:
          type: string
          enum:
            - DAYS
            - MONTHS
            - YEARS
          description: Unit of time for validity period
          example: MONTHS
        value:
          type: integer
          description: Value of the validity period
          example: 24
    GracePeriodDto:
      type: object
      properties:
        start:
          $ref: '#/components/schemas/GracePeriodItemDto'
        end:
          $ref: '#/components/schemas/GracePeriodItemDto'
    GracePeriodItemDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - DAYS_BEFORE
            - DAYS_AFTER
            - MONTHS_BEFORE
            - MONTHS_AFTER
            - YEARS_BEFORE
            - YEARS_AFTER
          description: Type of grace period adjustment
          example: DAYS_BEFORE
        value:
          type: integer
          description: Value of the grace period
          example: 30
    QualificationRelationDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - AIRCRAFT
            - AIRPORT
            - AIRPORT_C
            - PILOT_AND_AIRCRAFT
          description: Type of relation
          example: AIRCRAFT
        value:
          type: string
          description: Value of the relation
          example: Boeing 737
    PaginatedQualificationDto:
      type: object
      description: Paginated list of qualifications
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/QualificationDto'
          description: |
            The list of qualifications for the current page.
        pagination:
          $ref: '#/components/schemas/Pagination'
x-original-swagger-version: '2.0'
