entities

package
v0.0.0-...-64f9010 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2015 License: BSD-3-Clause, MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllPeople

func GetAllPeople(dbMap *gorp.DbMap) []interface{}

func GetDebt

func GetDebt(dbMap *gorp.DbMap, queryID int) interface{}

func GetExpense

func GetExpense(dbMap *gorp.DbMap, queryID int) interface{}

func GetHouse

func GetHouse(dbMap *gorp.DbMap, queryID int) interface{}

func GetPerson

func GetPerson(dbMap *gorp.DbMap, queryID int) interface{}

func GetPersonsRoommates

func GetPersonsRoommates(dbMap *gorp.DbMap, person Person) []interface{}

func GetRoommatesBalances

func GetRoommatesBalances(dbMap *gorp.DbMap, person Person) []interface{}

Types

type Balance

type Balance struct {
	PersonId        int `json:"person_id"`
	ForeignPersonId int `json:"foreign_person_id"`
	Amount          int `json:"amount"`
}

type Debt

type Debt struct {
	Id            int    `json:"id" db:"id"`
	AmountInCents int    `json:"amount_in_cents" db:"amount_in_cents"`
	Person        Person `json:"person" db:"person"`
	Loaner        Person `json:"loaner" db:"loaner"`

	UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
	CreatedAt time.Time `json:"created_at" db:"created_at"`
}

type Expense

type Expense struct {
	Id            int    `json:"id" db:"id"`
	HouseId       int    `json:"house_id" db:"house_id"`
	AmountInCents int    `json:"amount_in_cents" db:"amount_in_cents"`
	Name          string `json:"name" db:"name"`
	Description   string `json:"description" db:"description"`
	Notes         string `json:"notes" db:"notes"`

	UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
	CreatedAt time.Time `json:"created_at" db:"created_at"`

	Loaner Person `json:"loaner"`
	Debts  []Debt `json:"debts"`
}

type House

type House struct {
	Id   int    `json:"id" db:"id"`
	Name string `json:"name" db:"name"`

	UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
	CreatedAt time.Time `json:"created_at" db:"created_at"`

	People []Person `json:"people"`
}

type Person

type Person struct {
	Id      int    `json:"id" db:"id"`
	HouseId int    `json:"house_id" db:"house_id"`
	Name    string `json:"name" db:"name"`
	Email   string `json:"email" db:"email"`

	UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
	CreatedAt time.Time `json:"created_at" db:"created_at"`

	// associations
	Roommates []Person `json:"roommates"`
	House     House    `json:"house"`
}

Jump to

Keyboard shortcuts

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