service backend
This commit is contained in:
27
api/fx/storage/model/currency.go
Normal file
27
api/fx/storage/model/currency.go
Normal 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"`
|
||||
}
|
||||
Reference in New Issue
Block a user