Skip to content

Phase 9: Price-Drop Alerts — watch products for price changes #30

Description

@dbwg2009

What

Let users set a target price on a saved wishlist product. A daily cron job checks the current price and sends a Resend email when it drops to or below the target.

Why

Saved products often fluctuate in price. Automating the price watch saves the user from manually rechecking and means they can act quickly when a deal appears.

Milestone / Phase

Phase 9 — v1.5.0

Branch

phase-9-price-drop-alerts

Tasks

Schema

  • Add price_alerts table (id, wishlist_item_id, user_id, target_price_pence, last_known_price_pence, status enum: active/triggered/paused/dismissed, last_checked_at, created_at)
  • Run npm run db:push

Cron Extension (lib/reminders.ts or new lib/price-alerts.ts)

  • Query all active alerts
  • For eBay-sourced products: fetch current price via eBay Browse API (real item ID)
  • For AI-sourced products: re-run product search and compare closest match price
  • If current price ≤ target: mark alert as triggered, send email
  • Rate limit: max 10 products per cron run to stay within eBay API limits
  • Wire into /api/cron/reminders (or dedicated /api/cron/price-alerts) protected by CRON_SECRET

Email (lib/email.ts)

  • New template: "Good news — [Product] dropped to £X" with buy link

Server Actions

  • createPriceAlert (set target price, activate)
  • updatePriceAlertStatus (pause / dismiss)
  • deletePriceAlert

UI

  • Product card / wishlist item detail: "Watch price" button → set target price modal
  • /settings → Price Alerts section: list active alerts with current/target price, pause/dismiss controls
  • Alert status badge on watched wishlist items

Polish

  • Display last-checked timestamp on each alert
  • Handle case where product is no longer listed on eBay (mark paused with note)

Release

  • Update CHANGELOG.md
  • Bump package.json to 1.5.0
  • Open PR → Development

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestphaseBuild phasestretchv2 / stretch goal

Projects

Status
Backlog

Relationships

None yet

Development

No branches or pull requests

Issue actions