Skip to content

Commit

Permalink
stop update
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronClaydon committed Dec 17, 2024
1 parent 40e4673 commit 9d032e2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/ctdf/stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ type Stop struct {
DataSource *DataSourceReference `groups:"detailed" bson:",omitempty"`

PrimaryName string `groups:"basic,search,search-llm,stop-llm" bson:",omitempty"`
Descriptor string `groups:"basic" bson:",omitempty"`
Descriptor string `groups:"basic,search" bson:",omitempty"`
TransportTypes []TransportType `groups:"detailed,search,search-llm,stop-llm" bson:",omitempty"`

Timezone string `groups:"basic" bson:",omitempty"`

Location *Location `groups:"basic,stop-llm" bson:",omitempty"`

Services []*Service `bson:"-" groups:"basic,search,search-llm,stop-llm" bson:",omitempty"`
Services []*Service `bson:"-" groups:"basic,search,search-llm,stop-llm"`

Active bool `groups:"basic" bson:",omitempty"`

Expand Down
9 changes: 7 additions & 2 deletions pkg/dataimporter/formats/naptan/stop_point.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"time"

"github.com/travigo/travigo/pkg/ctdf"
"github.com/travigo/travigo/pkg/util"
)

type StopPoint struct {
Expand Down Expand Up @@ -165,11 +166,15 @@ func (orig *StopPoint) ToCTDF() *ctdf.Stop {

var descriptor []string

if orig.Descriptor.Indicator != "" && orig.Descriptor.Indicator != "--" {
if util.ContainsString([]string{
"", "-", "--", "unknown",
}, strings.ToLower(orig.Descriptor.Indicator)) {
descriptor = append(descriptor, orig.Descriptor.Indicator)
}

if orig.Descriptor.Landmark != "" && orig.Descriptor.Landmark != "--" {
if util.ContainsString([]string{
"", "-", "--", "unknown",
}, strings.ToLower(orig.Descriptor.Landmark)) {
descriptor = append(descriptor, orig.Descriptor.Landmark)
}

Expand Down

0 comments on commit 9d032e2

Please sign in to comment.