<?php

///////////////////////////////////////////////////////////////////////////////////////////////////
// Define each field of the current Entity - for each field you can set the following keys: ///////
// 'mandatory', 'invisible' and 'validation'. Use the '_special' field key code to allow adding ///
// extra validations that are not checked automatically. //////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////

// idCorporate
$CFG['globalEntity']['::Customer']['idCorporate']['mandatory']=false;
$CFG['globalEntity']['::Customer']['idCorporate']['invisible']=false;
$CFG['globalEntity']['::Customer']['idCorporate']['validation']= ['type'=>'int', 'minValue'=>0];
// idSegment
$CFG['globalEntity']['::Customer']['idSegment']['mandatory']=false;
$CFG['globalEntity']['::Customer']['idSegment']['invisible']=false;
$CFG['globalEntity']['::Customer']['idSegment']['validation']= ['type'=>'int', 'minValue'=>0];
// type
$CFG['globalEntity']['::Customer']['type']['mandatory']=true;
$CFG['globalEntity']['::Customer']['type']['invisible']=false;
$CFG['globalEntity']['::Customer']['type']['validation']= ['maxLength'=>1, 'list' => $CFG['generalData']['personTypes']];
// title
$CFG['globalEntity']['::Customer']['title']['mandatory']=false;
$CFG['globalEntity']['::Customer']['title']['invisible']=false;
$CFG['globalEntity']['::Customer']['title']['validation']= ['maxLength'=>1, 'list' => $CFG['generalData']['personTitles']];
// lastName
$CFG['globalEntity']['::Customer']['lastName']['mandatory']=false; // it is manually checked that is set inside the Entity
$CFG['globalEntity']['::Customer']['lastName']['invisible']=false;
$CFG['globalEntity']['::Customer']['lastName']['validation']= ['maxLength'=>100, 'case'=>'upper'];
// middleName
$CFG['globalEntity']['::Customer']['middleName']['mandatory']=false;
$CFG['globalEntity']['::Customer']['middleName']['invisible']=false;
$CFG['globalEntity']['::Customer']['middleName']['validation']= ['maxLength'=>50, 'case'=>'upper'];
// firstName
$CFG['globalEntity']['::Customer']['firstName']['mandatory']=false; // it is manually checked that is set inside the Entity
$CFG['globalEntity']['::Customer']['firstName']['invisible']=false;
$CFG['globalEntity']['::Customer']['firstName']['validation']= ['maxLength'=>100, 'case'=>'upper'];
// department
$CFG['globalEntity']['::Customer']['department']['mandatory']=false;
$CFG['globalEntity']['::Customer']['department']['invisible']=false;
$CFG['globalEntity']['::Customer']['department']['validation']= ['maxLength'=>100];

// birthday
$CFG['globalEntity']['::Customer']['birthday']['mandatory']=false;
$CFG['globalEntity']['::Customer']['birthday']['invisible']=false;
$CFG['globalEntity']['::Customer']['birthday']['validation']= ['type'=>'date', 'minValue'=>'1900-01-01', 'maxValue'=>TODAY_ISO];
// PNC
$CFG['globalEntity']['::Customer']['PNC']['mandatory']=false;
$CFG['globalEntity']['::Customer']['PNC']['invisible']=false;
$CFG['globalEntity']['::Customer']['PNC']['unique']=true;
$CFG['globalEntity']['::Customer']['PNC']['notUniqueValue']='-';
$CFG['globalEntity']['::Customer']['PNC']['validation']= ['maxLength'=>50];
// ID_series
$CFG['globalEntity']['::Customer']['ID_series']['mandatory']=false;
$CFG['globalEntity']['::Customer']['ID_series']['invisible']=false;
$CFG['globalEntity']['::Customer']['ID_series']['validation']= ['maxLength'=>30];
// ID_number
$CFG['globalEntity']['::Customer']['ID_number']['mandatory']=false;
$CFG['globalEntity']['::Customer']['ID_number']['invisible']=false;
$CFG['globalEntity']['::Customer']['ID_number']['validation']= ['maxLength'=>50];
// ID_releaseBy
$CFG['globalEntity']['::Customer']['ID_releaseBy']['mandatory']=false;
$CFG['globalEntity']['::Customer']['ID_releaseBy']['invisible']=false;
$CFG['globalEntity']['::Customer']['ID_releaseBy']['validation']= ['maxLength'=>100];
// ID_releaseDate
$CFG['globalEntity']['::Customer']['ID_releaseDate']['mandatory']=false;
$CFG['globalEntity']['::Customer']['ID_releaseDate']['invisible']=false;
$CFG['globalEntity']['::Customer']['ID_releaseDate']['validation']= ['type'=>'date', 'minValue'=>'1900-01-01', 'maxValue'=>TODAY_ISO];
// ID_expireDate
$CFG['globalEntity']['::Customer']['ID_expireDate']['mandatory']=false;
$CFG['globalEntity']['::Customer']['ID_expireDate']['invisible']=false;
$CFG['globalEntity']['::Customer']['ID_expireDate']['validation']= ['type'=>'date', 'minValue'=>'1900-01-01'];
// idParent
$CFG['globalEntity']['::Customer']['idParent']['mandatory']=false;
$CFG['globalEntity']['::Customer']['idParent']['invisible']=false;
$CFG['globalEntity']['::Customer']['idParent']['associatedToTypes']= ['i', 'c'];
$CFG['globalEntity']['::Customer']['idParent']['validation']= ['type'=>'int', 'minValue'=>0];

// address
$CFG['globalEntity']['::Customer']['address']['mandatory']=false;
$CFG['globalEntity']['::Customer']['address']['invisible']=false;
$CFG['globalEntity']['::Customer']['address']['validation']= ['maxLength'=>250];
// deliveryAddress
$CFG['globalEntity']['::Customer']['deliveryAddress']['mandatory']=false;
$CFG['globalEntity']['::Customer']['deliveryAddress']['invisible']=false;
$CFG['globalEntity']['::Customer']['deliveryAddress']['validation']= ['maxLength'=>250];
// zipCode
$CFG['globalEntity']['::Customer']['zipCode']['mandatory']=false;
$CFG['globalEntity']['::Customer']['zipCode']['invisible']=false;
$CFG['globalEntity']['::Customer']['zipCode']['validation']= ['maxLength'=>50];
// countryCode
$CFG['globalEntity']['::Customer']['countryCode']['mandatory']=false;
$CFG['globalEntity']['::Customer']['countryCode']['invisible']=false;
$CFG['globalEntity']['::Customer']['countryCode']['validation']= ['maxLength'=>2];
// cityId
$CFG['globalEntity']['::Customer']['cityId']['mandatory']=false;
$CFG['globalEntity']['::Customer']['cityId']['invisible']=false;
$CFG['globalEntity']['::Customer']['cityId']['validation']= ['type'=>'int', 'minValue'=>0];

// email
$CFG['globalEntity']['::Customer']['email']['mandatory']=false;
$CFG['globalEntity']['::Customer']['email']['invisible']=false;
$CFG['globalEntity']['::Customer']['email']['unique']=true;
$CFG['globalEntity']['::Customer']['email']['notUniqueValue']='-';
$CFG['globalEntity']['::Customer']['email']['validation']= ['maxLength'=>150, 'type'=>'email', 'allowedValues'=> ['-']];
// telephone
$CFG['globalEntity']['::Customer']['telephone']['mandatory']=false;
$CFG['globalEntity']['::Customer']['telephone']['invisible']=false;
$CFG['globalEntity']['::Customer']['telephone']['unique']=true;
$CFG['globalEntity']['::Customer']['telephone']['notUniqueValue']='-';
$CFG['globalEntity']['::Customer']['telephone']['validation']= ['maxLength'=>50];
// telephoneMobile
$CFG['globalEntity']['::Customer']['telephoneMobile']['mandatory']=false;
$CFG['globalEntity']['::Customer']['telephoneMobile']['invisible']=false;
$CFG['globalEntity']['::Customer']['telephoneMobile']['validation']= ['maxLength'=>50];
// fax
$CFG['globalEntity']['::Customer']['fax']['mandatory']=false;
$CFG['globalEntity']['::Customer']['fax']['invisible']=false;
$CFG['globalEntity']['::Customer']['fax']['validation']= ['maxLength'=>50];

// comments
$CFG['globalEntity']['::Customer']['comments']['mandatory']=false;
$CFG['globalEntity']['::Customer']['comments']['invisible']=false;
// remarks
$CFG['globalEntity']['::Customer']['remarks']['mandatory']=false;
$CFG['globalEntity']['::Customer']['remarks']['invisible']=false;
// idAccountManager
$CFG['globalEntity']['::Customer']['idAccountManager']['mandatory']=false;
$CFG['globalEntity']['::Customer']['idAccountManager']['invisible']=false;
$CFG['globalEntity']['::Customer']['idAccountManager']['validation']= ['type'=>'int', 'minValue'=>0];

// idBank
$CFG['globalEntity']['::Customer']['idBank']['mandatory']=false;
$CFG['globalEntity']['::Customer']['idBank']['invisible']=false;
$CFG['globalEntity']['::Customer']['idBank']['validation']= ['type'=>'int', 'minValue'=>0];
// idBankOffice
$CFG['globalEntity']['::Customer']['idBankOffice']['mandatory']=false;
$CFG['globalEntity']['::Customer']['idBankOffice']['invisible']=false;
$CFG['globalEntity']['::Customer']['idBankOffice']['validation']= ['type'=>'int', 'minValue'=>0];
// bankAccount
$CFG['globalEntity']['::Customer']['idBankAccount']['mandatory']=false;
$CFG['globalEntity']['::Customer']['idBankAccount']['invisible']=false;
$CFG['globalEntity']['::Customer']['idBankAccount']['validation']= ['maxLength'=>200];

// flag
$CFG['globalEntity']['::Customer']['flag']['mandatory']=false;
$CFG['globalEntity']['::Customer']['flag']['invisible']=false;

// idGdsProfile
$CFG['globalEntity']['::Customer']['idGdsProfileTemplate']['mandatory']=false;
$CFG['globalEntity']['::Customer']['idGdsProfileTemplate']['invisible']=false;
$CFG['globalEntity']['::Customer']['idGdsProfileTemplate']['validation']= ['type'=>'int', 'minValue'=>0];

// SPECIAL CONFIGS ////////////////////////////////////////////////////////////////////////////////

// PASSPORTS --------------------------------------------------------------------------------------

// number
$CFG['globalEntity']['::Customer']['_special']['passports']['number']['mandatory']=true;
$CFG['globalEntity']['::Customer']['_special']['passports']['number']['invisible']=false;
$CFG['globalEntity']['::Customer']['_special']['passports']['number']['unique'] = false;

// name
$CFG['globalEntity']['::Customer']['_special']['passports']['name']['mandatory']=false;
$CFG['globalEntity']['::Customer']['_special']['passports']['name']['invisible']=true;

// type
$CFG['globalEntity']['::Customer']['_special']['passports']['type']['mandatory']=false;
$CFG['globalEntity']['::Customer']['_special']['passports']['type']['invisible']=false;
$CFG['globalEntity']['::Customer']['_special']['passports']['type']['validation'] = ['list' => $CFG['generalData']['passportTypes']];

// expireDate
$CFG['globalEntity']['::Customer']['_special']['passports']['expireDate']['mandatory']=false;
$CFG['globalEntity']['::Customer']['_special']['passports']['expireDate']['invisible']=false;

// issueDate
$CFG['globalEntity']['::Customer']['_special']['passports']['issueDate']['mandatory']=false;
$CFG['globalEntity']['::Customer']['_special']['passports']['issueDate']['invisible']=false;

// issuedBy
$CFG['globalEntity']['::Customer']['_special']['passports']['issuedBy']['mandatory']=false;
$CFG['globalEntity']['::Customer']['_special']['passports']['issuedBy']['invisible']=false;

// issueCountryCode
$CFG['globalEntity']['::Customer']['_special']['passports']['issueCountryCode']['mandatory']=false;
$CFG['globalEntity']['::Customer']['_special']['passports']['issueCountryCode']['invisible']=false;

// citizenship
$CFG['globalEntity']['::Customer']['_special']['passports']['citizenship']['mandatory']=false;
$CFG['globalEntity']['::Customer']['_special']['passports']['citizenship']['invisible']=false;


// OTHERS -----------------------------------------------------------------------------------------

// extra validation on customer name - the field indicates if the name is mandatory in a certain alphabet: can be 'standard', 'local', 'both' or '' (no extra validations)
$CFG['globalEntity']['::Customer']['_special']['name']['mandatoryByAlphabet']='';

// address details
$CFG['globalEntity']['::Customer']['_special']['addressDetailsActive']=false;
$CFG['globalEntity']['::Customer']['_special']['addressDeliveryDetailsActive']=false;

// Accounting number
$CFG['globalEntity']['::Customer']['accountingNumber']['mandatory']=false;
$CFG['globalEntity']['::Customer']['accountingNumber']['invisible']=false;
$CFG['globalEntity']['::Customer']['accountingNumber']['unique']=true;
$CFG['globalEntity']['::Customer']['accountingNumber']['validation']=['maxLength'=>50];
