template-monorepo/internal/model/member/domain/entity/tenant.go

26 lines
762 B
Go
Raw Permalink Normal View History

2026-05-20 23:51:22 +00:00
package entity
import (
"gateway/internal/model/member/domain/enum"
"go.mongodb.org/mongo-driver/v2/bson"
)
// Tenant holds tenant metadata including UID prefix for readable UIDs.
type Tenant struct {
ID bson.ObjectID `bson:"_id,omitempty"`
TenantID string `bson:"tenant_id"`
Slug string `bson:"slug"`
Name string `bson:"name"`
UIDPrefix string `bson:"uid_prefix"`
Status enum.TenantStatus `bson:"status"`
OrgID string `bson:"org_id,omitempty"`
CreateAt int64 `bson:"create_at"`
UpdateAt int64 `bson:"update_at"`
}
// CollectionName returns the MongoDB collection for tenants.
func (Tenant) CollectionName() string {
return "tenants"
}