sackey e839d40a99
Some checks are pending
linter / quality (push) Waiting to run
tests / ci (push) Waiting to run
Initial commit
2025-07-30 17:15:50 +00:00

45 lines
1.1 KiB
PHP

<?php
namespace App\Livewire\CustomerPortal;
use App\Models\JobCard;
use App\Services\WorkflowService;
use Livewire\Component;
class JobStatus extends Component
{
public JobCard $jobCard;
public $workflowProgress;
public function mount(JobCard $jobCard)
{
$this->jobCard = $jobCard->load([
'customer',
'vehicle',
'serviceAdvisor',
'vehicleInspections',
'diagnoses',
'estimates',
'workOrders.tasks',
'timesheets'
]);
$workflowService = app(WorkflowService::class);
$this->workflowProgress = $workflowService->getWorkflowProgress($this->jobCard);
}
public function refreshStatus()
{
$this->jobCard->refresh();
$workflowService = app(WorkflowService::class);
$this->workflowProgress = $workflowService->getWorkflowProgress($this->jobCard);
session()->flash('message', 'Status updated!');
}
public function render()
{
return view('livewire.customer-portal.job-status');
}
}