refactor(training): use golang style of naming (do not repeat pacakge name in struct/func names)
This commit is contained in:
parent
e0f401f0a9
commit
c3795dba6a
12 changed files with 232 additions and 232 deletions
|
|
@ -6,35 +6,35 @@ import (
|
|||
"time"
|
||||
)
|
||||
|
||||
type TrainingID = int
|
||||
type ID = int
|
||||
|
||||
type Training struct {
|
||||
ID TrainingID
|
||||
ID ID
|
||||
Name string
|
||||
Days int8
|
||||
Description string
|
||||
Pricing []TrainingPrice `db:"-"`
|
||||
Pricing []Price `db:"-"`
|
||||
}
|
||||
|
||||
type TrainingPrice struct {
|
||||
type Price struct {
|
||||
Amount decimal.Decimal
|
||||
Currency money.Currency
|
||||
Type TrainingPriceType
|
||||
Type PriceType
|
||||
}
|
||||
|
||||
type TrainingPriceType string
|
||||
type PriceType string
|
||||
|
||||
const (
|
||||
OpenTrainingPrice TrainingPriceType = "OPEN"
|
||||
CorporateTrainingPrice TrainingPriceType = "CORPORATE"
|
||||
OpenTrainingPrice PriceType = "OPEN"
|
||||
CorporateTrainingPrice PriceType = "CORPORATE"
|
||||
)
|
||||
|
||||
type TrainingDateID = int
|
||||
type DateID = int
|
||||
|
||||
type TrainingDate struct {
|
||||
trainingID TrainingID
|
||||
type Date struct {
|
||||
trainingID ID
|
||||
|
||||
ID TrainingDateID
|
||||
ID DateID
|
||||
Date time.Time
|
||||
StartTime time.Time
|
||||
Days int8
|
||||
|
|
@ -46,12 +46,12 @@ type TrainingDate struct {
|
|||
PriceCurrency money.Currency `db:"price_currency"`
|
||||
}
|
||||
|
||||
type TrainingDateAttendeeID = int
|
||||
type AttendeeID = int
|
||||
|
||||
type TrainingDateAttendee struct {
|
||||
trainingDateID TrainingDateID
|
||||
type Attendee struct {
|
||||
trainingDateID DateID
|
||||
|
||||
ID TrainingDateAttendeeID
|
||||
ID AttendeeID
|
||||
Name string
|
||||
Email string
|
||||
Phone string
|
||||
|
|
|
|||
Reference in a new issue