<?php

namespace App\Reports\Sources\SupplierContracts;

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

	/**
	 * The definition of report source columns.
	 * @var array
	 */
	protected array $columnsCfg = [
		'cont_id'				=> ['type'=>'numeric', 		'dbDef'=>"INT UNSIGNED NOT NULL", 						'cat'=>"general"],
		'cont_number'			=> ['type'=>'string', 		'dbDef'=>"VARCHAR(50) NOT NULL DEFAULT ''", 			'cat'=>"general"],
		'cont_date'				=> ['type'=>'date', 		'dbDef'=>"DATE DEFAULT NULL", 							'cat'=>"general"],
		'cont_typeCode'			=> ['type'=>'string', 		'dbDef'=>"VARCHAR(20) NOT NULL DEFAULT ''",				'cat'=>"general"],
		'cont_typeName'			=> ['type'=>'string', 		'dbDef'=>"VARCHAR(30) NOT NULL DEFAULT ''",				'cat'=>"general"],
		'cont_expireDate'		=> ['type'=>'date', 		'dbDef'=>"DATE DEFAULT NULL", 							'cat'=>"general"],
		'cont_active'			=> ['type'=>'boolean', 		'dbDef'=>"TINYINT NOT NULL DEFAULT 0", 					'cat'=>"general"],
		'cont_serviceCode'		=> ['type'=>'string', 		'dbDef'=>"VARCHAR(2) NOT NULL DEFAULT ''", 				'cat'=>"general"],
		'cont_serviceName'		=> ['type'=>'string', 		'dbDef'=>"VARCHAR(100) NOT NULL DEFAULT ''", 			'cat'=>"general"],
		'cont_content'			=> ['type'=>'string', 		'dbDef'=>"MEDIUMTEXT NOT NULL", 						'cat'=>"general"],
		'cont_fileName'			=> ['type'=>'string',		'dbDef'=>"VARCHAR(250) NOT NULL DEFAULT ''",			'cat'=>"general"],

		'user_respIdUser'			=> ['type'=>'numeric',	'dbDef'=>"SMALLINT UNSIGNED NOT NULL DEFAULT 0", 		'cat'=>"responsible"],
		'user_respUserName'			=> ['type'=>'string', 	'dbDef'=>"VARCHAR(101) NOT NULL DEFAULT ''", 			'cat'=>"responsible"],
		'user_respIdOffice'			=> ['type'=>'numeric', 	'dbDef'=>"SMALLINT NOT NULL DEFAULT 0", 				'cat'=>"responsible"],
		'user_respOfficeName'		=> ['type'=>'string',	'dbDef'=>"VARCHAR(150) NOT NULL DEFAULT ''", 			'cat'=>"responsible"],
		'user_respIdDepartment'		=> ['type'=>'numeric', 	'dbDef'=>"SMALLINT UNSIGNED NOT NULL DEFAULT 0", 		'cat'=>"responsible"],
		'user_respDepartmentName' 	=> ['type'=>'string', 	'dbDef'=>"VARCHAR(100) NOT NULL DEFAULT ''", 			'cat'=>"responsible"],

		'supp_id'				=> ['type'=>'numeric', 		'dbDef'=>"INT UNSIGNED NOT NULL DEFAULT 0", 			'cat'=>"supplier"],
		'supp_alias'			=> ['type'=>'string', 		'dbDef'=>"VARCHAR(100) NOT NULL DEFAULT ''", 			'cat'=>"supplier"],
		'supp_companyName'		=> ['type'=>'string', 		'dbDef'=>"VARCHAR(170) NOT NULL DEFAULT ''", 			'cat'=>"supplier"],
		'supp_idTrust'			=> ['type'=>'numeric', 		'dbDef'=>"INT UNSIGNED NOT NULL DEFAULT 0", 			'cat'=>"supplier"],
		'supp_trustName'		=> ['type'=>'string', 		'dbDef'=>"VARCHAR(100) NOT NULL DEFAULT ''", 			'cat'=>"supplier"],
		'supp_duplicated'		=> ['type'=>'boolean',		'dbDef'=>"TINYINT UNSIGNED NOT NULL DEFAULT 0",			'cat'=>"supplier"],
		'supp_idOriginal'		=> ['type'=>'numeric',		'dbDef'=>"INT UNSIGNED NOT NULL DEFAULT 0",				'cat'=>"supplier"],

		'user_idAddUser'		=> ['type'=>'numeric', 		'dbDef'=>"SMALLINT UNSIGNED NOT NULL DEFAULT 0", 		'cat'=>"admin"],
		'user_addUserName'		=> ['type'=>'string', 		'dbDef'=>"VARCHAR(101) NOT NULL DEFAULT ''", 			'cat'=>"admin"],
		'user_idUpdateUser'		=> ['type'=>'numeric', 		'dbDef'=>"SMALLINT UNSIGNED NOT NULL DEFAULT 0", 		'cat'=>"admin"],
		'user_updateUserName'	=> ['type'=>'string', 		'dbDef'=>"VARCHAR(101) NOT NULL DEFAULT ''", 			'cat'=>"admin"],
		'cont_addTime'			=> ['type'=>'datetime', 	'dbDef'=>"DATETIME NULL", 								'cat'=>"admin"],
		'cont_lastUpdateTime'	=> ['type'=>'datetime', 	'dbDef'=>"DATETIME NULL DEFAULT NULL", 					'cat'=>"admin"],
		'cont_updatesCount'		=> ['type'=>'numeric', 		'dbDef'=>"SMALLINT NOT NULL DEFAULT 0", 				'cat'=>"admin"],

	];

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

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

	/**
	 * The columns dependencies list.
	 * @var array
	 */
	protected array $columnsDependencies = [
		'cont_typeName' 			=> ['cont_typeCode'],
		'cont_serviceName' 			=> ['cont_serviceCode'],

		'user_addUserName' 			=> ['user_idAddUser'],
		'user_updateUserName'		=> ['user_idUpdateUser'],

		'user_respUserName' 		=> ['user_respIdUser'],
		'user_respOfficeName' 		=> ['user_respIdOffice'],
		'user_respDepartmentName' 	=> ['user_respIdDepartment'],

		'supp_alias'				=> ['supp_id'],
		'supp_companyName'			=> ['supp_id'],
		'supp_idTrust'				=> ['supp_id'],
		'supp_trustName'			=> ['supp_idTrust'],
	];

}
