1
0
Fork 0

feat(training): add TrainingDate

This commit is contained in:
Vojtěch Mareš 2024-05-05 15:51:56 +02:00
parent 6f5a91a92d
commit 4bf2ae4a06
Signed by: vojtech.mares
GPG key ID: C6827B976F17240D
3 changed files with 130 additions and 1 deletions

View file

@ -1,6 +1,8 @@
package training
import (
"time"
"github.com/google/uuid"
"github.com/shopspring/decimal"
"gitlab.mareshq.com/hq/yggdrasil/internal/currency"
@ -32,3 +34,28 @@ const (
OpenTrainingPrice TrainingPriceType = "OPEN"
CorporateTrainingPrice TrainingPriceType = "CORPORATE"
)
type TrainingDateID = uuid.UUID
func NewTrainingDateID() TrainingDateID {
return uuid.Must(uuid.NewV7())
}
type TrainingDate struct {
trainingID TrainingID
ID TrainingDateID
Date time.Time
StartTime time.Time
Days int8
IsOnline bool
Location string
Address string
Capacity int8
Price TrainingDatePrice
}
type TrainingDatePrice struct {
Amount decimal.Decimal
Currency currency.Currency
}