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:
@@ -47,6 +47,22 @@ type Residence struct {
|
||||
PurchaseDate *time.Time `gorm:"column:purchase_date;type:date" json:"purchase_date"`
|
||||
PurchasePrice *decimal.Decimal `gorm:"column:purchase_price;type:decimal(12,2)" json:"purchase_price"`
|
||||
|
||||
// Home Profile (for smart onboarding suggestions)
|
||||
HeatingType *string `gorm:"column:heating_type;size:50" json:"heating_type"`
|
||||
CoolingType *string `gorm:"column:cooling_type;size:50" json:"cooling_type"`
|
||||
WaterHeaterType *string `gorm:"column:water_heater_type;size:50" json:"water_heater_type"`
|
||||
RoofType *string `gorm:"column:roof_type;size:50" json:"roof_type"`
|
||||
HasPool bool `gorm:"column:has_pool;default:false" json:"has_pool"`
|
||||
HasSprinklerSystem bool `gorm:"column:has_sprinkler_system;default:false" json:"has_sprinkler_system"`
|
||||
HasSeptic bool `gorm:"column:has_septic;default:false" json:"has_septic"`
|
||||
HasFireplace bool `gorm:"column:has_fireplace;default:false" json:"has_fireplace"`
|
||||
HasGarage bool `gorm:"column:has_garage;default:false" json:"has_garage"`
|
||||
HasBasement bool `gorm:"column:has_basement;default:false" json:"has_basement"`
|
||||
HasAttic bool `gorm:"column:has_attic;default:false" json:"has_attic"`
|
||||
ExteriorType *string `gorm:"column:exterior_type;size:50" json:"exterior_type"`
|
||||
FlooringPrimary *string `gorm:"column:flooring_primary;size:50" json:"flooring_primary"`
|
||||
LandscapingType *string `gorm:"column:landscaping_type;size:50" json:"landscaping_type"`
|
||||
|
||||
IsPrimary bool `gorm:"column:is_primary;default:true" json:"is_primary"`
|
||||
IsActive bool `gorm:"column:is_active;default:true;index" json:"is_active"` // Soft delete flag
|
||||
|
||||
|
||||
Reference in New Issue
Block a user