Fix PIS 'toc' and remove deduplication step
All checks were successful
Go Test / test (push) Successful in 58s

This commit is contained in:
Fred Boniface 2024-11-13 10:22:42 +00:00
parent d35a2a010e
commit 488551e914
3 changed files with 7 additions and 6 deletions

View File

@ -5,7 +5,7 @@ import (
) )
// Version Constants // Version Constants
const versionNum string = "2024.11.3" const versionNum string = "2024.11.4"
const versionSuffix string = "" const versionSuffix string = ""
const Version string = versionNum + versionSuffix const Version string = versionNum + versionSuffix

View File

@ -25,12 +25,13 @@ func processYaml(yamlStr string) (*[]database.PIS, error) {
return nil, fmt.Errorf("failed to unmarshal YAML: %v", err) return nil, fmt.Errorf("failed to unmarshal YAML: %v", err)
} }
/* DISABLE DEDUPLICATION - Add 'dupe' flag and have backend handle duplicates?
// Perform deduplication on the entire pis slice // Perform deduplication on the entire pis slice
err = deduplicateCodes(&pisData.Pis) err = deduplicateCodes(&pisData.Pis)
if err != nil { if err != nil {
return nil, err return nil, err
} }
*/
documents, err := convertPisForDatabase(&pisData.Pis) documents, err := convertPisForDatabase(&pisData.Pis)
if err != nil { if err != nil {
return nil, err return nil, err
@ -71,7 +72,7 @@ func convertPisForDatabase(in *[]PisData) (*[]database.PIS, error) {
for _, code := range *in { for _, code := range *in {
var document database.PIS var document database.PIS
document.Code = code.Code document.Code = code.Code
document.Operator = code.Operator document.Operator = code.Toc
document.Stops = code.Stops document.Stops = code.Stops
document.Tiplocs = GetTiplocsFromCrs(code.Stops) document.Tiplocs = GetTiplocsFromCrs(code.Stops)

View File

@ -9,7 +9,7 @@ type GiteaReleaseData struct {
} }
type PisData struct { type PisData struct {
Code string `json:"code"` Code string `json:"code"`
Stops []string `json:"stops"` Stops []string `json:"stops"`
Operator string `json:"operator"` Toc string `json:"toc"`
} }