package cvt

import (
	tntent "github.com/tidbcloud/devops/entity/tenant"
	tntmod "github.com/tidbcloud/devops/models/tenant"
)

type m2e struct{}

func (cvt m2e) Tenant(m *tntmod.Tenant) *tntent.Tenant {
	return &tntent.Tenant{
		Id:               m.ID.Uint64(),
		CreatedAt:        &m.CreatedAt,
		Name:             m.Name,
		Alias:            m.Alias,
		Email:            m.Email,
		Country:          m.Country,
		CountryRegion:    tntent.TenantRegion(m.CountryRegion),
		TimeZone:         m.TimeZone,
		Status:           tntent.TenantStatus(m.Status),
		Kind:             tntent.TenantKind(m.Kind),
		Plan:             tntent.TenantPlan(m.Plan),
		CustomID:         m.CustomID,
		Segmentation:     tntent.TenantSegmentation(m.Segmentation),
		SalesOwnerEmail:  m.SalesOwnerEmail,
		SalesForceRegion: tntent.TenantRegion(m.SalesForceRegion),
		SalesForceKind:   tntent.TenantKind(m.SalesForceKind),
		TAMName:          m.TAMName,
	}
}
