<?php
namespace App\Bsp\Hot230\Lines\Transaction;

/**
 * Line parser
 * @author Lucian Sirbu
 */
class BKI63 extends \App\Bsp\Hot230\HOTBase
{
	protected $children = [
		[ 'key'=>'SMSG',                 'type'=>'Constant', 'val'=>'BKI',       'len'=>3,                                                          'label'=>'Standard Message Identifier', ],              // L/M/Standard Message Identifier
		[ 'key'=>'SQNR',                 'type'=>'Integer',                      'len'=>8,                                                          'label'=>'Sequence Number', ],                          // L/M/Sequence Number
		[ 'key'=>'STNQ',                 'type'=>'Constant', 'val'=>'63',        'len'=>2,                                                          'label'=>'Standard Numeric Qualifier', ],               // L/M/Standard Numeric Qualifier
		[ 'key'=>'DAIS',                 'type'=>'Date',     'fmt'=>'YYMMDD',    'len'=>6,  'store'=>'DAIS',                                        'label'=>'Date of Issue', ],                            // L/M/Date of Issue
		[ 'key'=>'TRNN',                 'type'=>'Integer',                      'len'=>6,                                                          'label'=>'Transaction Number', ],                       // L/M/Transaction Number
		[ 'key'=>'TDNR_airline',         'type'=>'StringRaw',                    'len'=>3,                                                          'label'=>'Ticket/Document Number(airline number)', ],   // S/M/Ticket/Document Number
		[ 'key'=>'TDNR_ticketNumber',    'type'=>'StringRaw',                    'len'=>10,                                                         'label'=>'Ticket/Document Number', ],
		[ 'key'=>'TDNR_extra',           'type'=>'StringRaw',                    'len'=>1,                                                          'label'=>'Ticket/Document Number(extra digits)', ],
		[ 'key'=>'CDGT',                 'type'=>'Digits',                       'len'=>1,                                                          'label'=>'Check-Digit', ],                              // L/M/Check-Digit
		[ 'key'=>'SEGI',                 'type'=>'Digits',                       'len'=>1,                                                          'label'=>'Segment Identifier', ],                       // L/M/Segment Identifier
		[ 'key'=>'STPO',                 'type'=>'Letters',                      'len'=>1,                                                          'label'=>'Stopover Code', ],                            // L/M/Stopover Code
		// @see TD-5846, TD-6729. Search for date 29FEB. These dates seem to be aither before or after the ticket issue date. I'm not sure what the relations actually are, so I'm disabling this and parsing it as string
		// [ 'key'=>'NBDA',                 'type'=>'Date',     'fmt'=>'DDMMM',     'len'=>5,  'allowSpaces'=>true, 'onlyFuture'=>true, 'ref'=>'DAIS', 'label'=>'Not Valid Before Date', ],                    // X/C/Not Valid Before Date
		// [ 'key'=>'NADA',                 'type'=>'Date',     'fmt'=>'DDMMM',     'len'=>5,  'allowSpaces'=>true, 'onlyFuture'=>true, 'ref'=>'DAIS', 'label'=>'Not Valid After Date', ],                     // X/C/Not Valid After Date
		[ 'key'=>'NBDA',                 'type'=>'StringRaw',                    'len'=>5,                                                          'label'=>'Not Valid Before Date', ],                    // X/C/Not Valid Before Date
		[ 'key'=>'NADA',                 'type'=>'StringRaw',                    'len'=>5,                                                          'label'=>'Not Valid After Date', ],                     // X/C/Not Valid After Date
		[ 'key'=>'ORAC',                 'type'=>'StringTrim',                   'len'=>5,                                                          'label'=>'Origin Airport/ City Code', ],                // L/M/Origin Airport/ City Code
		[ 'key'=>'DSTC',                 'type'=>'StringTrim',                   'len'=>5,                                                          'label'=>'Destination Airport/ City Code', ],           // L/M/Destination Airport/ City Code
		[ 'key'=>'CARR',                 'type'=>'StringTrim',                   'len'=>3,                                                          'label'=>'Carrier', ],                                  // L/C/Carrier
		[ 'key'=>'CABI',                 'type'=>'StringRaw',                    'len'=>1,                                                          'label'=>'Sold passenger cabin', ],
		[ 'key'=>'FTNR',                 'type'=>'StringRaw',                    'len'=>5,                                                          'label'=>'Flight Number', ],                            // L/C/Flight Number
		[ 'key'=>'RBKD',                 'type'=>'StringRaw',                    'len'=>2,                                                          'label'=>'Reservation Booking Designator', ],           // L/M/Reservation Booking Designator
		[ 'key'=>'FTDA',                 'type'=>'DateAuto',                     'len'=>7, 'allowSpaces'=>true, 'onlyFuture'=>true, 'ref'=>'DAIS',  'label'=>'Flight Date', ],                              // L/C/Flight Date
		[ 'key'=>'FTDT',                 'type'=>'StringRaw',                    'len'=>5,                                                          'label'=>'Flight Departure Time', ],                    // X/C/Flight Departure Time
		[ 'key'=>'FBST',                 'type'=>'Letters',                      'len'=>2,                                                          'label'=>'Flight Booking Status', ],                    // X/C/Flight Booking Status
		[ 'key'=>'FBAL',                 'type'=>'StringRaw',                    'len'=>3,                                                          'label'=>'Free Baggage Allowance', ],                   // X/C/Free Baggage Allowance
		[ 'key'=>'FBTD',                 'type'=>'StringTrim',                   'len'=>15,                                                         'label'=>'Fare Basis/Ticket Designator', ],             // L/M/Fare Basis/Ticket Designator
		[ 'key'=>'FFRF',                 'type'=>'StringTrim',                   'len'=>20,                                                         'label'=>'Frequent Flyer Reference', ],                 // X/C/Frequent Flyer Reference
		[ 'key'=>'FCPT',                 'type'=>'StringRaw',                    'len'=>3,                                                          'label'=>'Frequent Component priced passenger type code', ],
		[ 'key'=>'COGI',                 'type'=>'StringRaw',                    'len'=>1,                                                          'label'=>'Through/Change of Gauge Indicator', ],
		[ 'key'=>'EQCD',                 'type'=>'StringRaw',                    'len'=>3,                                                          'label'=>'Equipment Code ', ],
		[ 'key'=>'RESD',                 'type'=>'StringTrim',                   'len'=>4,                                                          'label'=>'Reserved Space', ],                           //  /M/Reserved Space
	];
}
