# HG changeset patch # User Sascha Wilde # Date 1570199982 -7200 # Node ID 9b1e5a3ed3ccca1b4659eb92c6f5b6f4afbbcb27 # Parent 7caf620dda50ebf9b5adc33832ccd8d03855a525 FA import: if no LOS is provided assume LOS3. Near the black sea no LOS is provided with available fairway depth data, as the conditions (and requirements) are actually _better_ than LOS3. For gemma it is acceptable to assume LOS3 for these cases to fit into the requirement of given a LOS so that current reports and calculations work. diff -r 7caf620dda50 -r 9b1e5a3ed3cc pkg/imports/fa.go --- a/pkg/imports/fa.go Fri Oct 04 11:58:37 2019 +0200 +++ b/pkg/imports/fa.go Fri Oct 04 16:39:42 2019 +0200 @@ -300,6 +300,8 @@ feedback Feedback, ) ([]string, error) { + default_los := ifaf.LosEnumLOS3 + insertFAStmt, err := tx.PrepareContext(ctx, insertFASQL) if err != nil { return nil, err @@ -371,7 +373,10 @@ if faRes.Effective_fairway_availability != nil { efaCount := 0 for _, efa := range faRes.Effective_fairway_availability.EffectiveFairwayAvailability { - los := efa.Level_of_Service + los := &default_los + if efa.Level_of_Service != nil { + los = efa.Level_of_Service + } fgt := efa.Forecast_generation_time if efa.Forecast_generation_time.Status == pgtype.Undefined { fgt = pgtype.Timestamp{ @@ -407,10 +412,14 @@ if faRes.Reference_values != nil { rvCount := 0 for _, fav := range faRes.Reference_values.ReferenceValue { + los := &default_los + if fav.Level_of_Service != nil { + los = fav.Level_of_Service + } res, err := insertFAVStmt.ExecContext( ctx, faID, - fav.Level_of_Service, + los, fav.Fairway_depth, fav.Fairway_width, fav.Fairway_radius,