<?php
namespace App\Galileo\LineParser\Types; class Header_Line2 extends \App\Galileo\LineParser\Types\GalileoBase { protected $children = [ ['key'=>'T50BPC', 'type'=>'StringTrim','len'=>4, 'label'=>'BOOKING AGENCY ACCOUNT CODE'], ['key'=>'T50TPC', 'type'=>'StringTrim','len'=>4, 'label'=>'ISSUING/TICKETING AGENCY ACCOUNT CODE'], ['key'=>'T50AAN', 'type'=>'StringTrim','len'=>9, 'label'=>'AGENCY ACCOUNT NUMBER'], ['key'=>'T50RCL', 'type'=>'StringRaw', 'len'=>6, 'label'=>'RECORD LOCATOR'], ['key'=>'T50ORL', 'type'=>'StringTrim','len'=>6, 'label'=>'RECORD LOCATOR FROM ORIGINATING'], ['key'=>'T50OCC', 'type'=>'StringTrim','len'=>2, 'label'=>'OTHER CRS/AIRLINE CODE'], ['key'=>'T50OAM', 'type'=>'StringRaw', 'len'=>1, 'label'=>'AUTOMATIC/MANUAL INDICATOR'], ['key'=>'T50AGS', 'type'=>'StringRaw', 'len'=>6, 'label'=>'BOOKING AGENT SIGN'], ['key'=>'T50SBI', 'type'=>'Letters', 'len'=>1, 'label'=>'SERVICE BUREAU INDICATOR'], ['key'=>'T50AGT', 'label'=>'ISSUING AGENT DATA', 'children' => [ ['key'=>'T50SIN', 'type'=>'StringTrim','len'=>2, 'label'=>'TICKETING AGENT SIGN'], ['key'=>'T50DTY', 'type'=>'Letters', 'len'=>2, 'label'=>'AGENT DUTY CODE'], ]], ['key'=>'T50PNR', 'type'=>'Date', 'len'=>7, 'label'=>'PNR/BOOKING FILE CREATION DATE'], ['key'=>'T50EHT', 'type'=>'Integer', 'len'=>3, 'label'=>'ELAPSED PNR/BOOKING FILE HANDLING TIME'], ['key'=>'T50DTL', 'type'=>'Date', 'len'=>7, 'label'=>'DATE OF LAST CHANGE TO PNR/BOOKING FILE'], ['key'=>'T50NMC', 'type'=>'Integer', 'len'=>3, 'label'=>'NUMBER OF CHANGES TO PNR/BOOKING FILE'], ]; protected function postExtract(\App\Utils\BaseParser\TextParser\ExtractedBlock $ret) { $assoc = [ 'AG' => 'Agent', 'TA' => 'Training', 'OU' => 'Outside Agent', 'MA' => 'Meshing Agent', 'SU' => ' GI/NDC user', ]; if ($assoc[$ret->extractedData['T50AGT']['T50DTY']]) { $ret->extractedData['T50AGT']['T50DTY_'] = $assoc[$ret->extractedData['T50AGT']['T50DTY']]; } $ret->extractedData['T50AGS_']['sign'] = trim(substr($ret->extractedData['T50AGS'], -2)); return $ret; } } 