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
|
|
@ -5,7 +5,7 @@ import (
|
|||
|
||||
"github.com/google/uuid"
|
||||
"github.com/shopspring/decimal"
|
||||
"gitlab.mareshq.com/hq/yggdrasil/internal/currency"
|
||||
"gitlab.mareshq.com/hq/yggdrasil/internal/money"
|
||||
)
|
||||
|
||||
type TrainingID = uuid.UUID
|
||||
|
|
@ -24,7 +24,7 @@ type Training struct {
|
|||
|
||||
type TrainingPrice struct {
|
||||
Amount decimal.Decimal
|
||||
Currency currency.Currency
|
||||
Currency money.Currency
|
||||
Type TrainingPriceType
|
||||
}
|
||||
|
||||
|
|
@ -52,10 +52,6 @@ type TrainingDate struct {
|
|||
Location string
|
||||
Address string
|
||||
Capacity int8
|
||||
Price TrainingDatePrice
|
||||
Price money.Price
|
||||
}
|
||||
|
||||
type TrainingDatePrice struct {
|
||||
Amount decimal.Decimal
|
||||
Currency currency.Currency
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue