feat(appointments): resources share the doctors' timeline
Three views become two. The resource lanes were a separate tab, which meant reading a doctor's free hour on one screen and the laser's on another and matching them by eye — while in the resource-first model it is the device and the room that decide whether that hour is really free. They now sit under the same "زمانبندی" view, below the doctor's slots. Each lane says how much of its shift is still free, and that number respects capacity: a minute counts as busy only once the overlapping bookings reach the resource's capacity, so a three-bed room with two appointments is still open. Treating it otherwise would silently turn every multi-capacity resource into a single-capacity one. ResourceFreeTimeCalculator does the sweep and carries nine cases of its own. only_bookable=1 keeps resources with no service offering out of the view; they could only ever render an empty lane. On the seeded clinic that is five resources down to two. Two ruler defects the screenshot caught: hours rendered in Latin digits, and the last label was half-clipped by the container so 21 read as 2. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,15 +2,15 @@
|
||||
* سوییچ کشویی نمای نوبتها — بازسازی `TurnsViewModeToggle.jsx` طرح tauri
|
||||
* (پسزمینهٔ لغزنده، متن فعال #5559ce).
|
||||
*
|
||||
* نمای «منابع» بعداً اضافه شد چون در مدل منبعمحور، پرشدن یک ساعت را دستگاه و اتاق
|
||||
* تعیین میکنند نه فقط برنامهٔ پزشک.
|
||||
* منابع نمای جدا ندارند: ردیفشان درون همان نمای «زمانبندی» میآید، چون پرشدن یک ساعت
|
||||
* را دستگاه و اتاق تعیین میکنند نه فقط برنامهٔ پزشک — و دیدنشان جدا از هم یعنی کاربر
|
||||
* باید دو نما را با چشم تطبیق دهد.
|
||||
*/
|
||||
export type TurnsViewMode = 'table' | 'timeline' | 'resources';
|
||||
export type TurnsViewMode = 'table' | 'timeline';
|
||||
|
||||
const MODES: { id: TurnsViewMode; label: string }[] = [
|
||||
{ id: 'table', label: 'نمایش جدولی' },
|
||||
{ id: 'timeline', label: 'زمانبندی' },
|
||||
{ id: 'resources', label: 'منابع' },
|
||||
];
|
||||
|
||||
export default function TurnsViewToggle({
|
||||
@@ -27,7 +27,7 @@ export default function TurnsViewToggle({
|
||||
role="tablist"
|
||||
aria-label="نمای نوبتها"
|
||||
style={{
|
||||
position: 'relative', width: 272, height: 44, display: 'flex', overflow: 'hidden',
|
||||
position: 'relative', width: 193, height: 44, display: 'flex', overflow: 'hidden',
|
||||
border: '1px solid var(--border)', borderRadius: 'var(--r-sm)', background: 'var(--surface)',
|
||||
}}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user