Staff — Concepts & architecture
Staff is mostly frontend display (Tuke/Topi) over people, shift, and leave data. Below are the core concepts and data rules.
Concepts
| Concept | Meaning |
|---|---|
| Employee | Staff record in one BU. One person may have multiple Employee records (cross-BU). |
| enterpriseUserId | Cross-BU person identity — used to dedupe Employees for the same person. |
| Roster / Shift | Work schedule; each shift has a time interval. |
| Leave | Leave/absence: date/time interval, tracking code, status lifecycle (request→approve). |
| TrackingCode | Classification code; TypeId = Leave or Shift. Leave forms only show Leave type. |
| Availability | Declared weekly availability (time slots). |
| Timetable | Display timetable (Syncfusion ScheduleComponent). |
Dedupe rule in Weekly Planner
One person may only have one row in planner, even with multiple records:
- Person with both selected-BU and cross-BU records → keep selected BU's
employeeIdas canonical resource id. - Person missing both identities → still a separate row.
- Sort applies after role-filter + merge. Does not include archived staff (already excluded by employee-link contract).
Invariant:
INV-ROSTER-WP-001 v3.
Leave overlap display rule
When creating/editing a shift, popup shows read-only Leave if leave overlaps the shift interval:
- Evaluate by date-time interval intersection, not by same date only.
- Field includes leave date/time + tracking code; hidden when no overlap.
Invariant:
INV-ROSTER-LEAVE-DISPLAY-001 v1. Applies to Weekly Planner shift popup, Timesheet rows, and Timesheet exports.
Tracking Code rule
- Leave forms (create/edit/approve) only show codes with
TrackingCode.TypeId = Leave. - Shift codes are excluded from leave selectors.
Sort & display-only UI rules
Many Staff specs are display-only (no persistence/API change):
| Place | Rule |
|---|---|
| Availability time slots | Sort by ascending start time, per weekday. |
| Edit Time Slot popup templates | Sort by ascending start time (within loaded set). |
| Timetable controls | One control set; ScheduleComponent header is source of truth for range/view. |
| Staff Home header | Title left; action area right in fixed order. |
| Leave drawer | Compact paired date/time layout; collapses on narrow viewport. |
Architecture (high level)
Most rules live in the frontend (sort, display dedupe, layout). API/persistence in Tux stays unchanged for many display-only changes. When changing data behavior (for example canonical dedupe id), check both sides.
Next: Common cases.