harden(plan): 92-day range cap + dedup user_ids on bulk create

This commit is contained in:
BOHA
2026-06-08 12:17:51 +02:00
parent 13d1fc2be3
commit 2610301258
3 changed files with 23 additions and 1 deletions

View File

@@ -909,6 +909,20 @@ describe("plan.service.bulkCreateEntries", () => {
);
expect("error" in empty && empty.status).toBe(400);
const tooLong = await bulkCreateEntries(
{
user_ids: [adminUserId],
date_from: "2096-01-01",
date_to: "2096-12-31", // > 92 days
include_weekends: true,
project_id: null,
category: "work",
note: `${N}x`,
},
adminUserId,
);
expect("error" in tooLong && tooLong.status).toBe(400);
const past = await bulkCreateEntries(
{
user_ids: [adminUserId],