refactor(application): extract vacation management into application use-cases

Moves approve, reject, cancel, and request vacation business logic
out of the tRPC procedure layer into packages/application, matching
the pattern used by allocation use-cases.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-09 17:11:37 +02:00
10 changed files with 523 additions and 274 deletions
@@ -72,13 +72,13 @@ describe("assistant vacation mutation tools", () => {
message: "Rejected vacation for Alice Example: Capacity freeze",
}),
);
expect(db.vacation.updateMany).toHaveBeenCalledWith(
expect(db.vacation.update).toHaveBeenCalledWith(
expect.objectContaining({
where: expect.objectContaining({ id: "vac_cancelled" }),
data: expect.objectContaining({ status: "APPROVED" }),
}),
);
expect(db.vacation.updateMany).toHaveBeenCalledWith(
expect(db.vacation.update).toHaveBeenCalledWith(
expect.objectContaining({
where: expect.objectContaining({ id: "vac_pending" }),
data: expect.objectContaining({ status: "REJECTED", rejectionReason: "Capacity freeze" }),