models

package
v0.0.0-...-accc12c Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectDatabase

func ConnectDatabase()

Types

type Account

type Account struct {
	ID          int64  `json:"id" gorm:"primaryKey"`
	Description string `json:"description"`
}

type AccountModel

type AccountModel struct{}

func (*AccountModel) Create

func (*AccountModel) Create(newItem *Account)

func (*AccountModel) Delete

func (*AccountModel) Delete(id []*Account)

func (*AccountModel) GetList

func (*AccountModel) GetList(sort []string, itemRange []int, filters map[string]interface{}) []Account

func (*AccountModel) GetSingleItem

func (*AccountModel) GetSingleItem(key int64) (*Account, error)

func (*AccountModel) TotalCount

func (*AccountModel) TotalCount() int64

type CRUDModel

type CRUDModel[T any] interface {
	Create() T
	GetList() []T
	GetSingleItem(ID int) T
	UpdateItem(ID int) T
	Delete(ID int) bool
	TotalCount() int64
}

type CostCenter

type CostCenter struct {
	ID          int64  `json:"id" gorm:"primaryKey"`
	Description string `json:"description"`
}

type CostCenterModel

type CostCenterModel struct{}

func (*CostCenterModel) Create

func (*CostCenterModel) Create(newItem *CostCenter)

func (*CostCenterModel) Delete

func (*CostCenterModel) Delete(id []*CostCenter)

func (*CostCenterModel) GetList

func (*CostCenterModel) GetList(sort []string, itemRange []int, filters map[string]interface{}) []CostCenter

func (*CostCenterModel) GetSingleItem

func (*CostCenterModel) GetSingleItem(key int64) (*CostCenter, error)

func (*CostCenterModel) TotalCount

func (*CostCenterModel) TotalCount() int64

type Provider

type Provider struct {
	ID   int64  `json:"id" gorm:"primaryKey"`
	Name string `json:"name"`
}

type ProviderModel

type ProviderModel struct{}

func (*ProviderModel) Create

func (*ProviderModel) Create(newItem *Provider)

func (*ProviderModel) Delete

func (*ProviderModel) Delete(id []*Provider)

func (*ProviderModel) GetList

func (*ProviderModel) GetList(sort []string, itemRange []int, filters map[string]interface{}) []Provider

func (*ProviderModel) GetSingleItem

func (*ProviderModel) GetSingleItem(key int64) (*Provider, error)

func (*ProviderModel) TotalCount

func (*ProviderModel) TotalCount() int64

type Transaction

type Transaction struct {
	ID           int64  `json:"id"`
	Date         string `json:"date"`
	ProviderID   int64
	Provider     *Provider `json:"provider"`
	Description  string    `json:"description"`
	Amount       int64     `json:"amount"`
	CostCenterID int64
	CostCenter   *CostCenter `json:"cost_center"`
	AccountID    int64
	Account      *Account `json:"account"`
}

album represents data about a record album.

type TransactionInput

type TransactionInput struct {
	ID          int64  `json:"id"`
	Date        string `json:"date"`
	Provider    int64  `json:"provider"`
	Description string `json:"description"`
	Amount      int64  `json:"amount"`
	CostCenter  int64  `json:"cost_center"`
	Account     int64  `json:"account"`
}

album represents data about a record album.

type TransactionModel

type TransactionModel struct{}

func (*TransactionModel) Create

func (*TransactionModel) Create(newtx *Transaction)

func (*TransactionModel) Delete

func (*TransactionModel) Delete(id []*Transaction)

func (*TransactionModel) GetList

func (*TransactionModel) GetList(sort []string, itemRange []int, filters map[string]interface{}) []Transaction

func (*TransactionModel) GetSingleItem

func (*TransactionModel) GetSingleItem(id int64) (*Transaction, error)

func (*TransactionModel) TotalCount

func (*TransactionModel) TotalCount() int64

type TransactionOutput

type TransactionOutput struct {
	ID          int64  `json:"id"`
	Date        string `json:"date"`
	Provider    int64  `json:"provider"`
	Description string `json:"description"`
	Amount      int64  `json:"amount"`
	CostCenter  int64  `json:"cost_center"`
	Account     int64  `json:"account"`
}

album represents data about a record album.

func Flatten

func Flatten(transaction *Transaction) TransactionOutput

Jump to

Keyboard shortcuts

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