// Capacity math is intentionally trivial today: `consumed` is whatever the // caller already looked up (Bookings + active Holds, once those models // exist from Phase 4 on). Keeping it as an explicit input rather than a // query inside this function is what lets scheduling.server.ts's // getAvailability stay a pure, DB-free function while this still slots in // cleanly once real consumption exists. export interface CapacityInput { capacity: number; consumed: number; } export function remainingCapacity({ capacity, consumed }: CapacityInput): number { return Math.max(0, capacity - consumed); } export function hasCapacity(input: CapacityInput): boolean { return remainingCapacity(input) > 0; }