152 — Protocol code is unique per protocol¶
Description¶
Each protocol gets a unique generated code. Creating two COMPLETED_WORK_LIST
protocols on the same received order yields two distinct codes, both matching the
SPP prefix + year + counter format.
Preconditions¶
- Clean database (
TestControl.cleanDb()) - User logged in with ADMIN and ACCOUNTING roles
- Customer, contract and received order created via API
Steps¶
- Create a COMPLETED_WORK_LIST protocol (item price 1000) — Expected: detail page, code generated
- Create a second COMPLETED_WORK_LIST protocol on the same order (item price 2000) — Expected: detail page, code generated
- Return to
/protocols— Expected: exactly two rows - Read both code cells — Expected: both match
^SPP\d{8}$and are distinct
Related¶
- Spec:
tests/e2e/tests/protocols.spec.ts - DB enforces a unique constraint on
Protocol.code