models

package
v0.0.0-...-ce80fba Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bill

type Bill struct {
	ID                     uuid.UUID       `json:"id" gorm:"type:uuid;default:gen_random_uuid()"`
	DueDateOfMonth         int             `json:"due_date_of_month"`
	Name                   string          `json:"name"`
	Notes                  string          `json:"notes"`
	IsAutoPayment          bool            `json:"auto_payment"`
	AutoPaymentDateOfMonth int             `json:"auto_payment_date_of_month"`
	Amount                 decimal.Decimal `json:"amount" gorm:"type:numeric(6,2);"`
	PaydayId               uuid.UUID       `json:"payday_id"`
}

type Payday

type Payday struct {
	ID             uuid.UUID `json:"id" gorm:"type:uuid;default:gen_random_uuid()"`
	UserID         string    `json:"user_id"`
	PayDateOfMonth int       `json:"pay_date_of_month"`
	Bills          []Bill    `json:"bills" gorm:"constraint:OnDelete:CASCADE;"`
}

type User

type User struct {
	ID         string
	Name       string
	Paydays    []Payday
	Worksheets []Worksheet
}

type Worksheet

type Worksheet struct {
	ID           uuid.UUID       `json:"id" gorm:"type:uuid;default:gen_random_uuid()"`
	UserID       string          `json:"user_id"`
	Month        int             `json:"month"`
	Day          int             `json:"day"`
	Year         int             `json:"year"`
	InBank       decimal.Decimal `json:"in_bank" gorm:"type:numeric(6,2);"`
	Total        decimal.Decimal `json:"total" gorm:"type:numeric(6,2);"`
	Net          decimal.Decimal `json:"net" gorm:"->;type:numeric(6,2) GENERATED ALWAYS AS (in_bank - total) STORED;"`
	TotalPaid    decimal.Decimal `json:"total_paid" gorm:"type:numeric(6,2);"`
	NetAfterPaid decimal.Decimal `json:"net_after_paid" gorm:"->;type:numeric(6,2) GENERATED ALWAYS AS (in_bank - total_paid) STORED;"`
	Items        []WorksheetItem `json:"items" gorm:"constraint:OnDelete:CASCADE;"`
}

type WorksheetItem

type WorksheetItem struct {
	ID             uuid.UUID       `json:"id" gorm:"type:uuid;default:gen_random_uuid()"`
	Name           string          `json:"name"`
	Amount         decimal.Decimal `json:"amount" gorm:"type:numeric(6,2);"`
	IsPaid         bool            `json:"is_paid"`
	DueDateOfMonth int             `json:"due_date_of_month"`
	Notes          string          `json:"notes"`
	WorksheetId    uuid.UUID       `json:"worksheet_id"`
}

Jump to

Keyboard shortcuts

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