# WP5 — Config screen + My-Approvals inbox (FE)

## Goal
Make the approval **configuration** and **inbox** know about the new documents — and make the doc-type list impossible to drift again.

Today the doc-type catalogue is duplicated in **4** places with no source of truth: the BE enum, the config screen's 3 hardcoded maps, the inbox's 2 maps, and i18n. That duplication is *exactly why* `delivery_note`/`grn` are selectable but inert.

## Exact files
- `features/sales/approval-workflows/approval-workflows.component.{ts,html}`:
  - **Delete** the hardcoded maps: `docTypeModuleMap` (`:89-100`), `docTypeLabelKey` (`:102-113`), `moduleLabelKey` (`:115-118`), and the hand-built `buildOptions()` (`:150-178`).
  - **Drive the dropdown from `GET /core/approval-workflows/document-types`** (the WP1 endpoint) and **filter out `wired === false`** — an unwired type must be impossible to configure. This permanently kills the trap.
  - Note `:311` currently has a silent `?? 'sales'` module fallback — it disappears with the endpoint (module comes from the server).
  - Keep `availableDocumentTypeGroups()` (`:213-218`) — the "one workflow per type" filter — and keep the edit-mode behaviour (full list when editing).
  - Add the **Inventory** module group (it comes from the endpoint automatically).
- `features/approvals/my-approvals.component.ts`:
  - `docTypeLabelKey` (`:67-78`) — it already prefers the server-supplied `document_type_label`, so it mostly self-heals; verify.
  - **`docTypeRoute` (`:81-92`) — THIS IS A HARD REQUIREMENT.** An unmapped doc type gets **no deep link** (`hasDeepLink`, `:134-136`) — the approver sees a bare number and **cannot open the document**. Add routes for every new type: adjustments, issues, receipts, GRN, delivery notes.
  - Verify the target screens honour `?viewId=<id>` (the inbox navigates with it — `openDocument`, `:138-142`). Today's inventory screens likely do NOT. If a screen ignores it, either make it honour `viewId` or say so explicitly in your report.
- The config screen has a **duplicate** pending-approvals tab (`:346-377`, template `:103` renders `log.document_type?.replace('_',' ')` raw, with no label map). Either point it at the same labels or note it; do not leave it rendering raw slugs for the new types.
- i18n: `APPROVAL_WF.MODULE_INVENTORY` + `DT_*` keys for the new types in both `ar.json`/`en.json`.

## Acceptance criteria
- [ ] The config dropdown is built **from the endpoint**, not from FE constants.
- [ ] **An unwired document type cannot be selected** (filtered by `wired === false`).
- [ ] The Inventory module group appears with its document types.
- [ ] Every new doc type has a working **deep link** from the inbox (approver can click through to the document). If a target screen can't honour `?viewId=`, report it rather than shipping a dead link.
- [ ] The config screen's own pending tab no longer renders raw slugs.
- [ ] `ng build` green.

## Tests
FE `ng build` green + manual owner check on `/app`. No FE unit runner in this project.

## Flags
- **[FIN]** — no. **Migration** — no.

## Out of scope
BE controllers/engine (WP1–WP4). Permissions (WP6).
