updated rewards assignment and reward progress

This commit is contained in:
JCEEE
2026-08-31 16:44:37 +01:00
parent cda2cbfcab
commit 3bf78d777c
10 changed files with 549 additions and 209 deletions
+19
View File
@@ -440,6 +440,25 @@ async function ensureBonusFields(): Promise<void> {
fields.push({ name: "isPocketMoney", type: "bool", required: false });
changed = true;
}
// Standalone-reward progress window (bonus_configs only): how far progress
// counts (`completeBy`) and the window's start/custom-end dates.
if (name === "bonus_configs") {
if (!has("completeBy")) {
fields.push({
name: "completeBy", type: "select", required: false,
values: ["unlimited", "week", "custom"], maxSelect: 1,
});
changed = true;
}
if (!has("startDate")) {
fields.push({ name: "startDate", type: "text", required: false });
changed = true;
}
if (!has("completeByDate")) {
fields.push({ name: "completeByDate", type: "text", 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) {