# Validation rules seed: one record per contract, linked by contract_name and contract_version.

- contract_name: example_user_contract
  contract_version: "1.0.0"
  title: example_user_validation
  version: "1.0.0"
  description: null
  rules:
    user_id:
      non_empty_string: null
    name:
      non_empty_string: null
      max_length:
        threshold: 100
    email:
      is_email: null
    status:
      only_allow:
        allowed_values: [active, inactive, pending]

- contract_name: example_event_contract
  contract_version: "1.0.0"
  title: example_event_validation
  version: "1.0.0"
  description: null
  rules:
    event_id:
      non_empty_string: null
    event_type:
      non_empty_string: null

- contract_name: aircraft_configuration
  contract_version: "1.0.0"
  title: aircraft_configuration_validation
  version: "1.0.0"
  description: Validation rules for Aircraft Configuration dataset
  rules:
    registration:
      max_length: { threshold: 10 }
      non_empty_string: null
    ac_operator:
      max_length: { threshold: 3 }
      non_empty_string: null
    ac_owner:
      max_length: { threshold: 3 }
      non_empty_string: null
    ac_subtype:
      max_length: { threshold: 3 }
      non_empty_string: null
    ac_state:
      only_allow:
        allowed_values: [R, O]
    std_version:
      max_length: { threshold: 20 }
      non_empty_string: null
    ap_restriction:
      max_length: { threshold: 1 }
      non_empty_string: null
    ac_owner_name:
      max_length: { threshold: 30 }
      non_empty_string: null
    ac_subtype_name:
      max_length: { threshold: 30 }
      non_empty_string: null
    ac_category:
      max_length: { threshold: 1 }
      non_empty_string: null
    fuel_measure_unit:
      max_length: { threshold: 3 }
      non_empty_string: null
    ils_equipment:
      only_allow:
        allowed_values: [I, II, IIIa, IIIb]
    autoland:
      only_allow:
        allowed_values: [Y, N]
    dry_operating_wgt:
      greater_than_or_equal_to: { threshold: 0 }
    max_takeoff_wgt:
      greater_than_or_equal_to: { threshold: 0 }
    cargo_capacity:
      greater_than_or_equal_to: { threshold: 0 }
    fuel_capacity:
      greater_than_or_equal_to: { threshold: 0 }
    avg_fuel_consump:
      greater_than_or_equal_to: { threshold: 0 }
    crewsize_cockpit:
      greater_than_or_equal_to: { threshold: 0 }
    crewsize_cabin:
      greater_than_or_equal_to: { threshold: 0 }
    noise:
      greater_than_or_equal_to: { threshold: 0 }
    remark:
      max_length: { threshold: 80 }
    ac_callsign:
      max_length: { threshold: 5 }
    radio:
      max_length: { threshold: 1 }
    phone:
      max_length: { threshold: 20 }
    special_equipment:
      max_length: { threshold: 40 }
    acars:
      only_allow:
        allowed_values: [V, H, S]
    alt_reg:
      max_length: { threshold: 10 }
    last_update_user_id:
      max_length: { threshold: 32 }
    std_version_alt_1:
      max_length: { threshold: 20 }
    std_version_alt_2:
      max_length: { threshold: 20 }
    std_version_alt_3:
      max_length: { threshold: 20 }
    std_version_alt_4:
      max_length: { threshold: 20 }
    homebase:
      max_length: { threshold: 3 }

- contract_name: airports_and_geographic_information
  contract_version: "1.0.0"
  title: airports_and_geographic_information_validation
  version: "1.0.0"
  description: Validation rules for Airports and Geographic Information dataset
  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 }

# Domain entity validation (minimal; status enum enforced by schema)
- contract_name: order_domain
  contract_version: "1.0.0"
  title: order_domain_validation
  version: "1.0.0"
  description: Order domain entity validation
  rules:
    order_id: { non_empty_string: null }
    symbol: { non_empty_string: null }
    side: { only_allow: { allowed_values: [buy, sell] } }
    quantity: { greater_than_or_equal_to: { threshold: 0 } }
    status: { non_empty_string: null }

- contract_name: intraday_signal_domain
  contract_version: "1.0.0"
  title: intraday_signal_domain_validation
  version: "1.0.0"
  description: Intraday signal domain validation
  rules:
    signal_id: { non_empty_string: null }
    symbol: { non_empty_string: null }
    status: { non_empty_string: null }

- contract_name: intraday_session_domain
  contract_version: "1.0.0"
  title: intraday_session_domain_validation
  version: "1.0.0"
  description: Intraday session domain validation
  rules:
    session_id: { non_empty_string: null }
    status: { non_empty_string: null }

- contract_name: portfolio_domain
  contract_version: "1.0.0"
  title: portfolio_domain_validation
  version: "1.0.0"
  description: Portfolio domain validation
  rules:
    portfolio_id: { non_empty_string: null }
    status: { non_empty_string: null }

- contract_name: optimization_cycle_domain
  contract_version: "1.0.0"
  title: optimization_cycle_domain_validation
  version: "1.0.0"
  description: Optimization cycle domain validation
  rules:
    run_id: { non_empty_string: null }
    status: { non_empty_string: null }

- contract_name: flight_domain
  contract_version: "1.0.0"
  title: flight_domain_validation
  version: "1.0.0"
  description: Flight domain validation
  rules:
    flight_id: { non_empty_string: null }
    origin: { non_empty_string: null }
    destination: { non_empty_string: null }
    status: { non_empty_string: null }
