Skip to content

153 — Only-one-per-order variant cannot be created twice for same order

Description

Some variants are limited to one per received order (WORK_HANDOVER, CONSTRUCTION_SITE, RETAINAGE_REQUEST_SHORT_TERM, RETAINAGE_REQUEST_LONG_TERM). Once a WORK_HANDOVER exists for an order, re-opening the create flow for that order offers no "Nový" button for WORK_HANDOVER.

Preconditions

  • Clean database (TestControl.cleanDb())
  • User logged in with ADMIN and ACCOUNTING roles
  • Customer, contract and received order created via API

Steps

  1. Create a WORK_HANDOVER protocol for the order — Expected: created
  2. Re-open the create flow, select the same order — Expected: "Vyberte typ protokolu" dialog opens
  3. Inspect the WORK_HANDOVER row — Expected: no new-protocol-WORK_HANDOVER "Nový" button is offered
  • Spec: tests/e2e/tests/protocols.spec.ts
  • ONLY_ONE_PROTOCOLS in CreateProtocolModal