package activeemea

import (
	"time"

	"github.com/tidbcloud/devops/models/base"
)

type TenantCandidate struct {
	base.Updatable

	TenantID            uint64     `gorm:"not null;uniqueIndex"`
	TenantName          string     `gorm:"type:VARCHAR(255);not null"`
	TenantEmail         string     `gorm:"type:VARCHAR(255);not null"`
	TenantStatus        string     `gorm:"type:VARCHAR(32);not null"`
	TenantKind          string     `gorm:"type:VARCHAR(32);not null"`
	TenantRegion        string     `gorm:"type:VARCHAR(32);not null"`
	AccountName         string     `gorm:"type:VARCHAR(255);not null"`
	AccountEmail        string     `gorm:"type:VARCHAR(255);not null"`
	AccountCountry      string     `gorm:"type:VARCHAR(16);not null"`
	EmailDomain         string     `gorm:"type:VARCHAR(255);not null"`
	BillingConfigID     uint64     `gorm:"not null"`
	BillingConfigStatus string     `gorm:"type:VARCHAR(32);not null"`
	LastClusterCount    int        `gorm:"not null"`
	LastClusterIDs      string     `gorm:"type:TEXT;not null"`
	LastSkipReason      string     `gorm:"type:VARCHAR(128);not null"`
	LastCandidateAt     *time.Time `gorm:"index"`
	LastAccountSyncedAt *time.Time `gorm:"index"`
	LastBillingSyncedAt *time.Time `gorm:"index"`
	LastClusterSyncedAt *time.Time `gorm:"index"`
	LastIncludedAt      *time.Time `gorm:"index"`
}

func (TenantCandidate) TableName() string {
	return "active_emea_tenant_candidates"
}
