<?php
namespace App\Galileo\NDCLineParser\Types;

/**
 * Data line
 * @author Lucian Sirbu
 */
class Data_ReservationConfirmed extends \App\Galileo\LineParser\Types\GalileoBase
{
	protected $extractRegexp = "/^(?P<rawData>FT-#TAS[0-9]+#RESERVATION CONFIRMED [0-9]{2}[A-Z]{3}.+)/";
	protected $useCustomRegexp = true;

	/**
	 * Children elements
	 */
	protected $children = [
		[ 'key'=>'FT',  	                     'type'=>'Constant',        			 'val'=> 'FT-',                           'label'=>'DOCI-FREETEXT-#' ],
		[ 'key'=>'TAS',                          'type'=>'Constant',                     'val'=> '#TAS', ],
		[ 'key'=>'fareNumber',                   'type'=>'Integer',              'len' => 2, ],
		[ 'key'=>'separator',                    'type'=>'Constant',                     'val'=> '#', ],

		[ 'key'=>'RESERVATION CONFIRMED',        'type'=>'Constant',                     'val'=> 'RESERVATION CONFIRMED ', ],
		[ 'key'=>'date',                         'type'=>'Date',  'fmt' => 'DDMMMYY',  ],
		[ 'key'=>'separator',                    'type'=>'Constant',                     'val'=> ' ', ],
		[ 'key'=>'time',                         'type'=>'Time',  'fmt' => 'HHMM', ],
		[ 'key'=>'zulu',                         'type'=>'Constant',                     'val'=> 'Z', ],
	];
}
