fix bonus completeions

This commit is contained in:
JCEEE
2026-09-14 13:00:13 +01:00
parent e441c3d2a7
commit da6a6e372c
7 changed files with 60 additions and 12 deletions
+11
View File
@@ -589,6 +589,17 @@ async function ensureBonusFields(): Promise<void> {
fields.push({ name: 'targetChoreIds', type: 'json', required: false });
changed = true;
}
// Completion audit (bonus_configs only): who/when a goal was finished —
// stamped by the manual "Mark as complete" action or automatically when
// a `once` goal's reward is approved.
if (name === 'bonus_configs' && !has('completedBy')) {
fields.push({ name: 'completedBy', type: 'text', required: false });
changed = true;
}
if (name === 'bonus_configs' && !has('completedAt')) {
fields.push({ name: 'completedAt', type: 'date', required: false });
changed = true;
}
// rewardValue must be optional so an unset pocket-money droplet can exist.
const rv = fields.find((f: any) => f.name === 'rewardValue');
if (rv && rv.required) {