57 lines
981 B
Go
57 lines
981 B
Go
package training
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
"github.com/shopspring/decimal"
|
|
"gitlab.mareshq.com/hq/yggdrasil/internal/money"
|
|
)
|
|
|
|
type TrainingID = uuid.UUID
|
|
|
|
func NewTrainingID() TrainingID {
|
|
return uuid.Must(uuid.NewV7())
|
|
}
|
|
|
|
type Training struct {
|
|
ID TrainingID
|
|
Name string
|
|
Days int8
|
|
Description string
|
|
Pricing []TrainingPrice
|
|
}
|
|
|
|
type TrainingPrice struct {
|
|
Amount decimal.Decimal
|
|
Currency money.Currency
|
|
Type TrainingPriceType
|
|
}
|
|
|
|
type TrainingPriceType string
|
|
|
|
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 money.Price
|
|
}
|
|
|