79 lines
1.6 KiB
Go
79 lines
1.6 KiB
Go
package training
|
|
|
|
import (
|
|
"github.com/shopspring/decimal"
|
|
"gitlab.mareshq.com/hq/yggdrasil/internal/money"
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
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 `db:"-"`
|
|
}
|
|
|
|
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
|
|
PriceAmount decimal.Decimal `db:"price_amount"`
|
|
PriceCurrency money.Currency `db:"price_currency"`
|
|
}
|
|
|
|
type TrainingDateAttendeeID = uuid.UUID
|
|
|
|
func NewTrainingDateAttendeeID() TrainingDateAttendeeID {
|
|
return uuid.Must(uuid.NewV7())
|
|
}
|
|
|
|
type TrainingDateAttendee struct {
|
|
trainingDateID TrainingDateID
|
|
|
|
ID TrainingDateAttendeeID
|
|
Name string
|
|
Email string
|
|
Phone string
|
|
Company string
|
|
Position string
|
|
IsStudent bool
|
|
HasPaid bool
|
|
HasAttended bool
|
|
BillAmount decimal.Decimal `db:"bill_amount"`
|
|
BillCurrency money.Currency `db:"bill_currency"`
|
|
}
|