Centralize day/timestamp helper utilities
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5
- Forks
- 7
- Avg merge
- 4h 1m
- Merged PRs (30d)
- 6
Description
We compute day IDs and start-of-day timestamps in multiple mappings (e.g., BroadcasterDay, TranscoderDay, createOrLoadDay, and TicketBroker handlers). It would be good to centralize this logic in helpers.ts (e.g., dayStart(timestamp) and dayId(timestamp)) and reuse those helpers across mappings.
Goal: ensure day-boundary math is consistent across all handlers, reduce duplicated logic, and make future changes easier and safer.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in utils/helpers.ts at the existing day-ID and start-of-day logic referenced for BroadcasterDay, TranscoderDay, and createOrLoadDay, then compare the duplicate calculation in src/mappings/ticketBroker.ts. Centralize the day-boundary helpers and update all listed handlers to reuse them. Done means the mappings use consistent day IDs and start-of-day timestamps.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- data
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100