Description
Giveaway posts have an endsAt DateTime field in the Post model, but there is no mechanism to automatically transition a post from open to expired when the deadline passes. Posts remain open indefinitely regardless of their end date.
More info
- Add a cron job or scheduled function (e.g. using Vercel Cron, a Next.js Route Handler with
vercel.json schedule, or an external task runner) that runs every hour and:
- Finds all posts where
status = 'open' AND endsAt < NOW().
- Updates their status to
expired.
- Optionally triggers a notification to the post creator.
- The Post detail page and PostCard should also show a visual countdown timer when
endsAt is set, so users know how much time is left.
- The
TimelineFeed "Active" tab should filter by endsAt > NOW() when querying from the API.
Description
Giveaway posts have an
endsAtDateTimefield in thePostmodel, but there is no mechanism to automatically transition a post fromopentoexpiredwhen the deadline passes. Posts remainopenindefinitely regardless of their end date.More info
vercel.jsonschedule, or an external task runner) that runs every hour and:status = 'open'ANDendsAt < NOW().expired.endsAtis set, so users know how much time is left.TimelineFeed"Active" tab should filter byendsAt > NOW()when querying from the API.