service backend
All checks were successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful

This commit is contained in:
Stephan D
2025-11-07 18:35:26 +01:00
parent 20e8f9acc4
commit 62a6631b9a
537 changed files with 48453 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
package model
import "github.com/tech/sendico/pkg/db/storable"
// Currency captures rounding metadata for a given currency code.
type Currency struct {
storable.Base `bson:",inline" json:",inline"`
Code string `bson:"code" json:"code"`
Decimals uint32 `bson:"decimals" json:"decimals"`
Rounding RoundingMode `bson:"rounding" json:"rounding"`
DisplayName string `bson:"displayName,omitempty" json:"displayName,omitempty"`
Symbol string `bson:"symbol,omitempty" json:"symbol,omitempty"`
MinUnit string `bson:"minUnit,omitempty" json:"minUnit,omitempty"`
}
// Collection implements storable.Storable.
func (*Currency) Collection() string {
return CurrenciesCollection
}
// CurrencySettings embeds precision details inside a Pair document.
type CurrencySettings struct {
Code string `bson:"code" json:"code"`
Decimals uint32 `bson:"decimals" json:"decimals"`
Rounding RoundingMode `bson:"rounding" json:"rounding"`
}