feat: add postgres repository for training
This commit is contained in:
parent
8c277ef692
commit
ff7e320481
19 changed files with 1277 additions and 414 deletions
|
|
@ -1,11 +1,11 @@
|
|||
package training
|
||||
|
||||
import (
|
||||
"github.com/shopspring/decimal"
|
||||
"gitlab.mareshq.com/hq/yggdrasil/internal/money"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/shopspring/decimal"
|
||||
"gitlab.mareshq.com/hq/yggdrasil/internal/money"
|
||||
)
|
||||
|
||||
type TrainingID = uuid.UUID
|
||||
|
|
@ -19,7 +19,7 @@ type Training struct {
|
|||
Name string
|
||||
Days int8
|
||||
Description string
|
||||
Pricing []TrainingPrice
|
||||
Pricing []TrainingPrice `db:"-"`
|
||||
}
|
||||
|
||||
type TrainingPrice struct {
|
||||
|
|
@ -44,15 +44,16 @@ func NewTrainingDateID() TrainingDateID {
|
|||
type TrainingDate struct {
|
||||
trainingID TrainingID
|
||||
|
||||
ID TrainingDateID
|
||||
Date time.Time
|
||||
StartTime time.Time
|
||||
Days int8
|
||||
IsOnline bool
|
||||
Location string
|
||||
Address string
|
||||
Capacity int8
|
||||
Price money.Price
|
||||
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
|
||||
|
|
@ -64,14 +65,15 @@ func NewTrainingDateAttendeeID() TrainingDateAttendeeID {
|
|||
type TrainingDateAttendee struct {
|
||||
trainingDateID TrainingDateID
|
||||
|
||||
ID TrainingDateAttendeeID
|
||||
Name string
|
||||
Email string
|
||||
Phone string
|
||||
Company string
|
||||
Position string
|
||||
Bill money.Price
|
||||
IsStudent bool
|
||||
HasPaid bool
|
||||
HasAttended bool
|
||||
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"`
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue