package v1

import (
	"database/sql"
	"time"

	"gorm.io/plugin/soft_delete"
)

type CloudProvider struct {
	ID        uint64                `json:"id" gorm:"primary_key;AUTO_INCREMENT;column:id"`
	CreatedAt time.Time             `json:"createdAt" gorm:"column:createdAt"`
	UpdatedAt sql.NullTime          `json:"updatedAt" gorm:"column:updatedAt"`
	DeletedAt sql.NullTime          `json:"deletedAt" gorm:"column:deletedAt"`
	Code      string                `json:"code" gorm:"column:code;type:varchar(191);not null"`
	Name      string                `json:"name" gorm:"column:name"`
	Currency  string                `json:"currency" gorm:"column:currency"`
	Logos     string                `json:"logos" gorm:"column:logos"`
	IsDel     soft_delete.DeletedAt `json:"isDel" gorm:"column:isDel;softDelete:flag,DeletedAtField:DeletedAt"`
}

func (c *CloudProvider) TableName() string {
	return "cloud_provider"
}

const (
	AWS = iota + 1
	GCP
	AWSCN
	AZURE
	UCLOUD
	KSCLOUD
	AZURECN
)
