Problem Statement
The price-alerts.tsx route exists in the frontend, but users cannot actually subscribe to an item and receive notifications when the market price spikes or drops. This automation is crucial for a complete reselling experience.
Proposed Solution
Connect the PriceAlertsQuickAdd UI to the backend, save alert thresholds to the database, and update the cron job (api.cron.prices.ts) to trigger email or system notifications when a scraped price crosses a user's target threshold.
Acceptance Criteria
- Database Schema: Ensure the Prisma schema has a
PriceAlert model linked to a User and a sku, storing a target price and condition (e.g., GREATER_THAN or LESS_THAN).
- Backend API: Create a new Remix action in
market-prices.tsx to handle saving/deleting alerts.
- Cron Job Integration: Modify
api.cron.prices.ts to check all active alerts after fetching new prices, and log a notification if a threshold is crossed.
- UI Validation: The
PriceAlertsQuickAdd component should show active alerts and allow users to delete them.
Technical Hints
- For now, simply logging the alert to a new
Notification Prisma table (or console logging for MVP) is acceptable. Email integration (e.g., Resend) can be a separate issue.
Problem Statement
The
price-alerts.tsxroute exists in the frontend, but users cannot actually subscribe to an item and receive notifications when the market price spikes or drops. This automation is crucial for a complete reselling experience.Proposed Solution
Connect the
PriceAlertsQuickAddUI to the backend, save alert thresholds to the database, and update the cron job (api.cron.prices.ts) to trigger email or system notifications when a scraped price crosses a user's target threshold.Acceptance Criteria
PriceAlertmodel linked to aUserand asku, storing a target price and condition (e.g.,GREATER_THANorLESS_THAN).market-prices.tsxto handle saving/deleting alerts.api.cron.prices.tsto check all active alerts after fetching new prices, and log a notification if a threshold is crossed.PriceAlertsQuickAddcomponent should show active alerts and allow users to delete them.Technical Hints
NotificationPrisma table (or console logging for MVP) is acceptable. Email integration (e.g., Resend) can be a separate issue.