block-accounting/backend/internal/pkg/models/user.go
2024-05-18 11:22:53 +03:00

46 lines
571 B
Go

package models
import (
"time"
"github.com/google/uuid"
)
type UserIdentity interface {
Id() uuid.UUID
Seed() []byte
IsAdmin() bool
}
type User struct {
ID uuid.UUID
Bip32Seed []byte
Admin bool
Activated bool
CteatedAt time.Time
}
func NewUser(id uuid.UUID, seed []byte) *User {
return &User{
ID: id,
Bip32Seed: seed,
}
}
func (u *User) Id() uuid.UUID {
return u.ID
}
func (u *User) Seed() []byte {
return u.Bip32Seed
}
func (u *User) IsAdmin() bool {
return u.Admin
}
type OrganizationUser struct {
User
// add org info
}