<?php
namespace App\Worldspan\LineParser\Types\Line;

/**
 *
 * @author Lucian Sirbu
 */
class RO extends \App\Worldspan\LineParser\Types\WorldspanBaseLine
{
	protected $extractRegexp = "/^(?P<rawData>O\\\\.+)/sm";

	protected $children = [
        /**
         * This record contains the information for the automated MCO for interface levels 19 and higher
         */

       [                'key'=> 'key',                               'type'=> 'Constant',          'len'=> 2,     'val'=> 'O\\',                'req'=> true, ],              // Record Identifier
       [                'key'=> 'MCOTypeIdentifier',                 'type'=> 'Alphanumeric',      'len'=> 2,                                   'req'=> false, ],             // MCO Type Identifier
       [                'key'=> '#011',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator (See Note 16)
       [		        'key'=> 'NameNumber',	                     'type'=> 'StringDelimitedByChar', 'len' => [1, 5], 'val' => '\\',          'req' => true, ],             // Surname number (See Note 18)
       [                'key'=> '#015',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

       [                'key'=> 'complex:8',                         'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 3,     'val'=> 'NM-',                'req'=> true, ],              // Passenger Name Identifier
           [            'key'=> 'PassengerName',                     'type'=> 'StringDelimitedByChar',            'val' => '\\',                'req'=> true, ],              // Passenger Name (see Note 14)
        ]],
       [                'key'=> '#018',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

       [                'key'=> 'complex:10',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 3,     'val'=> 'MCO-',               'req'=> true, ],              // Automated MCO Number Identifier
           [            'key'=> 'MCONumber',                         'type'=> 'Digits',            'len'=> 10,                                  'req'=> false, ],             // MCO Number
        ]],
       [                'key'=> '#021',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

       [                'key'=> 'complex:12',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 3,     'val'=> 'VC-',                'req'=> true, ],              // Validating Carrier Identifier
           [            'key'=> 'ValidatingCarrierCode',             'type'=> 'StringRaw',         'len'=>[2,3],                                'req'=> true, ],             // Validating Carrier Code
           [            'key'=> '',                                  'type'=> 'Constant',          'len'=> 1,     'val'=> '/',                  'req'=> true, ],             // Item separator
           [            'key'=> 'ValidatingCarrierNumber',           'type'=> 'Integer',           'len'=>[0, 4],                               'req'=> true, ],             // Validating carrier number
        ]],
       [                'key'=> '#026',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

       [                'key'=> 'complex:14',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 3,     'val'=> 'TS-',                'req'=> true, ],              // Type of Service Identifier
           [            'key'=> 'TypeOfServiceInformation',          'type'=> 'StringDelimitedByChar',            'val' => '\\',                'req'=> false, ],             // Type of Service Information
        ]],
       [                'key'=> '#029',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

       [                'key'=> 'complex:16',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 3,     'val'=> 'TO-',                'req'=> true, ],              // TO Identifier
           [            'key'=> 'IncludesTOAndInformation',          'type'=> 'StringDelimitedByChar',            'val' => '\\',                'req'=> false, ],             // Includes TO and information
        ]],
       [                'key'=> '#032',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

       [                'key'=> 'complex:18',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 3,     'val'=> 'AT-',                'req'=> true, ],              // AT Identifier
           [            'key'=> 'IncludesATAndInformation',          'type'=> 'StringDelimitedByChar',            'val' => '\\',                'req'=> false, ],             // Includes AT and Information
        ]],
       [                'key'=> '#035',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

       [                'key'=> 'complex:20',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 3,     'val'=> 'RE-',                'req'=> true, ],              // MCO Remarks Identifier x.x              MCO Remarks Identifier
           [            'key'=> 'MCORemarks',                        'type'=> 'StringDelimitedByChar',            'val' => '\\',                'req'=> false, ],             // Note 15 and 17)
        ]],
       [                'key'=> '#039',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

       [                'key'=> 'complex:22',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 3,     'val'=> 'ER-',                'req'=> true, ],              // Endorsements Identifier
           [            'key'=> 'EndorsementsInformation',           'type'=> 'StringDelimitedByChar',            'val' => '\\',                'req'=> false, ],             // Endorsements information
        ]],
       [                'key'=> '#042',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

       [                'key'=> 'complex:24',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'BXR-',               'req'=> true, ],              // Bank Exchange Rate Identifier
           [            'key'=> 'BankExchangeRateInformation',       'type'=> 'StringDelimitedByChar',            'val' => '\\',                'req'=> false, ],             // Bank Exchange Rate Information
        ]],
       [                'key'=> '#045',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

       [                'key'=> 'complex:26',                                                            'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                                                                   'type'=> 'Constant',          'len'=> 4,     'val'=> 'EQV-',               'req'=> true, ],              // Equivalent Amount Identifier
           [            'key'=> 'EquivalentAmountBankExchangeRateInformationCurrencyCode',               'type'=> 'StringRaw',         'len'=> 3,                                   'req'=> false, ],             // Currency Code
           [            'key'=> 'EquivalentAmountBankExchangeRateInformation',                           'type'=> 'FloatRaw',          'len'=>[1, 25],                              'req'=> false, ],             // Bank Exchange Rate Information
           [            'key'=> '#049',                                                                  'type'=> 'Constant',          'len'=> 1,     'val'=> '\\',                 'req'=> false, ],             // Field Separator
           [            'key'=> 'EquivalentAmountCurrencyCode',                                          'type'=> 'StringRaw',         'len'=> 3,                                   'req'=> false, ],             // Currency Code
           [            'key'=> 'EquivalentAmount',                                                      'type'=> 'FloatRaw',          'len'=>[1, 11],                              'req'=> false, ],             // Equivalent Amount
        ]],
       [                'key'=> '#052',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

       [                'key'=> 'complex:28',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'AMT-',               'req'=> true, ],              // Amount Identifier
           [            'key'=> 'AmountInformationCurrency',    'type'=> 'StringRaw',         'len'=> 3,                                        'req'=> false, ],             // Currency Code
           [            'key'=> 'AmountInformation',            'type'=> 'FloatRaw',          'len'=>[1, 11],                                   'req'=> false, ],             // Amount Information (see Note 13)
        ]],
       [                'key'=> '#056',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

       [                'key'=> 'complex:30',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'TX1-',               'req'=> true, ],              // Tax One Identifier
           [            'key'=> 'Tax1Code',                          'type'=> 'StringRaw',         'len'=> 2,                                   'req'=> false, ],             // Tax Code
           [            'key'=> 'Tax1Information',                   'type'=> 'FloatRaw',          'len'=>[1, 11],                              'req'=> false, ],             // Tax One Information
        ]],
       [                'key'=> '#060',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

       [                'key'=> 'complex:32',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'TX2-',               'req'=> true, ],              // Tax Two Identifier
           [            'key'=> 'Tax2Code',                          'type'=> 'StringRaw',         'len'=> 2,                                   'req'=> false, ],             // Tax Code
           [            'key'=> 'Tax2Information',                   'type'=> 'FloatRaw',          'len'=>[1, 11],                              'req'=> false, ],             // Tax Two Information
        ]],
       [                'key'=> '#064',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

       [                'key'=> 'complex:34',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'TX3-',               'req'=> true, ],              // Tax Three Identifier
           [            'key'=> 'Tax3Code',                          'type'=> 'StringRaw',         'len'=> 2,                                   'req'=> false, ],             // Tax Code x.x              Tax Three Information
           [            'key'=> 'Tax3Information',                   'type'=> 'FloatRaw',          'len'=>[1, 11],                              'req'=> false, ],             // Tax Two Information
        ]],
       [                'key'=> '#068',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

       [                'key'=> 'complex:36',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'TX4-',               'req'=> true, ],              // Tax Four Identifier
           [            'key'=> 'Tax4Code',                          'type'=> 'StringRaw',         'len'=> 2,                                   'req'=> false, ],             // Tax Code
           [            'key'=> 'Tax4Information',                   'type'=> 'StringRaw',         'len'=>[0, 2],                               'req'=> false, ],             // Tax Four Information
        ]],
	   [                'key'=> '#068',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

		[                'key'=> 'complex:36',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'TX5-',               'req'=> true, ],              // Tax Four Identifier
           [            'key'=> 'Tax5Code',                          'type'=> 'StringRaw',         'len'=> 2,                                   'req'=> false, ],             // Tax Code
           [            'key'=> 'Tax5Information',                   'type'=> 'StringRaw',         'len'=>[0, 2],                               'req'=> false, ],             // Tax Four Information
        ]],
	   [                'key'=> '#068',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

		[                'key'=> 'complex:36',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'TX6-',               'req'=> true, ],              // Tax Four Identifier
           [            'key'=> 'Tax6Code',                          'type'=> 'StringRaw',         'len'=> 2,                                   'req'=> false, ],             // Tax Code
           [            'key'=> 'Tax6Information',                   'type'=> 'StringRaw',         'len'=>[0, 2],                               'req'=> false, ],             // Tax Four Information
        ]],
	   [                'key'=> '#068',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

		[                'key'=> 'complex:36',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'TX7-',               'req'=> true, ],              // Tax Four Identifier
           [            'key'=> 'Tax7Code',                          'type'=> 'StringRaw',         'len'=> 2,                                   'req'=> false, ],             // Tax Code
           [            'key'=> 'Tax7Information',                   'type'=> 'StringRaw',         'len'=>[0, 2],                               'req'=> false, ],             // Tax Four Information
        ]],
	   [                'key'=> '#068',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

		[                'key'=> 'complex:36',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'TX8-',               'req'=> true, ],              // Tax Four Identifier
           [            'key'=> 'Tax8Code',                          'type'=> 'StringRaw',         'len'=> 2,                                   'req'=> false, ],             // Tax Code
           [            'key'=> 'Tax8Information',                   'type'=> 'StringRaw',         'len'=>[0, 2],                               'req'=> false, ],             // Tax Four Information
        ]],
	   [                'key'=> '#068',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

		[                'key'=> 'complex:36',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'TX9-',               'req'=> true, ],              // Tax Four Identifier
           [            'key'=> 'Tax9Code',                          'type'=> 'StringRaw',         'len'=> 2,                                   'req'=> false, ],             // Tax Code
           [            'key'=> 'Tax9Information',                   'type'=> 'StringRaw',         'len'=>[0, 2],                               'req'=> false, ],             // Tax Four Information
        ]],
	   [                'key'=> '#068',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator


       [                'key'=> 'complex:48',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'TT1-',               'req'=> true, ],              // Ticket Tax One Identifier (note 21)
           [            'key'=> 'TicketTax1Code',                    'type'=> 'StringRaw',         'len'=> 2,                                   'req'=> false, ],             // Ticket Tax Code x.x      Ticket Tax One Information 11
        ]],
       [                'key'=> '#102',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

	   [                'key'=> 'complex:48',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'TT2-',               'req'=> true, ],              // Ticket Tax One Identifier (note 21)
           [            'key'=> 'TicketTax2Code',                    'type'=> 'StringRaw',         'len'=> 2,                                   'req'=> false, ],             // Ticket Tax Code x.x      Ticket Tax One Information 11
        ]],
       [                'key'=> '#102',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator
       [                'key'=> 'complex:48',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'TT3-',               'req'=> true, ],              // Ticket Tax One Identifier (note 21)
           [            'key'=> 'TicketTax3Code',                    'type'=> 'StringRaw',         'len'=> 2,                                   'req'=> false, ],             // Ticket Tax Code x.x      Ticket Tax One Information 11
        ]],
       [                'key'=> '#102',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

	   [                'key'=> 'complex:48',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'TT4-',               'req'=> true, ],              // Ticket Tax One Identifier (note 21)
           [            'key'=> 'TicketTax4Code',                    'type'=> 'StringRaw',         'len'=> 2,                                   'req'=> false, ],             // Ticket Tax Code x.x      Ticket Tax One Information 11
        ]],
       [                'key'=> '#102',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator
       [                'key'=> 'complex:48',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'TT5-',               'req'=> true, ],              // Ticket Tax One Identifier (note 21)
           [            'key'=> 'TicketTax5Code',                    'type'=> 'StringRaw',         'len'=> 2,                                   'req'=> false, ],             // Ticket Tax Code x.x      Ticket Tax One Information 11
        ]],
       [                'key'=> '#102',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

	   [                'key'=> 'complex:48',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'TT6-',               'req'=> true, ],              // Ticket Tax One Identifier (note 21)
           [            'key'=> 'TicketTax6Code',                    'type'=> 'StringRaw',         'len'=> 2,                                   'req'=> false, ],             // Ticket Tax Code x.x      Ticket Tax One Information 11
        ]],
       [                'key'=> '#102',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator
       [                'key'=> 'complex:48',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'TT7-',               'req'=> true, ],              // Ticket Tax One Identifier (note 21)
           [            'key'=> 'TicketTax7Code',                    'type'=> 'StringRaw',         'len'=> 2,                                   'req'=> false, ],             // Ticket Tax Code x.x      Ticket Tax One Information 11
        ]],
       [                'key'=> '#102',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

	   [                'key'=> 'complex:48',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'TT8-',               'req'=> true, ],              // Ticket Tax One Identifier (note 21)
           [            'key'=> 'TicketTax8Code',                    'type'=> 'StringRaw',         'len'=> 2,                                   'req'=> false, ],             // Ticket Tax Code x.x      Ticket Tax One Information 11
        ]],
       [                'key'=> '#102',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator
       [                'key'=> 'complex:48',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'TT9-',               'req'=> true, ],              // Ticket Tax One Identifier (note 21)
           [            'key'=> 'TicketTax9Code',                    'type'=> 'StringRaw',         'len'=> 2,                                   'req'=> false, ],             // Ticket Tax Code x.x      Ticket Tax One Information 11
        ]],
       [                'key'=> '#102',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

	   [                'key'=> 'complex:48',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'TT10-',              'req'=> true, ],              // Ticket Tax One Identifier (note 21)
           [            'key'=> 'TicketTax10Code',                    'type'=> 'StringRaw',        'len'=> 2,                                   'req'=> false, ],             // Ticket Tax Code x.x      Ticket Tax One Information 11
        ]],
       [                'key'=> '#102',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator
       [                'key'=> 'complex:48',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'TT11-',               'req'=> true, ],              // Ticket Tax One Identifier (note 21)
           [            'key'=> 'TicketTax11Code',                    'type'=> 'StringRaw',         'len'=> 2,                                   'req'=> false, ],             // Ticket Tax Code x.x      Ticket Tax One Information 11
        ]],
       [                'key'=> '#102',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

	   [                'key'=> 'complex:48',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'TT11-',               'req'=> true, ],              // Ticket Tax One Identifier (note 21)
           [            'key'=> 'TicketTax11Code',                   'type'=> 'StringRaw',         'len'=> 2,                                   'req'=> false, ],             // Ticket Tax Code x.x      Ticket Tax One Information 11
        ]],
       [                'key'=> '#102',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator
       [                'key'=> 'complex:48',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'TT12-',               'req'=> true, ],              // Ticket Tax One Identifier (note 21)
           [            'key'=> 'TicketTax12Code',                   'type'=> 'StringRaw',         'len'=> 2,                                   'req'=> false, ],             // Ticket Tax Code x.x      Ticket Tax One Information 11
        ]],
       [                'key'=> '#102',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

	   [                'key'=> 'complex:48',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'TT13-',               'req'=> true, ],              // Ticket Tax One Identifier (note 21)
           [            'key'=> 'TicketTax13Code',                   'type'=> 'StringRaw',         'len'=> 2,                                   'req'=> false, ],             // Ticket Tax Code x.x      Ticket Tax One Information 11
        ]],
       [                'key'=> '#102',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator
       [                'key'=> 'complex:48',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'TT14-',               'req'=> true, ],              // Ticket Tax One Identifier (note 21)
           [            'key'=> 'TicketTax14Code',                   'type'=> 'StringRaw',         'len'=> 2,                                   'req'=> false, ],             // Ticket Tax Code x.x      Ticket Tax One Information 11
        ]],
       [                'key'=> '#102',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

	   [                'key'=> 'complex:48',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'TT15-',               'req'=> true, ],              // Ticket Tax One Identifier (note 21)
           [            'key'=> 'TicketTax15Code',                   'type'=> 'StringRaw',         'len'=> 2,                                   'req'=> false, ],             // Ticket Tax Code x.x      Ticket Tax One Information 11
        ]],
       [                'key'=> '#102',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator
       [                'key'=> 'complex:48',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'TT16-',               'req'=> true, ],              // Ticket Tax One Identifier (note 21)
           [            'key'=> 'TicketTax16Code',                   'type'=> 'StringRaw',         'len'=> 2,                                   'req'=> false, ],             // Ticket Tax Code x.x      Ticket Tax One Information 11
        ]],
       [                'key'=> '#102',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

	   [                'key'=> 'complex:48',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'TT17-',               'req'=> true, ],              // Ticket Tax One Identifier (note 21)
           [            'key'=> 'TicketTax17Code',                   'type'=> 'StringRaw',         'len'=> 2,                                   'req'=> false, ],             // Ticket Tax Code x.x      Ticket Tax One Information 11
        ]],
       [                'key'=> '#102',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator
       [                'key'=> 'complex:48',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'TT18-',               'req'=> true, ],              // Ticket Tax One Identifier (note 21)
           [            'key'=> 'TicketTax18Code',                   'type'=> 'StringRaw',         'len'=> 2,                                   'req'=> false, ],             // Ticket Tax Code x.x      Ticket Tax One Information 11
        ]],
       [                'key'=> '#102',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

	   [                'key'=> 'complex:48',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'TT19-',               'req'=> true, ],              // Ticket Tax One Identifier (note 21)
           [            'key'=> 'TicketTax19Code',                   'type'=> 'StringRaw',         'len'=> 2,                                   'req'=> false, ],             // Ticket Tax Code x.x      Ticket Tax One Information 11
        ]],
       [                'key'=> '#102',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator
       [                'key'=> 'complex:48',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'TT20-',               'req'=> true, ],              // Ticket Tax One Identifier (note 21)
           [            'key'=> 'TicketTax20Code',                   'type'=> 'StringRaw',         'len'=> 2,                                   'req'=> false, ],             // Ticket Tax Code x.x      Ticket Tax One Information 11
        ]],
       [                'key'=> '#102',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator


       [                'key'=> 'complex:86',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 3,     'val'=> 'TL-',                'req'=> true, ],              // Total Amount Identifer
           [            'key'=> 'TotalAmountInformationCurrency',    'type'=> 'StringRaw',         'len'=> 3,                                   'req'=> false, ],             // Currency Code
           [            'key'=> 'TotalAmountInformation',            'type'=> 'FloatRaw',          'len'=>[1, 11],                              'req'=> false, ],             // Amount Information (see Note 13)
        ]],
       [                'key'=> '#204',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

       [                'key'=> 'complex:88',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 3,     'val'=> 'IS-',                'req'=> true, ],              // Issued in Connection with Identifer x.x      Issued in Connection with Number 17
           [            'key'=> 'IssuedInConnectionWith',            'type'=> 'Digits',                                                         'req'=> true, ],             // Form of Payment Code (See note 23) x.x      Primary form of payment info (see Chart A)
        ]],
       [                'key'=> '#208',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

       [                'key'=> 'complex:90',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 3,     'val'=> 'FP-',                'req'=> true, ],              // Form of Payment Identifer
           [            'key'=> 'FormOfPaymentCode1',                'type'=> 'StringDelimitedByChar',            'val' => '\\',                'req'=> false, ],             // Form of Payment Code (See note 23) x.x      Primary form of payment info (see Chart A)
        ]],
       [                'key'=> '#212',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

       [                'key'=> 'complex:92',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'AM1-',               'req'=> true, ],              // Amount One Identifier (See note 23) d.d      Amount for first form of payment 11
           [            'key'=> 'AmountForFirstFormOfPayment1',      'type'=> 'FloatRaw',                                                       'req'=> false, ],             // Form of Payment Code (See note 23) x.x      Primary form of payment info (see Chart A)
        ]],
       [                'key'=> '#216',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

       [                'key'=> 'complex:94',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'FPP-',               'req'=> true, ],              // Second form of payment identifer
           [            'key'=> 'FormOfPaymentCode2',                'type'=> 'StringDelimitedByChar',            'val' => '\\',                'req'=> false, ],             // Form of payment code (see Chart A; see Note 23) x.x      Primary form of payment info (Chart A) 65
        ]],
       [                'key'=> '#222',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

       [                'key'=> 'complex:96',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'AM2-',               'req'=> true, ],              // Amount Two Identifier (See note 23) d.d      Amount for first form of payment 11
           [            'key'=> 'AmountForFirstFormOfPayment2',      'type'=> 'FloatRaw',                                                       'req'=> false, ],
        ]],
       [                'key'=> '#226',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

       [                'key'=> 'complex:98',                        'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'FP1-',               'req'=> true, ],              // First free flow field identifier for FOP x.x      First free flow data for FOP 65
        ]],
       [                'key'=> '#230',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

       [                'key'=> 'complex:100',                       'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'FP2-',               'req'=> true, ],              // Second free flow field identifier for FOP x.x      Second free flow data for FOP 65
        ]],
       [                'key'=> '#234',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

       [                'key'=> 'complex:102',                       'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'FP3-',               'req'=> true, ],              // Third free flow field identifier for FOP x.x      Third free flow data for FOP 65
        ]],
       [                'key'=> '#238',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

       [                'key'=> 'complex:104',                       'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'FP4-',               'req'=> true, ],              // Fourth free flow field identifier for FOP x.x      Fourth free flow data for FOP 65
        ]],
       [                'key'=> '#242',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

       [                'key'=> 'complex:106',                       'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 3,     'val'=> 'IT-',                'req'=> true, ],              // IT Tour Code Identifier (see Note 25)
           [            'key'=> 'ITTourCode',                        'type'=> 'StringDelimitedByChar',            'val' => '\\',                'req'=> false, ],             // IT Tour Code
        ]],
       [                'key'=> '#245',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

//        [                'key'=> 'complex:108',                       'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
//            [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 3,     'val'=> 'PR-',                'req'=> true, ],              // Print Routine Identifier (see Note 22)
//            [            'key'=> 'CustomPrintRoutineIdentifier',      'type'=> 'StringRaw',         'len'=> 2,                                   'req'=> false, ],             // Custom print routine identifier
//         ]],
//        [                'key'=> '#248',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

       [                'key'=> 'complex:110',                       'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 3,     'val'=> 'PR-',                'req'=> true, ],              // Print Routine Identifier (see Note 22)
           [            'key'=> 'CustomPrintRoutineIdentifier',      'type'=> 'StringRaw',         'len'=> 2,                                   'req'=> false, ],             // Custom print routine identifier
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 3,     'val'=> 'CM-',                'req'=> false, ],             // Commission Identifier (see note 18)
           [            'key'=> 'ExchangeTransaction',               'type'=> 'StringRaw',         'len'=> 4,                                   'req'=> false, ],             // Exchange Transaction
        ]],
       [                'key'=> '#253',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

       [                'key'=> 'complex:112',                       'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 3,     'val'=> 'CP-',                'req'=> true, ],              // Commission Percentage Identifier
           [            'key'=> 'CommissionPercentage',              'type'=> 'StringDelimitedByChar',            'val' => '\\',                'req'=> false, ],             // Commission Percentage
        ]],
       [                'key'=> '#256',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

       [                'key'=> 'complex:114',                       'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 3,     'val'=> 'CA-',                'req'=> true, ],              // Commission Amount Identifier
           [            'key'=> 'CommissionAmount',                  'type'=> 'FloatRaw',                                                       'req'=> false, ],             // Commission amount
        ]],
       [                'key'=> '#259',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

       [                'key'=> 'complex:116',                       'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'EX1-',               'req'=> true, ],              // Issued in Exchange for Identifier
           [            'key'=> 'ExchangeType',                      'type'=> 'Alphanumeric',      'len'=> 1,                                   'req'=> false, ],             // Exchange type (E=even, I=uneven)
           [            'key'=> 'FirstDocumentTypeIndicator',        'type'=> 'Alphanumeric',      'len'=> 1,                                   'req'=> false, ],             // First document type indicator (see Note 10)
           [            'key'=> 'FirstDocumentNumber',               'type'=> 'StringDelimitedByChar',            'val' => '-',                 'req'=> false, ],             // First document number (see Note 11)
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 1,     'val'=> '-',                  'req'=> true, ],              // Dash
           [            'key'=> 'CouponNumbers',                     'type'=> 'StringDelimitedByChar',            'val' => '-',                 'req'=> false, ],             // Coupon Numbers (see Note 12)
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 1,     'val'=> '-',                  'req'=> false, ],             // Dash (see Note 24)
           [            'key'=> 'Last3DigitsOfConjunctTicketSet',    'type'=> 'Integer',           'len'=>[1, 3],                         'req'=> false, ],             // Last 3 digits of conjunct ticket set (see Note 24)
        ]],
       [                'key'=> '#269',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

//        [                'key'=> 'complex:118',                       'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
//            [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'EX2-',               'req'=> true, ],              // Issued in Exchange for Identifier 2
//            [            'key'=> 'ExchangeType',                      'type'=> 'Alphanumeric',      'len'=> 1,                                   'req'=> false, ],             // Exchange type (E=even, I=uneven) a            Second document type indicator
//            [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 1,     'val'=> '\(see',              'req'=> true, ],              // note 10)
//            [            'key'=> 'SecondDocumentNumber',              'type'=> 'StringRaw',         'len'=>[0, 14],                        'req'=> false, ],             // Second document number (see Note 11)
//            [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 1,     'val'=> '-',                  'req'=> false, ],             // Dash
//            [            'key'=> 'CouponNumbers',                     'type'=> 'StringRaw',         'len'=>[0, 4],                         'req'=> false, ],             // Coupon Numbers (see Note 12)
//            [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 1,     'val'=> '-',                  'req'=> false, ],             // Dash (see Note 24)
//            [            'key'=> 'Last3DigitsOfConjunctTicketSet',    'type'=> 'Integer',           'len'=>[1, 3],                         'req'=> false, ],             // Last 3 digits of conjunct ticket set (see Note 24)
//         ]],
//        [                'key'=> '#280',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

//        [                'key'=> 'complex:120',                       'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
//            [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'EX3-',               'req'=> true, ],              // Issued in Exchange for Identifier 3
//            [            'key'=> 'ExchangeType',                      'type'=> 'Alphanumeric',      'len'=> 1,                                   'req'=> false, ],             // Exchange type (E=even, I=uneven)
//            [            'key'=> 'ThirdDocumentTypeIndicator',        'type'=> 'Alphanumeric',      'len'=> 1,                                   'req'=> false, ],             // Third document type indicator (see Note 10)
//            [            'key'=> 'ThirdDocumentNumber',               'type'=> 'StringRaw',         'len'=>[0, 14],                        'req'=> false, ],             // Third document number (see Note 11)
//            [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 1,     'val'=> '-',                  'req'=> true, ],              // Dash
//            [            'key'=> 'CouponNumbers',                     'type'=> 'StringRaw',         'len'=>[0, 4],                         'req'=> false, ],             // Coupon Numbers (see Note 12)
//            [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 1,     'val'=> '-',                  'req'=> false, ],             // Dash (see Note 24)
//            [            'key'=> 'Last3DigitsOfConjunctTicketSet',    'type'=> 'Integer',           'len'=>[1, 3],                         'req'=> false, ],             // Last 3 digits of conjunct ticket set (see Note 24)
//         ]],
//        [                'key'=> '#290',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator

       [                'key'=> 'complex:122',                       'type'=> 'Complex', 'merge'=>true,                                         'req'=> false, 'children'=>[
           [            'key'=> 'key',                               'type'=> 'Constant',          'len'=> 4,     'val'=> 'OID-',               'req'=> true, ],              // Original Issue Document Identifier a            Document type indicator (T=Ticket,
           [            'key'=> 'OriginalIssueDocumentNumber',       'type'=> 'StringDelimitedByChar',            'val' => '\\',                'req'=> false, ],             // Original Issue Document Number
        ]],
       [                'key'=> '#295',                              'type'=> 'Separator',                                                      'req'=> false, ],             // Field Separator
       [                'key'=> 'key',                               'type'=> 'Constant',          'len'=> 3,     'val'=> 'OI-',                'req'=> false, ],             // Original Issue Identifier
       [                'key'=> 'PlaceOfIssue',                      'type'=> 'Alphanumeric',      'len'=> 3,                                   'req'=> false, ],             // Place of issue
       [                'key'=> 'OriginalIssueDate',                 'type'=> 'Date',              'len'=> 7,     'fmt'=> 'DDMMMYY',            'req'=> false, ],             // Original issue date
       [                'key'=> 'OriginalIssueAgencyIATA',           'type'=> 'Integer',           'len'=> 7,                                   'req'=> false, ],             // Original issue agency IATA
       [                'key'=> 'key',                               'type'=> 'Constant',          'len'=> 3,     'val'=> 'NF-',                'req'=> false, ],             // Net Fare Amount Identifier
       [                'key'=> 'ToNetFAmtCurrencyCode',             'type'=> 'StringRaw',         'len'=> 3,                                   'req'=> false, ],             // Currency Code
       [                'key'=> 'TotalNetFareAmount',                'type'=> 'StringRaw',                                                      'req'=> false, ],             // Total Net Fare Amount
	];

	protected function postExtract(\App\Utils\BaseParser\TextParser\ExtractedBlock $ret)
	{
		if ($ret->extractedData['PassengerName']) {
			$ret->extractedData['PassengerName_'] = $this->doExtractPassengerName($ret->extractedData['PassengerName']);
		}

      if ($ret->extractedData['FormOfPaymentCode1']) {
			$ret->extractedData['FormOfPaymentCode1_'] = $this->extractFP($ret->extractedData['FormOfPaymentCode1'], "", "", "", "");
		}

// 		for ($i=1; $i<=3; $i++) {
// 			if ($ret->extractedData["Tax{$i}CodeIdentifier"]) {
// 				$ret->extractedData["Tax{$i}CodeIdentifier"] = trim($ret->extractedData["Tax{$i}CodeIdentifier"]);
// 				if ($ret->extractedData["Tax{$i}CodeIdentifier"][0]=='X' && strlen($ret->extractedData["Tax{$i}CodeIdentifier"])==3) {
// 					$ret->extractedData["Tax{$i}CodeIdentifier"] = substr($ret->extractedData["Tax{$i}CodeIdentifier"], 1);
// 				}
// 			}
// 		}


		return $ret;
	}
}
