Smart onboarding: residence home profile + suggestion engine
14 new optional residence fields (heating, cooling, water heater, roof, pool, sprinkler, septic, fireplace, garage, basement, attic, exterior, flooring, landscaping) with JSONB conditions on templates. Suggestion engine scores templates against home profile: string match +0.25, bool +0.3, property type +0.15, universal base 0.3. Graceful degradation from minimal to full profile info. GET /api/tasks/suggestions/?residence_id=X returns ranked templates. 54 template conditions across 44 templates in seed data. 8 suggestion service tests.
This commit is contained in:
15
internal/dto/responses/suggestion.go
Normal file
15
internal/dto/responses/suggestion.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package responses
|
||||
|
||||
// TaskSuggestionResponse represents a single task suggestion with relevance scoring
|
||||
type TaskSuggestionResponse struct {
|
||||
Template TaskTemplateResponse `json:"template"`
|
||||
RelevanceScore float64 `json:"relevance_score"`
|
||||
MatchReasons []string `json:"match_reasons"`
|
||||
}
|
||||
|
||||
// TaskSuggestionsResponse represents the full suggestions response
|
||||
type TaskSuggestionsResponse struct {
|
||||
Suggestions []TaskSuggestionResponse `json:"suggestions"`
|
||||
TotalCount int `json:"total_count"`
|
||||
ProfileCompleteness float64 `json:"profile_completeness"`
|
||||
}
|
||||
Reference in New Issue
Block a user