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

class TransactionRefundDistribuited extends \App\Utils\BaseParser\Structure\StructureParser\Structures\TransactionRefundDistribuited
{
	/**
	 * {@inheritDoc}
	 * @see \App\Utils\BaseParser\Structure\StructureParser\Structures\Transaction::getStorageObjInstance()
	 */
	public function getStorageObjInstance()
	{
		return \App\Galileo\Storage\StorageHandler::getInstance();
	}

	/**
	 * (non-PHPdoc)
	 * @see \App\Utils\BaseParser\Structure\StructureParser\Structures\Transaction::getData()
	 */
	public function getData()
	{
		$this->documents = 	$this->extractAs("\App\Galileo\StructureParser\Structures\Refund\Documents");
		$this->passengers = $this->extractAs("\App\Galileo\StructureParser\Structures\Refund\Passengers");
		$this->agent = 		$this->extractAs("\App\Galileo\StructureParser\Structures\Refund\Agent");
		$this->price = 		$this->extractAs("\App\Galileo\StructureParser\Structures\Refund\Price");
		$this->remarks = 	$this->extractAs("\App\Galileo\StructureParser\Structures\Refund\Remarks");

		if ($this->price) {
			$this->price->checkIntegrity(['negativeTotal'=>true, 'negativeSupplier'=>true], $this->messages);
		}

		return $this;
	}

	public function isTicketingIssue($parsedStructure, $transactionType, $transactionIndexes)
	{
		return true;
	}
}