syntax = "proto3";

package worldmonitor.aviation.v1;

import "buf/validate/validate.proto";
import "sebuf/http/annotations.proto";
import "worldmonitor/aviation/v1/flight_instance.proto";

// GetFlightStatusRequest specifies a flight to look up.
message GetFlightStatusRequest {
  // IATA flight number (e.g., "TK1952").
  string flight_number = 1 [
    (sebuf.http.query) = { name: "flight_number" },
    (buf.validate.field).required = true,
    (buf.validate.field).string.min_len = 3,
    (buf.validate.field).string.max_len = 10
  ];
  // Departure date in ISO 8601 format (e.g., "2026-03-05").
  string date = 2 [
    (sebuf.http.query) = { name: "date" },
    (buf.validate.field).required = true,
    (buf.validate.field).string.len = 10
  ];
  // Optional origin airport IATA code to disambiguate.
  string origin = 3 [(sebuf.http.query) = { name: "origin" }];
}

// GetFlightStatusResponse contains flight status results.
message GetFlightStatusResponse {
  // Matching flight instances (may include codeshares).
  repeated FlightInstance flights = 1;
  // Data source identifier.
  string source = 2;
  // Whether the response was served from cache.
  bool cache_hit = 3;
}
