<?php
namespace App\Galileo\StructureParser\Structures\Ticketing;

class Agent extends \App\Galileo\StructureParser\Structures\Base\Agent
{
	protected function _getData()
	{
		list($parsedStructure, , ) = $this->getTransactionDetails();

		$item = new \App\Galileo\StructureParser\Types\Agent();
		$item->bookingAgent = 	new \App\Galileo\StructureParser\Types\User();
		$item->issuingAgent = 	new \App\Galileo\StructureParser\Types\User();

		$item->bookingAgent->idSystemOffice = 	$parsedStructure['header']['line2']['T50BPC'];
		$item->bookingAgent->idSystemUser = 	$parsedStructure['header']['line2']['T50AGS_']['sign'];

		$item->issuingAgent->officeIATACode = 	$parsedStructure['header']['line2']['T50AAN'];

		$item->issuingAgent->idSystemOffice = 	$parsedStructure['header']['line2']['T50TPC'];
		$item->issuingAgent->idSystemUser = 	$parsedStructure['header']['line2']['T50AGT']['T50SIN'];

		return $item;
	}
}
