<?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. //////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////

// active
$CFG['globalEntity']['::AutoProcessRule']['active']['mandatory']=false;
$CFG['globalEntity']['::AutoProcessRule']['active']['invisible']=false;

// cronProcess
$CFG['globalEntity']['::AutoProcessRule']['cronProcess']['mandatory']=false;
$CFG['globalEntity']['::AutoProcessRule']['cronProcess']['invisible']=false;

// name
$CFG['globalEntity']['::AutoProcessRule']['name']['mandatory']=false;
$CFG['globalEntity']['::AutoProcessRule']['name']['invisible']=false;
$CFG['globalEntity']['::AutoProcessRule']['name']['validation']= ['maxLength'=>100];

// clientType
$CFG['globalEntity']['::AutoProcessRule']['clientType']['mandatory']=true;
$CFG['globalEntity']['::AutoProcessRule']['clientType']['invisible']=false;
$CFG['globalEntity']['::AutoProcessRule']['clientType']['validation']= ['list'=> ['customer', 'corporate', 'supplier']];

// startTime
$CFG['globalEntity']['::AutoProcessRule']['startTime']['mandatory']=false;
$CFG['globalEntity']['::AutoProcessRule']['startTime']['invisible']=false;
$CFG['globalEntity']['::AutoProcessRule']['startTime']['validation']= ['type'=>'time']; // TODO: always validate
// endTime
$CFG['globalEntity']['::AutoProcessRule']['endTime']['mandatory']=false;
$CFG['globalEntity']['::AutoProcessRule']['endTime']['invisible']=false;
$CFG['globalEntity']['::AutoProcessRule']['endTime']['validation']= ['type'=>'time']; // TODO: always validate

// stopOnFirstError
$CFG['globalEntity']['::AutoProcessRule']['stopOnFirstError']['mandatory']=false;
$CFG['globalEntity']['::AutoProcessRule']['stopOnFirstError']['invisible']=false;

// recordsCountOnExecution
$CFG['globalEntity']['::AutoProcessRule']['recordsCountOnExecution']['mandatory']=true;
$CFG['globalEntity']['::AutoProcessRule']['recordsCountOnExecution']['invisible']=false;
$CFG['globalEntity']['::AutoProcessRule']['recordsCountOnExecution']['validation']= ['type'=>'int', 'minValue'=>1, 'maxValue'=>500]; // this can be set to 0 but it might include a lot of records thus wasting a lot of resources and AI ids

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

// label
$CFG['globalEntity']['::AutoProcessRule']['label']['mandatory']=false;
$CFG['globalEntity']['::AutoProcessRule']['label']['invisible']=false;
$CFG['globalEntity']['::AutoProcessRule']['label']['validation']= ['maxLength'=>50];

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