Glossary
Branch — A single clinic location within a company account. Each branch has its own opening hours, breaks, holidays, rooms, and doctor roster. Companies can have one or many branches.
selectedBranch — Front-end state (React context, branchContext.js) tracking which branch the current user is viewing/scheduling for. Not persisted — resets each session.
BRANCH_DETAILS — The GraphQL query that fetches a branch's opening hours, breaks, holidays, rooms, and doctors. Fetched with fetchPolicy: 'cache-first', keyed by branch id, and skipped entirely if no branch is selected.
branchData — The local variable name (in every affected component) for the result of the BRANCH_DETAILS query. undefined until the query resolves for the currently selected branch.
branchDetails — The nested object inside a BRANCH_DETAILS query result carrying the actual opening-hours fields (opens, closes, breaks, holidays, openDays, users, rooms).
Computation guard — This PR's own term (from its branch name) for a defensive if (!x) return <safe default> / x?.y check added before code that would otherwise dereference a value that might still be loading.
getStartAndEndTimes — Shared helper (mobile package, calendarHelpers.js) that converts a branch's raw opens/closes data for a given day into hour/minute boundaries used to compute available slots.
getAvailableSlots — Shared helper that, given a day's opening hours and existing appointments, returns the list of open time slots for that day. Still lacks a branchData guard as of this PR — see the gap noted in Feature breakdown.
isSlotAvailable — Shared helper that checks whether one specific time range is free (not a break, not a holiday, no conflicting appointment, respects a specific doctor's own closed hours if one is selected). Same unguarded status as getAvailableSlots.
Repeat appointment — An appointment-form feature that generates several future dates (e.g., "every Monday and Wednesday, 3 times") from one form submission. The Available Slots button checks all of those generated dates against the branch calendar before the user commits.
Month view / MonthlyCalendar — The "Select Date" modal opened from the calendar icon next to the appointment form's Day field, showing a month grid with per-day appointment and available-slot counts.