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

# Governance Contracts

> Browse, view, create, and manage contracts with status and type filters, tabbed detail, and a multi-step creation wizard.

This screen is the main list of all contracts in the GR module at route `/gr/contracts`.

## Overview

The Contracts list page loads all contracts via `useContractList` with support for text search, status filter, and contract type filter. Users can toggle between a grid view and table view (`ContractTable`). Contract type and status filter options are statically defined. Clicking a contract navigates to its detail page at `/gr/contracts/:id`. Creating a new contract is gated by `PermissionGate` with `gr.contracts.create`. Error states display a sanitized error message.

## Who it's for

Requires permission `gr.contracts.view`.

Creating a new contract requires `gr.contracts.create`.

## Before you start

* You must have the `gr.contracts.view` permission.
* To create a contract, you also need `gr.contracts.create`.

## Finding a contract

1. Navigate to `/gr/contracts`.
2. Use the search input to find contracts by name or number; use the Status and Type dropdowns to narrow results.
3. Toggle between grid and table view using the view-mode buttons.
4. Click a contract card or row to navigate to its detail page.

**Contract statuses** — `draft`, `pending_approval`, `active`, `expired`, `terminated`, `renewed`.

**Contract types** — `vendor`, `client`, `service`, `lease`, `employment`, `partnership`, `nda`, `other`.

**Grid vs. table** — the view mode toggle persists within the session.

## Viewing a contract

The Contract Detail page (`/gr/contracts/:id`) uses a tabbed `DetailPageLayout`. The **Overview** tab shows contract name, number, type badge, status badge, party/vendor name, value, start date, expiry date, and description. The **Obligations** tab renders `ObligationList`. The **Milestones** tab renders `MilestoneList`. The **Amendments** tab renders `AmendmentList`. Action buttons include: **Edit** (opens `ContractFormDialog`), **Approve** (calls `approveContract`), and **Terminate** (calls `terminateContract` with a fixed reason string). The page uses `useEntityBreadcrumb` to populate the breadcrumb with the contract name or number.

1. From `/gr/contracts` or the dashboard, click a contract to navigate to `/gr/contracts/:id`.
2. Review the **Overview** tab: check contract parties, value, dates, type, and current status.
3. Open the **Obligations** tab to see contracted obligations.
4. Open the **Milestones** tab to check milestone dates and completion status.
5. Open the **Amendments** tab to see any contract amendments.
6. Click **Edit** to open the contract form dialog and update details.
7. Click **Approve** to approve the contract, or **Terminate** to end it.

**Obligations** — contractual commitments tracked in `ObligationList`.

**Milestones** — key dates and deliverables tracked in `MilestoneList`.

**Amendments** — contract changes tracked in `AmendmentList`.

**Terminate reason** — currently hardcoded as `'Terminated by user'`; confirm with SME if a configurable reason is required.

## Creating a contract

The New Contract page (`/gr/contracts/new`) renders `ContractCreationWizardPage`, a full-page wizard powered by `ModuleWizardRenderer` (PF-41) that creates a new `gr_contracts` record. Requires permission `gr.contracts.create`.

Before you start: have the contract type, counterparty details, key dates (start, expiration), and obligation schedule ready. For contracts above the approval threshold (`contract_approval_threshold_amount` in settings), an approval workflow may be triggered after creation.

1. Navigate to `/gr/contracts/new` or use the create contract action from `/gr/contracts`. The wizard loads from the `contract_creation` template.
2. Select a contract type (from `useContractTypes`); this may pre-fill defaults.
3. Follow each step in the `ModuleWizardRenderer` — typically covering contract details, parties, terms, and obligations.
4. On the final review step, click the submit button (labeled "Save as Draft" or another label per `getSubmitButtonLabel`). The wizard validates via `validateFinalSubmit` before submitting.
5. After completion you are navigated to `/gr/contracts` where the new contract appears.

**ModuleWizardRenderer (PF-41)** — platform component rendering wizard steps from `pf_wizard_templates`.

**contract\_creation** — wizard type identifier for contract creation.

**mapWizardDataToPayload** — local mapper that converts `GrContractWizardFormData` to the `gr_contracts` insert payload.

**executionId** — optional query param linking this wizard run to a workflow execution.

## Related

<Columns cols={2}>
  <Card title="Governance & Compliance" icon="scale-balanced" href="/gr/overview">
    Governance & Compliance core overview.
  </Card>

  <Card title="Governance & parity" icon="clipboard-check" 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/gr.tsx
  * src/cores/gr/pages/ContractListPage.tsx
  * src/cores/gr/pages/ContractDetailPage.tsx
  * src/cores/gr/hooks/useContractList.ts
  * src/cores/gr/hooks/useContractDetail.ts
  * src/cores/gr/hooks/useContractMutation.ts
  * src/cores/gr/wizards/contract-creation/ContractCreationWizardPage.tsx
  * src/platform/permissions/constants.ts
</Accordion>
