<?php
 namespace VnChocola\Model;
 use TCMS\Model;
 use TCMS\FieldModel;
 use FIELD_DATA_TYPE;
 class HotCustomersModel extends Model {
 public $tableName = 'Hot_Customers';
 public $timestamp = true;
 public function registerField() {
 $this->addField('id', FIELD_DATA_TYPE::STRING);
 $this->addField('cCode', FIELD_DATA_TYPE::STRING, function(FieldModel $field) {
 $field->required = true;
 }
);
 $this->addField('cName', FIELD_DATA_TYPE::STRING, function(FieldModel $field) {
 $field->required = true;
 }
);
 $this->addField('cEmail', FIELD_DATA_TYPE::STRING);
 $this->addField('cCityID', FIELD_DATA_TYPE::STRING);
 $this->addField('cDistrictID', FIELD_DATA_TYPE::STRING);
 $this->addField('cAddress', FIELD_DATA_TYPE::STRING);
 $this->addField('cPhone', FIELD_DATA_TYPE::STRING, function(FieldModel $field) {
 $field->required = true;
 }
);
 $this->addField('cFax', FIELD_DATA_TYPE::STRING);
 $this->addField('cBirthday', FIELD_DATA_TYPE::DATE, function(FieldModel $field) {
 $field->format = lang('time.dateFormat');
 $field->autoFormat = true;
 }
);
 $this->addField('cSex', FIELD_DATA_TYPE::INTEGER, function(FieldModel $field) {
 $field->required = true;
 }
);
 $this->addField('numberOfVisitors', FIELD_DATA_TYPE::INTEGER, function(FieldModel $field) {
 $field->required = true;
 }
);
 $this->addField('purchaseStatus', FIELD_DATA_TYPE::INTEGER, function(FieldModel $field) {
 $field->required = true;
 }
);
 $this->addField('interests', FIELD_DATA_TYPE::STRING);
 $this->addField('cNote', FIELD_DATA_TYPE::STRING);
 $this->addField('cCompany', FIELD_DATA_TYPE::STRING);
 $this->addField('cCompanyCityID', FIELD_DATA_TYPE::STRING);
 $this->addField('cCompanyDistrictID', FIELD_DATA_TYPE::STRING);
 $this->addField('cCompanyAddress', FIELD_DATA_TYPE::STRING);
 $this->addField('cCompanyPhone', FIELD_DATA_TYPE::STRING);
 $this->addField('cCompanyFax', FIELD_DATA_TYPE::STRING);
 $this->addField('cCompanyTypeID', FIELD_DATA_TYPE::STRING);
 $this->addField('cDepartment', FIELD_DATA_TYPE::STRING);
 $this->addField('cPositionID', FIELD_DATA_TYPE::STRING);
 $this->addField('dName', FIELD_DATA_TYPE::STRING);
 $this->addField('dCompany', FIELD_DATA_TYPE::STRING);
 $this->addField('dDepartment', FIELD_DATA_TYPE::STRING);
 $this->addField('dPositionID', FIELD_DATA_TYPE::STRING);
 $this->addField('dEmail', FIELD_DATA_TYPE::STRING);
 $this->addField('dCityID', FIELD_DATA_TYPE::STRING);
 $this->addField('dDistrictID', FIELD_DATA_TYPE::STRING);
 $this->addField('dAddress', FIELD_DATA_TYPE::STRING);
 $this->addField('dPhone', FIELD_DATA_TYPE::STRING);
 $this->addField('dFax', FIELD_DATA_TYPE::STRING);
 $this->addField('dRelationship', FIELD_DATA_TYPE::STRING);
 $this->addField('iName', FIELD_DATA_TYPE::STRING);
 $this->addField('iCompany', FIELD_DATA_TYPE::STRING);
 $this->addField('iDepartment', FIELD_DATA_TYPE::STRING);
 $this->addField('iPositionID', FIELD_DATA_TYPE::STRING);
 $this->addField('iEmail', FIELD_DATA_TYPE::STRING);
 $this->addField('iCityID', FIELD_DATA_TYPE::STRING);
 $this->addField('iDistrictID', FIELD_DATA_TYPE::STRING);
 $this->addField('iAddress', FIELD_DATA_TYPE::STRING);
 $this->addField('iPhone', FIELD_DATA_TYPE::STRING);
 $this->addField('iFax', FIELD_DATA_TYPE::STRING);
 $this->addField('iRelationship', FIELD_DATA_TYPE::STRING);
 $this->addField('iDate', FIELD_DATA_TYPE::DATE,function(FieldModel $field){
 $field->format = lang('time.dateFormat');
 $field->autoFormat = true;
 }
);
 $this->addField('iNote', FIELD_DATA_TYPE::STRING);
 $this->addField('nCarID', FIELD_DATA_TYPE::STRING,function(FieldModel $field){
 }
);
 $this->addField('nAmount', FIELD_DATA_TYPE::INTEGER,function(FieldModel $field){
 $this->require = true;
 }
);
 $this->addField('nCarNote', FIELD_DATA_TYPE::STRING);
 $this->addField('staffID', FIELD_DATA_TYPE::STRING,function(FieldModel $field){
 $this->require = true;
 }
);
 $this->addField('cStatus', FIELD_DATA_TYPE::STRING,function(FieldModel $field){
 $this->require = true;
 $field->defaultValue = "COLD";
 }
);
 $this->addField('cPayments',FIELD_DATA_TYPE::INTEGER);
 $this->addField('cSource', FIELD_DATA_TYPE::STRING,function(FieldModel $field){
 $this->require = true;
 $field->defaultValue = "ALL";
 }
);
 $this->addField('contractDate', FIELD_DATA_TYPE::DATE,function(FieldModel $field){
 $field->format = lang('time.dateFormat');
 $field->autoFormat = true;
 }
);
 $this->addField('lostDate',FIELD_DATA_TYPE::DATE,function(FieldModel $field){
 $field->format = lang('time.dateFormat');
 $field->autoFormat = true;
 }
);
 $this->addField('lostNote',FIELD_DATA_TYPE::INTEGER);
 $this->addField('cType', FIELD_DATA_TYPE::STRING,function(FieldModel $field){
 $this->require = true;
 $field->defaultValue = "CN";
 }
);
 $this->addField('cardDate', FIELD_DATA_TYPE::DATE,function(FieldModel $field){
 $this->require = true;
 $field->format = lang('time.dateFormat');
 $field->autoFormat = true;
 }
);
 $this->addField('branchID', FIELD_DATA_TYPE::STRING,function(FieldModel $field){
 $this->require = true;
 }
);
 }
 }
