1
0
Fork 0

refactor: move currency to money package and add new type Price, refactor api and use price there too

This commit is contained in:
Vojtěch Mareš 2024-05-05 18:19:56 +02:00
parent 18d1c98b76
commit ef1526a1ac
Signed by: vojtech.mares
GPG key ID: C6827B976F17240D
7 changed files with 127 additions and 137 deletions

View file

@ -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
}