# Operator Desk

> Find accounts, review invoices, reconcile payments and resolve missed service appointments in the operator Desk.


Use the Desk to look up an account, explain an invoice or correct a billing hold. On a phone, **Bereiche** opens the same workspaces as the desktop sidebar.

[![Eingang: a held bill with its fix and an E-Mail eintragen button](../screenshots/desk-eingang.thumb.png)](../screenshots/desk-eingang.png)
[![An account: payment, the contract as a line, every bill, one timeline](../screenshots/desk-konto.thumb.png)](../screenshots/desk-konto.png)
[![A bill as the customer sees it, beside its facts](../screenshots/desk-rechnung.thumb.png)](../screenshots/desk-rechnung.png)
[![A fibre price book with its plans and golden tests](../screenshots/desk-preisbuch.thumb.png)](../screenshots/desk-preisbuch.png)
[![The test clock with +1 Tag and +1 Monat](../screenshots/desk-zeitreise.thumb.png)](../screenshots/desk-zeitreise.png)
[![Neukunde: the form beside the quote as it will be billed](../screenshots/desk-neukunde.thumb.png)](../screenshots/desk-neukunde.png)
[![Webhooks per service: who receives what, whether it arrives, test, log, replay](../screenshots/desk-webhooks.thumb.png)](../screenshots/desk-webhooks.png)

On a fibre invoice, **Abweichung untersuchen** starts an optional comparison with the preceding month. [Investigate a bill](../docs/agent-assistance/#investigate-a-fibre-bill)

**Netz** shows each carrier order’s requested and confirmed dates, completion and cancellation. [Open-access provisioning](../docs/open-access/)

Open **Online-Abrechnung** to trace a grant from the network request to the wallet journal and its mediation copy. [Operate online charging](../docs/online-charging/)

On **Konto**, open **Prepaid-Guthaben** to enroll subscriptions, assign a booked payment, change a monthly limit or view the customer statement. [Prepaid accounts](../docs/prepaid/)

Under **Weitere Aktionen** on an invoice or final bill, **Tarifprüffall (JSON)** downloads its rating inputs and expected result. [Replay a sealed invoice](../docs/golden-tests/)

In the same menu, **TMF-Rechnungsdaten (JSON)** downloads the same representation a billing partner retrieves for reconciliation. [Partner billing API](../docs/tmf-bills/)

## Find the account behind a call

Press Ctrl+K (⌘K on macOS), enter a name or the printed customer number, and press Enter. Open the result directly when it has one account. For a customer with several accounts, choose the account number on the invoice. **Weitere Treffer laden** continues the same search. Select an invoice, then use **Zum Konto** beside its billing period to return.

In **Eingang**, **Weitere Sperren laden** continues the list of held months. A count labelled **angezeigt** describes the rows loaded so far. **Stand aktualisieren** refreshes the list after another employee corrects a hold.

The `GET /customers?q=…` and `GET /holds` APIs return `items` and `next`. Send the value of `next` as `after` to continue. A null value marks the end. Customer pages contain up to 20 matches and hold pages up to 50 account-months.

## The views

| View | Shows | Changes |
|---|---|---|
| **Eingang** | Held bills and contract event deliveries, each with its own status | Open **Nachweis zur Sperre**, correct a missing invoice email or follow a delivery backlog to **Webhooks** |
| **Konten** | Search by name or customer number as you type (from two characters) | „Neukunde" |
| **Neukunde** | The first invoice and later price steps for the selected plan and start date | Review the quote and submit the signup |
| **Konto** | Address, masked payment details, contract dates, invoices and account history | Record a move or change the invoice email |
| **Störungsfälle** | Outage claims, receipt numbers and supporting evidence | Record a claim, recover its receipt and approve compensation |
| **Vorschläge** | Pending credits, tariff switches and dispute replies | Inspect the evidence, record a decision or reopen its receipt from **Alle**. [Proposal review](../docs/agent-assistance/) |
| **Terminfälle** | Visit evidence, responsibility, proposed amount and journal reference | Register a visit, record evidence, resolve a disputed report and approve compensation |
| **Umstieg** | Migration shadow run and billing differences | Open a local JSON report |
| **Zahlungen** | Bank import outcomes and unapplied receipts | Import a bank statement or notification |
| **Netz** | Carrier orders, appointments and completion | Inspect the date that triggers wholesale billing |
| **Gesprächsimporte** | The latest switch batches and their accepted, held or rejected records | Expand a receipt to match an outcome to its source row |
| **Mobilfunk** | Held records by source, receipt day and unit | Map a rating group, retry a container or record a documented exclusion. [Mobile usage](../docs/mobile-usage/) |
| **Anschlussnutzung** | Monthly source records with exact quantities and their assigned invoices | Open from a contract or a sealed usage charge, select a month and follow its records. [Monthly billing](../docs/billing/) |
| **Rechnung** | The bill page exactly as billd serves it, in a sandboxed frame, beside number, net, VAT, gross and hash; PDF and e-invoice | „Stornieren" with a reason creates the Stornorechnung |
| **Zeitreise** | All five service clocks | „+1 Tag", „+1 Monat", a date: contractd first (it delivers the day's facts), then accountingd, chargingd, billd and usaged; lists what the passes did |
| **Preisbuch** | The loaded books; a book's plans at their regular monthly price and its golden tests; two versions compared case by case, largest change first | — |
| **Webhooks** | Subscribers, event filters, delivery status and recent attempts | Register, test, replay or delete a webhook |

Neukunde takes its business date from contractd. Choose a tariff if several are available. Changing the tariff or start requests a fresh quote. Changes to the tariff, start, customer type or minimum term clear the summary confirmation. The submit button becomes available when billd returns the selected quote and the address is complete. Select the approval checkbox only when the customer has confirmed the contract summary. If the connection drops during submission, “Denselben Auftrag erneut senden” resends the original payload and order reference from the open form.

A refusal is shown as the service said it: its `detail`, its `code`, which service, and
the fix when it named one. An unreachable service is named; the rest of the screen
stays.

## Run it

```sh
just demo     # Docker Compose: everything, seeded, the Desk on http://localhost:9400
# or, to work on it:
just dev      # local services and the Desk on http://127.0.0.1:5179
just seed     # a year of bills to look at
```

Under `just dev` the Desk runs on Vite with the token in its environment; under
`just demo` it is the built app behind Caddy. The page calls
`/api/contractd/*`, `/api/billd/*`, `/api/usaged/*`, `/api/accountingd/*` and `/api/chargingd/*` on its own origin; the dev server forwards them
and adds `Authorization`. The browser never sees the token.

## Deploy it behind an edge

The Desk is static files. In a deployment, an edge serves them and forwards the API
paths with the token. `web/desk/Caddyfile` is that edge:

```sh
cd web/desk && npm ci && npm run build
TELCO_TOKEN=… CONTRACTD_URL=http://contractd:9401 BILLD_URL=http://billd:9402 USAGED_URL=http://usaged:9403 ACCOUNTINGD_URL=http://accountingd:9404 CHARGINGD_URL=http://chargingd:9405 caddy run
```

What the edge guarantees, and `npm run guards` checks:

- **The bundle holds no token.** It is built with a token in the environment, then
  searched for it.
- **Only operator API routes are forwarded**, with `Authorization` replaced by the
  edge's token; cookies are dropped. `/inbox` (signed deliveries) and `/mcp` (agents)
  are never routed.
- **A strict content security policy**: `script-src 'self'`, `connect-src 'self'`,
  `frame-ancestors 'none'`. Bill pages render in an `<iframe sandbox="">`, without
  scripts and without access to the Desk's origin.
- **The dev edge listens on 127.0.0.1 only.**

Put your sign-in in front of the edge (an identity-aware proxy, `forward_auth`). The edge supplies the operator token for routine requests. Proposal decisions require a personal reviewer credential. [Configure reviewer authentication](../docs/agent-assistance/)

## Gesprächsimporte

Open **Gesprächsimporte** to reconcile a switch export. Match its UUID to the receipt, then expand the batch for the source record numbers and German reasons for held or rejected calls. [Switch import workflow](../docs/voice-imports/)

## Reconcile a payment

Open **Zahlungen** to import a bank file and inspect unmatched receipts. On a sealed invoice, **Zahlungsstand** shows the amount paid, any credit notes and the remaining balance. [Reconcile bank payments](../docs/payments/)

## Review an outage claim

In **Störungsfälle**, enter the **Eingangsbeleg** UUID to find the original receipt and open its case. For a phone, written or in-person claim, open the case and enter the time on the source record in **Berlin time**. When the clocks go back, use the source record to choose the UTC offset. A time in the skipped spring hour needs correction.

If the reply is lost, keep the displayed request number and retry the same submission. After confirmation, give the claimant the receipt UUID. Start a new intake for a separate claim. Review the fee and eligibility findings before approving the current revision. The subscriber can follow the posting through the portal. [Outage calculation and receipt](../docs/service-status/#resolve-a-total-fibre-outage)

Production writes require the sign-in adapter configured with `DESK_OPERATOR_AUTH`. Its `/operator-session` endpoint returns the signed-in operator’s credential in `X-Telco-Operator-Authorization`. The edge forwards the credential directly to contractd.

## Resolve a missed appointment

On a consumer’s **Konto**, select **Terminfall eröffnen** beside the subscription. Record the agreed monthly fee and its tariff reference. Reuse the visit UUID and named field or integration key when an external system will report evidence. For manual entry, the Desk supplies a visit UUID.

Open **Terminfälle** to follow a case. Each report retains its event ID, source, submitting key, the sender's event type and its visit ID. Recording a report by hand sends the same `appointment@1` profile a field system sends. If responsibility is disputed, record the outcome and reason under **Verantwortung klären**. When the reports give conflicting visit dates, select the documented visit under **Belegter Besuchstag**. An undisputed report can support a proposal when neither party caused the missed visit and the provider missed the agreed appointment. The service calculates the proposal. Approval submits the credit for posting. The case displays its journal reference when accounting confirms the entry. [Appointment evidence and compensation](../docs/appointments/)

## Review a migration shadow run

Open **Umstieg** and choose the JSON report produced by `telco migration shadow`. The report stays in the browser tab’s memory. Search by account, invoice or billing month and select **Nur zu prüfen** to focus on differences. Open an invoice to compare net, VAT and gross, then inspect the changed positions and their tariff rules. Offsetting line changes stay visible even when gross totals agree. **Ungeklärter Rest** shows how much of the gross difference the listed lines leave unexplained. Close the report to discard it from the view.

Add the summary from `telco migration reconcile` to see the independent register count, turnover and discrepancies for each month. The Desk compares the fingerprints in the summary with the selected report. To verify the register itself, rerun the CLI with the original finance export. Detailed source keys stay in the restricted CLI workflow.

The Desk checks the report’s structure and cent arithmetic. Run `telco migration verify package.json report.json` to recompute the report against the original snapshot. [Run a migration rehearsal](../docs/migration/)

## Built with

React 19, Vite, Tailwind 4, React Aria Components, TanStack Router and Query, and clients
typed from the operator services’ OpenAPI documents (`npm run gen:api`; the check fails
when they are stale). `just desk-check` typechecks, lints, tests and builds it, and runs
the guards; CI does the same. The build checks the production bundle against a 300 KB gzip budget.
