# Metadata records seed: one record per contract, linked by contract_name and contract_version.
# Canonical shape: ownership (object), lineage (object), domain, runtime (storage_locations, serve, environments), lifecycle, data_quality at root.

- contract_name: example_user_contract
  contract_version: "1.0.0"
  title: example_user_metadata
  version: "1.0.0"
  status: active
  description: Example user contract metadata
  ownership: {}
  lineage: {}
  governance_rules:
    data_retention:
      days: 365
      reason: Standard retention
    sensitivity: internal
    access_control:
      read: [data-team]
      write: [data-team]

- contract_name: example_event_contract
  contract_version: "1.0.0"
  title: example_event_metadata
  version: "1.0.0"
  status: active
  description: Example event contract metadata
  ownership: {}
  lineage: {}
  governance_rules: {}

- contract_name: aircraft_configuration
  contract_version: "1.0.0"
  title: aircraft_configuration_metadata
  version: "1.0.0"
  status: active
  description: Default metadata for Aircraft Configuration
  ownership:
    business_owners: [operations-team]
    bu_sme: []
    it_application_owners: []
    it_sme: []
    support_lead: []
  lineage:
    pulls_from: [NetlineOpsReplica]
    pushes_to: [SCR, Fleetwise]
    system_sources: [NetlineBase]
  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 aircraft configuration records
    pii_fields:
      fields: []
    sensitivity: Internal
    access_control:
      read: [operations-team, data-team]
      write: [operations-team]
    data_feed_association:
      - title: Aircraft Configuration
        type: Operational
    dependencies: [Aircraft, AircraftType, Subfleet, Operator]
    business_rules:
      validity_period:
        description: valid_since must be before valid_until
        enforced: true
      weight_consistency:
        description: max_takeoff_wgt should be >= dry_operating_wgt
        enforced: false
    indexes:
      - cluster: "ioc-de-{env}"
        database: internal
        collection: replica_nlo_aircraft_configuration_serve
        indexes:
          - aircraft_configuration_unique_index:
              registration: 1
              valid_since: 1
              unique: true
              background: true
      - cluster: "ioc-de-{env}"
        database: internal
        collection: replica_nlo_aircraft_configuration_staging
        indexes:
          - aircraft_configuration_unique_index:
              registration: 1
              valid_since: 1
              unique: true
              background: true
  runtime:
    storage_locations: []
    serve:
      api:
        type: GET
        endpoint: "/v1/aircraft-configuration"
        rate_limit: "120/min"
        cache_ttl: 3600
        confluence_page: "https://cathaypacific-prod.atlassian.net/wiki/spaces/DEN/pages/AircraftConfiguration"
        params:
          - name: registration
            in: query
            required: false
            description: Filter by registration
            schema: { type: string }
            example: BLXN
          - name: effective_date
            in: query
            required: false
            description: Filter by effective date in ISO format
            schema: { type: string, format: date-time }
            example: "2025-03-29T00:00:00Z"
    environments: []

- contract_name: airports_and_geographic_information
  contract_version: "1.0.0"
  title: airports_and_geographic_information_metadata
  version: "1.0.0"
  status: active
  description: Default metadata for Airports and Geographic Information
  ownership:
    business_owners: [operations-team]
    bu_sme: []
    it_application_owners: []
    it_sme: []
    support_lead: []
  lineage:
    pulls_from: [NetlineOpsReplica]
    pushes_to: [SCR, Fleetwise]
    system_sources: [NetlineBase]
  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]
    data_feed_association:
      - title: Airports and Geographic Information
        type: Operational
    dependencies: [Airport, City, Country, Runway]
    business_rules:
      validity_period:
        description: valid_since must be before valid_until
        enforced: true
    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
  runtime:
    storage_locations: []
    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
            schema: { type: string, format: date-time }
            example: "2025-03-29T00:00:00Z"
    environments: []

# Domain entity metadata (lifecycle at root; see docs/guides/domain-models-and-lifecycle.md)
- contract_name: order_domain
  contract_version: "1.0.0"
  title: order_domain_metadata
  version: "1.0.0"
  status: active
  type: domain_entity
  description: Order domain entity; lifecycle bound to order_lifecycle FSM
  ownership: {}
  lineage: {}
  lifecycle:
    state_machine_name: order_lifecycle
    machine_version: "1.0.0"
    state_field: status
    entity_id_field: order_id

- contract_name: intraday_signal_domain
  contract_version: "1.0.0"
  title: intraday_signal_domain_metadata
  version: "1.0.0"
  status: active
  type: domain_entity
  description: Intraday signal domain entity; lifecycle bound to intraday_signal_lifecycle FSM
  ownership: {}
  lineage: {}
  lifecycle:
    state_machine_name: intraday_signal_lifecycle
    machine_version: "1.0.0"
    state_field: status
    entity_id_field: signal_id

- contract_name: intraday_session_domain
  contract_version: "1.0.0"
  title: intraday_session_domain_metadata
  version: "1.0.0"
  status: active
  type: domain_entity
  description: Trading session domain entity; lifecycle bound to intraday_trading_session FSM
  ownership: {}
  lineage: {}
  lifecycle:
    state_machine_name: intraday_trading_session
    machine_version: "1.0.0"
    state_field: status
    entity_id_field: session_id

- contract_name: portfolio_domain
  contract_version: "1.0.0"
  title: portfolio_domain_metadata
  version: "1.0.0"
  status: active
  type: domain_entity
  description: Portfolio lifecycle; bound to portfolio_lifecycle FSM
  ownership: {}
  lineage: {}
  lifecycle:
    state_machine_name: portfolio_lifecycle
    machine_version: "1.0.0"
    state_field: status
    entity_id_field: portfolio_id

- contract_name: optimization_cycle_domain
  contract_version: "1.0.0"
  title: optimization_cycle_domain_metadata
  version: "1.0.0"
  status: active
  type: domain_entity
  description: Single optimization-to-execution cycle; bound to optimization_cycle FSM
  ownership: {}
  lineage: {}
  lifecycle:
    state_machine_name: optimization_cycle
    machine_version: "1.0.0"
    state_field: status
    entity_id_field: run_id

- contract_name: flight_domain
  contract_version: "1.0.0"
  title: flight_domain_metadata
  version: "1.0.0"
  status: active
  type: domain_entity
  description: Flight entity; lifecycle bound to flight_lifecycle FSM
  ownership: {}
  lineage: {}
  lifecycle:
    state_machine_name: flight_lifecycle
    machine_version: "1.0.0"
    state_field: status
    entity_id_field: flight_id
