merchant_clean.go 1.6 KB

1234567891011121314151617181920212223242526272829303132
  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:idx_clean_filter,priority:3" json:"industry_tag"`
  18. Level string `gorm:"size:10;index:idx_clean_filter,priority:2" json:"level"` // Hot / Warm / Cold
  19. Status string `gorm:"size:20;not null;index:idx_clean_filter,priority:1" json:"status"` // valid / invalid / bot / duplicate
  20. FollowStatus string `gorm:"size:20;default:'pending';index" json:"follow_status"`
  21. AssignedTo string `gorm:"size:50;index" json:"assigned_to"`
  22. Remark string `gorm:"type:text" json:"remark"`
  23. IsAlive bool `gorm:"default:false" json:"is_alive"`
  24. LastCheckedAt *time.Time `json:"last_checked_at"`
  25. CreatedAt time.Time `json:"created_at"`
  26. UpdatedAt time.Time `json:"updated_at"`
  27. }
  28. func (MerchantClean) TableName() string { return "merchants_clean" }