Track preschool planning days, partner invites and real vacation forfeiture
Three strands of work that grew together across the same settings screen and
API client, so they land as one change.
Per-year preschool planning days ("studiedagar"): new table, repository
(SQLite + Postgres), service, router and migration 007, plus the hooks and
Settings UI to plan and record them per child and year. Allocation now
reserves the recorded figure for a year where one exists and only falls back
to the child-level estimate otherwise, marking that fallback as assumed.
Partner invitations: workspaces issue and list invitations, registration
accepts an invite token to join the inviter's workspace instead of creating a
personal one, and a /join/:token page plus the settings invite panel drive it.
Vacation forfeiture: tips and the dashboard now distinguish days a parent
genuinely loses from days that merely age, so the warning stops firing on
balances that were never at risk.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -150,6 +150,18 @@ CREATE TABLE IF NOT EXISTS vacation_days (
|
||||
FOREIGN KEY (workspace_id) REFERENCES workspace(id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS preschool_planning_days (
|
||||
id TEXT PRIMARY KEY,
|
||||
child_id TEXT NOT NULL,
|
||||
year INTEGER NOT NULL,
|
||||
planned_days INTEGER NOT NULL,
|
||||
taken_days INTEGER,
|
||||
created_at TIMESTAMP NOT NULL,
|
||||
updated_at TIMESTAMP NOT NULL,
|
||||
UNIQUE(child_id, year),
|
||||
FOREIGN KEY (child_id) REFERENCES child(id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS planned_leave_day (
|
||||
id TEXT PRIMARY KEY,
|
||||
workspace_id TEXT NOT NULL,
|
||||
@@ -245,6 +257,8 @@ CREATE INDEX IF NOT EXISTS idx_vacation_days_workspace
|
||||
ON vacation_days (workspace_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_planned_day_exclusion_workspace
|
||||
ON planned_day_exclusion (workspace_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_preschool_planning_days_child
|
||||
ON preschool_planning_days (child_id);
|
||||
"""
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user