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

/**
 * Data line
 * @author Lucian Sirbu
 */
class Data_TicketNumbers extends \App\Galileo\LineParser\Types\GalileoBase
{
	protected $extractRegexp = "/^(?P<rawData>FT-#TAS[0-9]+#TKT\/P[0-9\-]+\/S[0-9\-]+\/.+)/";
	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'=>'TKT',                          'type'=>'Constant',                     'val'=> 'TKT/P', ],
		[ 'key'=>'passengerIdentifier',          'type'=>'Integer', ],
		[ 'key'=>'SEG',                          'type'=>'Constant',                     'val'=> '/S', ],
		[ 'key'=>'segmentNumber',                'type'=>'Association', ],
		[ 'key'=>'separator',                    'type'=>'Constant',                     'val'=> '/', ],
		[ 'key'=>'ticketNumber',                 'type'=>'Digits', ],
	];
}
