feat(api,application): add checkConflicts query and soften overbooking block

- New allocation.checkConflicts managerProcedure: returns per-day overbooking
  breakdown (availableHours, existingHours, requestedHours, overageHours,
  maxOverbookPercent) plus vacation overlap list for the requested period.
  Read-only — used by AllocationModal for pre-submission warnings.
- createAssignment(): replace the hard >5-day overbooking block with a soft
  CONFLICT error. When allowOverbooking: true is passed the assignment is
  created and overbookingAcknowledged is set to true on the record.
- allowOverbooking field added to CreateAssignmentBaseSchema (optional)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-09 10:13:18 +02:00
parent b944a17572
commit 61e52e9995
4 changed files with 184 additions and 4 deletions
@@ -44,7 +44,7 @@ export const CreateAssignmentBaseSchema = z.object({
status: z.nativeEnum(AllocationStatus).default(AllocationStatus.PROPOSED),
metadata: z.record(z.string(), z.unknown()).default({}),
/** When true the caller acknowledges the resource will be overbooked. */
allowOverbooking: z.boolean().optional().default(false),
allowOverbooking: z.boolean().optional(),
});
/**