types

package
v0.0.0-...-30cc0c6 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 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 AuthCredentials

type AuthCredentials struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

type CreateMoneyspendParams

type CreateMoneyspendParams struct {
	Money float64   `json:"money"`
	Note  string    `json:"note"`
	Date  time.Time `json:"date"`
}

func (CreateMoneyspendParams) Validate

func (params CreateMoneyspendParams) Validate() map[string]string

type CreateTimespendParams

type CreateTimespendParams struct {
	Duration time.Duration `json:"duration"`
	Note     string        `json:"note"`
	Date     time.Time     `json:"date"`
}

func (CreateTimespendParams) Validate

func (params CreateTimespendParams) Validate() map[string]string

type CreateUserParams

type CreateUserParams struct {
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
	Email     string `json:"email"`
	Password  string `json:"password"`
}

func (CreateUserParams) Validate

func (p CreateUserParams) Validate() map[string]string

type Moneyspend

type Moneyspend struct {
	ID      string    `bson:"_id,omitempty" json:"id,omitempty"`
	OwnerID string    `bson:"ownerid,omitempty" json:"ownerid,omitempty"`
	Money   float64   `bson:"money" json:"money"`
	Date    time.Time `bson:"date" json:"date"`
	Note    string    `bson:"note" json:"note"`
}

func NewMoneyspendFromParams

func NewMoneyspendFromParams(params CreateMoneyspendParams) Moneyspend

type Timespend

type Timespend struct {
	ID       string        `bson:"_id,omitempty" json:"id,omitempty"`
	OwnerID  string        `bson:"ownerid,omitempty" json:"ownerid,omitempty"`
	Duration time.Duration `bson:"duration" json:"duration"`
	Date     time.Time     `bson:"date" json:"date"`
	Note     string        `bson:"note" json:"note"`
}

func NewTimespendFromParams

func NewTimespendFromParams(params CreateTimespendParams) Timespend

type UpdateMoneyspendParams

type UpdateMoneyspendParams struct {
	Money float64   `bson:"money,omitempty" json:"money"`
	Date  time.Time `bson:"date,omitempty" json:"date"`
	Note  string    `bson:"note,omitempty" json:"note"`
}

func (UpdateMoneyspendParams) ToBsonDoc

func (params UpdateMoneyspendParams) ToBsonDoc() (*bson.D, error)

func (UpdateMoneyspendParams) Validate

func (params UpdateMoneyspendParams) Validate() map[string]string

type UpdateTimespendParams

type UpdateTimespendParams struct {
	Duration time.Duration `bson:"duration,omitempty" json:"duration"`
	Date     time.Time     `bson:"date,omitempty" json:"date"`
	Note     string        `bson:"note,omitempty" json:"note"`
}

func (UpdateTimespendParams) ToBsonDoc

func (params UpdateTimespendParams) ToBsonDoc() (*bson.D, error)

func (UpdateTimespendParams) Validate

func (params UpdateTimespendParams) Validate() map[string]string

type UpdateUserParams

type UpdateUserParams struct {
	FirstName string `json:"firstName" bson:"firstName,omitempty"`
	LastName  string `json:"lastName" bson:"lastName,omitempty"`
}

func (UpdateUserParams) ToBsonDoc

func (params UpdateUserParams) ToBsonDoc() (*bson.D, error)

func (UpdateUserParams) Validate

func (p UpdateUserParams) Validate() map[string]string

type User

type User struct {
	ID           string `bson:"_id,omitempty" json:"id,omitempty"`
	FirstName    string `bson:"firstName" json:"firstName"`
	LastName     string `bson:"lastName" json:"lastName"`
	Email        string `bson:"email" json:"email"`
	HashPassword string `bson:"hpassword" json:"-"`
}

func NewUserFromParams

func NewUserFromParams(params CreateUserParams) (User, error)

Jump to

Keyboard shortcuts

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