{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/entur/json-schema/entur-available-element-with-compartments-response-schema.json",
  "title": "AvailableElementWithCompartmentsResponse",
  "description": "Element (e.g. train carriage) with available seats and/or compartments.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/entur-capacities-controller-api-openapi.yml#/components/schemas/AvailableElementWithCompartmentsResponse",
  "required": [
    "availableCompartments",
    "availableSingleSeats",
    "carriageIdentifier"
  ],
  "type": "object",
  "properties": {
    "carriageIdentifier": {
      "type": "string",
      "description": "Carriage number of the element."
    },
    "availableCompartments": {
      "type": "array",
      "description": "Available compartments in element.",
      "items": {
        "$ref": "#/$defs/AvailableCompartmentResponse"
      }
    },
    "availableSingleSeats": {
      "type": "array",
      "description": "Available single seats in element. These are seats that are not part of a compartment.",
      "items": {
        "$ref": "#/$defs/AvailableSeatResponse"
      }
    }
  },
  "$defs": {
    "AvailableCompartmentResponse": {
      "required": [
        "compartmentName",
        "seats"
      ],
      "type": "object",
      "properties": {
        "compartmentName": {
          "type": "string",
          "description": "Unique name identifying compartment in an element."
        },
        "compartmentLabel": {
          "type": [
            "string",
            "null"
          ],
          "description": "Human-readable label identifying compartment in an element."
        },
        "seats": {
          "type": "array",
          "description": "Seats in compartment.",
          "items": {
            "$ref": "#/$defs/AvailableSeatResponse"
          }
        }
      },
      "description": "Compartment (e.g. Sleeper, Couchette etc.) with available seats."
    },
    "AvailableSeatResponse": {
      "required": [
        "properties",
        "seatNumber"
      ],
      "type": "object",
      "properties": {
        "seatNumber": {
          "type": "string",
          "description": "Seat number of seat."
        },
        "properties": {
          "$ref": "#/$defs/SeatingPropertiesResponseV1"
        }
      },
      "description": "Seat with seatNumber and properties."
    },
    "SeatingPropertiesResponseV1": {
      "type": "object",
      "properties": {
        "fareClass": {
          "type": [
            "string",
            "null"
          ],
          "description": "Fare class of the seat. Netex enumeration.",
          "enum": [
            "UNKNOWN",
            "FIRST_CLASS",
            "SECOND_CLASS",
            "THIRD_CLASS",
            "PREFERENTE",
            "PREMIUM_CLASS",
            "BUSINESS_CLASS",
            "STANDARD_CLASS",
            "TURISTA",
            "ECONOMY_CLASS",
            "ANY"
          ]
        },
        "groupBooking": {
          "type": [
            "string",
            "null"
          ],
          "description": "Group booking permission of the seat. Netex enumeration.",
          "enum": [
            "GROUPS_ALLOWED",
            "GROUPS_NOT_ALLOWED",
            "GROUPS_ALLOWED_WITH_RESERVATION",
            "GROUP_BOOKINGS_RESTRICTED",
            "UNKNOWN"
          ]
        },
        "accommodationFacility": {
          "type": [
            "string",
            "null"
          ],
          "description": "Accommodation property of the seat. Netex enumeration.",
          "enum": [
            "UNKNOWN",
            "SEATING",
            "FOLDING_SEAT",
            "SLEEPER",
            "SINGLE_SLEEPER",
            "DOUBLE_SLEEPER",
            "SPECIAL_SLEEPER",
            "COUCHETTE",
            "SINGLE_COUCHETTE",
            "DOUBLE_COUCHETTE",
            "SPECIAL_SEATING",
            "RECLINING_SEATS",
            "BABY_COMPARTMENT",
            "FAMILY_CARRIAGE",
            "RECREATION_AREA",
            "PANORAMA_COACH",
            "PULLMAN_COACH",
            "PUSHCHAIR",
            "WHEELCHAIR",
            "STANDING"
          ]
        },
        "seatAttachment": {
          "type": [
            "string",
            "null"
          ],
          "description": "Attachment of the seat. Netex enumeration.",
          "enum": [
            "REVERSIBLE",
            "FIXED",
            "FOLDING",
            "REMOVABLE",
            "OTHER"
          ]
        },
        "seatPosition": {
          "type": [
            "string",
            "null"
          ],
          "description": "Position of the seat. Netex enumeration.",
          "enum": [
            "WINDOW",
            "AISLE",
            "MIDDLE",
            "UPPER_BERTH",
            "MIDDLE_BERTH",
            "LOWER_BERTH",
            "OTHER"
          ]
        },
        "relativeDirection": {
          "type": [
            "string",
            "null"
          ],
          "description": "Relative direction of the seat. Netex enumeration.",
          "enum": [
            "BOTH",
            "FORWARDS",
            "BACKWARDS"
          ]
        },
        "nuisanceFacilities": {
          "uniqueItems": true,
          "type": "array",
          "description": "Set of possible nuisance factors of the seat. Netex enumerations.",
          "items": {
            "type": "string",
            "description": "Set of possible nuisance factors of the seat. Netex enumerations.",
            "enum": [
              "UNKNOWN",
              "SMOKING",
              "NO_SMOKING",
              "FAMILY_AREA",
              "CHILDFREE_AREA",
              "ANIMALS_ALLOWED",
              "NO_ANIMALS",
              "BREASTFEEDING_FRIENDLY",
              "MOBILE_PHONE_USE_ZONE",
              "MOBILE_PHONE_FREE_ZONE"
            ]
          }
        },
        "passengerCommsFacilities": {
          "uniqueItems": true,
          "type": "array",
          "description": "Set of possible communication facilities available for passenger in the seat. Netex enumerations.",
          "items": {
            "type": "string",
            "description": "Set of possible communication facilities available for passenger in the seat. Netex enumerations.",
            "enum": [
              "UNKNOWN",
              "FREE_WIFI",
              "PUBLIC_WIFI",
              "POWER_SUPPLY_SOCKETS",
              "TELEPHONE",
              "AUDIO_ENTERTAINMENT",
              "VIDEO_ENTERTAINMENT",
              "BUSINESS_SERVICES",
              "INTERNET",
              "POST_OFFICE",
              "POST_BOX"
            ]
          }
        },
        "sanitaryFacilities": {
          "uniqueItems": true,
          "type": "array",
          "description": "Set of possible sanitary facilities available for passenger in the seat. Netex enumerations.",
          "items": {
            "type": "string",
            "description": "Set of possible sanitary facilities available for passenger in the seat. Netex enumerations.",
            "enum": [
              "NONE",
              "TOILET",
              "WHEELCHAIR_ACCESS_TOILET",
              "SHOWER",
              "WASHING_AND_CHANGE_FACILITIES",
              "BABY_CHANGE",
              "WHEELCHAIR_BABY_CHANGE",
              "SHOE_SHINER",
              "OTHER"
            ]
          }
        },
        "mobilityFacilities": {
          "uniqueItems": true,
          "type": "array",
          "description": "Set of possible mobility facilities available for passenger in the seat. Netex enumerations.",
          "items": {
            "type": "string",
            "description": "Set of possible mobility facilities available for passenger in the seat. Netex enumerations.",
            "enum": [
              "UNKNOWN",
              "LOW_FLOOR",
              "STEP_FREE_ACCESS",
              "SUITABLE_FOR_PUSHCHAIRS",
              "SUITABLE_FOR_WHEELCHAIRS",
              "SUITABLE_FOR_HEAVILIY_DISABLED",
              "BOARDING_ASSISTANCE",
              "ONBOARD_ASSISTANCE",
              "UNACCOMPANIED_MINOR_ASSISTANCE",
              "TACTILE_PLATFORM_EDGES",
              "TACTILE_GUIDING_STRIPS"
            ]
          }
        },
        "baggageType": {
          "uniqueItems": true,
          "type": "array",
          "description": "Set of possible baggage types possible for passenger in the seat. Netex enumerations.",
          "items": {
            "type": "string",
            "description": "Set of possible baggage types possible for passenger in the seat. Netex enumerations.",
            "enum": [
              "HANDBAG",
              "HAND_LUGGAGE",
              "SMALL_SUITCASE",
              "SUITCASE",
              "TRUNK",
              "OVERSIZE_ITEM",
              "BICYCLE",
              "MOTORCYCLE",
              "SPORTING_EQUIPMENT",
              "SKIS",
              "MUSICAL_INSTRUMENT",
              "PUSH_CHAIR",
              "WHEELCHAIR",
              "MOTORIZED_WHEELCHAIR",
              "LARGE_MOTORIZED_WHEELCHAIR",
              "SMALL_ANIMAL",
              "ANIMAL",
              "GAME",
              "OTHER"
            ]
          }
        }
      },
      "description": "Properties of a seat. They describe both physical and logical properties of a seat.Physical properties are for example position of the seat.Logical properties describe properties that the operator use when selling the seat. For example fare class."
    }
  }
}