go-types/pkg/database/timetable.go

50 lines
1.8 KiB
Go

package database
import (
"time"
)
type Stop struct {
PublicDeparture string `json:"publicDeparture,omitempty"`
WttDeparture string `json:"wttDeparture,omitempty"`
PublicArrival string `json:"publicArrival,omitempty"`
WttArrival string `json:"wttArrival,omitempty"`
IsPublic bool `json:"isPublic"` // Ensure omitempty is not set
Tiploc string `json:"tiploc,omitempty"`
Pass string `json:"pass,omitempty"`
Platform string `json:"platform,omitempty"`
ArrLine string `json:"arrLine,omitempty"`
DepLine string `json:"depLine,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
type ServiceDetail struct {
FirstClass bool `json:"firstClass"`
Catering bool `json:"catering"`
Sleeper bool `json:"sleeper"`
Vstp bool `json:"vstp"`
Guard bool `json:"guard"`
}
type DeleteQuery struct {
TrainUid string `json:"trainUid"`
ScheduleStartDate time.Time `json:"scheduleStartDate"`
StpIndicator string `json:"stpIndicator"`
}