WIP: EOL
This commit is contained in:
parent
7ed1e05284
commit
49e05cac10
23 changed files with 613 additions and 253 deletions
|
|
@ -4,6 +4,11 @@ import "github.com/google/uuid"
|
|||
|
||||
type AttendeeID uuid.UUID
|
||||
|
||||
func NewAttendeeID() AttendeeID {
|
||||
id := uuid.Must(uuid.NewV7())
|
||||
return AttendeeID(id)
|
||||
}
|
||||
|
||||
type Attendee struct {
|
||||
ID AttendeeID
|
||||
DateID DateID
|
||||
|
|
|
|||
|
|
@ -8,15 +8,21 @@ import (
|
|||
|
||||
type DateID uuid.UUID
|
||||
|
||||
type Date struct {
|
||||
ID DateID
|
||||
TrainingID ID
|
||||
Date time.Time
|
||||
StartTime time.Time
|
||||
Days int8
|
||||
Price Price
|
||||
IsOnline bool
|
||||
Location string // could be empty (null) for example: Prague, Brno, London, ...
|
||||
Address string // could be empty (null)
|
||||
Capacity int8
|
||||
func NewDateID() DateID {
|
||||
id := uuid.Must(uuid.NewV7())
|
||||
return DateID(id)
|
||||
}
|
||||
|
||||
type Date struct {
|
||||
ID DateID
|
||||
TrainingID ID
|
||||
Date time.Time
|
||||
StartTime time.Time
|
||||
Days int8
|
||||
IsOnline bool
|
||||
Location string // could be empty (null) for example: Prague, Brno, London, ...
|
||||
Address string // could be empty (null)
|
||||
Capacity int8
|
||||
PriceAmount float64
|
||||
PriceCurrency string
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,22 @@
|
|||
package training
|
||||
|
||||
type Price float32
|
||||
// type Price float32
|
||||
|
||||
type TrainingPrice struct {
|
||||
Currency string `json:"currency"`
|
||||
Amount float64 `json:"amount"`
|
||||
Type PriceType `json:"type"` // open | corporate
|
||||
}
|
||||
|
||||
type PriceType string
|
||||
|
||||
var (
|
||||
PriceTypes = []PriceType{OpenPrice, CorporatePrice, StudentPrice, GovernmentPrice}
|
||||
)
|
||||
|
||||
const (
|
||||
OpenPrice PriceType = "OPEN"
|
||||
CorporatePrice PriceType = "CORPORATE"
|
||||
StudentPrice PriceType = "STUDENT"
|
||||
GovernmentPrice PriceType = "GOVERNMENT"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -6,10 +6,15 @@ import (
|
|||
|
||||
type ID uuid.UUID
|
||||
|
||||
func NewID() ID {
|
||||
id := uuid.Must(uuid.NewV7())
|
||||
return ID(id)
|
||||
}
|
||||
|
||||
type Training struct {
|
||||
ID ID
|
||||
Days int8
|
||||
Name string
|
||||
Description string
|
||||
Price Price
|
||||
Price []TrainingPrice
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue