docs(fusion_clock): correct dashboard spec data contract (leaves auto-approved; add on_leave_count; drop very_late)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-05-31 02:09:54 -04:00
parent be721f82ae
commit db48029e61

View File

@@ -35,7 +35,7 @@ The dashboard renders **bands**, gated by role. The hard rule: **a regular emplo
| **— employee view ends here —** | | | |
| Team KPIs — Present / Absent / Late / Pending | ❌ | ✅ direct reports | ✅ org-wide |
| Currently Clocked In roster | ❌ | ✅ direct reports | ✅ everyone |
| Needs Attention (absences, pending reasons, requests, very-late) | ❌ | ✅ their team | ✅ org-wide |
| Needs Attention (genuine absences, pending reasons, pending corrections) | ❌ | ✅ their team | ✅ org-wide |
| Quick Actions | own (clock/leave/correction/timesheets) | + team views | + Reports / Settings |
**Scoping rule (server-side, never client-trusted):**
@@ -97,12 +97,13 @@ Single endpoint, reworked: **`POST /fusion_clock/dashboard_data`** (`type='jsonr
"team": null | { # present ONLY for team_lead / manager
"scope": "team" | "org",
"total_employees": int,
"present_count": int,
"absent_count": int,
"present_count": int, # distinct employees with an attendance today
"on_leave_count": int, # approved leave covering today (leave_date <= today <= date_to)
"absent_count": int, # genuine no-shows = total - present - on_leave (matches absence cron)
"late_count": int, # late_clock_in logs today, scoped
"pending_reasons": int, # scoped
"pending_approvals": int, # scoped: pending corrections + pending leaves
"very_late_count": int, # scoped, today
"pending_reasons": int, # scoped (owe an auto-clock-out explanation)
"pending_approvals": int, # scoped: fusion.clock.correction state='pending'
# (leaves are auto-approved — nothing to approve)
"clocked_in": [
{"employee": str, "check_in": str, "location": str, "late": bool}
]