Skip to content

Add post expiry automation based on endsAt field #194

@3m1n3nc3

Description

@3m1n3nc3

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:
    1. Finds all posts where status = 'open' AND endsAt < NOW().
    2. Updates their status to expired.
    3. 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.

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions