2024-03-31 21:45:34 +01:00
|
|
|
package upstreamApi
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
|
|
|
// Defines the first JSON line of a CIF file, containing metadata
|
|
|
|
type JsonTimetableV1 struct {
|
|
|
|
Classification string `json:"classification"`
|
|
|
|
Timestamp int64 `json:"timestamp"`
|
|
|
|
Owner string `json:"owner"`
|
|
|
|
Sender TimetableSender `json:"Sender"`
|
|
|
|
Metadata TimetableMetadata `json:"Metadata"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// Part of the JsonTimetableV1 type
|
|
|
|
type TimetableSender struct {
|
|
|
|
Organisation string `json:"organisation"`
|
|
|
|
Application string `json:"application"`
|
|
|
|
Component string `json:"component"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// Part of the JsonTimetableV1 type
|
|
|
|
type TimetableMetadata struct {
|
|
|
|
Type string `json:"type"`
|
|
|
|
Sequence int64 `json:"sequence"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// Defines the JsonAssociation lines of a CIF File
|
|
|
|
type JsonAssociationV1 struct {
|
|
|
|
TransactionType string `json:"transaction_type"`
|
|
|
|
MainTrainUid string `json:"main_train_uid"`
|
|
|
|
AssocTrainUid string `json:"assoc_train_uid"`
|
|
|
|
AssocStartDate time.Time `json:"assoc_start_date"`
|
|
|
|
AssocEndDate time.Time `json:"assoc_end_date"`
|
|
|
|
Location string `json:"location"`
|
|
|
|
BaseLocationSuffix string `json:"base_location_suffix"`
|
|
|
|
DiagramType string `json:"diagram_type"`
|
|
|
|
AssocDays string `json:"assoc_days"`
|
|
|
|
Category string `json:"category"`
|
2024-03-31 21:49:22 +01:00
|
|
|
CifStpIndicator string `json:"CIF_stp_indicator"`
|
2024-03-31 21:45:34 +01:00
|
|
|
DateIndicator string `json:"date_indicator"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// Defined a schedule entry from a CIF File
|
|
|
|
type JsonScheduleV1 struct {
|
2024-04-05 20:49:33 +01:00
|
|
|
TransactionType string `json:"transaction_type"`
|
2024-03-31 21:45:34 +01:00
|
|
|
CifBankHolidayRunning string `json:"CIF_bank_holiday_running"`
|
|
|
|
CifStpIndicator string `json:"CIF_stp_indicator"`
|
|
|
|
CifTrainUid string `json:"CIF_train_uid"`
|
|
|
|
ApplicableTimetable string `json:"applicable_timetable"`
|
|
|
|
AtocCode string `json:"atoc_code"`
|
|
|
|
NewScheduleSegment ScheduleNewScheduleSegment `json:"new_schedule_segment"`
|
2024-04-16 19:43:37 +01:00
|
|
|
ScheduleDaysRun string `json:"schedule_days_runs"`
|
2024-03-31 21:45:34 +01:00
|
|
|
ScheduleStartDate string `json:"schedule_start_date"`
|
|
|
|
ScheduleEndDate string `json:"schedule_end_date"`
|
|
|
|
ScheduleSegment CifScheduleSegment `json:"schedule_segment"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// Part of the JsonScheduleV1 type
|
|
|
|
type ScheduleNewScheduleSegment struct {
|
|
|
|
TractionClass string `json:"traction_class"`
|
|
|
|
UidCode string `json:"uid_code"`
|
|
|
|
}
|
|
|
|
|
2024-04-24 22:59:56 +01:00
|
|
|
// Part of the JsonScheduleV1 type - Not used keys commented out
|
2024-03-31 21:45:34 +01:00
|
|
|
type CifScheduleSegment struct {
|
2024-04-24 22:59:56 +01:00
|
|
|
SignallingId string `json:"signalling_id"`
|
|
|
|
CifTrainCategory string `json:"CIF_train_category"`
|
|
|
|
CifHeadcode string `json:"CIF_headcode"`
|
|
|
|
// CifCourseIndicator int64 `json:"CIF_course_indicator"`
|
|
|
|
CifTrainServiceCode string `json:"CIF_train_service_code"`
|
|
|
|
CifBusinessSector string `json:"CIF_business_sector"`
|
|
|
|
CifPowerType string `json:"CIF_power_type"`
|
|
|
|
CifTimingLoad string `json:"CIF_timing_load"`
|
|
|
|
CifSpeed string `json:"CIF_speed"`
|
|
|
|
CifOperatingCharacteristics string `json:"CIF_operating_characteristics"`
|
|
|
|
CifTrainClass string `json:"CIF_train_class"`
|
|
|
|
CifSleepers string `json:"CIF_sleepers"`
|
|
|
|
CifReservations string `json:"CIF_reservations"`
|
|
|
|
// CifConnectionIndicator string `json:"CIF_connection_indicator"`
|
|
|
|
CifCateringCode string `json:"CIF_catering_code"`
|
|
|
|
// CifServiceBranding string `json:"CIF_service_branding"`
|
|
|
|
ScheduleLocation []CifScheduleLocation `json:"schedule_location"`
|
2024-03-31 21:45:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Part of the CifScheduleSegment type
|
|
|
|
type CifScheduleLocation struct {
|
|
|
|
LocationType string `json:"location_type"`
|
|
|
|
RecordIdentity string `json:"record_identity"`
|
|
|
|
TiplocCode string `json:"tiploc_code"`
|
|
|
|
TiplocInstance string `json:"tiploc_instance"`
|
|
|
|
Arrival string `json:"arrival"`
|
|
|
|
PublicArrival string `json:"public_arrival"`
|
|
|
|
Departure string `json:"departure"`
|
|
|
|
PublicDeparture string `json:"public_departure"`
|
|
|
|
Pass string `json:"pass"`
|
|
|
|
Path string `json:"path"`
|
|
|
|
Platform string `json:"platform"`
|
|
|
|
Line string `json:"line"`
|
|
|
|
EngineeringAllowance string `json:"engineering_allowance"`
|
|
|
|
PathingAllowance string `json:"pathing_allowance"`
|
|
|
|
PerformanceAllowance string `json:"performance_allowance"`
|
|
|
|
}
|