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

20 lines
660 B
Go
Raw Normal View History

2026-05-20 23:51:22 +00:00
package entity
import "go.mongodb.org/mongo-driver/v2/bson"
// Identity maps external identity keys to a member UID within a tenant.
type Identity struct {
ID bson.ObjectID `bson:"_id,omitempty"`
TenantID string `bson:"tenant_id"`
UID string `bson:"uid"`
ZitadelUserID string `bson:"zitadel_user_id,omitempty"`
ExternalID string `bson:"external_id,omitempty"`
CreateAt int64 `bson:"create_at"`
UpdateAt int64 `bson:"update_at"`
}
// CollectionName returns the MongoDB collection for identity mappings.
func (Identity) CollectionName() string {
return "identities"
}