type: object
title: Sector Constraints Info
description: Definition of sector constraints info from snapshots with filtering
version: 1.0.0
properties:
  res_model_id:
    description: Resource Model ID (Default is 1, meaning the concerned model for ops)
    title: Resource Model ID
    type: integer
    default: 1
    examples:
      - 1
    coercion: coerce_to_integer
    validations:
      greater_than_or_equal_to:
        threshold: 0
  constraint_code:
    description: Constraint Code
    title: Constraint Code
    type: string
    examples:
      - "DPS NO B747-8F"
    coercion: coerce_to_string
    validations:
      non_empty_string: null
  flight_carrier:
    description: Flight Carrier code
    title: Flight Carrier
    type: string
    examples:
      - "CX"
    maxLength: 3
    coercion: coerce_to_nullable_string
    validations:
      max_length:
        threshold: 3
  flight_number:
    description: Flight Number
    title: Flight Number
    type: integer
    examples:
      - 251
    coercion: coerce_to_nullable_integer
    validations:
      greater_than_or_equal_to:
        threshold: 0
  day_of_origin:
    description: Day of origin (Date component of flight identifier) in ISO format
    title: Day of Origin
    type: string
    format: date-time
    examples:
      - "2035-12-31T00:00:00Z"
    coercion: coerce_to_datetime
    validations:
      non_empty_string: null
  match_aircraft_type:
    description: Match Aircraft Type
    title: Match Aircraft Type
    type: string
    examples:
      - "74N"
    maxLength: 10
    coercion: coerce_to_nullable_string
  constraint_type:
    description: Type of sector constraint
    title: Constraint Type
    type: string
    enum:
      - "AIRPORT_RESTRICTION"
      - "AIRCRAFT_RESTRICTION"
      - "ROUTE_RESTRICTION"
      - "TIME_RESTRICTION"
      - "OTHER"
    coercion: coerce_to_string
    validations:
      only_allow:
        allowed_values:
          - "AIRPORT_RESTRICTION"
          - "AIRCRAFT_RESTRICTION"
          - "ROUTE_RESTRICTION"
          - "TIME_RESTRICTION"
          - "OTHER"
  constraint_description:
    description: Description of the sector constraint
    title: Constraint Description
    type: string
    coercion: coerce_to_nullable_string
  origin_airport:
    description: Origin airport code
    title: Origin Airport
    type: string
    maxLength: 3
    coercion: coerce_to_nullable_string
  destination_airport:
    description: Destination airport code
    title: Destination Airport
    type: string
    maxLength: 3
    coercion: coerce_to_nullable_string
  effective_date:
    description: Date when the constraint becomes effective
    title: Effective Date
    type: string
    format: date-time
    coercion: coerce_to_datetime
  expiry_date:
    description: Date when the constraint expires
    title: Expiry Date
    type: string
    format: date-time
    coercion: coerce_to_nullable_datetime
  severity:
    description: Severity level of the constraint
    title: Severity
    type: string
    enum:
      - "CRITICAL"
      - "HIGH"
      - "MEDIUM"
      - "LOW"
    coercion: coerce_to_string
    validations:
      only_allow:
        allowed_values:
          - "CRITICAL"
          - "HIGH"
          - "MEDIUM"
          - "LOW"
  record_id:
    description: Unique identifier for the record
    title: Record ID
    type: integer
    coercion: coerce_to_integer
    validations:
      greater_than_or_equal_to:
        threshold: 0
  last_updated:
    description: Timestamp of last update
    title: Last Updated
    type: string
    format: date-time
    coercion: coerce_to_datetime
required:
  - res_model_id
  - constraint_code
  - day_of_origin
  - constraint_type
  - effective_date
  - record_id

