model

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2020 License: MIT Imports: 2 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            int64           `db:"id"             json:"id"`
	Name          string          `db:"name"           json:"name"`
	InitialAmount decimal.Decimal `db:"initial_amount" json:"initialAmount"`

	// Additional fields that used in view
	Total decimal.Decimal `db:"total" json:"total"`
}

Account is container for financial account

type ChartSeries

type ChartSeries struct {
	AccountID int64           `db:"account_id" json:"accountId"`
	Month     int             `db:"month"      json:"month"`
	Amount    decimal.Decimal `db:"amount"     json:"amount"`
}

ChartSeries is container for chart series

type Config

type Config struct {
	DbUser     string
	DbPassword string
	DbHost     string
	DbName     string
}

Config is content of configuration file

type Entry

type Entry struct {
	ID                int64           `db:"id"                  json:"id"`
	AccountID         int64           `db:"account_id"          json:"accountId"`
	AffectedAccountID null.Int        `db:"affected_account_id" json:"affectedAccountId"`
	Type              int             `db:"type"                json:"type"`
	Description       null.String     `db:"description"         json:"description"`
	Amount            decimal.Decimal `db:"amount"              json:"amount"`
	Date              string          `db:"date"                json:"date"`

	// Additional foreign key fields
	Account         string      `db:"account"          json:"account"`
	AffectedAccount null.String `db:"affected_account" json:"affectedAccount"`
}

Entry is container for book entries

type User

type User struct {
	ID       int64  `db:"id"       json:"id"`
	Username string `db:"username" json:"username"`
	Name     string `db:"name"     json:"name"`
	Password string `db:"password" json:"password,omitempty"`
	Admin    bool   `db:"admin"    json:"admin"`
}

User is container for user's data

Jump to

Keyboard shortcuts

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