import type { PractitionerRole } from 'fhir/r4'; import { isClinicianEnabled } from './clinicianEnabled'; /** * What deactivating a staff member does, in the confirm dialog's words. * * It removes their access to THIS practice. It does not stop them signing in: the same identity may work at * another practice, so the account stays and the server refuses this practice's data (NP-5 ruling, Captain * 2026-10-02). The dialog said "will no longer be able to log into", which the product does not do. */ export const staffDeactivationConsequence = (staffName: string, orgName: string): string => `${staffName} will lose access to ${orgName}'s staff portal, and no new appointments can be booked with them.`; /** * The seat line in the REACTIVATE dialog. The practice's clinician-seat count skips inactive roles, so a * clinician coming back is counted - and billed past the first - again. Said only for a clinician. */ export const staffReactivationSeatLine = (roles: PractitionerRole[]): string | undefined => roles.some((role) => isClinicianEnabled(role)) ? 'They hold a clinician seat, so reactivating counts them on your subscription again.' : undefined;