# MEL to Constraints Info Metadata
# Complete metadata definition for MEL to Constraints Info dataset

# Basic Information
title: MEL to Constraints Info
version: 1.0.0
status: active
type: object
description: Mappings of MEL-Item ATA Code to constraints information for operational configuration
validation_title: MEL to Constraints Info

# Audit Information
created_at: '2025-01-15T00:00:00+00:00'
updated_at: '2025-01-15T00:00:00+00:00'
created_by: spicoc@cathaypacific.com
updated_by: spicoc@cathaypacific.com

# Data Feed Information
data_feed_association:
  - title: MEL to Constraints Info
    type: Operational

# Data Lineage
pulls_from:
  - "NetlineOpsReplica"
pushes_to:
  - "SCR"
  - "Fleetwise"
system_sources:
  - "NetlineBase"
dependencies:
  - "MEL"
  - "Aircraft"
  - "Constraints"

# Business Context
# Ownership - references owner IDs from owners table
business_owners:
  - "andrew_baird@cathaypacific.com"
bu_sme:
  - "lincoln_mak@cathaypacific.com"
it_application_owners:
  - "ken_tong@cathaypacific.com"
it_sme:
  - "mimi_chu@cathaypacific.com"
domain: "IOC"

# Data Quality
data_quality:
  accuracy: 0.0
  monitoring_enabled: false
  sla: null
  total_records: 0
  last_updated: '2024-01-01T00:00:00'

# Governance Rules
governance_rules:
  data_retention:
    days: 2555
    reason: Regulatory compliance for MEL and constraints records
  pii_fields:
    fields: []
  sensitivity: Internal
  access_control:
    read:
      - operations-team
      - data-team
    write:
      - operations-team

# Business Rules
business_rules:
  validity_period:
    description: effective_date must be before expiry_date if expiry_date is set
    enforced: true
  ata_code_consistency:
    description: ATA chapter, subchapter, section, and item must form a valid ATA code
    enforced: true

# API Serve Configuration
serve:
  api:
    type: GET
    endpoint: "/ioc-de-api/v1/snapshots/operational-configs/mel-to-constraints-info"
    rate_limit: "120/min"
    cache_ttl: 3600
    confluence_page: "https://cathaypacific-prod.atlassian.net/wiki/spaces/DEN/pages/MELToConstraintsInfo"
    params:
      - name: "ata_chapter"
        in: query
        required: false
        description: ATA encoding for the MEL-Item
        schema:
          type: "string"
        example: "21"
      - name: "ata_subchapter"
        in: query
        required: false
        description: ATA encoding for the MEL-Item
        schema:
          type: "string"
        example: "51"
      - name: "ata_section"
        in: query
        required: false
        description: ATA encoding for the MEL-Item
        schema:
          type: "string"
        example: "01"
      - name: "ata_item"
        in: query
        required: false
        description: ATA Item code
        schema:
          type: "string"
      - name: "ac_owner"
        in: query
        required: false
        description: Aircraft Owner code
        schema:
          type: "string"
        example: "CX"
      - name: "ac_subtype"
        in: query
        required: false
        description: Aircraft Subtype code
        schema:
          type: "string"
        example: "32P"

# Database Indexes
indexes:
  - cluster: ioc-de-{env}
    database: internal
    collection: mel_to_constraints_info
    indexes:
      - mel_constraints_unique_index:
          ata_chapter: 1
          ata_subchapter: 1
          ata_section: 1
          ata_item: 1
          ac_owner: 1
          ac_subtype: 1
        unique: true
        background: true

