<?php
namespace App\Amadeus\FileParser;

class Line_TSA extends \App\Amadeus\FileParser\LineAbstract
{
	/**
	 * 4.92. TSA TST Segment Association
	 * see page 255(297)
	 *
	 * Used as separator segment when several TST’s per Pax applies. It presence is  mandatory in the IMR with multi-fares per pax.
	 * It contains the segment association and specific routing TST related data usually stored in the C-  and G- lines.
	 */
	protected $structure = [
		['name'=> 'MSGTAG',     'val' => 'TSA-',   'type' => 'AN',   'req' => 'M',                                     'len' => 4,],                    // 1 : Message Tag (TSA)
		['name' => 'SALEINFO',                    'type' =>'composite',                                                                                 // 2 SALES INDICATOR AND ORIGIN DESTINATION
		 'childs' => [
		   ['name'=> 'INTIND',                    'type' => 'S:trim',                                                  'len' => 3,],                    // 3 : International and/or Self Sale Indicator (value of ___, X__, _/S or X/S where _ = blank, X = international, S = self sale)
		   ['name'=> 'DELIM',   'val' => '+',     'type' => 'AN',                                                      'len' => 1,],                    // 4 : Delimiter (Constant value of '+')
		   ['name'=> 'SALEIND',                   'type' => 'AN',                                                      'len' => 4,],                    // 5 : International Sales indicator (value of SITI, SOTO, SOTI or SITO).
		   ['name'=> 'DELIM',   'val' => '+',     'type' => 'AN',                                                      'len' => 1,],                    // 6 : Delimiter (Constant value of '+')
		   ['name'=> 'ORG',                       'type' => 'AN',                                                      'len' => 3,],                    // 7 : Origin/Destination of the itinerary
		   ['name'=> 'DEST',                      'type' => 'AN',                                                      'len' => 3,],                    // 7 : Origin/Destination of the itinerary
		   ['name'=> 'DELIM',   'val' => '+',     'type' => 'AN',                                                      'len' => 1,],                    // 8 : Delimiter (Constant value of '+')
		   ['name'=> 'DOMISO',                    'type' => 'AN',                                                      'len' => 2,],                    // 9 : Conditional on INTIND
		 ]],                                                                                                                                                   // 10 END OF COMPOSITE ELEMENT
		['name'=> 'DELIM',      'val' => ';',     'type' => 'AN',   'req' => 'M',                                      'len' => 1,],                    // 11 : Delimiter (Constant value of ';')
		['name' => 'PRCINFO',                     'type' =>'composite',                                                                                 // 12 PRICING INFORMATION
		 'childs' => [
		   ['name'=> 'PRCDE',                     'type' => 'AN',                                                      'len' => 1,],                    // 13 : Pricing Code
		   ['name'=> 'DELIM',   'val' => '+',     'type' => 'AN',                                                      'len' => 1,],                    // 14 : Delimiter (Constant value of '+')
		   ['name'=> 'FCMI',                      'type' => 'AN',                                                      'len' => 1,],                    // 15 : Fare Calculation Mode Indicator
		   ['name'=> 'DELIM',   'val' => '+',     'type' => 'AN',                                                      'len' => 1,],                    // 16 : Delimiter (Constant value of '+')
		   ['name'=> 'DELIM',   'val' => '+',     'type' => 'AN',                                                      'len' => 1,],                    // 18 : Delimiter (Constant value of '+')
		   ['name'=> 'JRNYTYPE',                  'type' => 'AN',                                                      'len' => 1,],                    // 17 : Type of Journey 0=IATA 1=ATAF (within France Metropolitan) 2=ATAF Out of France
		   ['name'=> 'JRNYCODE',                  'type' => 'AN',                                                      'len' => 1,],                    // 19 : Type of journey code
		   ['name'=> 'DELIM',   'val' => '+',     'type' => 'AN',                                                      'len' => 1,],                    // 20 : Delimiter (Constant value of '+')
		   ['name'=> 'PSURCHG',                   'type' => 'AN',                                                      'len' => 1,],                    // 21 : ET/PT surcharge   :
		 ]],                                                                                                                                                   // 22 END OF COMPOSITE ELEMENT
		['name'=> 'SEGASS',     'val' => ';S',    'type' => 'ASSOC',],
	];
}
