{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sweetsaverfare-com/json-schema/sweetsaverfare-com-sailing-soon-response-schema.json",
  "title": "SailingSoonResponse",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/sweetsaverfare-com-api-openapi.json#/components/schemas/SailingSoonResponse",
  "allOf": [
    {
      "type": "object",
      "required": [
        "observation_id",
        "observed_at",
        "stale_after",
        "freshness_state",
        "source_status",
        "data_source",
        "parser_version",
        "observation_trace_id",
        "fixture_sha",
        "disclaimer"
      ],
      "properties": {
        "observation_id": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "observed_at": {
          "type": "string",
          "format": "date-time"
        },
        "stale_after": {
          "type": "string",
          "format": "date-time"
        },
        "freshness_state": {
          "type": "string",
          "enum": [
            "fresh",
            "stale",
            "expired"
          ]
        },
        "source_status": {
          "type": "string",
          "enum": [
            "ok",
            "missing",
            "provider_queue_active",
            "session_expired",
            "blocked",
            "unknown"
          ]
        },
        "data_source": {
          "type": "string",
          "enum": [
            "demo",
            "fake_worker",
            "fixture",
            "live_provider",
            "schedule_reference"
          ]
        },
        "parser_version": {
          "type": "string"
        },
        "observation_trace_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "fixture_sha": {
          "type": [
            "string",
            "null"
          ]
        },
        "observation_outcome": {
          "type": "string",
          "enum": [
            "verified",
            "partial",
            "unavailable",
            "failed"
          ]
        },
        "disclaimer": {
          "type": "string",
          "const": "Ferry fares can change. Confirm final availability and price directly with BC Ferries before making travel decisions."
        }
      }
    },
    {
      "type": "object",
      "required": [
        "route_id",
        "profile_id",
        "hours",
        "route_advisory",
        "status_refresh",
        "status_demand_id",
        "sailings"
      ],
      "properties": {
        "route_id": {
          "type": "string",
          "enum": [
            "TSA_SWB",
            "SWB_TSA",
            "TSA_DUK",
            "DUK_TSA",
            "TSA_NAN",
            "HSB_NAN",
            "NAN_HSB",
            "SWB_FUL",
            "FUL_SWB",
            "HSB_LNG",
            "LNG_HSB",
            "ERL_SLT",
            "SLT_ERL",
            "CMX_PWR",
            "PWR_CMX"
          ]
        },
        "profile_id": {
          "type": "string",
          "enum": [
            "ADULT_NO_VEHICLE",
            "ADULT_STANDARD_VEHICLE",
            "ADULT_OVERHEIGHT_VEHICLE"
          ]
        },
        "hours": {
          "type": "integer",
          "minimum": 1,
          "maximum": 48
        },
        "route_advisory": {
          "anyOf": [
            {
              "$ref": "#/$defs/RouteAdvisory"
            },
            {
              "type": "null"
            }
          ]
        },
        "status_refresh": {
          "type": "string",
          "enum": [
            "served_from_cache",
            "attached_to_job",
            "queued",
            "waiting_room_active"
          ]
        },
        "status_demand_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "sailings": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SailingSoonRow"
          }
        }
      }
    }
  ],
  "$defs": {
    "FareOption": {
      "allOf": [
        {
          "type": "object",
          "required": [
            "observation_id",
            "observed_at",
            "stale_after",
            "freshness_state",
            "source_status",
            "data_source",
            "parser_version",
            "observation_trace_id",
            "fixture_sha",
            "disclaimer"
          ],
          "properties": {
            "observation_id": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid"
            },
            "observed_at": {
              "type": "string",
              "format": "date-time"
            },
            "stale_after": {
              "type": "string",
              "format": "date-time"
            },
            "freshness_state": {
              "type": "string",
              "enum": [
                "fresh",
                "stale",
                "expired"
              ]
            },
            "source_status": {
              "type": "string",
              "enum": [
                "ok",
                "missing",
                "provider_queue_active",
                "session_expired",
                "blocked",
                "unknown"
              ]
            },
            "data_source": {
              "type": "string",
              "enum": [
                "demo",
                "fake_worker",
                "fixture",
                "live_provider",
                "schedule_reference"
              ]
            },
            "parser_version": {
              "type": "string"
            },
            "observation_trace_id": {
              "type": [
                "string",
                "null"
              ]
            },
            "fixture_sha": {
              "type": [
                "string",
                "null"
              ]
            },
            "observation_outcome": {
              "type": "string",
              "enum": [
                "verified",
                "partial",
                "unavailable",
                "failed"
              ]
            },
            "disclaimer": {
              "type": "string",
              "const": "Ferry fares can change. Confirm final availability and price directly with BC Ferries before making travel decisions."
            }
          }
        },
        {
          "type": "object",
          "required": [
            "fare_family",
            "price_cents",
            "currency",
            "available"
          ],
          "properties": {
            "fare_family": {
              "type": "string",
              "enum": [
                "SAVER",
                "PREPAID",
                "RESERVATION_ONLY",
                "STANDARD"
              ]
            },
            "price_cents": {
              "type": [
                "integer",
                "null"
              ],
              "minimum": 0
            },
            "currency": {
              "type": "string",
              "const": "CAD"
            },
            "available": {
              "type": "boolean"
            },
            "seats_remaining": {
              "type": [
                "integer",
                "null"
              ],
              "minimum": 0
            },
            "price_breakdown": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "label",
                  "price_cents"
                ],
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "price_cents": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 0
                  }
                }
              }
            }
          }
        }
      ]
    },
    "PriceHistoryPoint": {
      "type": "object",
      "required": [
        "observed_at",
        "price_cents"
      ],
      "properties": {
        "departure_time": {
          "type": "string",
          "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
        },
        "observed_at": {
          "type": "string",
          "format": "date-time"
        },
        "price_cents": {
          "type": "integer",
          "minimum": 0
        },
        "fare_options": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "fare_family",
              "price_cents",
              "available"
            ],
            "properties": {
              "fare_family": {
                "type": "string",
                "enum": [
                  "SAVER",
                  "PREPAID",
                  "RESERVATION_ONLY",
                  "STANDARD"
                ]
              },
              "price_cents": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "available": {
                "type": "boolean"
              },
              "price_breakdown": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "label",
                    "price_cents"
                  ],
                  "properties": {
                    "label": {
                      "type": "string"
                    },
                    "price_cents": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        },
        "saver_price_cents": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0
        }
      }
    },
    "RouteAdvisory": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "message",
        "source_url",
        "reviewed_at"
      ],
      "properties": {
        "message": {
          "type": "string"
        },
        "source_url": {
          "type": "string",
          "format": "uri"
        },
        "reviewed_at": {
          "type": "string",
          "format": "date"
        }
      }
    },
    "SailingSoonRow": {
      "allOf": [
        {
          "type": "object",
          "required": [
            "observation_id",
            "observed_at",
            "stale_after",
            "freshness_state",
            "source_status",
            "data_source",
            "parser_version",
            "observation_trace_id",
            "fixture_sha",
            "disclaimer"
          ],
          "properties": {
            "observation_id": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid"
            },
            "observed_at": {
              "type": "string",
              "format": "date-time"
            },
            "stale_after": {
              "type": "string",
              "format": "date-time"
            },
            "freshness_state": {
              "type": "string",
              "enum": [
                "fresh",
                "stale",
                "expired"
              ]
            },
            "source_status": {
              "type": "string",
              "enum": [
                "ok",
                "missing",
                "provider_queue_active",
                "session_expired",
                "blocked",
                "unknown"
              ]
            },
            "data_source": {
              "type": "string",
              "enum": [
                "demo",
                "fake_worker",
                "fixture",
                "live_provider",
                "schedule_reference"
              ]
            },
            "parser_version": {
              "type": "string"
            },
            "observation_trace_id": {
              "type": [
                "string",
                "null"
              ]
            },
            "fixture_sha": {
              "type": [
                "string",
                "null"
              ]
            },
            "observation_outcome": {
              "type": "string",
              "enum": [
                "verified",
                "partial",
                "unavailable",
                "failed"
              ]
            },
            "disclaimer": {
              "type": "string",
              "const": "Ferry fares can change. Confirm final availability and price directly with BC Ferries before making travel decisions."
            }
          }
        },
        {
          "type": "object",
          "required": [
            "sailing_id",
            "route_id",
            "profile_id",
            "travel_date",
            "departure_time",
            "original_departure_time",
            "previous_departure_time",
            "schedule_changed_at",
            "schedule_match_status",
            "actual_departure_time",
            "estimated_departure_time",
            "eta",
            "status_reason",
            "vessel_name",
            "sailing_lifecycle_state",
            "is_bookable",
            "is_past_departure",
            "booking_closed_reason",
            "space_available_percent",
            "space_available_label",
            "status_observed_at",
            "fare",
            "saver_fare",
            "price_history"
          ],
          "properties": {
            "sailing_id": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid"
            },
            "route_id": {
              "type": "string",
              "enum": [
                "TSA_SWB",
                "SWB_TSA",
                "TSA_DUK",
                "DUK_TSA",
                "TSA_NAN",
                "HSB_NAN",
                "NAN_HSB",
                "SWB_FUL",
                "FUL_SWB",
                "HSB_LNG",
                "LNG_HSB",
                "ERL_SLT",
                "SLT_ERL",
                "CMX_PWR",
                "PWR_CMX"
              ]
            },
            "profile_id": {
              "type": "string",
              "enum": [
                "ADULT_NO_VEHICLE",
                "ADULT_STANDARD_VEHICLE",
                "ADULT_OVERHEIGHT_VEHICLE"
              ]
            },
            "travel_date": {
              "type": "string",
              "format": "date"
            },
            "departure_time": {
              "type": [
                "string",
                "null"
              ]
            },
            "original_departure_time": {
              "type": [
                "string",
                "null"
              ]
            },
            "previous_departure_time": {
              "type": [
                "string",
                "null"
              ]
            },
            "schedule_changed_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "schedule_match_status": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "EXACT",
                "INFERRED",
                "AMBIGUOUS",
                null
              ]
            },
            "actual_departure_time": {
              "type": [
                "string",
                "null"
              ]
            },
            "estimated_departure_time": {
              "type": [
                "string",
                "null"
              ]
            },
            "eta": {
              "type": [
                "string",
                "null"
              ]
            },
            "status_reason": {
              "type": [
                "string",
                "null"
              ]
            },
            "vessel_name": {
              "type": [
                "string",
                "null"
              ]
            },
            "sailing_lifecycle_state": {
              "type": "string",
              "enum": [
                "UPCOMING",
                "NOW_TICKETING",
                "DELAYED",
                "DEPARTED",
                "CANCELLED",
                "NO_LONGER_LISTED",
                "NO_MORE_SAILINGS_TODAY",
                "UNKNOWN"
              ]
            },
            "is_bookable": {
              "type": "boolean"
            },
            "is_past_departure": {
              "type": "boolean"
            },
            "booking_closed_reason": {
              "type": [
                "string",
                "null"
              ]
            },
            "space_available_percent": {
              "type": [
                "integer",
                "null"
              ],
              "minimum": 0,
              "maximum": 100
            },
            "space_available_label": {
              "type": [
                "string",
                "null"
              ]
            },
            "reservations_not_checked_in_percent": {
              "type": [
                "integer",
                "null"
              ],
              "minimum": 0,
              "maximum": 100
            },
            "vehicles_checked_in_percent": {
              "type": [
                "integer",
                "null"
              ],
              "minimum": 0,
              "maximum": 100
            },
            "reservation_check_in_opens_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "pending_space_released_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "provider_updated_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "vehicle_capacity_aeq": {
              "type": [
                "integer",
                "null"
              ],
              "minimum": 1
            },
            "estimated_vehicle_spaces_available": {
              "type": [
                "integer",
                "null"
              ],
              "minimum": 0
            },
            "operational_departure_deviation_minutes": {
              "type": [
                "integer",
                "null"
              ]
            },
            "status_observed_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "fare": {
              "anyOf": [
                {
                  "$ref": "#/$defs/FareOption"
                },
                {
                  "type": "null"
                }
              ]
            },
            "saver_fare": {
              "anyOf": [
                {
                  "$ref": "#/$defs/FareOption"
                },
                {
                  "type": "null"
                }
              ]
            },
            "price_history": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/PriceHistoryPoint"
              }
            }
          }
        }
      ]
    }
  }
}