mirror of
https://github.com/emo2007/block-accounting.git
synced 2025-04-12 08:56:28 +00:00
43 lines
541 B
Go
43 lines
541 B
Go
package models
|
|
|
|
import (
|
|
"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
|
|
}
|
|
|
|
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
|
|
}
|