<?php
 namespace VnChocola\Model;
 use TCMS\Model;
 use TCMS\FieldModel;
 use FIELD_DATA_TYPE;
 class VisitCustomersModel extends Model {
 public $tableName = 'Visit_Customers';
 public $timestamp = true;
 public function registerField() {
 $this->addField('id', FIELD_DATA_TYPE::STRING);
 $this->addField('plate', FIELD_DATA_TYPE::STRING);
 $this->addField('search_plate', FIELD_DATA_TYPE::STRING);
 $this->addField('customerID', FIELD_DATA_TYPE::STRING);
 $this->addField('customerName', FIELD_DATA_TYPE::STRING);
 $this->addField('carType', FIELD_DATA_TYPE::STRING);
 $this->addField('carColor', FIELD_DATA_TYPE::STRING);
 $this->addField('staff', FIELD_DATA_TYPE::STRING);
 $this->addField('km', FIELD_DATA_TYPE::STRING);
 $this->addField('reserves', FIELD_DATA_TYPE::BOOLEAN,function(FieldModel $field){
 $field->required = true;
 $field->defaultValue = 0;
 }
);
 $this->addField('dateTime', FIELD_DATA_TYPE::DATETIME, function(FieldModel $field) {
 $field->required = true;
 $field->format = lang('time.dateFormat');
 $field->autoFormat = true;
 $field->defaultValue = date('Y-m-d H:i:s');
 }
);
 $this->addField('purpose', FIELD_DATA_TYPE::STRING);
 $this->addField('email', FIELD_DATA_TYPE::STRING);
 $this->addField('phone', FIELD_DATA_TYPE::STRING);
 $this->addField('sex', FIELD_DATA_TYPE::INTEGER);
 $this->addField('image', FIELD_DATA_TYPE::STRING, function(FieldModel $field) {
 }
);
 $this->addField('jobtime', FIELD_DATA_TYPE::STRING, function(FieldModel $field) {
 $field->required = true;
 $field->defaultValue = "00:00";
 }
);
 $this->addField('status', FIELD_DATA_TYPE::INTEGER, function(FieldModel $field) {
 $field->required = true;
 $field->defaultValue = 0;
 }
);
 $this->addField('numberOfVisitors', FIELD_DATA_TYPE::JSON);
 $this->addField('seatID', FIELD_DATA_TYPE::STRING);
 $this->addField('seatIndex', FIELD_DATA_TYPE::INTEGER);
 $this->addField('note', FIELD_DATA_TYPE::STRING);
 $this->addField('drinkID', FIELD_DATA_TYPE::STRING,function(FieldModel $field){
 $field->defaultValue = "";
 }
);
 $this->addField('drinkNotify', FIELD_DATA_TYPE::BOOLEAN, function(FieldModel $field) {
 $field->required = true;
 $field->defaultValue = 1;
 }
);
 $this->addField('notify', FIELD_DATA_TYPE::BOOLEAN, function(FieldModel $field) {
 $field->required = true;
 $field->defaultValue = 1;
 }
);
 $this->addField('camera', FIELD_DATA_TYPE::STRING);
 $this->addField('provideDrinkTime', FIELD_DATA_TYPE::STRING);
 $this->addField('branch', FIELD_DATA_TYPE::STRING);
 $this->addField('branchID', FIELD_DATA_TYPE::STRING, function(FieldModel $field) {
 $field->required = true;
 }
);
 $this->addField('custody', FIELD_DATA_TYPE::BOOLEAN, function(FieldModel $field) {
 $field->required = true;
 $field->defaultValue = 0;
 }
);
 $this->addField('jobIsStart', FIELD_DATA_TYPE::BOOLEAN, function(FieldModel $field) {
 $field->required = true;
 $field->defaultValue = 0;
 }
);
 $this->addField('startJobTime', FIELD_DATA_TYPE::DATETIME,function(FieldModel $field){
 $field->format = lang('time.dateFormat');
 $field->autoFormat = true;
 }
);
 $this->addField('returnDateTime', FIELD_DATA_TYPE::DATETIME, function(FieldModel $field) {
 $field->required = true;
 $field->format = lang('time.dateFormat');
 $field->autoFormat = true;
 $field->defaultValue = date('Y-m-d H:i:s');
 }
);
 $this->addField('outDateTime', FIELD_DATA_TYPE::DATETIME, function(FieldModel $field) {
 $field->required = true;
 $field->format = lang('time.dateFormat');
 $field->autoFormat = true;
 $field->defaultValue = date('Y-m-d H:i:s');
 }
);
 $this->addField('fromTime', FIELD_DATA_TYPE::INTEGER, function(FieldModel $field) {
 $field->required = true;
 $field->defaultValue = date('H')*3600+date('i')*60+date('s');
 }
);
 $this->addField('birthday', FIELD_DATA_TYPE::DATE, function(FieldModel $field) {
 $field->format = lang('time.dateFormat');
 $field->autoFormat = true;
 }
);
 $this->addField('cityID', FIELD_DATA_TYPE::STRING);
 $this->addField('districtID', FIELD_DATA_TYPE::STRING);
 $this->addField('address', FIELD_DATA_TYPE::STRING);
 $this->addField('created_at', FIELD_DATA_TYPE::DATETIME, function(FieldModel $field) {
 $field->required = true;
 $field->format = lang('time.dateFormat');
 $field->autoFormat = true;
 $field->defaultValue = date('Y-m-d H:i:s');
 }
);
 $this->addField('updated_at', FIELD_DATA_TYPE::DATETIME, function(FieldModel $field) {
 $field->required = true;
 $field->format = lang('time.dateFormat');
 $field->autoFormat = true;
 $field->defaultValue = date('Y-m-d H:i:s');
 }
);
 $this->addField('startDrinkTime', FIELD_DATA_TYPE::DATETIME, function(FieldModel $field) {
 $field->autoFormat = true;
 }
);
 $this->addField('compartmentID', FIELD_DATA_TYPE::STRING);
 $this->addField('compartmentStatus', FIELD_DATA_TYPE::INTEGER, function(FieldModel $field) {
 $field->defaultValue = 0;
 }
);
 $this->addField('compartmentJobTime', FIELD_DATA_TYPE::DATETIME, function(FieldModel $field) {
 $field->autoFormat = true;
 $field->defaultValue = date('Y-m-d H:i:s');
 }
);
 $this->addField('compartmentEndJobTime', FIELD_DATA_TYPE::DATETIME, function(FieldModel $field) {
 $field->autoFormat = true;
 $field->defaultValue = date('Y-m-d H:i:s');
 }
);
 $this->addField('sa', FIELD_DATA_TYPE::STRING);
 $this->addField('saId', FIELD_DATA_TYPE::STRING);
 $this->addField('deliveryTime', FIELD_DATA_TYPE::DATETIME, function(FieldModel $field) {
 $field->autoFormat = true;
 $field->defaultValue = date('Y-m-d H:i:s');
 }
);
 $this->addField('startWashTime', FIELD_DATA_TYPE::DATETIME, function(FieldModel $field) {
 $field->autoFormat = true;
 }
);
 $this->addField('endWashTime', FIELD_DATA_TYPE::DATETIME, function(FieldModel $field) {
 $field->autoFormat = true;
 }
);
 $this->addField('downTime', FIELD_DATA_TYPE::DATETIME, function(FieldModel $field) {
 $field->autoFormat = true;
 }
);
 $this->addField('runDownTime', FIELD_DATA_TYPE::BOOLEAN, function(FieldModel $field) {
 $field->defaultValue = 0;
 }
);
 $this->addField('stopDownTime', FIELD_DATA_TYPE::DATETIME, function(FieldModel $field) {
 $field->autoFormat = true;
 }
);
 $this->addField('countDownTime', FIELD_DATA_TYPE::STRING, function(FieldModel $field) {
 $field->defaultValue = '00:00:00';
 }
);
 $this->addField('insurranceId', FIELD_DATA_TYPE::STRING);
 $this->addField('loanCarId', FIELD_DATA_TYPE::STRING);
 $this->addField('isVisited', FIELD_DATA_TYPE::INTEGER, function(FieldModel $field) {
 $field->required = true;
 $field->defaultValue = 0;
 $field->displayName = lang('visit.isVisited');
 }
);
 $this->addField('commonMemo', FIELD_DATA_TYPE::STRING);
 $this->addField('notify_visit', FIELD_DATA_TYPE::BOOLEAN, function(FieldModel $field) {
 $field->required = true;
 $field->defaultValue = 1;
 }
);
 $this->addField('transactionId', FIELD_DATA_TYPE::STRING);
 $this->addField('inVideo', FIELD_DATA_TYPE::STRING);
 $this->addField('outVideo', FIELD_DATA_TYPE::STRING);
 }
 }
 