Files
AgendaPro Dev d796538fd9 feat: rebrand AgendaPro -> AgendaMax + calendar fixes + current-week demo seed
- Rebrand all user-facing text to AgendaMax
- Fix sidebar scrolling: card container no longer overflows html (flex h-full min-h-0)
- Fix calendar toolbar hover: active buttons keep readable contrast
- Sticky calendar toolbar (month/week/day always visible on scroll)
- Seed guarantees 2-4 appointments per day for current week (Mon-Sat)
2026-07-27 10:11:16 -06:00

21 lines
800 B
TypeScript

// server/lib/metrics.ts
// Pure KPI metric definitions. All return 0 when there is no data (no divide-by-zero).
/** Cancellation rate: cancelled / total, rounded to 1 decimal (percent). */
export function cancelRate(cancelled: number, total: number): number {
if (total <= 0) return 0;
return Math.round((cancelled / total) * 1000) / 10;
}
/** No-show rate: noShow / total, rounded to 1 decimal (percent). */
export function noShowRate(noShow: number, total: number): number {
if (total <= 0) return 0;
return Math.round((noShow / total) * 1000) / 10;
}
/** Completion rate: completed / total, rounded to the nearest whole percent. */
export function completionRate(completed: number, total: number): number {
if (total <= 0) return 0;
return Math.round((completed / total) * 100);
}