65 lines
		
	
	
	
		
			1.2 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			65 lines
		
	
	
	
		
			1.2 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
| package training
 | |
| 
 | |
| import (
 | |
| 	"github.com/shopspring/decimal"
 | |
| 	"gitlab.mareshq.com/hq/yggdrasil/internal/money"
 | |
| 	"time"
 | |
| )
 | |
| 
 | |
| type ID = int
 | |
| 
 | |
| type Training struct {
 | |
| 	ID          ID
 | |
| 	Name        string
 | |
| 	Days        int8
 | |
| 	Description string
 | |
| 	Pricing     []Price `db:"-"`
 | |
| }
 | |
| 
 | |
| type Price struct {
 | |
| 	Amount   decimal.Decimal
 | |
| 	Currency money.Currency
 | |
| 	Type     PriceType
 | |
| }
 | |
| 
 | |
| type PriceType string
 | |
| 
 | |
| const (
 | |
| 	OpenTrainingPrice      PriceType = "OPEN"
 | |
| 	CorporateTrainingPrice PriceType = "CORPORATE"
 | |
| )
 | |
| 
 | |
| type DateID = int
 | |
| 
 | |
| type Date struct {
 | |
| 	trainingID ID
 | |
| 
 | |
| 	ID            DateID
 | |
| 	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 AttendeeID = int
 | |
| 
 | |
| type Attendee struct {
 | |
| 	trainingDateID DateID
 | |
| 
 | |
| 	ID           AttendeeID
 | |
| 	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"`
 | |
| }
 |