Speed up Queue board loads by dropping sync and gate side effects.
Deploy Ladill Care / deploy (push) Successful in 1m22s

Stop issuing missing tickets and refreshing financial gates on every GET;
eager-load advances, cap board rows, and cache specialty department maps.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-18 19:50:03 +00:00
co-authored by Cursor
parent 93c7a71ee5
commit a5bbbe23b1
10 changed files with 512 additions and 76 deletions
@@ -64,6 +64,17 @@ class WorkflowEngine
public function currentAdvance(Visit $visit): ?VisitStageAdvance
{
if ($visit->relationLoaded('currentStageAdvance')) {
return $visit->currentStageAdvance;
}
if ($visit->relationLoaded('stageAdvances')) {
return $visit->stageAdvances
->whereIn('status', [VisitStageAdvance::STATUS_ACTIVE, VisitStageAdvance::STATUS_BLOCKED])
->sortByDesc('id')
->first();
}
return VisitStageAdvance::query()
->where('visit_id', $visit->id)
->whereIn('status', [VisitStageAdvance::STATUS_ACTIVE, VisitStageAdvance::STATUS_BLOCKED])