mirror of
https://github.com/bitbaum/vitareba.git
synced 2026-12-04 16:07:27 +01:00
Five things, all of them the same underlying problem: the booking flow was built
for date-only requests and never revisited when real appointments arrived.
THE CARD BURIED THE ONLY THING ANYONE OPENS IT FOR. It read as one flat
sentence — "Consultation · Mon 17 Aug, 17:00 · George" — so WHEN had the same
weight as the word "Consultation", followed by "Requested 16/08/2026", a date
nobody has ever needed, in a different format, directly under the one that
mattered. It is now when → what and who → where, with the time set in the
display face, and the requested date is gone.
THE DASHBOARD DROPPED THE TIME ENTIRELY. It said "17 August 2026" for a 17:00
consultation, because the card's props were Pick<"status" | "preferredDate"> —
it could not see scheduledAt even when one existed, and no type error was
possible because the field was not in scope. Widening it made the compiler
point at the query, which had never fetched the clinician either.
THE DASHBOARD SHOWED THE WRONG BOOKING. It ordered by createdAt, so a patient
with a consultation on Monday and a vague request typed yesterday was shown the
request. "Your next appointment" now means the next appointment.
THREE DATE FORMATS ON TWO SCREENS. "17 August 2026", "Mon 17 Aug, 17:00" and
"16/08/2026", all describing the same kind of thing. formatAppointment() is now
the one way to write an appointment, and it formats in CLINIC time — the general
date helpers use the runtime's zone, which on the box is UTC, so a late
appointment rendered on the previous day.
"LESS THAN 24H AWAY · CANCELLING NOW IS RECORDED AS LATE" — permanently, under a
confirmed appointment, at a patient who had not asked to cancel anything. Two
separate faults:
• It was NOISE. The policy belongs where the decision is made: it is already
beside the confirm button when booking, and in the confirmation step when
cancelling. A standing warning is just an alarm nobody switched on.
• It was UNFAIR, and this is the real bug. Slots open 12 hours ahead while the
notice window is 24, so an appointment booked for tomorrow evening is
ALREADY inside the window the moment it is created. The patient books it and
is immediately told cancelling would count against them, having never been
offered a way to do better. "Late" now also requires that the booking existed
long enough to have been cancelled in time. A rule that marks someone down
for a choice the software never gave them is a bug wearing a policy.
MOVING AN APPOINTMENT COULD SILENTLY CHANGE THE DOCTOR. "Move" opened the picker
on whichever clinician it happened to be showing, not the one the appointment is
with — so moving a consultation with George could reassign it to Manuel the
moment a time was picked. It now opens on the right clinician, and says that
changing clinician is something you may do here, which the picker always allowed
and nothing ever mentioned.
+6 tests. 1243 passing; build green.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>