<?php
namespace App\Bsp\Hot230\Lines\Footer;

/**
 * Line parser
 * @author Lucian Sirbu
 */
class BCT95 extends \App\Bsp\Hot230\HOTBase
{
	protected $children = [
		[ 'key'=>'SMSG',            'type'=>'Constant', 'val'=>'BCT',  'len'=>3,      'label'=>'Standard Message Identifier', ],         // S/M/Standard Message Identifier
		[ 'key'=>'SQNR',            'type'=>'Integer',                 'len'=>8,      'label'=>'Sequence Number', ],                     // S/M/Sequence Number
		[ 'key'=>'STNQ',            'type'=>'Constant', 'val'=>'95',   'len'=>2,      'label'=>'Standard Numeric Qualifier', ],          // S/M/Standard Numeric Qualifier
		[ 'key'=>'PDAI',            'type'=>'StringRaw',                  'len'=>3,      'label'=>'Processing Date Identifier', ],          // S/M/Processing Date Identifier
		[ 'key'=>'PCYC',            'type'=>'Digits',                  'len'=>1,      'label'=>'Processing Cycle Identifier', ],         // S/M/Processing Cycle Identifier
		[ 'key'=>'OFCC',            'type'=>'Integer',                 'len'=>5,      'label'=>'Office Count', ],                        // S/M/Office Count
		[ 'key'=>'GROS',            'type'=>'PriceAmount',             'len'=>15,     'label'=>'Gross Value Amount', ],                  // S/M/Gross Value Amount
		[ 'key'=>'TREM',            'type'=>'PriceAmount',             'len'=>15,     'label'=>'Total Remittance Amount', ],             // S/M/Total Remittance Amount
		[ 'key'=>'TCOM',            'type'=>'PriceAmount',             'len'=>15,     'label'=>'Total Commission Value Amount', ],       // S/M/Total Commission Value Amount
		[ 'key'=>'TTMF',            'type'=>'PriceAmount',             'len'=>15,     'label'=>'Total Tax/Miscellaneous Fee Amount', ],  // S/M/Total Tax/Miscellaneous Fee Amount
		[ 'key'=>'TTCA',            'type'=>'PriceAmount',             'len'=>15,     'label'=>'Total Tax on Commission Amount', ],      // S/M/Total Tax on Commission Amount
		[ 'key'=>'RESD',            'type'=>'StringTrim',              'len'=>35,     'label'=>'Reserved Space', ],                      // S/M/Reserved Space
		[ 'key'=>'CUTP',            'type'=>'StringRaw',                  'len'=>3,      'label'=>'Currency Type', ],                       // S/M/Currency Type
		[ 'key'=>'CUTP_decimals',   'type'=>'Integer',                 'len'=>1,      'label'=>'Currency Type(decimals)', ],             // S/M/Currency Type
	];

	protected function postExtract(\App\Utils\BaseParser\TextParser\ExtractedBlock $ret)
	{
		$ret = $this->postProcessPriceAmount($ret, $this->children, $ret->extractedData['CUTP_decimals']);

		return $ret;
	}
}
