feat(training): add TrainingDate
This commit is contained in:
parent
6f5a91a92d
commit
4bf2ae4a06
3 changed files with 130 additions and 1 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue