<?php
namespace App\Amadeus\FileParser;

class Line_TAC extends \App\Amadeus\FileParser\LineAbstract
{
	/**
	 * 4.48. TAC Amadeus Tours Server : Accommodation Data Line
	 * see page 149(191)
	 *
	 * Used to store the accommodation-related data contained in an automated Amadeus Tours segment for which
	 * the master booking is is in the Amadeus Tours Server (ATS). This data is stored in the ATS.
	 */
	protected $structure = [
		['name'=> 'MSGTAG',     'val' => 'TAC',   'type' => 'AN',   'req' => 'M',                                   'len' => 3,],                          // 1 : Message Tag (TAC)
		['name'=> 'TTONBR',                       'type' => 'N',    'req' => 'M',                                   'len' => 3,],                          // 2 : Tattoo Number in the PNR
		['name'=> 'DELIM',      'val' => ';',     'type' => 'AN',   'req' => 'M',                                   'len' => 1,],                          // 3 : Delimiter (Constant value of ';')
		['name'=> 'SEGNBR',                       'type' => 'N',    'req' => 'M',                                   'len' => 3,],                          // 4 : Segment Number in the PNR
		['name'=> 'DELIM',      'val' => ' ',     'type' => 'AN',   'req' => 'M',                                   'len' => 1,],                          // 5 : Delimiter (Constant value of blank)
		['name'=> 'TURPRV',                       'type' => 'AN',   'req' => 'M',                                   'len_min' => 1,   'len_max' => 3,],    // 6 : Tour provider code
		['name'=> 'DELIM',      'val' => ';',     'type' => 'AN',   'req' => 'M',                                   'len' => 1,],                          // 7 : Delimiter (Constant value of ';')
		['name'=> 'TURPRD',                       'type' => 'AN',   'req' => 'M',],                                                                        // 8 : Product's name or code
		['name'=> 'DELIM',      'val' => ';',     'type' => 'AN',   'req' => 'M',                                   'len' => 1,],                          // 9 : Delimiter (Constant value of ';')
		['name'=> 'ITEMNUM',                      'type' => 'AN',   'req' => 'M',                                   'len_min' => 1,   'len_max' => 3,],    // 10 : Item number in Tour product. Internal reference.
		['name'=> 'DELIM',      'val' => ';',     'type' => 'AN',   'req' => 'M',                                   'len' => 1,],                          // 11 : Delimiter (Constant value of ';')
		['name'=> 'ACMID',                        'type' => 'AN',   'req' => 'M',                                   'len' => 3,],                          // 12 : Accommodation Type Identifier. HTL : hotel, APT : apartment, VIL : villa, CHA : chalet, CAM : camping, RES : resort or BNB bed and breakfest
		['name'=> 'DELIM',      'val' => ';',     'type' => 'AN',   'req' => 'M',                                   'len' => 1,],                          // 13 : Delimiter (Constant value of ';')
		['name'=> 'CIECDE',                       'type' => 'AN',   'req' => 'M',],                                                                        // 14 : Company operating the service
		['name'=> 'DELIM',      'val' => ';',     'type' => 'AN',   'req' => 'M',                                   'len' => 1,],                          // 15 : Delimiter (Constant value of ';')
		['name'=> 'CTRCDE',                       'type' => 'AN',                                                   'len' => 2,],                          // 16 : Country Code
		['name'=> 'DELIM',      'val' => ';',     'type' => 'AN',   'req' => 'M',                                   'len' => 1,],                          // 17 : Delimiter (Constant value of ';')
		['name'=> 'CTYPAIR',                      'type' => 'AN',   'req' => 'M',                                   'len' => 3,],                          // 18 : Accommodation City code
		['name'=> 'DELIM',      'val' => ';',     'type' => 'AN',   'req' => 'M',                                   'len' => 1,],                          // 19 : Delimiter (Constant value of ';')
		['name'=> 'CTYTRANS',                     'type' => 'AN',   'req' => 'M',],                                                                        // 20 : Accommodation City translation
		['name'=> 'DELIM',      'val' => ';',     'type' => 'AN',   'req' => 'M',                                   'len' => 1,],                          // 21 : Delimiter (Constant value of ';')
		['name'=> 'ARRDTE',                       'type' => 'D:DDMMM:PNRDTE',                                              'len' => 5,],                          // 22 : Check-in date (DDMMM)
		['name'=> 'DELIM',      'val' => ';',     'type' => 'AN',   'req' => 'M',                                   'len' => 1,],                          // 23 : Delimiter (Constant value of ';')
		['name'=> 'DPTDTE',                       'type' => 'D:DDMMM:PNRDTE',                                              'len' => 5,],                          // 24 : Check-out date (DDMMM)
		['name'=> 'DELIM',      'val' => ';',     'type' => 'AN',   'req' => 'M',                                   'len' => 1,],                          // 25 : Delimiter (Constant value of ';')
		['name'=> 'DURTME',                       'type' => 'AN',                                                   'len' => 5],                           // 26 : Duration time. Format nnnXX, nnn = duration, XX = Time unit (DY: day, HR: hour, MH: month, MN: minute, NT: night, WK: week, YR: year)
		['name'=> 'DELIM',      'val' => ';',     'type' => 'AN',   'req' => 'M',                                   'len' => 1,],
// 		Array( 'name'=> 'FLD',                       	'type' => 'AN', ),                           // 26 : Duration time. Format nnnXX, nnn = duration, XX = Time unit (DY: day, HR: hour, MH: month, MN: minute, NT: night, WK: week, YR: year)
		['name' => 'RMDET',                       'type' =>'composite',                                             'rep' => 99,                           // 27 ROOM DETAILS INFORMATION
		 'childs' => [
		   ['name'=> 'RMTYP',                     'type' => 'AN',                                                   'len' => 3,],                          // 28 : Room Type
		   ['name'=> 'DELIM',   'val' => '/',     'type' => 'AN',                  'requires' => ['RMTYP'],   'len' => 1,],                          // 29 : Delimiter (Constant value of '/')
		   ['name'=> 'MLPLN',                     'type' => 'AN',                  'requires' => ['RMTYP',], 'len' => 3,],                          // 30 : Meal Plan Code
		   ['name'=> 'DELIM',   'val' => '+',     'type' => 'AN',                  'requires' => ['MLPLN'],   'len' => 1,],                          // 31 : Delimiter (Constant value of '+'). No delimiter follows last Room Type.
		 ]],                                                                                                                                                      // 32
	];
}
