schema:
  type: object
  version: "1.0.0"
  title: Airports and Geographic Information
  properties:
    metadata:
      description: Metadata when the record is processed
      title: Metadata
      type: object
    iata_ap_code:
      description: IATA airport code
      maxLength: 3
      title: IATA AP Code
      type: string
      coercion: coerce_to_string
      validations:
        max_length:
          threshold: 3
        non_empty_string: null
    valid_since:
      description: Valid from date
      format: date-time
      title: Valid Since
      type: string
      coercion: coerce_to_datetime
    valid_until:
      description: Valid until date
      format: date-time
      title: Valid Until
      type: string
      coercion: coerce_to_datetime
    icao_code:
      anyOf:
      - maxLength: 4
        type: string
      - type: 'null'
      default: null
      description: ICAO airport code
      title: ICAO Code
      coercion: coerce_to_nullable_string
      validations:
        max_length:
          threshold: 4
    ap_name:
      description: Airport name
      maxLength: 30
      title: AP Name
      type: string
      coercion: coerce_to_string
      validations:
        max_length:
          threshold: 30
        non_empty_string: null
    country_code:
      description: Country code
      maxLength: 4
      title: Country Code
      type: string
      coercion: coerce_to_string
      validations:
        max_length:
          threshold: 4
        non_empty_string: null
    dst_zone_code:
      description: Daylight saving time zone code
      maxLength: 4
      title: DST Zone Code
      type: string
      coercion: coerce_to_string
      validations:
        max_length:
          threshold: 4
        non_empty_string: null
    area:
      anyOf:
      - maxLength: 3
        type: string
      - type: 'null'
      default: null
      description: Area code
      title: Area
      coercion: coerce_to_nullable_string
      validations:
        max_length:
          threshold: 3
    category:
      description: Airport category
      maxLength: 1
      title: Category
      type: string
      coercion: coerce_to_string
      validations:
        max_length:
          threshold: 1
        non_empty_string: null
    time_zone:
      description: Time zone code
      maxLength: 4
      title: Time Zone
      type: string
      coercion: coerce_to_string
      validations:
        max_length:
          threshold: 4
        non_empty_string: null
    coord_longitude:
      description: Longitude coordinate
      maxLength: 10
      title: Coord Longitude
      type: string
      coercion: coerce_to_string
      validations:
        max_length:
          threshold: 10
        non_empty_string: null
    coord_latitude:
      description: Latitude coordinate
      maxLength: 9
      title: Coord Latitude
      type: string
      coercion: coerce_to_string
      validations:
        max_length:
          threshold: 9
        non_empty_string: null
    external_reference:
      anyOf:
      - maxLength: 10
        type: string
      - type: 'null'
      default: null
      description: External reference
      title: External Reference
      coercion: coerce_to_nullable_string
      validations:
        max_length:
          threshold: 10
    record_id:
      default: 0
      description: Record ID
      title: Record Id
      type: integer
      coercion: coerce_to_integer
    last_update:
      anyOf:
      - format: date-time
        type: string
      - type: 'null'
      default: null
      description: Last update timestamp
      title: Last Update
      coercion: coerce_to_nullable_datetime
    last_update_user_id:
      anyOf:
      - maxLength: 32
        type: string
      - type: 'null'
      default: null
      description: Last update user ID
      title: Last Update User Id
      coercion: coerce_to_nullable_string
      validations:
        max_length:
          threshold: 32
    ap_name_nls:
      anyOf:
      - maxLength: 60
        type: string
      - type: 'null'
      default: null
      description: Airport name in native language
      title: AP Name NLS
      coercion: coerce_to_nullable_string
      validations:
        max_length:
          threshold: 60
    runways:
      description: List of runways at this airport
      items:
        type: object
      title: Runways
      type: array
    subtype_details:
      description: Subtype-specific airport details
      items:
        type: object
      title: Subtype Details
      type: array
    city_info:
      description: City information
      items:
        type: object
      title: City Info
      type: array
    iata_city_code:
      anyOf:
      - type: string
      - type: 'null'
      default: null
      description: IATA city code (from city_info)
      title: IATA City Code
      coercion: coerce_to_nullable_string
    city:
      anyOf:
      - type: string
      - type: 'null'
      default: null
      description: City name (from city_info)
      title: City
      coercion: coerce_to_nullable_string
    state_designator:
      anyOf:
      - type: string
      - type: 'null'
      default: null
      description: State designator (from city_info)
      title: State Designator
      coercion: coerce_to_nullable_string
    country:
      anyOf:
      - type: string
      - type: 'null'
      default: null
      description: Country name
      title: Country
      coercion: coerce_to_nullable_string
    diff_utc_lst:
      anyOf:
      - type: integer
      - type: 'null'
      default: null
      description: Deviation to UTC (signed Minutes)
      title: Diff UTC LST
      coercion: coerce_to_nullable_integer
    diff_lst_dst:
      anyOf:
      - type: integer
      - type: 'null'
      default: null
      description: Deviation from Local Standard Time (signed Minutes)
      title: Diff LST DST
      coercion: coerce_to_nullable_integer
    area_rules:
      anyOf:
      - type: string
      - type: 'null'
      default: null
      description: Area rules categorized by airport, country, and city
      title: Area Rules
      coercion: coerce_to_nullable_json
  required:
  - metadata
  - iata_ap_code
  - valid_since
  - valid_until
  - ap_name
  - country_code
  - dst_zone_code
  - category
  - time_zone
  - coord_longitude
  - coord_latitude
metadata:
  title: Airports and Geographic Information
  status: active
  type: object
  description: Default metadata for Airports and Geographic Information
  validation_title: Airports and Geographic Information
  created_at: '2025-08-28T04:10:45.905705+00:00'
  updated_at: '2025-08-28T04:10:45.905712+00:00'
  created_by: IOC DE
  updated_by: IOC DE
  data_feed_association:
  - title: Airports and Geographic Information
    type: Operational
  pulls_from:
  - NetlineOpsReplica
  pushes_to:
  - SCR
  - Fleetwise
  system_sources:
  - NetlineBase
  dependencies:
  - Airport
  - City
  - Country
  - Runway
  # Ownership - references owner IDs from owners table
  # These will be stored in join tables: metadata_record_business_owners, etc.
  business_owners:
  - operations-team
  bu_sme: []
  it_application_owners: []
  it_sme: []
  domain: NetlineOps configuration
  data_quality:
    accuracy: 0.0
    monitoring_enabled: false
    sla: null
    total_records: 0
    last_updated: '2024-01-01T00:00:00'
  governance_rules:
    data_retention:
      days: 2555
      reason: Regulatory compliance for airport and geographic records
    pii_fields:
      fields: []
    sensitivity: Internal
    access_control:
      read:
      - operations-team
      - data-team
      write:
      - operations-team
  business_rules:
    validity_period:
      description: valid_since must be before valid_until
      enforced: true
  serve:
    api:
      type: GET
      endpoint: /v1/airports-and-geographic-information
      rate_limit: 120/min
      cache_ttl: 3600
      confluence_page: https://cathaypacific-prod.atlassian.net/wiki/spaces/DEN/pages/AirportsAndGeographicInformation
      params:
      - name: iata_ap_code
        in: query
        required: false
        description: Filter by IATA airport code
        schema:
          type: string
        example: HKG
      - name: effective_date
        in: query
        required: false
        description: Filter by effective date in ISO format, default will be request
          timestamp
        example: '2025-03-29T00:00:00Z'
        schema:
          type: string
          format: date-time
  indexes:
  - cluster: ioc-de-{env}
    database: internal
    collection: replica_nlo_airports_and_geographic_information_serve
    indexes:
    - airports_and_geographic_information_unique_index:
        iata_ap_code: 1
        valid_since: 1
      unique: true
      background: true
  - cluster: ioc-de-{env}
    database: internal
    collection: replica_nlo_airports_and_geographic_information_staging
    indexes:
    - airports_and_geographic_information_unique_index:
        iata_ap_code: 1
        valid_since: 1
      unique: true
      background: true
  changelog:
  - version: 1.0.0
    date: '2025-08-28T04:10:45.905715+00:00'
    author: IOC
    type: initial
    changes:
    - 'Initial metadata collected from upstream for: Airports and Geographic Information'
  ownership:
    owner: operations-team
    team: data-engineering
    additional_info: {}
coercion_rules:
  version: "1.0.0"
  rules:
    iata_ap_code: coerce_to_string
    ap_name: coerce_to_string
    country_code: coerce_to_string
    dst_zone_code: coerce_to_string
    category: coerce_to_string
    time_zone: coerce_to_string
    coord_longitude: coerce_to_string
    coord_latitude: coerce_to_string
    valid_since: coerce_to_datetime
    valid_until: coerce_to_datetime
    last_update: coerce_to_nullable_datetime
    record_id: coerce_to_integer
    icao_code: coerce_to_nullable_string
    area: coerce_to_nullable_string
    external_reference: coerce_to_nullable_string
    last_update_user_id: coerce_to_nullable_string
    ap_name_nls: coerce_to_nullable_string
    iata_city_code: coerce_to_nullable_string
    city: coerce_to_nullable_string
    state_designator: coerce_to_nullable_string
    country: coerce_to_nullable_string
    diff_utc_lst: coerce_to_nullable_integer
    diff_lst_dst: coerce_to_nullable_integer
validation_rules:
  version: "1.0.0"
  rules:
    iata_ap_code:
      max_length: { threshold: 3 }
      non_empty_string: null
    ap_name:
      max_length: { threshold: 30 }
      non_empty_string: null
    country_code:
      max_length: { threshold: 4 }
      non_empty_string: null
    dst_zone_code:
      max_length: { threshold: 4 }
      non_empty_string: null
    category:
      max_length: { threshold: 1 }
      non_empty_string: null
    time_zone:
      max_length: { threshold: 4 }
      non_empty_string: null
    coord_longitude:
      max_length: { threshold: 10 }
      non_empty_string: null
    coord_latitude:
      max_length: { threshold: 9 }
      non_empty_string: null
    icao_code:
      max_length: { threshold: 4 }
    area:
      max_length: { threshold: 3 }
    external_reference:
      max_length: { threshold: 10 }
    last_update_user_id:
      max_length: { threshold: 32 }
    ap_name_nls:
      max_length: { threshold: 60 }
versions:
  schema: "1.0.0"
  coercion_rules: "1.0.0"
  validation_rules: "1.0.0"
  metadata: "1.0.0"

