entities

package
v0.0.0-...-7442cfa Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Expense

type Expense struct {
	// contains filtered or unexported fields
}

func NewExpense

func NewExpense(groupid string, amount float64, paidBy *User, etype ExpenseType, distribution map[string]float64) (*Expense, error)

func (*Expense) GetContribution

func (expense *Expense) GetContribution() []*UserExpenseShare

func (*Expense) GetGroupID

func (expense *Expense) GetGroupID() string

func (*Expense) GetID

func (expense *Expense) GetID() string

func (*Expense) GetSpender

func (expense *Expense) GetSpender() *User

func (*Expense) String

func (expense *Expense) String() string

type ExpenseType

type ExpenseType int
const (
	ExpenseTypeEqual ExpenseType = iota + 1
	ExpenseTypeExact
	ExpenseTypePercentage
)

type Group

type Group struct {
	// contains filtered or unexported fields
}

func NewGroup

func NewGroup(name, description string, members ...*User) *Group

func (*Group) AddMembers

func (group *Group) AddMembers(members ...*User)

func (*Group) CreationMessage

func (group *Group) CreationMessage() string

func (*Group) GetID

func (group *Group) GetID() string

func (*Group) GetMembers

func (group *Group) GetMembers() (members []*User)

func (*Group) RemoveMember

func (group *Group) RemoveMember(userID string)

func (*Group) String

func (group *Group) String() string

type User

type User struct {
	// contains filtered or unexported fields
}

func NewUser

func NewUser(name, email, phone string) *User

func (*User) GetID

func (user *User) GetID() string

func (*User) String

func (user *User) String() string

func (*User) UserCreationMessage

func (user *User) UserCreationMessage() string

type UserExpenseShare

type UserExpenseShare struct {
	// contains filtered or unexported fields
}

func NewUserExpenseShare

func NewUserExpenseShare(userID string, contribution float64) *UserExpenseShare

func (*UserExpenseShare) AddCredit

func (usertExpShare *UserExpenseShare) AddCredit(amount float64)

func (*UserExpenseShare) GetShare

func (userExpShare *UserExpenseShare) GetShare() (string, float64)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL