assetrate

package
v1.31.0-beta.3 Latest Latest
Warning

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

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

Documentation

Overview

Package assetrate is a generated GoMock package.

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" example:"00000000-0000-0000-0000-000000000000"`
	BaseAssetCode    string         `json:"baseAssetCode" example:"BRL"`
	CounterAssetCode string         `json:"counterAssetCode" example:"USD"`
	Amount           float64        `json:"amount" example:"5000"`
	Scale            float64        `json:"scale" example:"2"`
	Source           string         `json:"source" example:"@person1"`
	OrganizationID   string         `json:"organizationId" example:"00000000-0000-0000-0000-000000000000"`
	LedgerID         string         `json:"ledgerId" example:"00000000-0000-0000-0000-000000000000"`
	CreatedAt        time.Time      `json:"createdAt" example:"2021-01-01T00:00:00Z"`
	Metadata         map[string]any `json:"metadata"`

} // @name AssetRate

AssetRate is a struct designed to encapsulate response payload data.

swagger:model AssetRate @Description AssetRate is a struct designed to store asset rate 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 AssetRatePostgreSQLRepository

type AssetRatePostgreSQLRepository struct {
	// contains filtered or unexported fields
}

AssetRatePostgreSQLRepository is a Postgresql-specific implementation of the AssetRateRepository.

func NewAssetRatePostgreSQLRepository

func NewAssetRatePostgreSQLRepository(pc *mpostgres.PostgresConnection) *AssetRatePostgreSQLRepository

NewAssetRatePostgreSQLRepository returns a new instance of AssetRatePostgreSQLRepository using the given Postgres connection.

func (*AssetRatePostgreSQLRepository) Create

func (r *AssetRatePostgreSQLRepository) Create(ctx context.Context, assetRate *AssetRate) (*AssetRate, error)

Create a new AssetRate entity into Postgresql and returns it.

func (*AssetRatePostgreSQLRepository) Find

func (r *AssetRatePostgreSQLRepository) Find(ctx context.Context, organizationID, ledgerID, assetRateID uuid.UUID) (*AssetRate, error)

Find an AssetRate entity by its ID in Postgresql and returns it.

type CreateAssetRateInput

type CreateAssetRateInput struct {
	BaseAssetCode    string         `json:"baseAssetCode" example:"BRL"`
	CounterAssetCode string         `json:"counterAssetCode" example:"USD"`
	Amount           float64        `json:"amount" example:"5000"`
	Scale            float64        `json:"scale" example:"2"`
	Source           string         `json:"source" example:"@person1"`
	Metadata         map[string]any `json:"metadata,omitempty"`

} // @name CreateAssetRateInput

CreateAssetRateInput is a struct design to encapsulate payload data.

swagger:model CreateAssetRateInput @Description CreateAssetRateInput is the input payload to create an asset rate.

type MockRepository

type MockRepository struct {
	// contains filtered or unexported fields
}

MockRepository is a mock of Repository interface.

func NewMockRepository

func NewMockRepository(ctrl *gomock.Controller) *MockRepository

NewMockRepository creates a new mock instance.

func (*MockRepository) Create

func (m *MockRepository) Create(arg0 context.Context, arg1 *AssetRate) (*AssetRate, error)

Create mocks base method.

func (*MockRepository) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockRepository) Find

func (m *MockRepository) Find(arg0 context.Context, arg1, arg2, arg3 uuid.UUID) (*AssetRate, error)

Find mocks base method.

type MockRepositoryMockRecorder

type MockRepositoryMockRecorder struct {
	// contains filtered or unexported fields
}

MockRepositoryMockRecorder is the mock recorder for MockRepository.

func (*MockRepositoryMockRecorder) Create

func (mr *MockRepositoryMockRecorder) Create(arg0, arg1 any) *gomock.Call

Create indicates an expected call of Create.

func (*MockRepositoryMockRecorder) Find

func (mr *MockRepositoryMockRecorder) Find(arg0, arg1, arg2, arg3 any) *gomock.Call

Find indicates an expected call of Find.

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 asset_rate template entities.

Jump to

Keyboard shortcuts

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