common

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAmountExceedsMaxSafeInt = errors.New(

	"amount exceeds max safe int") // Deposit would overflow balance

ErrAmountExceedsMaxSafeInt is returned when an amount exceeds the maximum safe integer value.

View Source
var ErrInvalidCurrencyCode = errors.New(
	"invalid currency code")

ErrInvalidCurrencyCode is returned when a currency code is invalid.

View Source
var ErrInvalidDecimalPlaces = errors.New(
	"amount has more decimal places than allowed by the currency")

ErrInvalidDecimalPlaces is returned when a monetary amount has more decimal places than allowed by the currency.

View Source
var ErrUnsupportedCurrency = errors.New(
	"unsupported currency")

ErrUnsupportedCurrency is return when currency is not supported by global registry #see: /pkg/currency

Functions

This section is empty.

Types

type ConversionInfo

type ConversionInfo struct {
	OriginalAmount    float64
	OriginalCurrency  string
	ConvertedAmount   float64
	ConvertedCurrency string
	ConversionRate    float64
}

ConversionInfo holds details about a currency conversion performed during a transaction.

Jump to

Keyboard shortcuts

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