a72b8dbbbecb714692d27d6ecee70bb4bf5cc704
createAssignment() enforces the XOR (assetItemId/licenseId) at the Zod layer and the AssetItem.status/License.seatsUsed business rules inside a single prisma.$transaction(), using atomic WHERE-guarded updateMany() calls (not plain read-then-write) to close the seat-overbooking and double-assignment race conditions flagged for License by code-reviewer. returnAssignment() reverses those side-effects the same way and closes the double-return race with the same pattern.
Description
No description provided
950 KiB
Languages
TypeScript
98%
CSS
1.7%
Dockerfile
0.2%