package model import "time" type BaziChartRecord struct { ID uint `gorm:"primaryKey" json:"id"` ReportID string `gorm:"index;size:64" json:"reportId"` UserID *uint `gorm:"index" json:"userId,omitempty"` Name string `gorm:"size:64" json:"name"` BirthDate string `gorm:"size:16" json:"birthDate"` BirthTime string `gorm:"size:8" json:"birthTime"` Gender string `gorm:"size:16" json:"gender"` City string `gorm:"size:64" json:"city"` ConsentVersion string `gorm:"size:32;not null;default:''" json:"consentVersion"` ConsentAt *time.Time `json:"consentAt,omitempty"` Snapshot string `gorm:"type:longtext" json:"-"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` } type ReportProduct struct { ID uint `gorm:"primaryKey" json:"id"` Code string `gorm:"uniqueIndex;size:40" json:"code"` Name string `gorm:"size:100" json:"name"` Description string `gorm:"size:255" json:"description"` StripeAmount int `json:"stripeAmount"` StripeCurrency string `gorm:"size:10" json:"stripeCurrency"` BinanceAmount string `gorm:"size:32" json:"binanceAmount"` BinanceCurrency string `gorm:"size:10" json:"binanceCurrency"` Status int `gorm:"default:1" json:"status"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` } type ReportEntitlement struct { ID uint `gorm:"primaryKey" json:"id"` UserID uint `gorm:"uniqueIndex:idx_user_report;index" json:"userId"` ReportID string `gorm:"uniqueIndex:idx_user_report;size:64;index" json:"reportId"` OrderID uint `gorm:"uniqueIndex" json:"orderId"` Status string `gorm:"size:20;default:'active'" json:"status"` GrantedAt time.Time `json:"grantedAt"` RevokedAt *time.Time `json:"revokedAt"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` } type ReportSnapshot struct { ID uint `gorm:"primaryKey" json:"id"` UserID uint `gorm:"index" json:"userId"` ReportID string `gorm:"size:64;index" json:"reportId"` OrderID uint `gorm:"uniqueIndex;index" json:"orderId"` Snapshot string `gorm:"type:longtext" json:"-"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` } type PaymentEvent struct { ID uint `gorm:"primaryKey" json:"id"` Provider string `gorm:"uniqueIndex:idx_provider_event;size:30" json:"provider"` ProviderEventID string `gorm:"uniqueIndex:idx_provider_event;size:128" json:"providerEventId"` EventType string `gorm:"size:80" json:"eventType"` OrderNo string `gorm:"size:32;index" json:"orderNo"` PayloadHash string `gorm:"size:64" json:"payloadHash"` ProcessedAt time.Time `json:"processedAt"` CreatedAt time.Time `json:"createdAt"` } type EmailLoginCode struct { ID uint `gorm:"primaryKey" json:"-"` Email string `gorm:"size:254;index" json:"-"` CodeHash string `gorm:"size:64" json:"-"` Attempts int `gorm:"default:0" json:"-"` ExpiresAt time.Time `gorm:"index" json:"-"` UsedAt *time.Time `json:"-"` CreatedAt time.Time `gorm:"index" json:"-"` }