Speed up Queue board loads by dropping sync and gate side effects.
Deploy Ladill Care / deploy (push) Successful in 1m22s
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:
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user