Skip to content

Remove the hardcoded voting window and item count #55

Description

@Kaushik4141

apps/api/src/services/vote.Service.ts:8-34 hardcodes if (year !== 2026 || month !== 3) return false with per-day hour ranges.

Day 2 also has a real bug: endMins = 4 * 60 + 30 is 4:30 AM, which is below the 9:30 AM start — so that window can never be open.

  • Replace isVotingOpen() with a check against votingStartsAt / votingEndsAt from settings. Both null → always open, the right default for a fresh install. This also drops the manual IST offset arithmetic.
  • Replace the three hardcoded 11s: vote.Service.ts:70, vote.Service.ts:78, items.Service.ts:50
  • refreshItemAggregates(db, itemIds) takes the threshold as a third argument, passed from vote.Service.ts and results.route.ts rather than re-queried inside the loop
  • apps/web/src/App.tsx:39const totalStalls = 11 becomes config.totalItems

Blocked by the settings issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendHono API / WorkerbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions