feat(scheduling): add expired loyalty cleanup and extend guest anonymization

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-06-05 15:40:38 +01:00
co-authored by Sisyphus
parent 6cc65341a0
commit f88854e5c2
2 changed files with 69 additions and 0 deletions
@@ -317,6 +317,11 @@ func GetAvailableHours(w http.ResponseWriter, r *http.Request) {
log.Printf("Failed to anonymize stale guest accounts: %v", err)
}
// Clean up expired loyalty redemptions (pending past expires_at)
if err := CleanupExpiredLoyaltyRedemptions(r.Context()); err != nil {
log.Printf("Failed to cleanup expired loyalty redemptions: %v", err)
}
// Load default hours
defaultMap := map[int]DefaultHours{}
defRows, _ := db.DB.Query(r.Context(), `SELECT weekday, start_time::text, end_time::text, is_open FROM working_hours`)