merchant_clean.go 1.3 KB

1234567891011121314151617181920212223242526272829
  1. package model
  2. import (
  3. "time"
  4. "gorm.io/datatypes"
  5. )
  6. // MerchantClean stores validated, deduplicated merchants.
  7. type MerchantClean struct {
  8. ID uint `gorm:"primaryKey;autoIncrement" json:"id"`
  9. TgUsername string `gorm:"uniqueIndex;size:255" json:"tg_username"`
  10. TgLink string `gorm:"size:500" json:"tg_link"`
  11. MerchantName string `gorm:"size:500" json:"merchant_name"`
  12. Website string `gorm:"size:2048" json:"website"`
  13. Email string `gorm:"size:255" json:"email"`
  14. Phone string `gorm:"size:100" json:"phone"`
  15. SourceCount int `gorm:"default:1" json:"source_count"`
  16. AllSources datatypes.JSON `gorm:"type:json" json:"all_sources"`
  17. IndustryTag string `gorm:"size:100;index" json:"industry_tag"`
  18. Level string `gorm:"size:10;index" json:"level"` // Hot / Warm / Cold
  19. Status string `gorm:"size:20;not null;index" json:"status"` // valid / invalid / bot / duplicate
  20. IsAlive bool `gorm:"default:false" json:"is_alive"`
  21. LastCheckedAt *time.Time `json:"last_checked_at"`
  22. CreatedAt time.Time `json:"created_at"`
  23. UpdatedAt time.Time `json:"updated_at"`
  24. }
  25. func (MerchantClean) TableName() string { return "merchants_clean" }