Documentation
¶
Index ¶
- func AliasKey(alias, balanceKey string) stringdeprecated
- func AppendIfNotExist(slice []string, s []string) []stringdeprecated
- func CalculateTotal(fromTos []FromTo, transaction Transaction, transactionType string, ...)deprecated
- func ConcatAlias(i int, alias string) stringdeprecated
- func DetermineOperation(isPending bool, isFrom bool, transactionType string) stringdeprecated
- func SplitAlias(alias string) stringdeprecated
- func SplitAliasWithKey(alias string) stringdeprecated
- func ValidateBalancesRules(ctx context.Context, transaction Transaction, validate Responses, ...) errordeprecated
- func ValidateFromToOperation(ft FromTo, validate Responses, balance *Balance) (Amount, Balance, error)deprecated
- type Amountdeprecated
- type Balancedeprecated
- type Distributedeprecated
- type FromTodeprecated
- func (ft FromTo) ConcatAlias(i int) stringdeprecated
- func (ft FromTo) SplitAlias() stringdeprecated
- type Metadatadeprecated
- type Ratedeprecated
- func (r Rate) IsEmpty() booldeprecated
- type Responsesdeprecated
- type Senddeprecated
- type Sharedeprecated
- type Sourcedeprecated
- type Transactiondeprecated
- func (t Transaction) IsEmpty() booldeprecated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendIfNotExist
deprecated
func CalculateTotal
deprecated
func CalculateTotal(fromTos []FromTo, transaction Transaction, transactionType string, t chan decimal.Decimal, ft chan map[string]Amount, sd chan []string, or chan map[string]string)
Deprecated: use CalculateTotal method from Midaz pkg instead. CalculateTotal Calculate total for sources/destinations based on shares, amounts and remains
func ConcatAlias
deprecated
func DetermineOperation
deprecated
func SplitAlias
deprecated
func SplitAliasWithKey
deprecated
added in
v2.3.0
func ValidateBalancesRules
deprecated
Types ¶
type Amount
deprecated
type Amount struct {
Asset string `json:"asset,omitempty" validate:"required" example:"BRL"`
Value decimal.Decimal `json:"value,omitempty" validate:"required" example:"1000"`
Operation string `json:"operation,omitempty"`
TransactionType string `json:"transactionType,omitempty"`
} // @name Amount
Deprecated: use model from Midaz pkg instead. Amount structure for marshaling/unmarshalling JSON.
swagger:model Amount @Description Amount is the struct designed to represent the amount of an operation.
type Balance
deprecated
type Balance struct {
ID string `json:"id" example:"00000000-0000-0000-0000-000000000000"`
OrganizationID string `json:"organizationId" example:"00000000-0000-0000-0000-000000000000"`
LedgerID string `json:"ledgerId" example:"00000000-0000-0000-0000-000000000000"`
AccountID string `json:"accountId" example:"00000000-0000-0000-0000-000000000000"`
Alias string `json:"alias" example:"@person1"`
Key string `json:"key" example:"asset-freeze"`
AssetCode string `json:"assetCode" example:"BRL"`
Available decimal.Decimal `json:"available" example:"1500"`
OnHold decimal.Decimal `json:"onHold" example:"500"`
Version int64 `json:"version" example:"1"`
AccountType string `json:"accountType" example:"creditCard"`
AllowSending bool `json:"allowSending" example:"true"`
AllowReceiving bool `json:"allowReceiving" example:"true"`
CreatedAt time.Time `json:"createdAt" example:"2021-01-01T00:00:00Z"`
UpdatedAt time.Time `json:"updatedAt" example:"2021-01-01T00:00:00Z"`
DeletedAt *time.Time `json:"deletedAt" example:"2021-01-01T00:00:00Z"`
Metadata map[string]any `json:"metadata,omitempty"`
} // @name Balance
Deprecated: use model from Midaz pkg instead. Balance structure for marshaling/unmarshalling JSON.
swagger:model Balance @Description Balance is the struct designed to represent the account balance.
func OperateBalances
deprecated
type Distribute
deprecated
type Distribute struct {
Remaining string `json:"remaining,omitempty"`
To []FromTo `json:"to,omitempty" validate:"singletransactiontype,required,dive"`
} // @name Distribute
Deprecated: use model from Midaz pkg instead. Distribute structure for marshaling/unmarshalling JSON.
swagger:model Distribute @Description Distribute is the struct designed to represent the distribution fields of an operation.
type FromTo
deprecated
type FromTo struct {
AccountAlias string `json:"accountAlias,omitempty" example:"@person1"`
BalanceKey string `json:"balanceKey,omitempty" example:"asset-freeze"`
Amount *Amount `json:"amount,omitempty"`
Remaining string `json:"remaining,omitempty" example:"remaining"`
Rate *Rate `json:"rate,omitempty"`
Description string `json:"description,omitempty" example:"description"`
ChartOfAccounts string `json:"chartOfAccounts" example:"1000"`
Metadata map[string]any `json:"metadata" validate:"dive,keys,keymax=100,endkeys,nonested,valuemax=2000"`
IsFrom bool `json:"isFrom,omitempty" example:"true"`
Route string `json:"route,omitempty" validate:"omitempty,max=250" example:"00000000-0000-0000-0000-000000000000"`
} // @name FromTo
Deprecated: use model from Midaz pkg instead. FromTo structure for marshaling/unmarshalling JSON.
swagger:model FromTo @Description FromTo is the struct designed to represent the from/to fields of an operation.
func (FromTo) ConcatAlias
deprecated
func (FromTo) SplitAlias
deprecated
type Metadata
deprecated
type Rate
deprecated
type Rate struct {
From string `json:"from" validate:"required" example:"BRL"`
To string `json:"to" validate:"required" example:"USDe"`
Value decimal.Decimal `json:"value" validate:"required" example:"1000"`
ExternalID string `json:"externalId" validate:"uuid,required" example:"00000000-0000-0000-0000-000000000000"`
} // @name Rate
Deprecated: use model from Midaz pkg instead. Rate structure for marshaling/unmarshalling JSON.
swagger:model Rate @Description Rate is the struct designed to represent the rate fields of an operation.
type Responses
deprecated
type Responses struct {
Total decimal.Decimal
Asset string
From map[string]Amount
To map[string]Amount
Sources []string
Destinations []string
Aliases []string
Pending bool
TransactionRoute string
OperationRoutesFrom map[string]string
OperationRoutesTo map[string]string
}
Deprecated: use model from Midaz pkg instead.
func ValidateSendSourceAndDistribute
deprecated
type Send
deprecated
type Send struct {
Asset string `json:"asset,omitempty" validate:"required" example:"BRL"`
Value decimal.Decimal `json:"value,omitempty" validate:"required" example:"1000"`
Source Source `json:"source,omitempty" validate:"required"`
Distribute Distribute `json:"distribute,omitempty" validate:"required"`
} // @name Send
Deprecated: use model from Midaz pkg instead. Send structure for marshaling/unmarshalling JSON.
swagger:model Send @Description Send is the struct designed to represent the sending fields of an operation.
type Share
deprecated
type Share struct {
} // @name Share
Deprecated: use model from Midaz pkg instead. Share structure for marshaling/unmarshalling JSON.
swagger:model Share @Description Share is the struct designed to represent the sharing fields of an operation.
type Source
deprecated
type Source struct {
Remaining string `json:"remaining,omitempty" example:"remaining"`
From []FromTo `json:"from,omitempty" validate:"singletransactiontype,required,dive"`
} // @name Source
Deprecated: use model from Midaz pkg instead. Source structure for marshaling/unmarshalling JSON.
swagger:model Source @Description Source is the struct designed to represent the source fields of an operation.
type Transaction
deprecated
type Transaction struct {
ChartOfAccountsGroupName string `json:"chartOfAccountsGroupName,omitempty" example:"1000"`
Description string `json:"description,omitempty" example:"Description"`
Code string `json:"code,omitempty" example:"00000000-0000-0000-0000-000000000000"`
Pending bool `json:"pending,omitempty" example:"false"`
Metadata map[string]any `json:"metadata,omitempty" validate:"dive,keys,keymax=100,endkeys,nonested,valuemax=2000"`
Route string `json:"route,omitempty" validate:"omitempty,max=250" example:"00000000-0000-0000-0000-000000000000"`
TransactionDate time.Time `json:"transactionDate,omitempty" example:"2021-01-01T00:00:00Z"`
Send Send `json:"send" validate:"required"`
} // @name Transaction
Deprecated: use model from Midaz pkg instead. Transaction structure for marshaling/unmarshalling JSON.
swagger:model Transaction @Description Transaction is a struct designed to store transaction data.
func (Transaction) IsEmpty
deprecated
func (t Transaction) IsEmpty() bool
Deprecated: use IsEmpty method from Midaz pkg instead. IsEmpty is a func that validate if transaction is Empty.