> ## 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.

# Assignments

> View, filter, and manage staff assignments to recovery housing residences with role and active-status filters at /rh/staff-operations/assignments.

The Assignments screen at `/rh/staff-operations/assignments` lists all staff assignments to residences within the current organization and provides filters by residence, staff role, active status, and a primary-assignment toggle.

## Overview

The page loads residence options via `useResidences` for the filter dropdown. The `StaffAssignmentsTable` component renders assignment rows filtered by the locally-managed `StaffAssignmentFilters` state. Filter options include a residence selector (all residences from `useResidences`), a role selector with values `housing_tech`, `house_manager`, `program_manager`, `peer_pss`, and `other`, an active-status selector (`active` / `inactive` / all), and a **Primary Only** switch that sets `isPrimary` on the filter. The **Add Assignment** button opens the `StaffAssignmentDialog`. The page wraps in `MobilePullToRefresh`; pulling to refresh invalidates the `['rh', 'staff-assignments', organizationId]` query key.

## Who it's for

No route-level `RequirePermission` beyond the outer `RHViewGuard`, which requires `RH_PERMISSIONS.DASHBOARD_VIEW` (`rh.dashboard.view`). The code comments reference `RH_PERMISSIONS.STAFF_OPERATIONS_VIEW` and `STAFF_OPERATIONS_CREATE` but these are not applied as a `<Route>`-level guard on this path.

## Before you start

* Hold `rh.dashboard.view` to access the RH module.

## Steps

<Steps>
  <Step title="Open the Assignments list">
    Navigate to `/rh/staff-operations/assignments`. The `StaffAssignmentsTable` loads for the current organization.
  </Step>

  <Step title="Filter by residence">
    Use the **Residence** dropdown to show assignments for a specific residence, or leave as "All Residences".
  </Step>

  <Step title="Filter by role">
    Use the **Role** dropdown to filter by `Housing Tech`, `House Manager`, `Program Manager`, `Peer PSS`, or `Other`.
  </Step>

  <Step title="Filter by active status">
    Use the **Status** dropdown to show only `Active`, only `Inactive`, or all assignments.
  </Step>

  <Step title="Show primary assignments only">
    Toggle the **Primary Only** switch to filter to assignments where `is_primary` is true.
  </Step>

  <Step title="Add a new assignment">
    Click **Add Assignment** in the page header. The `StaffAssignmentDialog` opens. Complete the form and save.
  </Step>

  <Step title="Refresh (mobile)">
    On a touch device, pull down from the top of the list to trigger a data refresh.
  </Step>
</Steps>

## Key concepts

<AccordionGroup>
  <Accordion title="Staff role values">
    The role filter uses the following values from the `StaffRole` type: `housing_tech` (Housing Tech), `house_manager` (House Manager), `program_manager` (Program Manager), `peer_pss` (Peer PSS), `other` (Other).
  </Accordion>

  <Accordion title="Pull-to-refresh">
    On mobile, pulling down calls `queryClient.invalidateQueries` with key `['rh', 'staff-assignments', organizationId]`, triggering a live refetch.
  </Accordion>
</AccordionGroup>

## 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/StaffAssignmentsPage.tsx
</Accordion>
