Update service to use service ddetail struct

This commit is contained in:
Fred Boniface 2024-04-21 23:01:20 +01:00
parent 9686d0d660
commit 1fc6bf03c3

View File

@ -17,22 +17,20 @@ type Stop struct {
DepLine string `json:"depLine,omitempty"`
}
type Service struct { // Consider including catering, train class etc. here too.
TransactionType string `json:"transactionType,omitempty"`
StpIndicator string `json:"stpIndicator,omitempty"`
Vstp bool `json:"vstp"`
Operator string `json:"operator,omitempty"`
TrainUid string `json:"trainUid,omitempty"`
Headcode string `json:"headcode,omitempty"`
PowerType string `json:"powerType,omitempty"`
PlanSpeed int32 `json:"planSpeed,omitempty"`
ScheduleStartDate time.Time `json:"scheduleStartDate,omitempty"`
ScheduleEndDate time.Time `json:"scheduleEndDate,omitempty"`
FirstClass bool `json:"firstClass"` // Ensure omitempty is not set
Catering bool `json:"catering"` // Ensure omitempty is not set
Sleeper bool `json:"sleeper"` // Ensure omitempty is not set
DaysRun []string `json:"daysRun,omitempty"`
Stops []Stop `json:"stops,omitempty"`
// Defined the Database Document format
type Service struct {
TransactionType string `json:"transactionType,omitempty"`
StpIndicator string `json:"stpIndicator,omitempty"`
Operator string `json:"operator,omitempty"`
TrainUid string `json:"trainUid,omitempty"`
Headcode string `json:"headcode,omitempty"`
PowerType string `json:"powerType,omitempty"`
PlanSpeed int32 `json:"planSpeed,omitempty"`
ScheduleStartDate time.Time `json:"scheduleStartDate,omitempty"`
ScheduleEndDate time.Time `json:"scheduleEndDate,omitempty"`
ServiceDetail ServiceDetail `json:"serviceDetail"`
DaysRun []string `json:"daysRun,omitempty"`
Stops []Stop `json:"stops,omitempty"`
}
// Contains service detail booleans