Recount-Server/types/types.go
2024-02-27 18:38:00 -08:00

54 lines
1.8 KiB
Go

package types
import (
"database/sql"
"time"
)
type Transaction struct {
Id int `db:"trns_id" json:"Id"`
Amount string `db:"trns_amount" json:"Amount"`
Description sql.NullString `db:"trns_description" json:"Description"`
Account int `db:"trns_account" json:"Account"`
Bucket sql.NullInt64 `db:"trns_bucket" json:"Bucket"`
Date time.Time `db:"trns_date" json:"TransactionDate"`
}
type Account struct {
Id int `db:"acnt_id" json:"Id"`
DisplayName sql.NullString `db:"acnt_display_name" json:"DisplayName"`
Description sql.NullString `db:"acnt_description" json:"Description"`
}
type Bucket struct {
Id int `db:"bkt_id" json:"id"`
DisplayCode sql.NullString `db:"bkt_display_code" json:"DisplayCode"`
DisplayName sql.NullString `db:"bkt_display_name" json:"DisplayName"`
Description sql.NullString `db:"bkt_description" json:"Description"`
}
type HumanLegibleTransaction struct {
Id int `db:"trns_id" json:"Id"`
Amount string `db:"trns_amount" json:"Amount"`
Description sql.NullString `db:"trns_description" json:"Description"`
AccountName sql.NullString `db:"account_name" json:"AccountName"`
Account int `db:"trns_account" json:"Account"`
Bucket sql.NullInt64 `db:"trns_bucket" json:"Bucket"`
BucketName sql.NullString `db:"bucket_name" json:"BucketName"`
Date time.Time `db:"trns_date" json:"TransactionDate"`
}
type QuickTransactionType struct {
DisplayName string
}
type ChartjsData struct {
Labels []string `json:"labels"`
Data []int `json:"data"`
}
type TwoIntsItem struct {
Item1 int
Item2 int
}