refactor: use serial as id instead of uuid
This commit is contained in:
parent
18b033add1
commit
370531a9a5
11 changed files with 319 additions and 381 deletions
|
|
@ -4,15 +4,9 @@ import (
|
|||
"github.com/shopspring/decimal"
|
||||
"gitlab.mareshq.com/hq/yggdrasil/internal/money"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type TrainingID = uuid.UUID
|
||||
|
||||
func NewTrainingID() TrainingID {
|
||||
return uuid.Must(uuid.NewV7())
|
||||
}
|
||||
type TrainingID = int
|
||||
|
||||
type Training struct {
|
||||
ID TrainingID
|
||||
|
|
@ -35,11 +29,7 @@ const (
|
|||
CorporateTrainingPrice TrainingPriceType = "CORPORATE"
|
||||
)
|
||||
|
||||
type TrainingDateID = uuid.UUID
|
||||
|
||||
func NewTrainingDateID() TrainingDateID {
|
||||
return uuid.Must(uuid.NewV7())
|
||||
}
|
||||
type TrainingDateID = int
|
||||
|
||||
type TrainingDate struct {
|
||||
trainingID TrainingID
|
||||
|
|
@ -56,11 +46,7 @@ type TrainingDate struct {
|
|||
PriceCurrency money.Currency `db:"price_currency"`
|
||||
}
|
||||
|
||||
type TrainingDateAttendeeID = uuid.UUID
|
||||
|
||||
func NewTrainingDateAttendeeID() TrainingDateAttendeeID {
|
||||
return uuid.Must(uuid.NewV7())
|
||||
}
|
||||
type TrainingDateAttendeeID = int
|
||||
|
||||
type TrainingDateAttendee struct {
|
||||
trainingDateID TrainingDateID
|
||||
|
|
|
|||
Reference in a new issue