# Prepare a complaint procedure

> Review complaint coverage across case owners, calculate four average handling times and prepare a German HTML draft.


Customer operations can use its existing CMS and complaint system to publish filing instructions and average handling times overall and for service quality, contract performance and billing. The offline CLI helps when several owners supply those figures. The operator reviews the accessible filing route and decides what to publish. [TKG § 67(1)](https://www.gesetze-im-internet.de/tkg_2021/__67.html)

## Try a reporting period

Download the [registry](../examples/complaints/registry.json), [CRM return](../examples/complaints/crm.json) and [specialist return](../examples/complaints/portal.json) into one directory. The sample uses synthetic figures and an example contact address.

```sh
umask 077
telco complaints review registry.json crm.json portal.json > review.json
```

Ten CRM cases took ten hours in total. One specialist case took twelve hours. Across eleven closures the average is **2.0 hours**. That specialist case concerned both quality and billing. Contract performance has no closures and its mean is `null`. One complaint was still open at cutoff.

Omit `portal.json` and repeat the review. Exit 1 names the missing partition and its owner. The four combined measures are withheld. Exit 2 indicates an invalid input, such as a repeated population or impossible sum.

## Prepare the inputs

- In the registry, list every public filing channel and each authoritative case population with its responsible owner. The same channel can feed disjoint populations. Include phone and postal intake where offered. Give practical German instructions, including how the subscriber can recover a receipt. Linked routes must be HTTPS on the registry’s approved origin, without credentials or query parameters.
- Agree a versioned ownership policy for transfers and reopens. Each owner supplies one return for its assigned population and attests to deduplication against the other populations. Keep the signed source reports privately. Comparing aggregates cannot detect the same case counted under two different population identifiers.
- For this reporting format, use Berlin business dates with an inclusive start and exclusive end. At the end cutoff, count a resolved case once at final resolution. Its duration runs from first receipt to final resolution in elapsed seconds, including weekends and time changes. Report cases still open at cutoff separately. If later corrections change the source, review the revised returns.
- Supply each topic’s closed count and summed elapsed seconds. Overall includes cases outside the three named topics. Within a topic each case counts once. Use zero count and zero seconds for an observed empty group. The tool combines integer sums and counts before rounding to tenths of an hour, half up. The reporting interval and rounding convention are operator choices.
- Use aggregate fields only. A review accepts up to 128 partitions and 1 MiB across all files. Unknown fields, mismatched coverage or a different reporting scope prevent a draft.

## Review and publish

Check the owners, all four denominators, the separate backlog and the source fingerprints in the private review. Assess whether a small group or its duration could identify an individual. Withhold publication until the operator resolves any privacy concern. After approval, copy the complete `review_sha256` value into the command.

```sh
telco complaints draft registry.json crm.json portal.json \
  --reviewed '<review_sha256>' > draft.html
```

Only a successful exit produces a complete draft. Keep generated files in a private working directory. The German page contains the filing routes, period, method and averages. A zero denominator reads “Keine abgeschlossenen Beschwerden”. Source counts, owners and the backlog stay in the private review.

Link the approved procedure from the operator’s public contact page so subscribers can find it without signing in. Check the page in the actual CMS with keyboard and screen-reader users. Follow a filing route through to an acknowledgement. Record the approved revision and publish through the usual CMS process. Any change to the registry or a return needs a fresh review. [W3C guidance on evaluating with users](https://www.w3.org/WAI/test-evaluate/involving-users/)
