/**
 * Which action last changed a session extension row's `activationStatus`.
 * Null until any action has ever been taken on the row (still in its default
 * ACTIVE state from provisioning). `ACTIVE`/`INACTIVE` mean a manual
 * admin/RM/Shoba toggle via the per-session activation endpoint; `ARCHIVED`/
 * `CANCELLED`/`DELETED` mean the registration lifecycle cascade set it as a
 * side effect of the parent registration being archived/cancelled/soft-deleted
 * — those three are terminal and block manual reactivation through the
 * toggle endpoint.
 *
 * Stored in `hdb_program_registration_online_session.activation_source`.
 */
export enum RegistrationOnlineSessionActivationSource {
  ACTIVE = 'active',
  INACTIVE = 'inactive',
  ARCHIVED = 'archived',
  CANCELLED = 'cancelled',
  DELETED = 'deleted',
}

/**
 * The subset of `RegistrationOnlineSessionActivationSource` that means "the parent
 * registration itself is terminal" rather than "an admin toggled this one session
 * off while the registration is still perfectly valid". Attendance/KPI/eligibility
 * queries exclude a row only when it's INACTIVE for one of these reasons — a
 * registrant manually deactivated for a session (activationSource INACTIVE) still
 * holds a live registration and must still be counted (and, if they never joined,
 * marked absent) like anyone else.
 */
export const TERMINAL_REGISTRATION_ACTIVATION_SOURCES = [
  RegistrationOnlineSessionActivationSource.ARCHIVED,
  RegistrationOnlineSessionActivationSource.CANCELLED,
  RegistrationOnlineSessionActivationSource.DELETED,
];
