models

package
v0.0.0-...-91c277e Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2018 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID            uint   `json:"id"`
	Name          string `json:"name"`
	Bank          string `json:"bank"`
	AccountTypeID uint   `json:"account_type_id"`
	UserIDs       []uint `json:"user_ids"`
}

type AccountType

type AccountType struct {
	ID    uint   `json:"id"`
	Label string `json:"label"`
}

type Category

type Category struct {
	ID      int    `json:"id"`
	Account int    `json:"account"`
	Name    string `json:"name"`
}

type Currency

type Currency int
const (
	Euro   Currency = 0
	Dollar Currency = 1
)

type Transaction

type Transaction struct {
	User      User
	UserID    uint
	Account   Account
	AccountID uint
	Type      TransactionType `json:"type"`
	Amount    float32         `json:"amount"`
	Currency  Currency        `json:"currency"`
}

type TransactionType

type TransactionType uint
const (
	Expense TransactionType = 0
	Income  TransactionType = 1
)

type User

type User struct {
	ID         uint   `json:"-"`
	Username   string `json:"username"`
	FirstName  string `json:"first_name"`
	LastName   string `json:"last_name"`
	Email      string `json:"email"`
	PwdHash    string `json:"-"`
	IsAdmin    bool   `json:"is_admin"`
	AccountIDs []uint `json:"account_ids"`
}

Jump to

Keyboard shortcuts

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