1
0
Fork 0
This repository has been archived on 2025-09-02. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
mareshq-yggdrasil/pkg/training/model.go
Vojtech Mares 2d32c80182
feat!: add slug to training
BREAKING CHANGE: update init migration
2024-06-26 22:24:36 +02:00

66 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
Slug 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"`
}