refactor: move currency to money package and add new type Price, refactor api and use price there too
This commit is contained in:
parent
18d1c98b76
commit
ef1526a1ac
7 changed files with 127 additions and 137 deletions
13
internal/money/currency.go
Normal file
13
internal/money/currency.go
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
package money
|
||||
|
||||
type Currency string
|
||||
|
||||
const (
|
||||
USD Currency = "USD"
|
||||
EUR Currency = "EUR"
|
||||
CZK Currency = "CZK"
|
||||
)
|
||||
|
||||
var (
|
||||
AllowedCurrencies = []Currency{USD, EUR, CZK}
|
||||
)
|
||||
Reference in a new issue