Skip to content

161 — Retainage request protocols (KZ/DZ) linked on the retainage invoice row

Description

Verifies the protocols ↔ retainage module link ("provázání s modulem retainage"): a short-term (KZ) and a long-term (DZ) RETAINAGE_REQUEST protocol created for a received order are surfaced on that order's invoice row in the /retainage grid. mapRetainageInvoice fills retainageRequestProtocol.{SHORT,LONG} and the grid renders each protocol code as a link in the corresponding column.

Preconditions

  • Clean database (TestControl.cleanDb())
  • User logged in with ADMIN and ACCOUNTING roles; user signature set up
  • Customer + contract (branch 2025031) + received order (externalNumber OBJ-NOT-EXPIRED, matching mock invoice FV2025020006) with retainage %
  • A signed work-handover protocol on the order (so the invoice appears)

Steps

  1. Create a RETAINAGE_REQUEST_SHORT_TERM and a RETAINAGE_REQUEST_LONG_TERM protocol on the order (API) — Expected: created (IN_PROCESS)
  2. Open the /retainage page — Expected: invoice row FV2025020006 is visible
  3. Assert the row's retainageRequestProtocol.SHORT cell — Expected: links a ZKZ… code
  4. Assert the row's retainageRequestProtocol.LONG cell — Expected: links a ZDZ… code
  5. Click the SHORT (KZ) link — Expected: navigates to /protocols/{id}/retainage-request-short-term, detail heading = that ZKZ… code
  6. Return to /retainage and click the LONG (DZ) link — Expected: navigates to /protocols/{id}/retainage-request-long-term, detail heading = that ZDZ… code
  • Spec: tests/e2e/tests/retainage.spec.ts
  • RetainageService.getAllRetainageInvoicesmapRetainageInvoice(invoice, workHandover, retainageRequestProtocols)
  • Protocol-level coverage of the variants: tests/e2e/tests/protocols.spec.ts (scenario 156)