Kaizen
Browse modulesPersistenceFunctions

Function: isOrderCodeCollision()

function isOrderCodeCollision(error: unknown): boolean;

Defined in: server/persistence/prisma-unique-violation.ts:90

Prisma unique-constraint violation (P2002) on the (organization_id, code) unique SPECIFICALLY — the order-code collision that drives the whole- transaction create/finalize retry. Detected structurally across the same reporting shapes uniqueViolationNames understands. A P2002 on any other constraint (notably (organization_id, idempotency_key) — none of its spellings contain a bare code) returns false so the caller rethrows it.

Parameters

ParameterType
errorunknown

Returns

boolean

On this page