refactor(admin): rebuild the staff sessions page around the operator's question
The page an operator opens to see the day's work did not say who any of it was for. TreatmentSession::toArray() carries no patient, so the list showed a service name, a time, and a repeated 40-char button — the same three lines for every row, with the finished work leading. The endpoint now sends patient_name and resource_name. They are added in the controller next to case_uuid/service_name rather than in toArray(), so patient identity does not leak into every other consumer of that method. The list is now a queue: unfinished work first, settled work (done, cancelled, no-show) below it, each group counted. Every row leads with its time, names the patient, and carries the service, device, session number and area progress on one meta line. The whole row is the link, so the repeated button is gone. Also fixes three things the redesign checklist calls out: Latin digits in the session and area counts (formatNumber), a date repeated on every row of a page whose title is "today", and a missing error state — a failed request rendered as "no sessions today", which reads as an empty day rather than a broken one. Adds the test file the page never had. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -57,9 +57,16 @@ class SessionExecutionController extends BaseController
|
||||
$staff = $this->requireStaff($user);
|
||||
|
||||
return $this->success(array_map(
|
||||
/**
|
||||
* نام بیمار و دستگاه اینجا اضافه میشوند نه در `TreatmentSession::toArray()`:
|
||||
* صفِ اپراتور بدون نام بیمار بیمعنی است، ولی هویت بیمار نباید در هر
|
||||
* مصرفکنندهٔ دیگرِ همان متد هم بنشیند.
|
||||
*/
|
||||
static fn (TreatmentSession $s): array => $s->toArray(withAreas: true) + [
|
||||
'case_uuid' => $s->getTreatmentCase()->getUuid(),
|
||||
'service_name' => $s->getTreatmentCase()->getServiceItem()->getName(),
|
||||
'case_uuid' => $s->getTreatmentCase()->getUuid(),
|
||||
'service_name' => $s->getTreatmentCase()->getServiceItem()->getName(),
|
||||
'patient_name' => $s->getAppointment()?->getPatientName(),
|
||||
'resource_name' => $s->getAppointment()?->getResource()?->getName(),
|
||||
],
|
||||
$this->sessions->findTodayForStaff(
|
||||
$staff,
|
||||
|
||||
Reference in New Issue
Block a user