update footer | add shared chores | expire todos if not completed

This commit is contained in:
JCEEE
2026-09-03 11:50:51 +01:00
parent 8cec99715a
commit 68a0851467
14 changed files with 531 additions and 126 deletions
+3
View File
@@ -8,6 +8,7 @@ import {
} from '@shared/timezone';
import { slugify } from '@shared/slugify';
import { evaluateFam } from './bonuses';
import { cleanupExpiredTodos } from './chores';
function resolveServerTz(tz?: string): string {
return resolveTz(tz || 'auto');
@@ -236,6 +237,8 @@ export async function completeWeek(pb: any, famId: string) {
const ws = weekStart(payday, tz);
await evaluateFam(pb, famId);
// Start of a new week → purge todos whose deadline was in a prior week.
await cleanupExpiredTodos(pb, famId).catch(() => {});
const [members, assigned, completions] = await Promise.all([
pb.collection('users').getFullList({ filter: `famId = '${famId}' && role = 'child'` }),