models

package
v0.0.0-...-b22ffeb Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch

type Batch struct {
	ID          uint32 `gorm:"primary_key;auto_increment" json:"id"`
	Dispatched  bool   `gorm:"default:false"`
	Summary     int    `gorm:"not null" json:"summary"`
	BatchUserID uint32 `sql:"type:int REFERENCES users(id)" json:"batch_user_id"`
}

func (*Batch) FindAllBatches

func (u *Batch) FindAllBatches(db *gorm.DB) (*[]Batch, error)

func (*Batch) FindBatchesByUserId

func (u *Batch) FindBatchesByUserId(db *gorm.DB, uid uint32) (*[]Batch, error)

getting all the batches filtered by user id

type Filter

type Filter struct {
	UserID int64 `schema:"userid"`
}

type Roundup

type Roundup struct {
	ID             uint32 `gorm:"primary_key;auto_increment" json:"id"`
	Amount         int    `gorm:"not null" json:"amount"`
	RoundupBatchID uint32 `sql:"type:int REFERENCES batches(id)" json:"roundup_batch_id"`
	RoundupUserID  uint32 `sql:"type:int REFERENCES users(id)" json:"roundup_user_id"`
}

func (*Roundup) FindAllRoundups

func (r *Roundup) FindAllRoundups(db *gorm.DB) (*[]Roundup, error)

func (*Roundup) SaveRoundup

func (r *Roundup) SaveRoundup(db *gorm.DB) (*Roundup, error)

type Transaction

type Transaction struct {
	ID                 uint64 `gorm:"primary_key;auto_increment" json:"id"`
	Amount             int    `gorm:"not null" json:"amount"`
	TransactionBatchID uint32 `sql:"type:int REFERENCES batches(id)" json:"transaction_batch_id"`
}

func (*Transaction) FindAllTransactions

func (t *Transaction) FindAllTransactions(db *gorm.DB) (*[]Transaction, error)

type User

type User struct {
	ID   uint32 `gorm:"primary_key;auto_increment" json:"id"`
	Name string `gorm:"size:255;not null;unique" json:"name"`
}

func (*User) FindAllUsers

func (u *User) FindAllUsers(db *gorm.DB) (*[]User, error)

func (*User) SaveUser

func (u *User) SaveUser(db *gorm.DB) (*User, error)

Jump to

Keyboard shortcuts

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