mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim.git
synced 2026-08-24 15:04:07 +00:00
40 lines
984 B
PHP
40 lines
984 B
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Orders\Services\Attachments;
|
|
|
|
|
|
use App\Classes\Modules\Orders\DataTransferObjects\ScheduleObject;
|
|
use App\Models\Schedule;
|
|
|
|
class UpdatesSchedule
|
|
{
|
|
|
|
/** @var Schedule */
|
|
private $repository;
|
|
|
|
/**
|
|
* UpdatesSchedule constructor.
|
|
* @param Schedule $repository
|
|
*/
|
|
public function __construct(Schedule $repository)
|
|
{
|
|
$this->repository = $repository;
|
|
}
|
|
|
|
|
|
public function execute(int $arrangementId, ScheduleObject $schedule){
|
|
|
|
$this->repository->where('arrangement_id', $arrangementId)->where('type', $schedule->getType())->where('status', 0)
|
|
->update(['status' => 2, 'issue_remark' => $schedule->getIssue()]);
|
|
|
|
$this->repository->arrangement_id = $arrangementId;
|
|
$this->repository->type = $schedule->getType();
|
|
$this->repository->ETA = $schedule->getETA();
|
|
$this->repository->ETD = $schedule->getETD();
|
|
|
|
$this->repository->save();
|
|
|
|
}
|
|
|
|
|
|
} |