models

package
v0.0.0-...-a247b90 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2021 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TicketMappings = map[TicketCode]TicketType{
	"0AQ": WeeklyStd,
	"0AS": WeeklyStd,
	"7DS": WeeklyStd,
	"7TS": WeeklyZ16TCStd,
}

Functions

This section is empty.

Types

type FareData

type FareData struct {
	gorm.Model
	FlowID          uint
	TicketCode      string
	Fare            uint
	RestrictionCode string
}

FareData maps directly to rows in the fare table

func (FareData) TableName

func (FareData) TableName() string

type FareDetail

type FareDetail struct {
	gorm.Model
	FlowID          uint   `header:"flowId"`
	TicketCode      string `header:"ticket_code"`
	Fare            uint   `header:"fare"`
	RestrictionCode string `header:"restriction_code"`
	// LEFT JOINed from ticket_type
	TicketDescription string `header:"tkt_desc"`
	TicketClass       uint   `header:"tkt_class"`
	TicketType        string `header:"tkt_type"`
	// LEFT JOINed from restriction_header
	RestrictionDesc    string `header:"restriction_desc"`
	RestrictionDescOut string `header:"restriction_desc_out"`
	RestrictionDescRtn string `header:"restriction_desc_rtn"`
}

FareDetail contains the base of FareData, with additional columns LEFT JOINed from ticket_type table

type FareDetailExtreme

type FareDetailExtreme struct {
	gorm.Model
	FlowID          uint   `header:"flow_id"`
	OriginCode      string `header:"origin_code"`
	OriginName      string `header:"origin_name"`
	DestinationCode string `header:"destination_code"`
	DestinationName string `header:"destination_name"`
	RouteCode       string `header:"route_code"`
	RouteDesc       string `header:"route_desc"`
	RouteAaaDesc    string `header:"route_aaa_desc"`
	StatusCode      string `header:"status_code"`
	UsageCode       string `header:"usage_code"`
	TOC             string `header:"toc"`
	FareID          string `header:"fare_id"`
	TicketCode      string `header:"ticket_code"`
	TicketDesc      string `header:"tkt_desc"`
	TicketClass     uint   `header:"tkt_class"`
	TicketType      string `header:"tkt_type"`
	AdultFare       uint   `header:"adult_fare"`
	ChildFare       uint   `header:"child_fare"`
	RestrictionCode string `header:"restriction_code"`
	RestrictionDesc string `header:"restriction_desc"`
}

FareDetailExtreme has all the fields I think we'll need to hit the db just once

type FlowData

type FlowData struct {
	gorm.Model
	FlowID          string
	OriginCode      string
	DestinationCode string
	RouteCode       string
	Direction       string
	StartDate       *time.Time
	EndDate         *time.Time
}

FareData maps directly to records in the flow table

func (FlowData) TableName

func (FlowData) TableName() string

type FlowDetail

type FlowDetail struct {
	gorm.Model
	FlowID          string
	OriginCode      string
	DestinationCode string
	Direction       string
	StartDate       *time.Time
	EndDate         *time.Time
	RouteCode       string
	// Left Join route
	RouteDesc string
}

type LocationData

type LocationData struct {
	gorm.Model
	UIC         string `gorm:"column:uic"`
	NLC         string
	CRS         string
	FareGroup   string
	Description string
	StartDate   *time.Time
	EndDate     *time.Time
}

LocationData represents the records in location table

func (LocationData) TableName

func (LocationData) TableName() string

type LocationGroup

type LocationGroup struct {
	UIC         string
	Description string
}

LocationGroup contains fields pulled from the subquery method

type LocationGroupData

type LocationGroupData struct {
	gorm.Model
	GroupUICCode string
	Description  string
	ERSCountry   string
	ERSCode      string
	StartDate    *time.Time
	EndDate      *time.Time
	QuoteDate    *time.Time
}

func (LocationGroupData) TableName

func (LocationGroupData) TableName() string

type LocationGroupMemberData

type LocationGroupMemberData struct {
	gorm.Model
	GroupUICCode  string
	MemberUICCode string
	MemberCRSCode string
	StartDate     *time.Time
	EndDate       *time.Time
}

func (LocationGroupMemberData) TableName

func (LocationGroupMemberData) TableName() string

type LocationWithGroupData

type LocationWithGroupData struct {
	gorm.Model
	UIC              string `gorm:"column:uic"`
	NLC              string
	CRS              string
	FareGroup        string
	Description      string
	StartDate        *time.Time
	EndDate          *time.Time
	GroupUicCode     string
	GroupDescription string
}

LocationWithGroupData is the record the subquery method retrieves back

type LocationWithGroups

type LocationWithGroups struct {
	UIC         string
	NLC         string
	CRS         string
	FareGroup   string
	Description string
	StartDate   *time.Time
	EndDate     *time.Time
	Groups      []*LocationGroup
}

LocationWithGroups is a flattened struct from LocationWithGroupData

func (LocationWithGroups) IsGroupedStation

func (l LocationWithGroups) IsGroupedStation() bool

type TicketCode

type TicketCode string

type TicketType

type TicketType int
const (
	Unknown TicketType = iota
	WeeklyStd
	WeeklyZ16TCStd
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL