Documentation ¶
Index ¶
- func Scale(v, s0, s1 int) float64
- func UndoScale(v float64, s int) int
- func UpdateAccounts(operation string, fromTo map[string]Amount, accounts []*a.Account, ...)
- func ValidateAccounts(validate Responses, accounts []*a.Account) error
- func ValidateFromToOperation(ft FromTo, validate Responses, acc *a.Account) (Amount, Balance, error)
- type Amount
- type Balance
- type Distribute
- type FromTo
- type Metadata
- type Responses
- type Send
- type Share
- type Source
- type Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UpdateAccounts ¶ added in v1.26.0
func UpdateAccounts(operation string, fromTo map[string]Amount, accounts []*a.Account, result chan []*a.Account, e chan error)
UpdateAccounts function with some updates values in accounts and
func ValidateAccounts ¶ added in v1.26.0
ValidateAccounts function with some validates in accounts and DSL operations
Types ¶
type Amount ¶
type Balance ¶ added in v1.26.0
type Distribute ¶
type FromTo ¶
type FromTo struct { Account string `json:"account,omitempty"` Amount *Amount `json:"amount,omitempty"` Remaining string `json:"remaining,omitempty"` Description string `json:"description,omitempty"` ChartOfAccounts string `json:"chartOfAccountsG"` Metadata map[string]any `json:"metadata,omitempty"` IsFrom bool `json:"isFrom,omitempty"` }
type Responses ¶ added in v1.26.0
type Responses struct { Total int From map[string]Amount To map[string]Amount Sources []string Destinations []string Aliases []string }
func ValidateSendSourceAndDistribute ¶ added in v1.26.0
func ValidateSendSourceAndDistribute(transaction Transaction) (*Responses, error)
ValidateSendSourceAndDistribute Validate send and distribute totals
type Transaction ¶
type Transaction struct { ChartOfAccountsGroupName string `json:"chartOfAccountsGroupName"` Description string `json:"description,omitempty"` Code string `json:"code,omitempty"` Pending bool `json:"pending,omitempty"` Metadata map[string]any `json:"metadata,omitempty"` Send Send `json:"send,omitempty"` Distribute Distribute `json:"distribute,omitempty"` }
Click to show internal directories.
Click to hide internal directories.