Loading...
{:else if error}
Bonus Notices
{bonusNotices.length}
{#if bonusNotices.length > 0}
+{bonusNotices.reduce((s, r) => s + Number(r.value), 0)} pts
{/if}
Total Cash
£{(totalCash / 100).toFixed(2)}
Pending Cash
£{(pendingCash / 100).toFixed(2)}
Total Points
{totalPoints}
{#if weeklyTotal > 0}
{@const wpct = Math.round((weeklyDone / weeklyTotal) * 100)}
{#each bonusProgresses as bp}
{@const pct = bp.criteria > 0 ? Math.min(100, (bp.current / bp.criteria) * 100) : 0}
{@const hasReward = bp.periodStart ? rewards.some(r => r.memberId === memberId && r.bonusConfigId === bp.config.id && r.date >= bp.periodStart && r.date <= bp.periodEnd) : rewards.some(r => r.memberId === memberId && r.bonusConfigId === bp.config.id)}
{@const typeClass = bp.config.type === 'threshold' ? 'type-threshold' : bp.config.type === 'count' ? 'type-count' : 'type-manual'}
{bp.config.name}
{bp.config.type}
{#if bp.criteria > 0}
{bp.current}/{bp.criteria} {bp.config.type === 'threshold' ? 'pts' : 'chores'}
{/if}
{#if hasReward}
Reward earned 🎉
{/if}
{/each}
{/if}
Daily Pending ({dailyPending.length})
{#if dailyPending.length === 0}
All done!
{:else}
{#each dailyPending as chore}
{/each}
{/if}
Weekly Pending ({weeklyPending.length})
{#if weeklyPending.length === 0}
All done!
{:else}
{#each weeklyPending as chore}
{/each}
{/if}
Completed Today ({completedToday.length})
{#if completedToday.length === 0}
Nothing yet
{:else}
{#each completedToday as c}
{@const chore = assigned.find(a => a.id === c.assignedChoreId)}
{#if chore}
{/if}
{/each}
{/if}
Claimable ({claimableRewardsChild.length})
{#if claimableRewardsChild.length === 0}
Nothing to claim
{:else}
{#each claimableRewardsChild as r}
{r.label}
{rewardLabelChild(r)}
{r.rewardType}
{/each}
{/if}
{/if}