diff --git a/src/Services/Location/Locations.API/Infrastructure/LocationsContextSeed.cs b/src/Services/Location/Locations.API/Infrastructure/LocationsContextSeed.cs index 05acfe0b8..b26054d35 100644 --- a/src/Services/Location/Locations.API/Infrastructure/LocationsContextSeed.cs +++ b/src/Services/Location/Locations.API/Infrastructure/LocationsContextSeed.cs @@ -24,6 +24,7 @@ { await SetIndexes(); await SetUSLocations(); + await SetBarcelonaLocations(); } } @@ -81,6 +82,20 @@ await ctx.Locations.InsertOneAsync(rdm); } + static async Task SetBarcelonaLocations() + { + var bcn = new Locations() + { + Code = "BCN", + Description = "Barcelona", + LocationId = 5 + }; + bcn.SetLocation(2.156453, 41.395226); + bcn.SetArea(GetBarcelonaPoligon()); + await ctx.Locations.InsertOneAsync(bcn); + } + + static async Task SetIndexes() { // Set location indexes @@ -141,5 +156,17 @@ new GeoJson2DGeographicCoordinates(-124.68633, 48.8943) }; } + + static List GetBarcelonaPoligon() + { + return new List() + { + new GeoJson2DGeographicCoordinates(2.113741, 41.419068), + new GeoJson2DGeographicCoordinates(2.188778, 41.451153), + new GeoJson2DGeographicCoordinates(2.235266, 41.418033), + new GeoJson2DGeographicCoordinates(2.137101, 41.299536), + new GeoJson2DGeographicCoordinates(2.033879, 41.383858) + }; + } } }