first commit
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace App\Core\Validator\PropertyRoomRateMapping;
|
||||
|
||||
use Illuminate\Contracts\Container\Container;
|
||||
use Illuminate\Contracts\Translation\Translator;
|
||||
|
||||
use App\Core\Validator\BaseValidator;
|
||||
|
||||
use Exception;
|
||||
|
||||
class PropertyRoomRateMappingAddValidator extends BaseValidator
|
||||
{
|
||||
|
||||
|
||||
public function __construct
|
||||
(
|
||||
|
||||
|
||||
Translator $translator,
|
||||
Container $container
|
||||
)
|
||||
{
|
||||
parent::__construct($translator, $container);
|
||||
|
||||
}
|
||||
|
||||
public function rules($params = null)
|
||||
{
|
||||
return
|
||||
[
|
||||
'room_id' => 'required|numeric',
|
||||
'room_rate_id' => 'required|numeric',
|
||||
'description' => 'required',
|
||||
'rack_rate' => 'required|numeric',
|
||||
'included_occupancy' => 'required|numeric',
|
||||
];
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function messages()
|
||||
{
|
||||
$thisMessages = [];
|
||||
return array_merge(parent::messages() , $thisMessages);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function validate(array $params, array $rules = [], array $messages = [], array $customAttributes = [])
|
||||
{
|
||||
return $this->make($params, $this->rules($params), $this->messages());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace App\Core\Validator\PropertyRoomRateMapping;
|
||||
|
||||
use Illuminate\Contracts\Container\Container;
|
||||
use Illuminate\Contracts\Translation\Translator;
|
||||
|
||||
use App\Core\Validator\BaseValidator;
|
||||
|
||||
use Exception;
|
||||
|
||||
class PropertyRoomRateMappingAddWithSetupValidator extends BaseValidator
|
||||
{
|
||||
|
||||
|
||||
public function __construct
|
||||
(
|
||||
|
||||
|
||||
Translator $translator,
|
||||
Container $container
|
||||
)
|
||||
{
|
||||
parent::__construct($translator, $container);
|
||||
|
||||
}
|
||||
|
||||
public function rules($params = null)
|
||||
{
|
||||
return
|
||||
[
|
||||
'room_id' => 'required|array',
|
||||
'room_id.*' => 'required|numeric',
|
||||
'room_rate_id' => 'required|numeric',
|
||||
// 'rack_rate' => 'required|numeric',
|
||||
'included_occupancy' => 'required|numeric',
|
||||
/*'room_rate_mapping_setup' => 'required|array',
|
||||
'room_rate_mapping_setup.*.setup_type' => 'required|in:EXT_ADULT,EXT_CHILD,DIS_GUEST',
|
||||
'room_rate_mapping_setup.*.value_type' => 'required|in:FIX,PER',
|
||||
'room_rate_mapping_setup.*.value' => 'required|numeric',*/
|
||||
];
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function messages()
|
||||
{
|
||||
$thisMessages = [];
|
||||
return array_merge(parent::messages() , $thisMessages);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function validate(array $params, array $rules = [], array $messages = [], array $customAttributes = [])
|
||||
{
|
||||
return $this->make($params, $this->rules($params), $this->messages());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace App\Core\Validator\PropertyRoomRateMapping;
|
||||
|
||||
use Illuminate\Contracts\Container\Container;
|
||||
use Illuminate\Contracts\Translation\Translator;
|
||||
|
||||
use App\Core\Validator\BaseValidator;
|
||||
|
||||
use Exception;
|
||||
|
||||
class PropertyRoomRateMappingConnectedValidator extends BaseValidator
|
||||
{
|
||||
|
||||
|
||||
public function __construct
|
||||
(
|
||||
Translator $translator,
|
||||
Container $container
|
||||
)
|
||||
{
|
||||
parent::__construct($translator, $container);
|
||||
|
||||
}
|
||||
|
||||
public function rules($params = null)
|
||||
{
|
||||
|
||||
return
|
||||
[
|
||||
'property_id' => 'required|numeric',
|
||||
'room_rate_id' => 'required|numeric',
|
||||
'connected_room_rate.*.room_id' => 'required|numeric',
|
||||
'connected_room_rate.*.room_rate_id' => 'required|numeric',
|
||||
'connected_room_rate.*.is_affected_price' => 'required|boolean',
|
||||
'connected_room_rate.*.affect_price_action_type' => 'nullable|in:INC,DEC',
|
||||
'connected_room_rate.*.affect_price_type' => 'nullable|in:PER,FIX',
|
||||
'connected_room_rate.*.affect_price_value' => 'nullable|numeric',
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
public function messages()
|
||||
{
|
||||
$thisMessages = [];
|
||||
return array_merge(parent::messages(), $thisMessages);
|
||||
}
|
||||
|
||||
|
||||
public function validate(array $params, array $rules = [], array $messages = [], array $customAttributes = [])
|
||||
{
|
||||
return $this->make($params, $this->rules($params), $this->messages());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace App\Core\Validator\PropertyRoomRateMapping;
|
||||
|
||||
use App\Models\Property;
|
||||
use Illuminate\Contracts\Container\Container;
|
||||
use Illuminate\Contracts\Translation\Translator;
|
||||
|
||||
use App\Core\Validator\BaseValidator;
|
||||
|
||||
use Exception;
|
||||
|
||||
class PropertyRoomRateMappingDeleteValidator extends BaseValidator
|
||||
{
|
||||
|
||||
|
||||
|
||||
public function __construct
|
||||
(
|
||||
|
||||
Translator $translator,
|
||||
Container $container
|
||||
)
|
||||
{
|
||||
parent::__construct($translator, $container);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function rules($params = null)
|
||||
{
|
||||
return
|
||||
[
|
||||
'id' => 'required|numeric',
|
||||
|
||||
];
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function messages()
|
||||
{
|
||||
$thisMessages = [];
|
||||
return array_merge(parent::messages() , $thisMessages);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function validate(array $params, array $rules = [], array $messages = [], array $customAttributes = [])
|
||||
{
|
||||
return $this->make($params, $this->rules($params), $this->messages());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace App\Core\Validator\PropertyRoomRateMapping;
|
||||
|
||||
use App\Models\PropertyRoomRateMapping;
|
||||
use Illuminate\Contracts\Container\Container;
|
||||
use Illuminate\Contracts\Translation\Translator;
|
||||
|
||||
use App\Core\Validator\BaseValidator;
|
||||
|
||||
use Exception;
|
||||
|
||||
class PropertyRoomRateMappingSetStatusValidator extends BaseValidator
|
||||
{
|
||||
|
||||
|
||||
public function __construct
|
||||
(
|
||||
Translator $translator,
|
||||
Container $container
|
||||
)
|
||||
{
|
||||
parent::__construct($translator, $container);
|
||||
|
||||
}
|
||||
|
||||
public function rules($params = null)
|
||||
{
|
||||
return
|
||||
[
|
||||
'room_rate_mapping_id' => 'required|numeric',
|
||||
'is_selected' => 'required|boolean',
|
||||
];
|
||||
}
|
||||
|
||||
public function messages()
|
||||
{
|
||||
$thisMessages = [];
|
||||
return array_merge(parent::messages() , $thisMessages);
|
||||
}
|
||||
|
||||
|
||||
public function validate(array $params, array $rules = [], array $messages = [], array $customAttributes = [])
|
||||
{
|
||||
return $this->make($params, $this->rules($params), $this->messages());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace App\Core\Validator\PropertyRoomRateMapping;
|
||||
|
||||
use Illuminate\Contracts\Container\Container;
|
||||
use Illuminate\Contracts\Translation\Translator;
|
||||
|
||||
use App\Core\Validator\BaseValidator;
|
||||
|
||||
use Exception;
|
||||
|
||||
class PropertyRoomRateMappingUpdateValidator extends BaseValidator
|
||||
{
|
||||
|
||||
|
||||
public function __construct
|
||||
(
|
||||
|
||||
Translator $translator,
|
||||
Container $container
|
||||
)
|
||||
{
|
||||
parent::__construct($translator, $container);
|
||||
|
||||
}
|
||||
|
||||
public function rules($params = null)
|
||||
{
|
||||
return
|
||||
[
|
||||
'id' => 'required|numeric',
|
||||
'room_id' => 'required|numeric',
|
||||
'room_rate_id' => 'required|numeric',
|
||||
'description' => 'required',
|
||||
'rack_rate' => 'required|numeric',
|
||||
'included_occupancy' => 'required|numeric',
|
||||
];
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function messages()
|
||||
{
|
||||
$thisMessages = [];
|
||||
return array_merge(parent::messages() , $thisMessages);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function validate(array $params, array $rules = [], array $messages = [], array $customAttributes = [])
|
||||
{
|
||||
return $this->make($params, $this->rules($params), $this->messages());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user