Merge pull request #104 from witelgroup/feature/PaymentHarimCheckServise

Write webservice for harim and Cmms
This commit is contained in:
Amir Ghasempoor
2025-12-20 10:57:32 +03:30
committed by GitHub
10 changed files with 209 additions and 4 deletions

View File

@@ -36,13 +36,13 @@ class AllocateRequest extends FormRequest
return [
function (Validator $validator) {
$duplicateMission = Mission::query()->where('machine_id', '=', $this->machine_id)
->whereBetween('start_date', [$this->mission->start_date, $this->mission->end_date])
->orWhereBetween('end_date', [$this->mission->start_date, $this->mission->end_date])
->where('start_date', '<=', $this->mission->end_date)
->where('end_date', '>=', $this->mission->start_date)
->exists();
if ($duplicateMission) {
$validator->errors()->add(
'machine',
'machine_id',
'خودروی مورد نظر در این زمان رزرو می باشد'
);
}