Update VSTP Types

This commit is contained in:
Fred Boniface 2024-04-24 22:11:22 +01:00
parent 4cbfa28c72
commit cbaac44f96
2 changed files with 46 additions and 42 deletions

View File

@ -55,21 +55,6 @@ type JsonScheduleV1 struct {
ScheduleSegment CifScheduleSegment `json:"schedule_segment"`
}
// VSTP Version of the JsonScheduleV1 type
type JsonScheduleV1vstp struct {
TransactionType string `json:"transaction_type"`
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"`
ScheduleDaysRun string `json:"schedule_days_runs"`
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"`

View File

@ -6,41 +6,60 @@ type MsgData struct {
}
type VstpMsg struct {
CIFMsg JsonScheduleV1vstp `json:"schedule,omitempty"`
CIFMsg VSTPSchedule `json:"schedule,omitempty"`
}
// Redundant Types:
type Schedule struct {
TransactionType string `json:"transaction_type,omitempty"`
ScheduleStartDate string `json:"schedule_start_date,omitempty"`
ScheduleEndDate string `json:"schedule_end_date,omitempty"`
ScheduleDaysRun string `json:"schedule_days_runs,omitempty"`
CIFTrainUID string `json:"CIF_train_uid,omitempty"`
CIFSTPIndicator string `json:"CIF_stp_indicator,omitempty"`
ScheduleSegment []ScheduleSegment `json:"schedule_segment,omitempty"`
// VSTP Version of the JsonScheduleV1 type
type VSTPSchedule struct {
TransactionType string `json:"transaction_type"`
CifBankHolidayRunning string `json:"CIF_bank_holiday_running"`
CifStpIndicator string `json:"CIF_stp_indicator"`
CifTrainUid string `json:"CIF_train_uid"`
ApplicableTimetable string `json:"applicable_timetable"`
ScheduleDaysRun string `json:"schedule_days_runs"`
ScheduleStartDate string `json:"schedule_start_date"`
ScheduleEndDate string `json:"schedule_end_date"`
ScheduleSegment []VSTPScheduleSegment `json:"schedule_segment"`
}
type ScheduleSegment struct {
SignallingID string `json:"signalling_id,omitempty"`
ATOCCode string `json:"atoc_code,omitempty"`
CIFTrainCategory string `json:"CIF_train_category,omitempty"`
CIFHeadcode string `json:"CIF_headcode,omitempty"`
CIFPowerType string `json:"CIF_power_type,omitempty"`
CIFSpeed string `json:"CIF_speed,omitempty"`
ScheduleLocation []ScheduleLocation `json:"schedule_location,omitempty"`
// Part of the VSTPSchedule type
type VSTPScheduleSegment struct {
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"`
}
type ScheduleLocation struct {
ScheduledArrivalTime string `json:"scheduled_arrival_time,omitempty"`
ScheduledDepartureTime string `json:"scheduled_departure_time,omitempty"`
ScheduledPassTime string `json:"scheduled_pass_time,omitempty"`
PublicArrivalTime string `json:"public_arrival_time,omitempty"`
PublicDepartureTime string `json:"public_departure_time,omitempty"`
CIFPlatform string `json:"CIF_platform,omitempty"`
CIFLine string `json:"CIF_line,omitempty"`
Tiploc LocationTiploc `json:"location,omitempty"`
// Part of the VSTPScheduleSegment type
type VSTPScheduleLocation struct {
Arrival string `json:"scheduled_arrival_time"`
PublicArrival string `json:"public_arrival_time"`
Departure string `json:"scheduled_departure_time"`
PublicDeparture string `json:"public_departure_time"`
Pass string `json:"scheduled_pass_time"`
Path string `json:"CIF_path"`
Platform string `json:"CIF_platform"`
Line string `json:"CIF_line"`
EngineeringAllowance string `json:"CIF_engineering_allowance"`
PathingAllowance string `json:"CIF_pathing_allowance"`
PerformanceAllowance string `json:"CIF_performance_allowance"`
Location LocationTiploc `json:"location"`
}
// Part of the VSTPScheduleLocaiton type
type LocationTiploc struct {
Tiploc struct {
TiplocId string `json:"tiploc_id,omitempty"`