File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,18 @@ import (
44 "gorm.io/gorm"
55)
66
7+ // Add new model for price alerts
8+ type PriceAlert struct {
9+ gorm.Model
10+ UserID string `gorm:"index"`
11+ CryptocurrencyID string `gorm:"index"` // e.g., "BTC", "ETH"
12+ ThresholdPrice string `gorm:"type:numeric"` // Store as string for precision
13+ IsUpperBound bool // true for price above, false for below
14+ IsActive bool `gorm:"default:true"`
15+ EmailNotification bool `gorm:"default:true"`
16+ }
17+
18+ // Update UserPreference to include price alerts
719type UserPreference struct {
820 gorm.Model
921 UserID string `gorm:"uniqueIndex"`
@@ -12,4 +24,5 @@ type UserPreference struct {
1224 TrackNFTs bool
1325 EmailNotification bool
1426 PushNotification bool
27+ PriceAlerts []PriceAlert `gorm:"foreignKey:UserID"`
1528}
You can’t perform that action at this time.
0 commit comments