Let a day removed from a period stay removed

Taking one day out of a period the planner placed did nothing that
lasted: the period still asked for a full week, so the next sync put the
day straight back. The option was disabled rather than lying about it.

A removed day is now recorded as its own thing — no leave for this
parent, this child, this date — and the planner honours it on every
later sync. It is kept apart from the working-day overrides, which
answer a different question about the calendar rather than about the
plan.

The day belongs to the parent whose band was clicked, so removing one
parent's day leaves their partner's alone; where both parents were to be
off on one funding arrangement, the partner is simply funded on their
own instead. A removed day shortens what the period is asking for rather
than counting as a day the plan failed to find, so the advice about
closing a shortfall does not start arguing for a day nobody wants.

Nothing is removed without a way back: the toast undoes it, and the day
itself is marked in the calendar and offers to restore.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ei7gCZzdd751uZtPzb1Pep
This commit is contained in:
2026-09-19 16:05:17 +02:00
parent 6d92b87bf3
commit 8cfb9c82c6
39 changed files with 2362 additions and 31 deletions
+14
View File
@@ -18,6 +18,7 @@ import type { usePlannedDays } from '@/hooks/usePlannedDays'
import type { useScraperFetch } from '@/hooks/useScraperFetch'
import type { useWorkspaceMembers } from '@/hooks/useWorkspaceMembers'
import type { useOptimizationTips } from '@/hooks/useOptimizationTips'
import type { usePlannedDayExclusions } from '@/hooks/usePlannedDayExclusions'
import type { useDayOverrides } from '@/hooks/useDayOverrides'
import type { useLeaveWishes } from '@/hooks/useLeaveWishes'
import type { usePlanProposal } from '@/hooks/usePlanProposal'
@@ -172,6 +173,19 @@ export function makeDayOverridesResult(
}
}
export function makePlannedDayExclusionsResult(
overrides: Partial<ReturnType<typeof usePlannedDayExclusions>> = {},
): ReturnType<typeof usePlannedDayExclusions> {
return {
data: [],
isLoading: false,
error: null,
exclude: vi.fn(),
restore: vi.fn(),
...overrides,
}
}
export function makeLeaveWishesResult(
overrides: Partial<ReturnType<typeof useLeaveWishes>> = {},
): ReturnType<typeof useLeaveWishes> {
+16
View File
@@ -19,6 +19,7 @@ import type {
Tip,
VacationDays,
Workspace,
PlannedDayExclusion,
} from '@/types'
// ---------------------------------------------------------------------------
@@ -195,6 +196,21 @@ export function makeDayOverride(overrides: Partial<DayOverride> = {}): DayOverri
}
}
export function makePlannedDayExclusion(
overrides: Partial<PlannedDayExclusion> = {},
): PlannedDayExclusion {
return {
id: 'ex-1',
workspaceId: 'ws-1',
childId: 'child-1',
parentPersonalDataUuid: 'parent-1',
date: '2027-02-03',
createdAt: '2027-01-01T00:00:00',
updatedAt: '2027-01-01T00:00:00',
...overrides,
}
}
// ---------------------------------------------------------------------------
// Tips
// ---------------------------------------------------------------------------