create new stracture for Report in mission and fix form request

This commit is contained in:
2026-06-17 14:48:42 +03:30
parent c9e779d726
commit 8da1ae1d74
6 changed files with 144 additions and 260 deletions

View File

@@ -41,12 +41,18 @@ class UpdateRequest extends FormRequest
'زمان پایان ماموریت باید بعد از زمان شروع ماموریت باشد.'
);
}
if ($this->end_km < $this->violation->km) {
if ($this->end_km <= $this->violation->km) {
$validator->errors()->add(
'end_km',
'کیلومتر پایان باید بزرگتر از کیلومتر شروع باشد.'
);
}
if (($this->end_km - $this->violation->km ) < 100) {
$validator->errors()->add(
'end_km',
'اختلاف کلیلومتر شروع و پایان نباید بیشتر از 100 کیلومتر باشد'
);
}
}
];
}