<?php

use App\Models\Achievement;
use App\Models\Aircraft;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    protected array $aircraft_codes = [
        '100' => ['icao' => 'F100',  'description' => 'Fokker 100',                                                                         'wtc' => 'M'],
        '141' => ['icao' => 'B461',  'description' => 'BAe 146-100 Pax',                                                                    'wtc' => 'M'],
        '142' => ['icao' => 'B462',  'description' => 'BAe 146-200 Pax',                                                                    'wtc' => 'M'],
        '143' => ['icao' => 'B463',  'description' => 'BAe 146-300 Pax',                                                                    'wtc' => 'M'],
        '146' => ['icao' => '',      'description' => 'BAe 146 all pax models',                                                             'wtc' => 'M'],
        '14F' => ['icao' => '',      'description' => 'BAe 146 Freighter (-100/200/300QT & QC)',                                            'wtc' => 'M'],
        '14X' => ['icao' => 'B461',  'description' => 'BAe 146 Freighter (-100QT & QC)',                                                    'wtc' => 'M'],
        '14Y' => ['icao' => 'B462',  'description' => 'BAe 146 Freighter (-200QT & QC)',                                                    'wtc' => 'M'],
        '14Z' => ['icao' => 'B463',  'description' => 'BAe 146 Freighter (-200QT & QC)',                                                    'wtc' => 'M'],
        '290' => ['icao' => 'E290',  'description' => 'Embraer E190-E2',                                                                    'wtc' => 'M'],
        '295' => ['icao' => 'E295',  'description' => 'Embraer E195-E2',                                                                    'wtc' => 'M'],
        '221' => ['icao' => 'BCS1',  'description' => 'Airbus A220-100',                                                                    'wtc' => 'M'],
        '223' => ['icao' => 'BCS3',  'description' => 'Airbus A220-200',                                                                    'wtc' => 'M'],
        '310' => ['icao' => 'A310',  'description' => 'Airbus A310 all pax models',                                                         'wtc' => 'H'],
        '312' => ['icao' => 'A310',  'description' => 'Airbus A310-200 pax',                                                                'wtc' => 'H'],
        '313' => ['icao' => 'A310',  'description' => 'Airbus A310-300 pax',                                                                'wtc' => 'H'],
        '318' => ['icao' => 'A318',  'description' => 'Airbus A318',                                                                        'wtc' => 'M'],
        '319' => ['icao' => 'A319',  'description' => 'Airbus A319 Ceo',                                                                    'wtc' => 'M'],
        '31F' => ['icao' => 'A310',  'description' => 'Airbus A310 Freighter',                                                              'wtc' => 'M'],
        '31N' => ['icao' => 'A19N',  'description' => 'Airbus A319 Neo',                                                                    'wtc' => 'M'],
        '31X' => ['icao' => 'A310',  'description' => 'Airbus A310-200 Freighter',                                                          'wtc' => 'M'],
        '31Y' => ['icao' => 'A310',  'description' => 'Airbus A310-300 Freighter',                                                          'wtc' => 'M'],
        '320' => ['icao' => 'A320',  'description' => 'Airbus A320-100/200 Ceo',                                                            'wtc' => 'M'],
        '321' => ['icao' => 'A321',  'description' => 'Airbus A321-100/200 Ceo',                                                            'wtc' => 'M'],
        '32A' => ['icao' => 'A320',  'description' => 'Airbus A320-200 Ceo (Sharklets)',                                                    'wtc' => 'M'],
        '32C' => ['icao' => 'A318',  'description' => 'Airbus A318 (Sharklets)',                                                            'wtc' => 'M'],
        '32D' => ['icao' => 'A319',  'description' => 'Airbus A319 Ceo (Sharklets)',                                                        'wtc' => 'M'],
        '32N' => ['icao' => 'A20N',  'description' => 'Airbus A320-200 Neo',                                                                'wtc' => 'M'],
        '32Q' => ['icao' => 'A21N',  'description' => 'Airbus A321-200 Neo',                                                                'wtc' => 'M'],
        '32S' => ['icao' => 'n/a',   'description' => 'Airbus A318/319/320/321',                                                            'wtc' => 'M'],
        '330' => ['icao' => 'A330',  'description' => 'Airbus A330 all models',                                                             'wtc' => 'H'],
        '332' => ['icao' => 'A332',  'description' => 'Airbus A330-200',                                                                    'wtc' => 'H'],
        '333' => ['icao' => 'A333',  'description' => 'Airbus A330-300',                                                                    'wtc' => 'H'],
        '338' => ['icao' => 'A338',  'description' => 'Airbus A330-800 Neo',                                                                'wtc' => 'H'],
        '339' => ['icao' => 'A339',  'description' => 'Airbus A330-900 Neo',                                                                'wtc' => 'H'],
        '33X' => ['icao' => 'A332',  'description' => 'Airbus A330-200 Freighter',                                                          'wtc' => 'H'],
        '340' => ['icao' => 'A340',  'description' => 'Airbus A340 all models',                                                             'wtc' => 'H'],
        '342' => ['icao' => 'A342',  'description' => 'Airbus A340-200',                                                                    'wtc' => 'H'],
        '343' => ['icao' => 'A343',  'description' => 'Airbus A340-300',                                                                    'wtc' => 'H'],
        '345' => ['icao' => 'A345',  'description' => 'Airbus A340-500',                                                                    'wtc' => 'H'],
        '346' => ['icao' => 'A346',  'description' => 'Airbus A340-600',                                                                    'wtc' => 'H'],
        '351' => ['icao' => 'A35K',  'description' => 'Airbus A350-1000',                                                                   'wtc' => 'H'],
        '359' => ['icao' => 'A359',  'description' => 'Airbus A350-900',                                                                    'wtc' => 'H'],
        '380' => ['icao' => 'A388',  'description' => 'Airbus A380 pax',                                                                    'wtc' => 'J'],
        '38F' => ['icao' => '',      'description' => 'Airbus A380 Freighter',                                                              'wtc' => 'J'],
        '703' => ['icao' => 'B703',  'description' => 'Boeing 707-300 pax',                                                                 'wtc' => 'H'],
        '707' => ['icao' => 'n/a',   'description' => 'Boeing 707/720 all pax models',                                                      'wtc' => 'H'],
        '70F' => ['icao' => 'B703',  'description' => 'Boeing 707 Freighter',                                                               'wtc' => 'H'],
        '70M' => ['icao' => 'B703',  'description' => 'Boeing 707 Combi',                                                                   'wtc' => 'H'],
        '717' => ['icao' => 'B712',  'description' => 'Boeing 717',                                                                         'wtc' => 'M'],
        '721' => ['icao' => 'B721',  'description' => 'Boeing 727-100 pax',                                                                 'wtc' => 'M'],
        '722' => ['icao' => 'B722',  'description' => 'Boeing 727-200 pax',                                                                 'wtc' => 'M'],
        '727' => ['icao' => 'n/a',   'description' => 'Boeing 727 all pax models',                                                          'wtc' => 'M'],
        '72B' => ['icao' => 'B721',  'description' => 'Boeing 727-100 Mixed Configuration',                                                 'wtc' => 'M'],
        '72C' => ['icao' => 'B722',  'description' => 'Boeing 727-200 Mixed Configuration',                                                 'wtc' => 'M'],
        '72F' => ['icao' => 'n/a',   'description' => 'Boeing 727 Freighter (-100/200)',                                                    'wtc' => 'M'],
        '72M' => ['icao' => 'n/a',   'description' => 'Boeing 727 Combi',                                                                   'wtc' => 'M'],
        '72S' => ['icao' => 'B722',  'description' => 'Boeing 727-200 Advanced pax',                                                        'wtc' => 'M'],
        '72W' => ['icao' => 'B721',  'description' => 'Boeing 727-200 (winglets) pax',                                                      'wtc' => 'M'],
        '72X' => ['icao' => 'B721',  'description' => 'Boeing 727-100 Freighter',                                                           'wtc' => 'M'],
        '72Y' => ['icao' => 'B722',  'description' => 'Boeing 727-200 Freighter',                                                           'wtc' => 'M'],
        '731' => ['icao' => 'B731',  'description' => 'Boeing 737-100 pax',                                                                 'wtc' => 'M'],
        '732' => ['icao' => 'B732',  'description' => 'Boeing 737-200 pax',                                                                 'wtc' => 'M'],
        '733' => ['icao' => 'B733',  'description' => 'Boeing 737-300 pax',                                                                 'wtc' => 'M'],
        '734' => ['icao' => 'B734',  'description' => 'Boeing 737-400 pax',                                                                 'wtc' => 'M'],
        '735' => ['icao' => 'B735',  'description' => 'Boeing 737-500 pax',                                                                 'wtc' => 'M'],
        '736' => ['icao' => 'B736',  'description' => 'Boeing 737-600 pax',                                                                 'wtc' => 'M'],
        '737' => ['icao' => 'n/a',   'description' => 'Boeing 737 all pax models',                                                          'wtc' => 'M'],
        '738' => ['icao' => 'B738',  'description' => 'Boeing 737-800 pax',                                                                 'wtc' => 'M'],
        '739' => ['icao' => 'B739',  'description' => 'Boeing 737-900 pax',                                                                 'wtc' => 'M'],
        '73C' => ['icao' => 'B733',  'description' => 'Boeing 737-300 (winglets) pax',                                                      'wtc' => 'M'],
        '73E' => ['icao' => 'B735',  'description' => 'Boeing 737-500 (winglets) pax',                                                      'wtc' => 'M'],
        '73F' => ['icao' => 'n/a',   'description' => 'Boeing 737 all Freighter models',                                                    'wtc' => 'M'],
        '73G' => ['icao' => 'B737',  'description' => 'Boeing 737-700 pax',                                                                 'wtc' => 'M'],
        '73H' => ['icao' => 'B738',  'description' => 'Boeing 737-800 (winglets) pax',                                                      'wtc' => 'M'],
        '73J' => ['icao' => 'B739',  'description' => 'Boeing 737-900 (winglets) pax',                                                      'wtc' => 'M'],
        '73L' => ['icao' => 'B732',  'description' => 'Boeing 737-200 Combi',                                                               'wtc' => 'M'],
        '73M' => ['icao' => 'n/a',   'description' => 'Boeing 737 Combi',                                                                   'wtc' => 'M'],
        '73P' => ['icao' => 'B734',  'description' => 'Boeing 737-400 Freighter',                                                           'wtc' => 'M'],
        '73Q' => ['icao' => 'B734',  'description' => 'Boeing 737-400 Combi',                                                               'wtc' => 'M'],
        '73R' => ['icao' => 'B737',  'description' => 'Boeing 737-700 Combi',                                                               'wtc' => 'M'],
        '73W' => ['icao' => 'B737',  'description' => 'Boeing 737-700 (winglets) pax',                                                      'wtc' => 'M'],
        '73X' => ['icao' => 'B732',  'description' => 'Boeing 737-200 Freighter',                                                           'wtc' => 'M'],
        '73Y' => ['icao' => 'B733',  'description' => 'Boeing 737-300 Freighter',                                                           'wtc' => 'M'],
        '741' => ['icao' => 'B741',  'description' => 'Boeing 747-100 pax',                                                                 'wtc' => 'H'],
        '742' => ['icao' => 'B742',  'description' => 'Boeing 747-200 pax',                                                                 'wtc' => 'H'],
        '743' => ['icao' => 'B743',  'description' => 'Boeing 747-300 pax',                                                                 'wtc' => 'H'],
        '744' => ['icao' => 'B744',  'description' => 'Boeing 747-400 pax',                                                                 'wtc' => 'H'],
        '747' => ['icao' => 'n/a',   'description' => 'Boeing 747 all pax models',                                                          'wtc' => 'H'],
        '748' => ['icao' => 'B748',  'description' => 'Boeing 747-8 pax',                                                                   'wtc' => 'H'],
        '74B' => ['icao' => 'B744',  'description' => 'Boeing 747-400 Swingtail Freighter',                                                 'wtc' => 'H'],
        '74C' => ['icao' => 'B742',  'description' => 'Boeing 747-200 Combi',                                                               'wtc' => 'H'],
        '74D' => ['icao' => 'B743',  'description' => 'Boeing 747-300 Combi',                                                               'wtc' => 'H'],
        '74E' => ['icao' => 'B744',  'description' => 'Boeing 747-400 Combi',                                                               'wtc' => 'H'],
        '74F' => ['icao' => 'n/a',   'description' => 'Boeing 747 all Freighter models',                                                    'wtc' => 'H'],
        '74H' => ['icao' => 'n/a',   'description' => 'Boeing 747-8I Passenger',                                                            'wtc' => 'H'],
        '74J' => ['icao' => 'B744',  'description' => 'Boeing 747-400 (Domestic) pax',                                                      'wtc' => 'H'],
        '74L' => ['icao' => 'B74S',  'description' => 'Boeing 747SP',                                                                       'wtc' => 'H'],
        '74M' => ['icao' => 'n/a',   'description' => 'Boeing 747 all Combi models',                                                        'wtc' => 'H'],
        '74N' => ['icao' => 'n/a',   'description' => 'Boeing 747-8F',                                                                      'wtc' => 'H'],
        '74R' => ['icao' => 'B74R',  'description' => 'Boeing 747SR pax',                                                                   'wtc' => 'H'],
        '74T' => ['icao' => 'B741',  'description' => 'Boeing 747-100 Freighter',                                                           'wtc' => 'H'],
        '74U' => ['icao' => 'B743',  'description' => 'Boeing 747-300 / 747-200 SUD Freighter',                                             'wtc' => 'H'],
        '74V' => ['icao' => 'B74R',  'description' => 'Boeing 747SR Freighter',                                                             'wtc' => 'H'],
        '74X' => ['icao' => 'B742',  'description' => 'Boeing 747-200 Freighter',                                                           'wtc' => 'H'],
        '74Y' => ['icao' => 'B744',  'description' => 'Boeing 747-400 Freighter',                                                           'wtc' => 'H'],
        '752' => ['icao' => 'B752',  'description' => 'Boeing 757-200 pax',                                                                 'wtc' => 'H'],
        '753' => ['icao' => 'B753',  'description' => 'Boeing 757-300 pax',                                                                 'wtc' => 'H'],
        '757' => ['icao' => 'n/a',   'description' => 'Boeing 757 all pax models',                                                          'wtc' => 'H'],
        '75F' => ['icao' => 'B752',  'description' => 'Boeing 757 Freighter',                                                               'wtc' => 'H'],
        '75M' => ['icao' => 'B752',  'description' => 'Boeing 757 Mixed Configuration',                                                     'wtc' => 'H'],
        '75T' => ['icao' => 'B753',  'description' => 'Boeing 757-300 (winglets) pax',                                                      'wtc' => 'H'],
        '75W' => ['icao' => 'B752',  'description' => 'Boeing 757-200 (winglets) pax',                                                      'wtc' => 'H'],
        '762' => ['icao' => 'B762',  'description' => 'Boeing 767-200 pax',                                                                 'wtc' => 'H'],
        '763' => ['icao' => 'B763',  'description' => 'Boeing 767-300 pax',                                                                 'wtc' => 'H'],
        '764' => ['icao' => 'B764',  'description' => 'Boeing 767-400 pax',                                                                 'wtc' => 'H'],
        '767' => ['icao' => 'n/a',   'description' => 'Boeing 767 all pax models',                                                          'wtc' => 'H'],
        '76F' => ['icao' => 'n/a',   'description' => 'Boeing 767 all Freighter models',                                                    'wtc' => 'H'],
        '76W' => ['icao' => 'B763',  'description' => 'Boeing 767-300 (winglets) pax',                                                      'wtc' => 'H'],
        '76V' => ['icao' => 'B763',  'description' => 'Boeing 767-300 (winglets) Freighter',                                                'wtc' => 'H'],
        '76X' => ['icao' => 'B762',  'description' => 'Boeing 767-200 Freighter',                                                           'wtc' => 'H'],
        '76Y' => ['icao' => 'B763',  'description' => 'Boeing 767-300 Freighter',                                                           'wtc' => 'H'],
        '772' => ['icao' => 'B772',  'description' => 'Boeing 777-200 pax',                                                                 'wtc' => 'H'],
        '773' => ['icao' => 'B773',  'description' => 'Boeing 777-300 pax',                                                                 'wtc' => 'H'],
        '777' => ['icao' => 'n/a',   'description' => 'Boeing 777 all pax models',                                                          'wtc' => 'H'],
        '77F' => ['icao' => 'n/a',   'description' => 'Boeing 777 Freighter',                                                               'wtc' => 'H'],
        '77L' => ['icao' => 'B772',  'description' => 'Boeing 777-200LR pax',                                                               'wtc' => 'H'],
        '77W' => ['icao' => 'B77W',  'description' => 'Boeing 777-300ER pax',                                                               'wtc' => 'H'],
        '77X' => ['icao' => 'B77L',  'description' => 'Boeing 777-200 Freighter',                                                           'wtc' => 'H'],
        '781' => ['icao' => 'B78X',  'description' => 'Boeing 787-10 pax',                                                                  'wtc' => 'H'],
        '788' => ['icao' => 'B788',  'description' => 'Boeing 787-8 pax',                                                                   'wtc' => 'H'],
        '789' => ['icao' => 'B789',  'description' => 'Boeing 787-9 pax',                                                                   'wtc' => 'H'],
        '7M7' => ['icao' => 'B37M',  'description' => 'Boeing 737 MAX 7 pax',                                                               'wtc' => 'M'],
        '7M8' => ['icao' => 'B38M',  'description' => 'Boeing 737 MAX 8 pax',                                                               'wtc' => 'M'],
        '7M9' => ['icao' => 'B39M',  'description' => 'Boeing 737 MAX 9 pax',                                                               'wtc' => 'M'],
        '7MJ' => ['icao' => 'B3XM',  'description' => 'Boeing 737 MAX 10 pax',                                                              'wtc' => 'M'],
        'A22' => ['icao' => 'AN22',  'description' => 'Antonov AN-22',                                                                      'wtc' => 'L'],
        'A26' => ['icao' => 'AN26',  'description' => 'Antonov AN-26',                                                                      'wtc' => 'L'],
        'A28' => ['icao' => 'AN28',  'description' => 'Antonov AN-28 / PZL Miele M-28 Skytruck',                                            'wtc' => 'L'],
        'A30' => ['icao' => 'AN30',  'description' => 'Antonov AN-30',                                                                      'wtc' => 'L'],
        'A32' => ['icao' => 'AN32',  'description' => 'Antonov AN-32',                                                                      'wtc' => 'L'],
        'A38' => ['icao' => 'AN38',  'description' => 'Antonov AN-38',                                                                      'wtc' => 'L'],
        'A40' => ['icao' => 'A140',  'description' => 'Antonov AN-140',                                                                     'wtc' => 'M'],
        'A4F' => ['icao' => 'A124',  'description' => 'Antonov AN-124 Ruslan',                                                              'wtc' => 'H'],
        'A5F' => ['icao' => 'A225',  'description' => 'Antonov AN-225',                                                                     'wtc' => 'H'],
        'A81' => ['icao' => 'A148',  'description' => 'Antonov AN-148-100',                                                                 'wtc' => 'M'],
        'AB3' => ['icao' => 'A30B',  'description' => 'Airbus Industrie A300 pax',                                                          'wtc' => 'H'],
        'AB4' => ['icao' => 'A30B',  'description' => 'Airbus Industrie A300B2/B4/C4 pax',                                                  'wtc' => 'H'],
        'AB6' => ['icao' => 'A306',  'description' => 'Airbus Industrie A300-600 pax',                                                      'wtc' => 'H'],
        'ABB' => ['icao' => 'A3ST',  'description' => 'Airbus Industrie A300-600ST Beluga Freighter',                                       'wtc' => 'H'],
        'ABF' => ['icao' => 'A30B',  'description' => 'Airbus Industrie A300 Freighter',                                                    'wtc' => 'H'],
        'ABX' => ['icao' => 'A30B',  'description' => 'Airbus Industrie A300C4/F4 Freighter',                                               'wtc' => 'H'],
        'ABY' => ['icao' => 'A306',  'description' => 'Airbus Industrie A300-600 Freighter',                                                'wtc' => 'H'],
        'ACD' => ['icao' => 'n/a',   'description' => 'Gulfstream/Rockwell (Aero) Commander/Turbo Commander',                               'wtc' => 'L'],
        'ACP' => ['icao' => 'AC68',  'description' => 'Gulfstream/Rockwell (Aero) Commander',                                               'wtc' => 'L'],
        'ACT' => ['icao' => 'AC90',  'description' => 'Gulfstream/Rockwell (Aero) Turbo Commander',                                         'wtc' => 'L'],
        'AGH' => ['icao' => 'A109',  'description' => 'Agusta A109',                                                                        'wtc' => 'n/a'],
        'ALM' => ['icao' => 'LOAD',  'description' => 'Ayres LM-200 Loadmaster',                                                            'wtc' => 'M'],
        'AN4' => ['icao' => 'AN24',  'description' => 'Antonov AN-24',                                                                      'wtc' => 'M'],
        'AN6' => ['icao' => 'n/a',   'description' => 'Antonov AN-26 / AN-30 / AN-32',                                                      'wtc' => 'M'],
        'AN7' => ['icao' => 'AN72',  'description' => 'Antonov AN-72 / AN-74',                                                              'wtc' => 'M'],
        'ANF' => ['icao' => 'AN12',  'description' => 'Antonov AN-12',                                                                      'wtc' => 'M'],
        'APH' => ['icao' => 'n/a',   'description' => 'Eurocopter (Aerospatiale) SA330 Puma / AS332 Super Puma',                            'wtc' => 'n/a'],
        'AR1' => ['icao' => 'RJ1H',  'description' => 'Avro RJ100 Avroliner',                                                               'wtc' => 'M'],
        'AR7' => ['icao' => 'RJ70',  'description' => 'Avro RJ70 Avroliner',                                                                'wtc' => 'M'],
        'AR8' => ['icao' => 'RJ85',  'description' => 'Avro RJ85 Avroliner',                                                                'wtc' => 'M'],
        'ARJ' => ['icao' => 'n/a',   'description' => 'Avro RJ70 / RJ85 / RJ100 Avroliner',                                                'wtc' => 'M'],
        'ARX' => ['icao' => 'n/a',   'description' => 'Avro RJX85 / RJX100',                                                                'wtc' => 'M'],
        'AT4' => ['icao' => 'AT43',  'description' => 'Aerospatiale/Alenia ATR 42-300 / 320',                                               'wtc' => 'M'],
        'AT5' => ['icao' => 'AT45',  'description' => 'Aerospatiale/Alenia ATR 42-500',                                                     'wtc' => 'M'],
        'AT7' => ['icao' => 'AT72',  'description' => 'Aerospatiale/Alenia ATR 72',                                                         'wtc' => 'M'],
        'ATD' => ['icao' => 'AT44',  'description' => 'Aerospatiale/Alenia ATR 42-400',                                                     'wtc' => 'M'],
        'ATF' => ['icao' => 'AT72',  'description' => 'Aerospatiale/Alenia ATR 72 Freighter',                                               'wtc' => 'M'],
        'ATP' => ['icao' => 'ATP',   'description' => 'British Aerospace ATP',                                                               'wtc' => 'M'],
        'ATR' => ['icao' => 'n/a',   'description' => 'Aerospatiale/Alenia ATR 42 / ATR 72',                                                'wtc' => 'M'],
        'AX1' => ['icao' => 'RX1H',  'description' => 'Avro RJX100',                                                                        'wtc' => 'M'],
        'AX8' => ['icao' => 'RX85',  'description' => 'Avro RJX85',                                                                         'wtc' => 'M'],
        'B11' => ['icao' => 'BA11',  'description' => 'British Aerospace (BAC) One Eleven / RomBAC One Eleven',                             'wtc' => 'M'],
        'B12' => ['icao' => 'BA11',  'description' => 'British Aerospace (BAC) One Eleven 200',                                             'wtc' => 'M'],
        'B13' => ['icao' => 'BA11',  'description' => 'British Aerospace (BAC) One Eleven 300',                                             'wtc' => 'M'],
        'B14' => ['icao' => 'BA11',  'description' => 'British Aerospace (BAC) One Eleven 400/475',                                         'wtc' => 'M'],
        'B15' => ['icao' => 'BA11',  'description' => 'British Aerospace (BAC) One Eleven 500 / RomBAC One Eleven',                         'wtc' => 'M'],
        'B72' => ['icao' => 'B720',  'description' => 'Boeing 720B pax',                                                                    'wtc' => 'M'],
        'BE1' => ['icao' => 'B190',  'description' => 'Beechcraft 1900/1900C/1900D',                                                        'wtc' => 'M'],
        'BE2' => ['icao' => 'n/a',   'description' => 'Beechcraft twin piston engines',                                                     'wtc' => 'L'],
        'BEC' => ['icao' => 'n/a',   'description' => 'Beechcraft light aircraft',                                                           'wtc' => 'L'],
        'BEH' => ['icao' => 'B190',  'description' => 'Beechcraft 1900D',                                                                   'wtc' => 'M'],
        'BEP' => ['icao' => 'n/a',   'description' => 'Beechcraft light aircraft - single engine',                                          'wtc' => 'L'],
        'BES' => ['icao' => 'B190',  'description' => 'Beechcraft 1900/1900C',                                                              'wtc' => 'M'],
        'BET' => ['icao' => 'n/a',   'description' => 'Beechcraft light aircraft - twin turboprop engine',                                  'wtc' => 'L'],
        'BH2' => ['icao' => 'n/a',   'description' => 'Bell Helicopters',                                                                   'wtc' => 'n/a'],
        'BNI' => ['icao' => 'BN2P',  'description' => 'Pilatus Britten-Norman BN-2A/B Islander',                                            'wtc' => 'L'],
        'BNT' => ['icao' => 'TRIS',  'description' => 'Pilatus Britten-Norman BN-2A Mk III Trislander',                                     'wtc' => 'L'],
        'BUS' => ['icao' => 'n/a',   'description' => 'Bus',                                                                                'wtc' => 'n/a'],
        'C27' => ['icao' => 'AJ27',  'description' => 'COMAC ARJ21',                                                                        'wtc' => 'M'],
        'CCJ' => ['icao' => 'CL60',  'description' => 'Canadair Challenger',                                                                'wtc' => 'M'],
        'CCX' => ['icao' => 'GLEX',  'description' => 'Canadair Global Express',                                                            'wtc' => 'M'],
        'CD2' => ['icao' => 'NOMA',  'description' => 'Government Aircraft Factories N22B / N24A Nomad',                                    'wtc' => 'L'],
        'CL4' => ['icao' => 'CL44',  'description' => 'Canadair CL-44',                                                                     'wtc' => 'M'],
        '919' => ['icao' => 'C919', 'description' => 'Comac C919 Passenger', 'wtc' => 'M'],
        'CN1' => ['icao' => 'n/a',   'description' => 'Cessna light aircraft - single piston engine',                                       'wtc' => 'L'],
        'CN2' => ['icao' => 'n/a',   'description' => 'Cessna light aircraft - twin piston engines',                                        'wtc' => 'L'],
        'CN7' => ['icao' => 'C750',  'description' => 'Cessna 750 Citation X',                                                              'wtc' => 'M'],
        'CNA' => ['icao' => 'n/a',   'description' => 'Cessna light aircraft',                                                               'wtc' => 'L'],
        'CNC' => ['icao' => 'n/a',   'description' => 'Cessna light aircraft - single turboprop engine',                                    'wtc' => 'L'],
        'CNJ' => ['icao' => 'n/a',   'description' => 'Cessna Citation',                                                                    'wtc' => 'L'],
        'CNT' => ['icao' => 'n/a',   'description' => 'Cessna light aircraft - twin turboprop engines',                                     'wtc' => 'L'],
        'CR1' => ['icao' => 'CRJ1',  'description' => 'Canadair Regional Jet 100',                                                          'wtc' => 'M'],
        'CR2' => ['icao' => 'CRJ2',  'description' => 'Canadair Regional Jet 200',                                                          'wtc' => 'M'],
        'CR7' => ['icao' => 'CRJ7',  'description' => 'Canadair Regional Jet 700',                                                          'wtc' => 'M'],
        'CR9' => ['icao' => 'CRJ9',  'description' => 'Canadair Regional Jet 900',                                                          'wtc' => 'M'],
        'CRA' => ['icao' => 'CRJ9',  'description' => 'Canadair Regional Jet 705',                                                          'wtc' => 'M'],
        'CRF' => ['icao' => 'n/a',   'description' => 'Canadair Regional Jet Freighter',                                                    'wtc' => 'M'],
        'CRJ' => ['icao' => 'n/a',   'description' => 'Canadair Regional Jet',                                                              'wtc' => 'M'],
        'CRK' => ['icao' => 'CRJX',  'description' => 'Canadair Regional Jet 1000',                                                         'wtc' => 'M'],
        'CRV' => ['icao' => 'S210',  'description' => 'Aerospatiale (Sud Aviation) Se.210 Caravelle',                                       'wtc' => 'M'],
        'CS1' => ['icao' => 'BCS1',  'description' => 'Bombardier C Series CS100',                                                          'wtc' => 'M'],
        'CS2' => ['icao' => 'C212',  'description' => 'CASA / IPTN 212 Aviocar',                                                            'wtc' => 'M'],
        'CS3' => ['icao' => 'BCS3',  'description' => 'Bombardier C Series CS300',                                                          'wtc' => 'M'],
        'CS5' => ['icao' => 'CN35',  'description' => 'CASA / IPTN CN-235',                                                                 'wtc' => 'M'],
        'CV2' => ['icao' => 'CVLP',  'description' => 'Convair CV-240 pax',                                                                 'wtc' => 'M'],
        'CV4' => ['icao' => 'CVLP',  'description' => 'Convair CV-440 Metropolitan pax',                                                    'wtc' => 'M'],
        'CV5' => ['icao' => 'CVLT',  'description' => 'Convair CV-580 pax',                                                                 'wtc' => 'M'],
        'CVF' => ['icao' => 'n/a',   'description' => 'Convair CV-240 / 440 / 580 / 600 / 640 Freighter',                                  'wtc' => 'M'],
        'CVR' => ['icao' => 'n/a',   'description' => 'Convair CV-240 / 440 / 580 / 600 / 640 pax',                                        'wtc' => 'M'],
        'CVV' => ['icao' => 'CVLP',  'description' => 'Convair CV-240 Freighter',                                                           'wtc' => 'M'],
        'CVX' => ['icao' => 'CVLP',  'description' => 'Convair CV-440 Freighter',                                                           'wtc' => 'M'],
        'CVY' => ['icao' => 'CVLT',  'description' => 'Convair CV-580 / 600 / 640 Freighter',                                               'wtc' => 'M'],
        'CWC' => ['icao' => 'C46',   'description' => 'Curtiss C-46 Commando',                                                              'wtc' => 'M'],
        'D10' => ['icao' => 'DC10',  'description' => 'Douglas DC-10 pax',                                                                  'wtc' => 'H'],
        'D11' => ['icao' => 'DC10',  'description' => 'Douglas DC-10-10/15 pax',                                                            'wtc' => 'H'],
        'D1C' => ['icao' => 'DC10',  'description' => 'Douglas DC-10-30/40 pax',                                                            'wtc' => 'H'],
        'D1F' => ['icao' => 'DC10',  'description' => 'Douglas DC-10 all Freighters',                                                       'wtc' => 'H'],
        'D1M' => ['icao' => 'DC10',  'description' => 'Douglas DC-10 all Combi models',                                                     'wtc' => 'H'],
        'D1X' => ['icao' => 'DC10',  'description' => 'Douglas DC-10-10 Freighter',                                                         'wtc' => 'H'],
        'D1Y' => ['icao' => 'DC10',  'description' => 'Douglas DC-10-30 / 40 Freighters',                                                   'wtc' => 'H'],
        'D28' => ['icao' => 'D228',  'description' => 'Fairchild Dornier Do.228',                                                            'wtc' => 'L'],
        'D38' => ['icao' => 'D328',  'description' => 'Fairchild Dornier Do.328',                                                            'wtc' => 'M'],
        'D3F' => ['icao' => 'DC3',   'description' => 'Douglas DC-3 Freighter',                                                             'wtc' => 'M'],
        'D6F' => ['icao' => 'DC6',   'description' => 'Douglas DC-6A/B/C Freighter',                                                        'wtc' => 'M'],
        'D8F' => ['icao' => 'n/a',   'description' => 'Douglas DC-8 all Freighters',                                                        'wtc' => 'H'],
        'D8L' => ['icao' => 'DC86',  'description' => 'Douglas DC-8-62 pax',                                                                'wtc' => 'H'],
        'D8M' => ['icao' => 'n/a',   'description' => 'Douglas DC-8 all Combi models',                                                      'wtc' => 'H'],
        'D8Q' => ['icao' => 'DC87',  'description' => 'Douglas DC-8-72 pax',                                                                'wtc' => 'H'],
        'D8T' => ['icao' => 'DC85',  'description' => 'Douglas DC-8-50 Freighter',                                                          'wtc' => 'H'],
        'D8X' => ['icao' => 'n/a',   'description' => 'Douglas DC-8-61 / 62 / 63 Freighters',                                               'wtc' => 'H'],
        'D8Y' => ['icao' => 'DC87',  'description' => 'Douglas DC-8-71 / 72 / 73 Freighters',                                               'wtc' => 'H'],
        'D91' => ['icao' => 'DC91',  'description' => 'Douglas DC-9-10 pax',                                                                'wtc' => 'M'],
        'D92' => ['icao' => 'DC92',  'description' => 'Douglas DC-9-20 pax',                                                                'wtc' => 'M'],
        'D93' => ['icao' => 'DC93',  'description' => 'Douglas DC-9-30 pax',                                                                'wtc' => 'M'],
        'D94' => ['icao' => 'DC94',  'description' => 'Douglas DC-9-40 pax',                                                                'wtc' => 'M'],
        'D95' => ['icao' => 'DC95',  'description' => 'Douglas DC-9-50 pax',                                                                'wtc' => 'M'],
        'D9C' => ['icao' => 'DC93',  'description' => 'Douglas DC-9-30 Freighter',                                                          'wtc' => 'M'],
        'D9D' => ['icao' => 'DC94',  'description' => 'Douglas DC-9-40 Freighter',                                                          'wtc' => 'M'],
        'D9F' => ['icao' => 'n/a',   'description' => 'Douglas DC-9 all Freighters',                                                        'wtc' => 'M'],
        'D9X' => ['icao' => 'DC91',  'description' => 'Douglas DC-9-10 Freighter',                                                          'wtc' => 'M'],
        'DC3' => ['icao' => 'DC3',   'description' => 'Douglas DC-3 pax',                                                                   'wtc' => 'M'],
        'DC4' => ['icao' => 'DC4',   'description' => 'Douglas DC-4 pax',                                                                   'wtc' => 'M'],
        'DC6' => ['icao' => 'DC6',   'description' => 'Douglas DC6A/B pax',                                                                 'wtc' => 'M'],
        'DC8' => ['icao' => 'n/a',   'description' => 'Douglas DC-8 all pax models',                                                        'wtc' => 'H'],
        'DC9' => ['icao' => 'DC9',   'description' => 'Douglas DC-9 all pax models',                                                        'wtc' => 'M'],
        'DF2' => ['icao' => 'n/a',   'description' => 'Dassault (Breguet Mystere) Falcon 10 / 100 / 20 / 200 / 2000',                       'wtc' => 'M'],
        'DF3' => ['icao' => 'n/a',   'description' => 'Dassault (Breguet Mystere) Falcon 50 / 900',                                         'wtc' => 'M'],
        'DFL' => ['icao' => 'n/a',   'description' => 'Dassault (Breguet Mystere) Falcon',                                                  'wtc' => 'M'],
        'DH1' => ['icao' => 'DH8A',  'description' => 'De Havilland Canada DHC-8-100 Dash 8 / 8Q',                                         'wtc' => 'M'],
        'DH2' => ['icao' => 'DH8B',  'description' => 'De Havilland Canada DHC-8-200 Dash 8 / 8Q',                                         'wtc' => 'M'],
        'DH3' => ['icao' => 'DH8C',  'description' => 'De Havilland Canada DHC-8-300 Dash 8 / 8Q',                                         'wtc' => 'M'],
        'DH4' => ['icao' => 'DH8D',  'description' => 'De Havilland Canada DHC-8-400 Dash 8Q',                                             'wtc' => 'M'],
        'DH7' => ['icao' => 'DHC7',  'description' => 'De Havilland Canada DHC-7 Dash 7',                                                   'wtc' => 'M'],
        'DH8' => ['icao' => 'n/a',   'description' => 'De Havilland Canada DHC-8 Dash 8 all models',                                       'wtc' => 'M'],
        'DHB' => ['icao' => 'n/a',   'description' => 'De Havilland Canada DHC-2 Beaver / Turbo Beaver',                                    'wtc' => 'L'],
        'DHC' => ['icao' => 'DHC4',  'description' => 'De Havilland Canada DHC-4 Caribou',                                                  'wtc' => 'M'],
        'DHD' => ['icao' => 'DOVE',  'description' => 'De Havilland DH.104 Dove',                                                           'wtc' => 'L'],
        'DHH' => ['icao' => 'HERN',  'description' => 'De Havilland DH.114 Heron',                                                          'wtc' => 'L'],
        'DHL' => ['icao' => 'DHC3',  'description' => 'De Havilland Canada DHC-3 Turbo Otter',                                              'wtc' => 'L'],
        'DHO' => ['icao' => 'DHC3',  'description' => 'De Havilland Canada DHC-3 Otter / Turbo Otter',                                     'wtc' => 'L'],
        'DHP' => ['icao' => 'DHC2',  'description' => 'De Havilland Canada DHC-2 Beaver',                                                   'wtc' => 'L'],
        'DHR' => ['icao' => 'DH2T',  'description' => 'De Havilland Canada DHC-2 Turbo-Beaver',                                            'wtc' => 'L'],
        'DHS' => ['icao' => 'DHC3',  'description' => 'De Havilland Canada DHC-3 Otter',                                                    'wtc' => 'L'],
        'DHT' => ['icao' => 'DHC6',  'description' => 'De Havilland Canada DHC-6 Twin Otter',                                               'wtc' => 'L'],
        'E70' => ['icao' => 'E170',  'description' => 'Embraer 170',                                                                        'wtc' => 'M'],
        'E75' => ['icao' => 'E75L',  'description' => 'Embraer 175 (Short wing / Long Wing)',                                               'wtc' => 'M'],
        'E90' => ['icao' => 'E190',  'description' => 'Embraer 190',                                                                        'wtc' => 'M'],
        'E95' => ['icao' => 'E195',  'description' => 'Embraer 195',                                                                        'wtc' => 'M'],
        'EC3' => ['icao' => 'EC30',  'description' => 'Eurocopter EC.130',                                                                  'wtc' => 'n/a'],
        'EM2' => ['icao' => 'E120',  'description' => 'Embraer EMB.120 Brasilia',                                                           'wtc' => 'L'],
        'EMB' => ['icao' => 'E110',  'description' => 'Embraer EMB.110 Bandeirnate',                                                        'wtc' => 'M'],
        'EMJ' => ['icao' => 'n/a',   'description' => 'Embraer 170/190',                                                                    'wtc' => 'M'],
        'ER3' => ['icao' => 'E135',  'description' => 'Embraer RJ135 / Legacy 600 / Legacy 650',                                            'wtc' => 'M'],
        'ER4' => ['icao' => 'E145',  'description' => 'Embraer RJ145 Amazon',                                                               'wtc' => 'M'],
        'ERD' => ['icao' => 'n/a',   'description' => 'Embraer RJ140',                                                                      'wtc' => 'M'],
        'ERJ' => ['icao' => 'n/a',   'description' => 'Embraer RJ135 / RJ140 / RJ145',                                                     'wtc' => 'M'],
        'F21' => ['icao' => 'F28',   'description' => 'Fokker F.28 Fellowship 1000',                                                        'wtc' => 'M'],
        'F22' => ['icao' => 'F28',   'description' => 'Fokker F.28 Fellowship 2000',                                                        'wtc' => 'M'],
        'F23' => ['icao' => 'F28',   'description' => 'Fokker F.28 Fellowship 3000',                                                        'wtc' => 'M'],
        'F24' => ['icao' => 'F28',   'description' => 'Fokker F.28 Fellowship 4000',                                                        'wtc' => 'M'],
        'F27' => ['icao' => 'F27',   'description' => 'Fokker F.27 Friendship / Fairchild F.27',                                            'wtc' => 'M'],
        'F28' => ['icao' => 'F28',   'description' => 'Fokker F.28 Fellowship',                                                             'wtc' => 'M'],
        'F50' => ['icao' => 'F50',   'description' => 'Fokker 50',                                                                          'wtc' => 'M'],
        'F5F' => ['icao' => 'F50',   'description' => 'Fokker 50 Freighter',                                                                'wtc' => 'M'],
        'F70' => ['icao' => 'F70',   'description' => 'Fokker 70',                                                                          'wtc' => 'M'],
        'FA7' => ['icao' => 'n/a',   'description' => 'Fairchild Dornier 728JET',                                                           'wtc' => 'M'],
        'FK7' => ['icao' => 'F27',   'description' => 'Fairchild FH.227',                                                                   'wtc' => 'M'],
        'FRJ' => ['icao' => 'J328',  'description' => 'Fairchild Dornier 328JET',                                                           'wtc' => 'M'],
        'GRG' => ['icao' => 'G21',   'description' => 'Grumman G.21 Goose',                                                                 'wtc' => 'L'],
        'GRJ' => ['icao' => 'n/a',   'description' => 'Gulfstream Aerospace G-1159 Gulfstream II / III / IV / V',                           'wtc' => 'M'],
        'GRM' => ['icao' => 'G73T',  'description' => 'Grumman G.73 Turbo Mallard',                                                         'wtc' => 'L'],
        'GRS' => ['icao' => 'G159',  'description' => 'Gulfstream Aerospace G-159 Gulfstream I',                                            'wtc' => 'M'],
        'H25' => ['icao' => 'n/a',   'description' => 'British Aerospace (Hawker Siddeley) HS.125',                                         'wtc' => 'M'],
        'HEC' => ['icao' => 'COUC',  'description' => 'Helio H-250 Courier / H-295 / 385 Super Courier',                                   'wtc' => 'L'],
        'HOV' => ['icao' => 'n/a',   'description' => 'Hovercraft',                                                                         'wtc' => 'n/a'],
        'HS7' => ['icao' => 'A748',  'description' => 'Hawker Siddeley HS.748',                                                             'wtc' => 'M'],
        'I14' => ['icao' => 'I114',  'description' => 'Ilyushin IL114',                                                                     'wtc' => 'M'],
        'I93' => ['icao' => 'IL96',  'description' => 'Ilyushin IL96-300 pax',                                                              'wtc' => 'H'],
        'I9F' => ['icao' => 'IL96',  'description' => 'Ilyushin IL96 Freighters',                                                           'wtc' => 'H'],
        'I9M' => ['icao' => 'IL96',  'description' => 'Ilyushin IL96M pax',                                                                 'wtc' => 'H'],
        'I9X' => ['icao' => 'IL96',  'description' => 'Ilyushin IL96-300 Freighter',                                                        'wtc' => 'H'],
        'I9Y' => ['icao' => 'IL96',  'description' => 'Ilyushin IL96T Freighter',                                                           'wtc' => 'H'],
        'IL6' => ['icao' => 'IL62',  'description' => 'Ilyushin IL62',                                                                      'wtc' => 'H'],
        'IL7' => ['icao' => 'IL76',  'description' => 'Ilyushin IL76',                                                                      'wtc' => 'H'],
        'IL8' => ['icao' => 'IL18',  'description' => 'Ilyushin IL18',                                                                      'wtc' => 'M'],
        'IL9' => ['icao' => 'IL96',  'description' => 'Ilyushin IL96 pax',                                                                  'wtc' => 'H'],
        'ILW' => ['icao' => 'IL86',  'description' => 'Ilyushin IL86',                                                                      'wtc' => 'H'],
        'J31' => ['icao' => 'JS31',  'description' => 'British Aerospace Jetstream 31',                                                     'wtc' => 'L'],
        'J32' => ['icao' => 'JS32',  'description' => 'British Aerospace Jetstream 32',                                                     'wtc' => 'L'],
        'J41' => ['icao' => 'JS41',  'description' => 'British Aerospace Jetstream 41',                                                     'wtc' => 'M'],
        'JST' => ['icao' => 'n/a',   'description' => 'British Aerospace Jetstream 31 / 32 / 41',                                           'wtc' => 'L/M'],
        'JU5' => ['icao' => 'JU52',  'description' => 'Junkers Ju52/3M',                                                                    'wtc' => 'M'],
        'L10' => ['icao' => 'L101',  'description' => 'Lockheed L-1011 Tristar pax',                                                        'wtc' => 'H'],
        'L11' => ['icao' => 'L101',  'description' => 'Lockheed L-1011 1 / 50 / 100 / 150 / 200 / 250 Tristar pax',                        'wtc' => 'H'],
        'L15' => ['icao' => 'L101',  'description' => 'Lockheed L-1011 500 Tristar pax',                                                    'wtc' => 'H'],
        'L1F' => ['icao' => 'L101',  'description' => 'Lockheed L-1011 Tristar Freighter',                                                  'wtc' => 'H'],
        'L49' => ['icao' => 'CONI',  'description' => 'Lockheed L-1049 Super Constellation',                                                'wtc' => 'M'],
        'L4T' => ['icao' => 'L410',  'description' => 'LET 410',                                                                            'wtc' => 'L'],
        'LCH' => ['icao' => 'n/a',   'description' => 'Launch - Boat',                                                                      'wtc' => 'n/a'],
        'LMO' => ['icao' => 'n/a',   'description' => 'Limousine',                                                                          'wtc' => 'n/a'],
        'LOE' => ['icao' => 'L188',  'description' => 'Lockheed L-188 Electra pax',                                                         'wtc' => 'M'],
        'LOF' => ['icao' => 'L188',  'description' => 'Lockheed L-188 Electra Freighter',                                                   'wtc' => 'M'],
        'LOH' => ['icao' => 'C130',  'description' => 'Lockheed L-182 / 282 / 382 (L-100) Hercules',                                       'wtc' => 'M'],
        'LOM' => ['icao' => 'L188',  'description' => 'Lockheed L-188 Electra Mixed Configuration',                                        'wtc' => 'M'],
        'LRJ' => ['icao' => 'n/a',   'description' => 'Gates Learjet',                                                                      'wtc' => 'M'],
        'M11' => ['icao' => 'MD11',  'description' => 'McDonnell Douglas MD11 pax',                                                         'wtc' => 'H'],
        'M1F' => ['icao' => 'MD11',  'description' => 'McDonnell Douglas MD11 Freighter',                                                   'wtc' => 'H'],
        'M1M' => ['icao' => 'MD11',  'description' => 'McDonnell Douglas MD11 Mixed Configuration',                                         'wtc' => 'H'],
        'M80' => ['icao' => 'MD80',  'description' => 'McDonnell Douglas MD80',                                                             'wtc' => 'M'],
        'M81' => ['icao' => 'MD81',  'description' => 'McDonnell Douglas MD81',                                                             'wtc' => 'M'],
        'M82' => ['icao' => 'MD82',  'description' => 'McDonnell Douglas MD82',                                                             'wtc' => 'M'],
        'M83' => ['icao' => 'MD83',  'description' => 'McDonnell Douglas MD83',                                                             'wtc' => 'M'],
        'M87' => ['icao' => 'MD87',  'description' => 'McDonnell Douglas MD87',                                                             'wtc' => 'M'],
        'M88' => ['icao' => 'MD88',  'description' => 'McDonnell Douglas MD88',                                                             'wtc' => 'M'],
        'M90' => ['icao' => 'MD90',  'description' => 'McDonnell Douglas MD90',                                                             'wtc' => 'M'],
        'MBH' => ['icao' => 'B105',  'description' => 'Eurocopter (MBB) Bo.105',                                                            'wtc' => 'n/a'],
        'MD9' => ['icao' => 'EXPL',  'description' => 'MD Helicopters MD900 Explorer',                                                      'wtc' => 'n/a'],
        'MIH' => ['icao' => 'MI8',   'description' => 'MIL Mi-8 / Mi-17 / Mi-171 / Mil-172',                                               'wtc' => 'n/a'],
        'MU2' => ['icao' => 'MU2',   'description' => 'Mitsubishi Mu-2',                                                                    'wtc' => 'L'],
        'ND2' => ['icao' => 'N262',  'description' => 'Aerospatiale (Nord) 262',                                                            'wtc' => 'M'],
        'NDC' => ['icao' => 'S601',  'description' => 'Aerospatiale SN.601 Corvette',                                                       'wtc' => 'L'],
        'NDE' => ['icao' => 'n/a',   'description' => 'Eurocopter (Aerospatiale) AS350 Ecureuil / AS355 Ecureuil 2',                        'wtc' => 'n/a'],
        'NDH' => ['icao' => 'S65C',  'description' => 'Eurocopter (Aerospatiale) SA365C / SA365N Dauphin 2',                                'wtc' => 'n/a'],
        'PA1' => ['icao' => 'n/a',   'description' => 'Piper light aircraft - single piston engine',                                        'wtc' => 'L'],
        'PA2' => ['icao' => 'n/a',   'description' => 'Piper light aircraft - twin piston engines',                                         'wtc' => 'L'],
        'PAG' => ['icao' => 'n/a',   'description' => 'Piper light aircraft',                                                               'wtc' => 'L'],
        'PAT' => ['icao' => 'n/a',   'description' => 'Piper light aircraft - twin turboprop engines',                                      'wtc' => 'L'],
        'PL2' => ['icao' => 'PC12',  'description' => 'Pilatus PC-12',                                                                      'wtc' => 'L'],
        'PL6' => ['icao' => 'PC6T',  'description' => 'Pilatus PC-6 Turbo Porter',                                                          'wtc' => 'L'],
        'PN6' => ['icao' => 'P68',   'description' => 'Partenavia P.68',                                                                    'wtc' => 'L'],
        'RFS' => ['icao' => 'n/a',   'description' => 'Road Feeder Service - Cargo Truck',                                                  'wtc' => 'n/a'],
        'S20' => ['icao' => 'SB20',  'description' => 'Saab 2000',                                                                          'wtc' => 'M'],
        'S58' => ['icao' => 'S58T',  'description' => 'Sikorsky S-58T',                                                                     'wtc' => 'n/a'],
        'S61' => ['icao' => 'S61',   'description' => 'Sikorsky S-61',                                                                      'wtc' => 'n/a'],
        'S76' => ['icao' => 'S76',   'description' => 'Sikorsky S-76',                                                                      'wtc' => 'n/a'],
        'SF3' => ['icao' => 'SF34',  'description' => 'Saab SF340',                                                                         'wtc' => 'M'],
        'SFB' => ['icao' => 'SF34',  'description' => 'Saab SF340B',                                                                        'wtc' => 'M'],
        'SFF' => ['icao' => 'SF34',  'description' => 'Saab SF340 Freighter',                                                               'wtc' => 'M'],
        'SH3' => ['icao' => 'SH33',  'description' => 'Shorts SD.330',                                                                      'wtc' => 'M'],
        'SH6' => ['icao' => 'SH36',  'description' => 'Shorts SD.360',                                                                      'wtc' => 'M'],
        'SHB' => ['icao' => 'BELF',  'description' => 'Shorts SC-5 Belfast',                                                                'wtc' => 'M'],
        'SHS' => ['icao' => 'SC7',   'description' => 'Shorts SC-7 Skyvan',                                                                 'wtc' => 'L'],
        'SSC' => ['icao' => 'CONC',  'description' => 'Aerospatiale/BAC Concorde',                                                          'wtc' => 'H'],
        'SU1' => ['icao' => '',      'description' => 'Sukhoi Superjet 100',                                                                'wtc' => 'M'],
        'SU7' => ['icao' => '',      'description' => 'Sukhoi Superjet 100-75',                                                             'wtc' => 'M'],
        'SU9' => ['icao' => 'SU95',  'description' => 'Sukhoi Superjet 100-95',                                                             'wtc' => 'M'],
        'SWM' => ['icao' => 'n/a',   'description' => 'Fairchild (Swearingen) SA26 / SA226 / SA227 Metro / Merlin / Expediter',             'wtc' => 'L'],
        'T20' => ['icao' => 'T204',  'description' => 'Tupolev Tu-204 / Tu-214',                                                            'wtc' => 'M'],
        'T2F' => ['icao' => 'T204',  'description' => 'Tupolev Tu-204 Freighter',                                                           'wtc' => 'M'],
        'TRN' => ['icao' => 'n/a',   'description' => 'Train',                                                                              'wtc' => 'n/a'],
        'TU3' => ['icao' => 'T134',  'description' => 'Tupolev Tu134',                                                                      'wtc' => 'M'],
        'TU5' => ['icao' => 'T154',  'description' => 'Tupolev Tu154',                                                                      'wtc' => 'M'],
        'VCV' => ['icao' => 'VISC',  'description' => 'Vickers Viscount',                                                                   'wtc' => 'M'],
        'WWP' => ['icao' => 'WW24',  'description' => 'Israel Aircraft Industries 1124 Westwind',                                           'wtc' => 'M'],
        'YK2' => ['icao' => 'YK42',  'description' => 'Yakovlev Yak 42',                                                                    'wtc' => 'M'],
        'YK4' => ['icao' => 'YK40',  'description' => 'Yakovlev Yak 40',                                                                    'wtc' => 'M'],
        'YN2' => ['icao' => 'Y12',   'description' => 'Harbin Yunshuji Y12',                                                                'wtc' => 'M'],
        'YN7' => ['icao' => 'AN24',  'description' => 'Xian Yunshuji Y7',                                                                   'wtc' => 'M'],
        'YS1' => ['icao' => 'YS11',  'description' => 'NAMC YS-11',                                                                         'wtc' => 'M'],
        ];

    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Achievement::whereInternalName('fun_challenges.canadian_provinces')->update(['difficulty_description' => null]);

        Aircraft::create([
            'designator' => 'A330',
            'manufacturer_code' => 'AIRBUS',
            'model_full_name' => 'A-330 Family',
            'aircraft_description' => 'LandPlane',
            'engine_type' => 'Jet',
            'engine_count' => 2,
            'wtc' => 'H',
        ]);

        Aircraft::create([
            'designator' => 'A340',
            'manufacturer_code' => 'AIRBUS',
            'model_full_name' => 'A-340 Family',
            'aircraft_description' => 'LandPlane',
            'engine_type' => 'Jet',
            'engine_count' => 4,
            'wtc' => 'H',
        ]);

        Schema::table('aircraft', function (Blueprint $table) {
            $table->string('iata_code', 10)->nullable()->after('designator');
        });

        $updated = 0;
        $unmatched = [];

        foreach ($this->aircraft_codes as $iata => $data) {
            $icao = $data['icao'];

            if (empty($icao) || $icao === 'n/a') {
                continue;
            }

            $rows = DB::table('aircraft')->where('designator', $icao)->update([
                'iata_code' => $iata,
            ]);

            if ($rows === 0) {
                $unmatched[] = "{$iata} → {$icao} ({$data['description']})";
            }

            $updated += $rows;
        }

        echo "Updated {$updated} aircraft record(s) with IATA codes.\n";

        if (!empty($unmatched)) {
            echo "\n=== IATA codes with no matching ICAO in aircraft table ===\n";
            foreach ($unmatched as $line) {
                echo "  {$line}\n";
            }
            echo "==========================================================\n";
        }
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        //
    }
};
