diff --git a/src/Services/Location/Locations.API/Infrastructure/LocationsContextSeed.cs b/src/Services/Location/Locations.API/Infrastructure/LocationsContextSeed.cs index 6f519f6b1..0c53582e3 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(); } } @@ -85,6 +86,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 @@ -145,5 +160,18 @@ new GeoJson2DGeographicCoordinates(-124.68633, 48.8943) }; } + + static List GetBarcelonaPoligon() + { + return new List() + { + new GeoJson2DGeographicCoordinates(2.033879, 41.383858), + 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) + }; + } } }