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

# Deleted Records

> Admin interface for viewing, restoring, or permanently deleting soft-deleted records across modules at /admin/deleted-records.

The Deleted Records page (`/admin/deleted-records`) gives platform administrators visibility into all soft-deleted records across the HR, Governance, Forms, and Housing modules, with the ability to restore or permanently delete each record.

## Overview

The page is double-gated: the route requires `admin.deleted_records.manage`, and the component wraps its content in a `RequirePermission` for the same permission. Records are loaded via `useDeletedRecords` with optional entity-type filtering. The page is tabbed by module: **All**, **HR**, **Governance**, **Forms**, and **Housing**. Each tab shows a `DeletedRecordsTable` with the filtered soft-deleted records. Tab labels show a badge with the count of records in each module. The **Restore** and **Permanent Delete** actions open confirmation dialogs (`RestoreRecordDialog`, `PermanentDeleteDialog`) before executing the respective mutations.

## Who it's for

Requires permission `admin.deleted_records.manage`.

## Before you start

* You must hold `admin.deleted_records.manage`.
* Confirm with your team before permanently deleting any record.

<Warning>
  Permanent deletion cannot be undone. Records purged from this screen are unrecoverable.
</Warning>

## Steps

<Steps>
  <Step title="Open Deleted Records">
    Navigate to `/admin/deleted-records`. The **All** tab is active by default showing all soft-deleted records.
  </Step>

  <Step title="Filter by module">
    Click a module tab (HR, Governance, Forms, Housing) to narrow the list to records from that module.
  </Step>

  <Step title="Restore a record">
    Locate the record in the table and click **Restore**. Confirm the action in the `RestoreRecordDialog` dialog.
  </Step>

  <Step title="Permanently delete a record">
    Click **Permanent Delete** on a record row. Confirm the irreversible action in the `PermanentDeleteDialog`.
  </Step>
</Steps>

## Key concepts

<AccordionGroup>
  <Accordion title="Soft delete vs. permanent delete">
    Records soft-deleted in the platform have their `deleted_at` timestamp set but remain in the database. This page exposes both the restore path (clear `deleted_at`) and permanent deletion (remove from the database entirely).
  </Accordion>

  <Accordion title="Module tabs and entity configs">
    Module-to-entity mapping is defined in `DELETED_ENTITY_CONFIGS`. Each config entry specifies the database table and module key, which drives both the tab count badges and the record filtering.
  </Accordion>
</AccordionGroup>

## Related

<Columns cols={2}>
  <Card title="Platform Foundation" icon="layer-group" href="/pf/overview">
    Platform Foundation 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/platform.tsx
  * src/platform/admin/pages/DeletedRecordsPage.tsx
  * src/platform/admin/hooks/useDeletedRecords.ts
</Accordion>
