From ab34be5063a4ed8aa0b278dc73afaf439d26ef45 Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Thu, 2 May 2024 14:37:18 +0100 Subject: [PATCH] Add PIS and ReasonCode types --- pkg/database/pis.go | 8 ++++++++ pkg/database/reasonCodes.go | 7 +++++++ pkg/upstreamApi/pis.go | 7 +++++++ pkg/upstreamApi/reasonCodes.go | 15 +++++++++++++++ 4 files changed, 37 insertions(+) create mode 100644 pkg/database/pis.go create mode 100644 pkg/database/reasonCodes.go create mode 100644 pkg/upstreamApi/pis.go create mode 100644 pkg/upstreamApi/reasonCodes.go diff --git a/pkg/database/pis.go b/pkg/database/pis.go new file mode 100644 index 0000000..f568479 --- /dev/null +++ b/pkg/database/pis.go @@ -0,0 +1,8 @@ +package database + +type PIS struct { + Code string `json:"code"` + Stops []string `json:"stops"` + Tiplocs []string `json:"tiplocs"` + Operator string `json:"operator"` +} diff --git a/pkg/database/reasonCodes.go b/pkg/database/reasonCodes.go new file mode 100644 index 0000000..b48cc6e --- /dev/null +++ b/pkg/database/reasonCodes.go @@ -0,0 +1,7 @@ +package database + +type ReasonCode struct { + Code string `json:"code"` + Late string `json:"lateReason"` + Cancel string `json:"cancReason"` +} diff --git a/pkg/upstreamApi/pis.go b/pkg/upstreamApi/pis.go new file mode 100644 index 0000000..4092f9d --- /dev/null +++ b/pkg/upstreamApi/pis.go @@ -0,0 +1,7 @@ +package upstreamApi + +type PIS struct { + Code string `json:"code"` + Stops []string `json:"stops"` + Operator string `json:"operator,omitempty"` +} diff --git a/pkg/upstreamApi/reasonCodes.go b/pkg/upstreamApi/reasonCodes.go new file mode 100644 index 0000000..300e5d1 --- /dev/null +++ b/pkg/upstreamApi/reasonCodes.go @@ -0,0 +1,15 @@ +package upstreamApi + +type ReasonCodeObject struct { + GetReasonCodeListResult Reasons `json:"GetReasonCodeListResult"` +} + +type Reasons struct { + ReasonList []ReasonCode `json:"reason"` +} + +type ReasonCode struct { + Code string `json:"code"` + Late string `json:"lateReason"` + Cancel string `json:"cancReason"` +}