Add watch alert rules: target price and minimum saving #30

Merged
kubus merged 2 commits from feature/target-price-net-alerts into main 2026-10-09 12:24:56 +00:00
Owner

Summary

  • Target price: Listing at or below this PLN amount alerts immediately, even while the watch is learning. Goes to all configured channels regardless of minimum priority or digest settings. Marked with Target chip in feed.
  • Minimum saving: Deal alerts also require listing to be at least this many złoty below typical price. Target-price hits ignore this rule. Helps prevent cheap high-percentage deals with minimal profit from alerting.
  • Estimated net: Server now calculates resale profit at typical asking price on the same marketplace after platform fees (from Flips fee presets). Displayed in iOS and web UI; shown in Discord and ntfy alerts. Built from asking prices, so treated as upper estimate.
  • Removes operator-written Jev verification checks feature in favor of these simpler rules.
  • Updates watch editor and detail views; iOS shows target status and net estimate.
  • Database migration adds target_price_pln and min_saving_pln columns; alert rules don't affect scoring, baselines, or feed visibility—only which listings alert.

Testing

  • Unit tests added for alert rule decoding, validation, encoding, and demo calculations.
  • Demo transport applies alert fields to listings based on watch settings.
  • Watch PATCH request updates alert rules without affecting other fields.
  • Estimated net matches expected values in demo dashboard (e.g., Sony headphones: 1199 typical − 4.9% Allegro Lokalnie fee − 749 buy = 391 zł estimated net).
  • npm run typecheck, npm test, and npm audit --omit=dev pass.
  • Manual test: create watch with target price, verify listing at/below price shows Target chip and alerts immediately; set minimum saving, verify cheap high-percentage deals don't alert until saving threshold is met.
## Summary - **Target price**: Listing at or below this PLN amount alerts immediately, even while the watch is learning. Goes to all configured channels regardless of minimum priority or digest settings. Marked with **Target** chip in feed. - **Minimum saving**: Deal alerts also require listing to be at least this many złoty below typical price. Target-price hits ignore this rule. Helps prevent cheap high-percentage deals with minimal profit from alerting. - **Estimated net**: Server now calculates resale profit at typical asking price on the same marketplace after platform fees (from Flips fee presets). Displayed in iOS and web UI; shown in Discord and ntfy alerts. Built from asking prices, so treated as upper estimate. - Removes operator-written Jev verification checks feature in favor of these simpler rules. - Updates watch editor and detail views; iOS shows target status and net estimate. - Database migration adds `target_price_pln` and `min_saving_pln` columns; alert rules don't affect scoring, baselines, or feed visibility—only which listings alert. ## Testing - Unit tests added for alert rule decoding, validation, encoding, and demo calculations. - Demo transport applies alert fields to listings based on watch settings. - Watch PATCH request updates alert rules without affecting other fields. - Estimated net matches expected values in demo dashboard (e.g., Sony headphones: 1199 typical − 4.9% Allegro Lokalnie fee − 749 buy = 391 zł estimated net). - `npm run typecheck`, `npm test`, and `npm audit --omit=dev` pass. - Manual test: create watch with target price, verify listing at/below price shows Target chip and alerts immediately; set minimum saving, verify cheap high-percentage deals don't alert until saving threshold is met.
Add watch alert rules: target price and minimum saving
Some checks failed
ci / verify (pull_request) Has been cancelled
bf4a3042bd
- Target price: alert when listing ≤ price, even while watch is learning
- Minimum saving: deal alerts require listing at least this many zł below typical
- Display estimated net (resale profit after fee) in listings and alert details
- Database schema, iOS UI, server endpoints, validation, and tests
Merge main into feature/target-price-net-alerts
Some checks failed
ci / verify (pull_request) Has been cancelled
91c484d177
Keeps both the per-watch alert rules (target price, minimum saving) and
main's per-watch Jev verification checks: watch create/update carry all
three fields, and the deal candidate helper now passes verificationChecks
so target-price and reference-band alerts are verified like deal alerts.
Both 033 migrations are kept (ids are full filenames), and the readiness
test now expects 36 migrations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kubus merged commit c7f6151f1a into main 2026-10-09 12:24:56 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kubus/scout!30
No description provided.