java2go

package module
v0.0.0-...-9ed5d2c Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2025 License: MIT Imports: 2 Imported by: 0

README

Working with Go implementation

Building the application

To build the application run command

go build $PWD/cmd/client-exposure-server

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientExposure

type ClientExposure struct {
	ClientId int64
	Exposure *MonetaryAmount
}

type ClientExposureDetailStorage

type ClientExposureDetailStorage interface {
	FindByClientIdAndExposureCurrency(ctx context.Context, clientId int64, exposureCurrency string) (*ClientExposure, error)
	FindAllByClientId(ctx context.Context, clientId int64) ([]*ClientExposure, error)
	FindAll(ctx context.Context) ([]*ClientExposure, error)
	Save(ctx context.Context, detail *ClientExposure) error
}

type ClientExposureStorage

type ClientExposureStorage interface {
	Save(ctx context.Context, totalExposure *ClientExposure) error
	FindByClientId(ctx context.Context, clientId int64) (*ClientExposure, error)
}

type CurrencyRate

type CurrencyRate struct {
	BaseCurrency   string  `json:"baseCurrency"`
	QuotedCurrency string  `json:"quotedCurrency"`
	Rate           float64 `json:"rate"`
}

type CurrencyRateMessage

type CurrencyRateMessage []CurrencyRate

type CurrencyRateService

type CurrencyRateService interface {
	ReceiveRate(rate *CurrencyRate) error
}

type CurrencyRateStorage

type CurrencyRateStorage interface {
	SaveRate(ctx context.Context, rate *CurrencyRate) error
	FindByBaseCurrencyAndQuotedCurrency(ctx context.Context, baseCurrency, quotedCurrency string) (*CurrencyRate, error)
	FindAll(ctx context.Context) ([]*CurrencyRate, error)
}

type Deal

type Deal struct {
	Id           int64          `json:"id"`
	ClientId     int64          `json:"clientId"`
	AmountBought MonetaryAmount `json:"amountBought"`
	AmountSold   MonetaryAmount `json:"amountSold"`
}

func (*Deal) String

func (d *Deal) String() string

type DealService

type DealService interface {
	ReceiveDeal(deal *Deal) error
}

type DealStorage

type DealStorage interface {
	SaveDeal(ctx context.Context, deal *Deal) error
	FindAll(ctx context.Context) ([]*Deal, error)
	FindAllByClientId(ctx context.Context, clientId int64) ([]*Deal, error)
}

type MonetaryAmount

type MonetaryAmount struct {
	Currency string  `json:"currency"`
	Amount   float64 `json:"amount"`
}

func (*MonetaryAmount) Negate

func (m *MonetaryAmount) Negate() MonetaryAmount

func (*MonetaryAmount) String

func (m *MonetaryAmount) String() string

type TotalExposure

type TotalExposure struct {
	ClientId int64            `json:"clientId"`
	Total    MonetaryAmount   `json:"total"`
	Amounts  []MonetaryAmount `json:"amounts"`
}

type TotalExposureService

type TotalExposureService interface {
	RecalculateAllTotalExposure() error
	GetClientsTotalExposure(clientId int64) (*TotalExposure, error)
	ConsiderNewAmounts(clientId int64, monetaryAmounts ...MonetaryAmount) error
}

Directories

Path Synopsis
cmd
deal-producer command
internal

Jump to

Keyboard shortcuts

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