package user
import (
"git.sr.ht/~evanj/cms/internal/m/org"
"git.sr.ht/~evanj/cms/internal/m/role"
"git.sr.ht/~evanj/cms/internal/m/tier"
"github.com/google/uuid"
)
type _user struct {
id, name, tok, email string
org _org
pass string
role role.Role
}
type _org struct {
id string
}
func NewMock(id, name string) _user {
return _user{id, name, uuid.New().String(), "", _org{id}, "", role.Admin}
}
func NewMockWithEmail(id, name, email string) _user {
return _user{id, name, uuid.New().String(), email, _org{id}, "", role.Admin}
}
func NewMockWithRole(id, name string, r role.Role) _user {
return _user{id, name, uuid.New().String(), "", _org{id}, "", r}
}
func (u _user) ID() string { return u.id }
func (u _user) Name() string { return u.name }
func (u _user) Token() string { return u.tok }
func (u _user) HasEmail() bool { return u.email != "" }
func (u _user) Email() string { return u.email }
func (u _user) Org() org.Org { return u.org }
func (u _user) SetPass(p string) _user { u.pass = p; return u }
func (u _user) Pass() string { return u.pass }
func (u _user) Role() role.Role { return u.role }
func (o _org) ID() string { return o.id }
func (o _org) HasPaymentCustomer() bool { return false }
func (o _org) PaymentCustomerID() string { return "" }
func (o _org) Tier() tier.Tier { return tier.Free }