From 0613fc4f467722a662aa0db783f4c0b3ff000845 Mon Sep 17 00:00:00 2001 From: JCEEE <0xjceee@proton.me> Date: Sun, 20 Sep 2026 17:42:51 +0100 Subject: [PATCH] payday tests --- .../src/routes/[fam]/[username]/+page.svelte | 25 +++++++++++++------ .../[fam]/[username]/settings/+page.svelte | 11 ++++++-- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/frontend/src/routes/[fam]/[username]/+page.svelte b/frontend/src/routes/[fam]/[username]/+page.svelte index 11700be..63db48d 100644 --- a/frontend/src/routes/[fam]/[username]/+page.svelte +++ b/frontend/src/routes/[fam]/[username]/+page.svelte @@ -17,13 +17,13 @@ clockIcon, giftIcon, handCoinsIcon, - moneyIcon, coinsIcon, walletIcon, chevronLeftIcon, chevronRightIcon } from '$lib/components/icons'; import type { AssignedChore, Completion, ChoreTemplate, BonusConfig, Reward } from '$lib/types'; + import PiggyBank from '@lucide/svelte/icons/piggy-bank'; import { handleOf } from '@shared/slugify'; import { weekStart as tzWeekStart, @@ -501,6 +501,15 @@ return sum + (chore?.type === 'money' ? Number(chore.value) : 0); }, 0) ); + // Week's cash-reward earnings (pocket money, bonuses) count while still + // pending AND once claimed — auto-created money-todo rewards are skipped + // (already counted via the chore completion above). + let weekRewardCash = $derived.by(() => + weekRewards + .filter((r) => r.rewardType === 'cash' && !autoRewardIds.has(r.id)) + .reduce((sum, r) => sum + Number(r.value), 0) + ); + let weekCashTotal = $derived(weekChoreCash + weekRewardCash); let weekChorePoints = $derived.by(() => weekCompletions.reduce((sum, c) => { const chore = assigned.find((a) => a.id === c.assignedChoreId); @@ -1250,7 +1259,7 @@ {/if} {#if showCountdown}
Payday is today!
@@ -1439,7 +1448,7 @@
- Payday: the week starts on this day and weekly earnings are settled at this time. Auto - timezone follows each device. + Payday: the week starts on this day and weekly earnings are settled at this time. Pick + your city so payday lands at the right local time — Auto uses the server's timezone + (UTC), which is an hour out during daylight saving.