<?php

namespace App\Reports\Sources\ImportedServices;

class ColumnsManager extends \App\Reports\Sources\ColumnsManagerAbstract
{

	/**
	 * The definition of report source columns.
	 * @var array
	 */
	protected array $columnsCfg = [
		'currentRowIndex'					=> [ 'type' => 'numeric',   'dbDef' => "INT UNSIGNED NOT NULL DEFAULT 0",				'cat' => "impOrderGeneral"],
		'impOrd_id' 						=> [ 'type' => 'numeric',	'dbDef' => "INT UNSIGNED NOT NULL DEFAULT 0",				'cat' => "impOrderGeneral"],
		'impOrd_idOrderExtSys'				=> [ 'type' => 'string',	'dbDef' => "VARCHAR(50) NOT NULL DEFAULT ''",				'cat' => "impOrderGeneral"],
		'impOrd_idSystem'					=> [ 'type'	=> 'numeric',	'dbDef' => "SMALLINT UNSIGNED NOT NULL DEFAULT 0",			'cat' => "impOrderGeneral"],
		'impOrd_systemName'					=> [ 'type'	=> 'string',	'dbDef' => "VARCHAR(50) NOT NULL DEFAULT ''",				'cat' => "impOrderGeneral"],
		'impOrd_date'						=> [ 'type'	=> 'date',		'dbDef' => "DATE NULL DEFAULT NULL",						'cat' => "impOrderGeneral"],
		'impOrd_idCorporateOwner' 			=> [ 'type'	=> 'numeric',	'dbDef' => "INT UNSIGNED NOT NULL DEFAULT 0",				'cat' => "impOrderGeneral"],
		'impOrd_corporateOwnerAlias'		=> [ 'type'	=> 'string',	'dbDef' => "VARCHAR(170) NOT NULL DEFAULT ''",				'cat' => "impOrderGeneral"],
		'impOrd_corporateOwnerNameOriginal' => [ 'type'	=> 'string',	'dbDef' => "VARCHAR(170) NOT NULL DEFAULT ''",				'cat' => "impOrderGeneral"],
		'impOrd_idCustomerOwner' 			=> [ 'type'	=> 'numeric',	'dbDef' => "INT UNSIGNED NOT NULL DEFAULT 0",				'cat' => "impOrderGeneral"],
		'impOrd_customerOwnerName'		 	=> [ 'type'	=> 'string',	'dbDef' => "VARCHAR(201) NOT NULL DEFAULT ''",				'cat' => "impOrderGeneral"],
		'impOrd_customerOwnerNameOriginal' 	=> [ 'type'	=> 'string',	'dbDef' => "VARCHAR(201) NOT NULL DEFAULT ''",				'cat' => "impOrderGeneral"],

		'impServ_id' 						=> [ 'type' => 'numeric',	'dbDef' => "INT UNSIGNED NOT NULL DEFAULT 0",											'cat' => "impServGeneral"],
		'impServ_idServiceExtSys' 			=> [ 'type' => 'string',	'dbDef' => "VARCHAR(50) NOT NULL DEFAULT ''",											'cat' => "impServGeneral"],
		'impServ_idServiceTina' 			=> [ 'type' => 'numeric',	'dbDef' => "BIGINT UNSIGNED NOT NULL DEFAULT 0",										'cat' => "impServGeneral"],
		'impServ_processStatusCode' 		=> [ 'type' => 'string',	'dbDef' => "ENUM('new', 'processed', 'blocked') NOT NULL",								'cat' => "impServGeneral"],
		'impServ_processStatusName'			=> [ 'type' => 'string',	'dbDef' => "VARCHAR(20) NOT NULL DEFAULT ''",											'cat' => "impServGeneral"],
		'impServ_systemStatusCode' 			=> [ 'type' => 'string',	'dbDef' => "ENUM('request', 'confirmed', 'deleted', 'cancelled', 'refunded') NOT NULL",	'cat' => "impServGeneral"],
		'impServ_systemStatusName' 			=> [ 'type' => 'string',	'dbDef' => "VARCHAR(20) NOT NULL DEFAULT ''",											'cat' => "impServGeneral"],
		'impServ_cancelDate' 				=> [ 'type' => 'date',		'dbDef' => "DATE NULL DEFAULT NULL",													'cat' => "impServGeneral"],
		'impServ_idImportedServiceReissued' => [ 'type' => 'numeric',	'dbDef' => "INT UNSIGNED NOT NULL DEFAULT 0",											'cat' => "impServGeneral"],
		'impServ_serviceCode'				=> [ 'type' => 'string',	'dbDef' => "CHAR(2) NOT NULL DEFAULT ''",												'cat' => "impServGeneral"],
		'impServ_serviceName' 				=> [ 'type' => 'string',	'dbDef' => "VARCHAR(20) NOT NULL DEFAULT ''",											'cat' => "impServGeneral"],
		'impServ_pax' 						=> [ 'type' => 'numeric',	'dbDef' => "SMALLINT UNSIGNED NOT NULL DEFAULT 0",										'cat' => "impServGeneral"],
		'impServ_startDate'					=> [ 'type' => 'date',		'dbDef' => "DATE NULL DEFAULT NULL",													'cat' => "impServGeneral"],
		'impServ_endDate' 					=> [ 'type' => 'date',		'dbDef' => "DATE NULL DEFAULT NULL",													'cat' => "impServGeneral"],
		'impServ_firstPassengerName' 		=> [ 'type' => 'string',	'dbDef' => "VARCHAR(201) NOT NULL DEFAULT ''",											'cat' => "impServGeneral"],
		'impServ_passengersAssociated'		=> [ 'type' => 'string',	'dbDef' => "VARCHAR(500) NOT NULL DEFAULT ''",											'cat' => "impServGeneral", 'formula'=>['type'=>'entity', 'entity'=>'ImportedService', 'id'=>'impServ_id', 'attribute'=>'passengersFullNameListStd'] ],
		'impServ_ticketsDate' 				=> [ 'type' => 'date',		'dbDef' => "DATE NULL DEFAULT NULL",													'cat' => "impServGeneral"],
		'impServ_firstTicketNumber' 		=> [ 'type' => 'string',	'dbDef' => "VARCHAR(50) NOT NULL DEFAULT ''",											'cat' => "impServGeneral"],
		'impServ_addTime' 					=> [ 'type' => 'datetime',  'dbDef' => "DATETIME NULL DEFAULT NULL",												'cat' => "impServGeneral"],
		'impServ_processTime' 				=> [ 'type' => 'datetime',  'dbDef' => "DATETIME NULL DEFAULT NULL",												'cat' => "impServGeneral"],
		'impServ_blockTime'					=> [ 'type' => 'datetime',  'dbDef' => "DATETIME NULL DEFAULT NULL",												'cat' => "impServGeneral"],
		'impServ_blockedComments' 			=> [ 'type' => 'string',	'dbDef' => "VARCHAR(200) NOT NULL DEFAULT ''",											'cat' => "impServGeneral"],
		'impServ_remarks'					=> [ 'type' => 'string',    'dbDef' => "TEXT NOT NULL",																'cat' => "impServGeneral"],
		'impServ_processedRemarks'			=> [ 'type' => 'string',    'dbDef' => "TEXT NOT NULL",																'cat' => "impServGeneral", 'disabled' => true, 'content' => 'remarks'],

		'impServ_destinationCountryCode'		=> [ 'type' => 'string',	'dbDef' => "CHAR(3) NOT NULL DEFAULT ''",					'cat' => "impServDestination"],
		'impServ_destinationCountryName'		=> [ 'type' => 'string',	'dbDef' => "VARCHAR(50) NOT NULL DEFAULT ''",				'cat' => "impServDestination"],
		'impServ_destinationCityId'				=> [ 'type' => 'numeric',	'dbDef' => "MEDIUMINT UNSIGNED NOT NULL DEFAULT 0",			'cat' => "impServDestination"],
		'impServ_destinationCityName'			=> [ 'type' => 'string',	'dbDef' => "VARCHAR(50) NOT NULL DEFAULT ''",				'cat' => "impServDestination"],

		'impOff_offerTotalValue' 					=> [ 'type' => 'price',		'dbDef' => "DECIMAL(16,3) NOT NULL DEFAULT 0"	,			'cat' => "impOffGeneral"],
		'impOff_offerTotalCurrency'					=> [ 'type' => 'string',	'dbDef' => "VARCHAR(3) NOT NULL DEFAULT ''",				'cat' => "impOffGeneral"],
		'impOff_idSupplier' 						=> [ 'type' => 'numeric',	'dbDef' => "MEDIUMINT UNSIGNED NOT NULL DEFAULT 0",			'cat' => "impOffGeneral"],
		'impOff_supplierAlias'						=> [ 'type' => 'string',	'dbDef' => "VARCHAR(100) NOT NULL DEFAULT ''",				'cat' => "impOffGeneral"],
		'impOff_offerExternalSystemReservationId'	=> [ 'type' => 'string',	'dbDef' => "VARCHAR(50) NOT NULL DEFAULT ''",				'cat' => "impOffGeneral"],
		'impOff_offerExternalSystemReservationDate'	=> [ 'type' => 'date',		'dbDef' => "DATE NULL DEFAULT NULL",						'cat' => "impOffGeneral"],
		'impOff_offerConfirmationNumber' 			=> [ 'type' => 'string',	'dbDef' => "VARCHAR(50) NOT NULL DEFAULT ''",				'cat' => "impOffGeneral"],
		'impOff_offerOptionDate' 					=> [ 'type' => 'date',		'dbDef' => "DATE NULL DEFAULT NULL",						'cat' => "impOffGeneral"],
		'impOff_offerFormOfPaymentCode' 			=> [ 'type' => 'string',	'dbDef' => "VARCHAR(10) NOT NULL DEFAULT ''",				'cat' => "impOffGeneral"],
		'impOff_offerFormOfPaymentName' 			=> [ 'type' => 'string',	'dbDef' => "VARCHAR(20) NOT NULL DEFAULT ''",				'cat' => "impOffGeneral"],

		'impServ_idBookUser'			=> [ 'type' => 'numeric',	'dbDef' => "SMALLINT UNSIGNED NOT NULL DEFAULT 0",		'cat' => "impServUserDetails"],
		'impServ_bookUserName'			=> [ 'type' => 'string',	'dbDef' => "VARCHAR(101) NOT NULL DEFAULT ''",			'cat' => "impServUserDetails"],
		'impServ_idBookUserSystem'		=> [ 'type' => 'string',	'dbDef' => "VARCHAR(50) NOT NULL DEFAULT ''",			'cat' => "impServUserDetails"],
		'impServ_idBookOffice'			=> [ 'type' => 'numeric',	'dbDef' => "SMALLINT UNSIGNED NOT NULL DEFAULT 0",		'cat' => "impServUserDetails"],
		'impServ_bookOfficeName'		=> [ 'type' => 'string',	'dbDef' => "VARCHAR(100) NOT NULL DEFAULT ''",			'cat' => "impServUserDetails"],
		'impServ_idBookOfficeSystem'	=> [ 'type' => 'string',	'dbDef' => "VARCHAR(30) NOT NULL DEFAULT ''",			'cat' => "impServUserDetails"],
		'impServ_idIssueUser' 			=> [ 'type' => 'numeric',	'dbDef' => "SMALLINT UNSIGNED NOT NULL DEFAULT 0",		'cat' => "impServUserDetails"],
		'impServ_issueUserName'			=> [ 'type' => 'string',	'dbDef' => "VARCHAR(101) NOT NULL DEFAULT ''",			'cat' => "impServUserDetails"],
		'impServ_idIssueUserSystem' 	=> [ 'type' => 'string',	'dbDef' => "VARCHAR(50) NOT NULL DEFAULT ''",			'cat' => "impServUserDetails"],
		'impServ_idIssueOffice'			=> [ 'type' => 'numeric',	'dbDef' => "SMALLINT UNSIGNED NOT NULL DEFAULT 0",		'cat' => "impServUserDetails"],
		'impServ_issueOfficeName'		=> [ 'type' => 'string',	'dbDef' => "VARCHAR(100) NOT NULL DEFAULT ''",			'cat' => "impServUserDetails"],
		'impServ_idIssueOfficeSystem'	=> [ 'type' => 'string',	'dbDef' => "VARCHAR(30) NOT NULL DEFAULT ''",			'cat' => "impServUserDetails"],
		'impServ_idRespUser' 			=> [ 'type' => 'numeric',	'dbDef' => "SMALLINT UNSIGNED NOT NULL DEFAULT 0",		'cat' => "impServUserDetails"],
		'impServ_respUserName' 			=> [ 'type' => 'string',	'dbDef' => "VARCHAR(101) NOT NULL DEFAULT ''",			'cat' => "impServUserDetails"],
		'impServ_idRespOffice' 			=> [ 'type' => 'numeric',	'dbDef' => "SMALLINT UNSIGNED NOT NULL DEFAULT 0",		'cat' => "impServUserDetails"],
		'impServ_respOfficeName' 		=> [ 'type' => 'string',	'dbDef' => "VARCHAR(100) NOT NULL DEFAULT ''",			'cat' => "impServUserDetails"],
		'impServ_idProcessUser' 		=> [ 'type' => 'numeric',	'dbDef' => "SMALLINT UNSIGNED NOT NULL DEFAULT 0",		'cat' => "impServUserDetails"],
		'impServ_processUserName' 		=> [ 'type' => 'string',	'dbDef' => "VARCHAR(101) NOT NULL DEFAULT ''",			'cat' => "impServUserDetails"],
		'impServ_idBlockUser' 			=> [ 'type' => 'numeric', 	'dbDef' => "SMALLINT UNSIGNED NOT NULL DEFAULT 0",		'cat' => "impServUserDetails"],
		'impServ_blockUserName' 		=> [ 'type' => 'string',	'dbDef' => "VARCHAR(101) NOT NULL DEFAULT ''",			'cat' => "impServUserDetails"],
	];

	/**
	 * The primary key column.
	 * @var string
	 */
	protected string $primaryKeyColumn = 'impServ_id';

	/**
	 * The columns that are forced into the report.
	 * @var array
	 */
	protected array $forcedColumns = [ ];

	/**
	 * The columns dependencies list.
	 * @var array
	 */
	protected array $columnsDependencies = [
		'impOrd_systemName' 				=> ['impOrd_idSystem'],
		'impOrd_corporateOwnerAlias' 		=> ['impOrd_idCorporateOwner'],
		'impOrd_customerOwnerName' 			=> ['impOrd_idCustomerOwner'],
		'impServ_processStatusName' 		=> ['impServ_processStatusCode'],
		'impServ_systemStatusName' 			=> ['impServ_systemStatusCode'],
		'impServ_serviceName' 				=> ['impServ_serviceCode'],
		'impServ_destinationCountryName' 	=> ['impServ_destinationCountryCode'],
		'impServ_destinationCityName' 		=> ['impServ_destinationCityId'],
		'impOff_supplierAlias' 				=> ['impOff_idSupplier'],
		'impOff_offerFormOfPaymentName'	 	=> ['impOff_offerFormOfPaymentCode'],
		'impServ_bookUserName' 				=> ['impServ_idBookUser'],
		'impServ_bookOfficeName' 			=> ['impServ_idBookOffice'],
		'impServ_issueUserName' 			=> ['impServ_idIssueUser'],
		'impServ_issueOfficeName' 			=> ['impServ_idIssueOffice'],
		'impServ_processUserName' 			=> ['impServ_idProcessUser'],
		'impServ_blockUserName' 			=> ['impServ_idBlockUser'],
		'impServ_respUserName'				=> ['impServ_idRespUser'],
		'impServ_respOfficeName'			=> ['impServ_idRespOffice'],
	];

}
