customer/internal/models/currency.go

31 lines
858 B
Go
Raw Normal View History

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 {
2023-05-22 12:52:00 +00:00
Money float64 `json:"value"`
From CurrencyKey `json:"currencyFrom"`
To CurrencyKey `json:"currencyTo"`
2023-05-22 12:43:15 +00:00
}
type ChangeCurrency struct {
Currency CurrencyKey `json:"currency"`
}