> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Compliance Setup Wizard

> Three-step guided wizard to define, schedule, and activate a recurring compliance requirement for recovery housing residences.

The Compliance Setup Wizard walks users through creating a new recurring compliance requirement, accessible at `/rh/compliance/requirements/wizard`.

## Overview

The wizard uses a three-step timeline layout (`WizardShell` with `layout="timeline"`). After completing all three steps and clicking **Activate requirement**, the wizard calls `createRequirement` and navigates to the new requirement detail page. Exiting at any step navigates back to `/rh/compliance/requirements` without saving.

## Who it's for

This route requires `RH_PERMISSIONS.COMPLIANCE_CREATE` (`rh.compliance.create`) in addition to the outer `RH_PERMISSIONS.DASHBOARD_VIEW` (`rh.dashboard.view`) guard.

## Before you start

* Your account must hold both `rh.dashboard.view` and `rh.compliance.create` permissions.
* An organization context must be active.
* Navigate from the Compliance dashboard or Requirements list; the wizard cannot be bookmarked to bypass the permission gate.

## Steps

<Steps>
  <Step title="Step 1 — Requirement Definition">
    Fill in the required fields: **Title**, **Description**, **Category**, and **Requirement Type**. Optionally provide a **Regulatory Reference**. All four required fields must be non-empty before proceeding; a validation toast appears if any are missing.
  </Step>

  <Step title="Step 2 — Schedule & Scope">
    Set the recurrence **Frequency** (default: `monthly`), **Lead Time Days** (default: `7`, minimum: `0`), and **Scope** (default: `all_residences`). Optionally set `due_day_of_month`. All three fields are required; validation runs on **Next**.
  </Step>

  <Step title="Step 3 — Review & Activate">
    Review the summary of definition and schedule data on the `ComplianceReviewActivateStep` screen. Click **Activate requirement** to submit. On success a toast confirms activation and the page navigates to the new requirement's detail page. On error a sanitized error message appears in a toast.
  </Step>
</Steps>

## Key concepts

| Term                   | Code identifier                | Notes                                                    |
| ---------------------- | ------------------------------ | -------------------------------------------------------- |
| Requirement Definition | `RequirementDefinitionStep`    | Title, description, category, type, regulatory reference |
| Schedule & Scope       | `ScheduleScopeStep`            | Frequency, lead time, scope, optional due day            |
| Review & Activate      | `ComplianceReviewActivateStep` | Read-only summary before final submission                |
| `frequency`            | `schedule.frequency`           | Recurrence cadence stored on the requirement record      |
| `scope`                | `custom_fields.scope`          | Stored in `custom_fields`; default `all_residences`      |

## Related

<Columns cols={2}>
  <Card title="Recovery Housing" icon="house" href="/rh/references">
    Recovery Housing references and overview.
  </Card>

  <Card title="Governance & parity" icon="scale-balanced" href="/governance/index">
    Documentation coverage and governance.
  </Card>
</Columns>

<Note>
  This page documents shipped product behavior. It is not medical, legal, or
  billing advice. Verify against your organization's policies and applicable
  regulations before using it for clinical, compliance, or billing decisions.
  Protected health information (PHI) shown in the product is governed by your
  tenant's access controls and is never exposed in this documentation.
</Note>

<Accordion title="Documentation sources">
  * src/routes/rh.tsx
  * src/cores/rh/pages/ComplianceSetupWizardPage.tsx
  * src/cores/rh/components/wizards/compliance-setup/ComplianceSetupWizard.tsx
</Accordion>
