feat: price trend signal (best time to buy)#77
Merged
Merged
Conversation
computePriceTrend() analyzes sold comp history and returns:
- direction (falling/rising/stable), signal (good_buy/wait/fair)
- 7d and 30d price changes (% and $)
- per-source breakdown with bestSource
- human-readable summary ("Down 8% this week")
Added to /api/price-history response as trend object (null if <3
data points). 10 unit tests + 3 API tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
computePriceTrend()analyzes sold comp history: direction (falling/rising/stable), signal (good_buy/wait/fair), 7d/30d changes, per-source breakdown, human-readable summary/api/price-historyresponse astrendobject (null if <3 data points)redisfield check)Type
Endpoints
GET /api/price-history— now includestrendobject in responseChecks
yarn test:unitpasses (140 tests, +10 new)Infrastructure
None
Frontend impact
Lovable prompt #29 ready — trend badge on card view and search results using
trend.summary,trend.signal,trend.bestSourceDeploy notes
None — standard auto-deploy