model

package
v0.0.0-...-81f13ae Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category struct {
	rdbms.Entity

	ID       string `gorm:"primary_key;type:varchar(100);"`
	Limit    float32
	Name     string
	Expenses []Expense
	UserID   string `gorm:"type:varchar(100)"`
}

func (Category) IsValid

func (c Category) IsValid() bool

type CategoryRepository

type CategoryRepository struct {
	*gorm.RepositoryBase
}

func NewCategoryRepository

func NewCategoryRepository(c rdbms.DbContext) *CategoryRepository

func (*CategoryRepository) FindByID

func (cr *CategoryRepository) FindByID(id string) (*Category, error)

func (*CategoryRepository) FindByUserID

func (cr *CategoryRepository) FindByUserID(userID string, offset, limit int32) ([]Category, error)

type Expense

type Expense struct {
	rdbms.Entity

	ID         string `gorm:"primary_key;type:varchar(100)"`
	Date       time.Time
	Value      float32
	Category   Category
	CategoryID string `gorm:"type:varchar(100)"`
	UserID     string `gorm:"type:varchar(100)"`
}

func (Expense) IsValid

func (e Expense) IsValid() bool

type ExpenseRepository

type ExpenseRepository struct {
	*gorm.RepositoryBase
}

func NewExpenseRepository

func NewExpenseRepository(c rdbms.DbContext) *ExpenseRepository

func (*ExpenseRepository) FindByID

func (er *ExpenseRepository) FindByID(id string) (*Expense, error)

func (*ExpenseRepository) FindByUserID

func (er *ExpenseRepository) FindByUserID(userID string, offset, limit int32) ([]Expense, error)

Jump to

Keyboard shortcuts

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