diff --git a/pkg/database/timetable.go b/pkg/database/timetable.go index d698086..38c4740 100644 --- a/pkg/database/timetable.go +++ b/pkg/database/timetable.go @@ -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