assetrate

package
v1.29.0-beta.7 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssetRate

type AssetRate struct {
	ID               string         `json:"id"`
	BaseAssetCode    string         `json:"baseAssetCode"`
	CounterAssetCode string         `json:"counterAssetCode"`
	Amount           float64        `json:"amount"`
	Scale            float64        `json:"scale"`
	Source           string         `json:"source"`
	OrganizationID   string         `json:"organizationId"`
	LedgerID         string         `json:"ledgerId"`
	CreatedAt        time.Time      `json:"createdAt"`
	Metadata         map[string]any `json:"metadata"`
}

AssetRate is a struct designed to encapsulate response payload data.

type AssetRatePostgreSQLModel

type AssetRatePostgreSQLModel struct {
	ID               string
	BaseAssetCode    string
	CounterAssetCode string
	Amount           float64
	Scale            float64
	Source           string
	OrganizationID   string
	LedgerID         string
	CreatedAt        time.Time
	Metadata         map[string]any
}

AssetRatePostgreSQLModel represents the entity AssetRatePostgreSQLModel into SQL context in Database

func (*AssetRatePostgreSQLModel) FromEntity

func (a *AssetRatePostgreSQLModel) FromEntity(assetRate *AssetRate)

FromEntity converts an entity AssetRate to AssetRatePostgreSQLModel

func (*AssetRatePostgreSQLModel) ToEntity

func (a *AssetRatePostgreSQLModel) ToEntity() *AssetRate

ToEntity converts an TransactionPostgreSQLModel to entity Transaction

type CreateAssetRateInput

type CreateAssetRateInput struct {
	BaseAssetCode    string         `json:"baseAssetCode"`
	CounterAssetCode string         `json:"counterAssetCode"`
	Amount           float64        `json:"amount"`
	Scale            float64        `json:"scale"`
	Source           string         `json:"source"`
	Metadata         map[string]any `json:"metadata,omitempty"`
}

CreateAssetRateInput is a struct design to encapsulate payload data.

type Repository

type Repository interface {
	Create(ctx context.Context, assetRate *AssetRate) (*AssetRate, error)
	Find(ctx context.Context, organizationID, ledgerID, id uuid.UUID) (*AssetRate, error)
}

Repository provides an interface for assetrate template entities.

Jump to

Keyboard shortcuts

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