Let a household choose to be paid for the red days
Asking for a full week off never spent anything on the Saturday, the Sunday or a holiday, and a test now says so outright rather than leaving it to be rediscovered. Those days are free because vacation cannot be taken on a day that is not a working day. Parental benefit is a payment rather than a schedule, though, so it can be drawn on a red day to turn an unpaid day off into a paid one — at the cost of a day the family would otherwise keep. That is now a workspace setting, off by default, and it never reaches for a vacation day. With it off the planner behaves exactly as before. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ei7gCZzdd751uZtPzb1Pep
This commit is contained in:
@@ -26,19 +26,21 @@ class SQLiteWorkspaceRepository(WorkspaceRepository):
|
||||
id=UUID(row["id"]),
|
||||
name=row["name"],
|
||||
created_at=datetime.fromisoformat(row["created_at"]),
|
||||
take_pl_on_red_days=bool(row["take_pl_on_red_days"]),
|
||||
)
|
||||
|
||||
async def create(self, item: Workspace) -> Workspace:
|
||||
item.created_at = item.created_at or datetime.now()
|
||||
await self._conn.execute(
|
||||
"""
|
||||
INSERT INTO workspace (id, name, created_at)
|
||||
VALUES (?, ?, ?)
|
||||
INSERT INTO workspace (id, name, created_at, take_pl_on_red_days)
|
||||
VALUES (?, ?, ?, ?)
|
||||
""",
|
||||
(
|
||||
str(item.id),
|
||||
item.name,
|
||||
item.created_at.isoformat(),
|
||||
int(item.take_pl_on_red_days),
|
||||
),
|
||||
)
|
||||
await commit(self._conn)
|
||||
@@ -51,8 +53,8 @@ class SQLiteWorkspaceRepository(WorkspaceRepository):
|
||||
|
||||
async def update(self, id: UUID, item: Workspace) -> Workspace:
|
||||
cursor = await self._conn.execute(
|
||||
"UPDATE workspace SET name = ? WHERE id = ?",
|
||||
(item.name, str(id)),
|
||||
"UPDATE workspace SET name = ?, take_pl_on_red_days = ? WHERE id = ?",
|
||||
(item.name, int(item.take_pl_on_red_days), str(id)),
|
||||
)
|
||||
await commit(self._conn)
|
||||
if cursor.rowcount == 0:
|
||||
|
||||
Reference in New Issue
Block a user