|
@@ -9,10 +9,10 @@ class FranchiseeContractRequest extends FormRequest
|
|
|
public function rules(): array
|
|
public function rules(): array
|
|
|
{
|
|
{
|
|
|
$rules = [
|
|
$rules = [
|
|
|
- 'start_date' => 'required|date',
|
|
|
|
|
- 'end_date' => 'required|date|after:start_date',
|
|
|
|
|
- 'tbr_fixed_value' => 'required|numeric|min:0',
|
|
|
|
|
- 'invoice_due_date' => 'nullable|date',
|
|
|
|
|
|
|
+ 'start_date' => 'nullable|date',
|
|
|
|
|
+ 'end_date' => 'nullable|date|after:start_date',
|
|
|
|
|
+ 'tbr_fixed_value' => 'nullable|numeric|min:0',
|
|
|
|
|
+ 'invoice_due_date' => 'nullable|integer|between:1,31',
|
|
|
'inhabitant_classification_id' => 'nullable|integer|exists:inhabitant_classifications,id',
|
|
'inhabitant_classification_id' => 'nullable|integer|exists:inhabitant_classifications,id',
|
|
|
'tbr_fixed_value_percentage' => 'nullable|numeric|between:0,1',
|
|
'tbr_fixed_value_percentage' => 'nullable|numeric|between:0,1',
|
|
|
'marketing_fund_percentage' => 'nullable|numeric|between:0,1',
|
|
'marketing_fund_percentage' => 'nullable|numeric|between:0,1',
|
|
@@ -20,7 +20,10 @@ public function rules(): array
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
if ($this->isMethod('POST')) {
|
|
if ($this->isMethod('POST')) {
|
|
|
- $rules['unit_id'] = 'required|integer|exists:units,id';
|
|
|
|
|
|
|
+ $rules['unit_id'] = 'required|integer|exists:units,id';
|
|
|
|
|
+ $rules['start_date'] = 'required|date';
|
|
|
|
|
+ $rules['end_date'] = 'required|date|after:start_date';
|
|
|
|
|
+ $rules['tbr_fixed_value'] = 'required|numeric|min:0';
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return $rules;
|
|
return $rules;
|