Skip to content

feat(automation): Wire up Price Drop / Spike Alerts Cron Job #124

Description

@rushikesh-bobade

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

  1. 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).
  2. Backend API: Create a new Remix action in market-prices.tsx to handle saving/deleting alerts.
  3. 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.
  4. 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.

Metadata

Metadata

Assignees

Labels

ECSoC26Required label for ECSOC Sentinel scoringenhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions