2023-05-18 19:43:43 +00:00
|
|
|
package models
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
|
|
|
type CurrencyKey = string
|
|
|
|
|
|
|
|
type CurrencyList struct {
|
|
|
|
ID string `json:"id" bson:"_id,omitempty"`
|
|
|
|
Name string `json:"name" bson:"name"`
|
|
|
|
Currencies []CurrencyKey `json:"currencies" bson:"currencies"`
|
|
|
|
Deleted bool `json:"deleted" bson:"deleted"`
|
|
|
|
CreatedAt time.Time `json:"createdAt" bson:"createdAt"`
|
|
|
|
UpdatedAt time.Time `json:"updatedAt" bson:"updatedAt"`
|
|
|
|
DeletedAt *time.Time `json:"deletedAt,omitempty" bson:"deletedAt,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
const (
|
2023-05-22 12:43:15 +00:00
|
|
|
DefaultCurrencyListName = "currency_list"
|
|
|
|
InternalCurrencyKey CurrencyKey = "RUB"
|
2023-05-18 19:43:43 +00:00
|
|
|
)
|
2023-05-22 12:43:15 +00:00
|
|
|
|
|
|
|
type TranslateCurrency struct {
|
|
|
|
Money float64 `json:"money"`
|
|
|
|
From CurrencyKey `json:"from"`
|
|
|
|
To CurrencyKey `json:"to"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type ChangeCurrency struct {
|
|
|
|
Currency CurrencyKey `json:"currency"`
|
|
|
|
}
|