Link planned days to their wish, fix the age-4 cap, drop the planning goal
Three changes that together unblock treating a calendar period as one editable object. Migration 008 adds `planned_leave_day.wish_id` (nullable, ON DELETE SET NULL) so a persisted day knows which `leave_wish` produced it, `is_pinned` to mark a day the user hand-edited, and `leave_wish.target_days` so a period drawn on a calendar need not be a whole number of weeks. Apply-time identity still keys on day_type/is_dubbeldag only, so a wish_id-only difference is a metadata update rather than a collision. The age-4 savable ceiling was applying the per-child figure of 96 to each parent's pool, modelling a two-parent family as able to save 192 days past the child's fourth birthday. `resolve_age4_savable_cap` is now the single place that decides 48 (couple with two parents) versus 96 (everyone else), and both AnalyticsService and the allocator read it. Migration 009 drops `workspace.planning_goal` and `leave_wish.goal_override`. The allocator's tier-3 policy collapses to one rule; `salary_type` still branches, since that reflects what a vacation day actually costs a parent rather than a user preference.
This commit is contained in:
@@ -45,7 +45,6 @@ export interface WorkspaceCreateRequest {
|
||||
|
||||
export interface WorkspaceUpdateRequest {
|
||||
name?: string
|
||||
planningGoal?: 'max_time' | 'max_money' | 'balanced'
|
||||
planningMode?: 'solo' | 'couple'
|
||||
}
|
||||
|
||||
@@ -86,7 +85,6 @@ export interface LeaveWishCreateRequest {
|
||||
priority?: number
|
||||
parentMode?: 'either' | 'both' | 'specific'
|
||||
parentPersonalDataUuid?: string | null
|
||||
goalOverride?: 'max_time' | 'max_money' | 'balanced' | null
|
||||
|
||||
// PLANNING_ENGINE_SPEC.md §10.1 — defaults to 'fixed' server-side when omitted.
|
||||
windowMode?: 'fixed' | 'flexible'
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
export interface Workspace {
|
||||
id: string
|
||||
name: string
|
||||
planningGoal: 'max_time' | 'max_money' | 'balanced'
|
||||
planningMode: 'solo' | 'couple'
|
||||
createdAt: string // ISO-8601
|
||||
}
|
||||
@@ -50,7 +49,6 @@ export interface LeaveWish {
|
||||
priority: number
|
||||
parentMode: 'either' | 'both' | 'specific'
|
||||
parentPersonalDataUuid: string | null
|
||||
goalOverride: 'max_time' | 'max_money' | 'balanced' | null
|
||||
// PLANNING_ENGINE_SPEC.md §10.1 — 'fixed': window_start_*/window_end_* are the
|
||||
// exact placement. 'flexible': the same fields describe the bounding range the
|
||||
// allocator searches within for the best-costing placement.
|
||||
|
||||
Reference in New Issue
Block a user