[AZ-372] Apply dotnet format whitespace cleanup; archive batch 22
ci/woodpecker/push/01-test Pipeline was successful
ci/woodpecker/push/02-build-push Pipeline was successful

Pure whitespace-only cleanup uncovered by the new format gate from the
previous commit. Verified via `git diff -w --stat`: only 4 files differ
when whitespace is ignored, and those differ only by the BOM byte.

Cleanup kinds applied across 22 source files:
- BOM removal (MapConfig.cs, SatTile.cs, GeoUtils.cs,
  IntegrationTests/Program.cs)
- CRLF -> LF (IntegrationTests/Program.cs)
- Trailing whitespace on blank lines (Common, Api, DataAccess,
  IntegrationTests, Services.RegionProcessing,
  Services.TileDownloader)
- Final newline added (RoutePoint.cs, GeoPoint.cs, others)

After this commit `dotnet format whitespace SatelliteProvider.sln
--verify-no-changes` exits 0; AC-1 is enforceable from `scripts/
run-tests.sh` going forward.

Also lands the batch 22 report, code-review report
(PASS_WITH_WARNINGS, 2 Low findings — both deferred per spec),
dependency-table status update (AZ-372 -> Done (In Testing)), task
archive (todo/ -> done/), and autodev state update.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-05-11 04:43:08 +03:00
parent 68359350fc
commit 534ab41b8e
28 changed files with 519 additions and 279 deletions
@@ -29,7 +29,7 @@ public class RegionRepository : IRegionRepository
created_at as CreatedAt, updated_at as UpdatedAt
FROM regions
WHERE id = @Id";
var region = await connection.QuerySingleOrDefaultAsync<RegionEntity>(sql, new { Id = id });
return region;
}
@@ -47,7 +47,7 @@ public class RegionRepository : IRegionRepository
FROM regions
WHERE status = @Status
ORDER BY created_at ASC";
return await connection.QueryAsync<RegionEntity>(sql, new { Status = status });
}
@@ -64,7 +64,7 @@ public class RegionRepository : IRegionRepository
@TilesDownloaded, @TilesReused, @StitchTiles,
@CreatedAt, @UpdatedAt)
RETURNING id";
return await connection.ExecuteScalarAsync<Guid>(sql, region);
}
@@ -85,7 +85,7 @@ public class RegionRepository : IRegionRepository
stitch_tiles = @StitchTiles,
updated_at = @UpdatedAt
WHERE id = @Id";
return await connection.ExecuteAsync(sql, region);
}
@@ -30,7 +30,7 @@ public class RouteRepository : IRouteRepository
created_at as CreatedAt, updated_at as UpdatedAt
FROM routes
WHERE id = @Id";
return await connection.QuerySingleOrDefaultAsync<RouteEntity>(sql, new { Id = id });
}
@@ -44,7 +44,7 @@ public class RouteRepository : IRouteRepository
FROM route_points
WHERE route_id = @RouteId
ORDER BY sequence_number";
var points = (await connection.QueryAsync<RoutePointEntity>(sql, new { RouteId = routeId })).ToList();
return points;
}
@@ -62,7 +62,7 @@ public class RouteRepository : IRouteRepository
@CreateTilesZip, @CsvFilePath, @SummaryFilePath, @StitchedImagePath,
@TilesZipPath, @CreatedAt, @UpdatedAt)
RETURNING id";
return await connection.ExecuteScalarAsync<Guid>(sql, route);
}
@@ -74,7 +74,7 @@ public class RouteRepository : IRouteRepository
point_type, segment_index, distance_from_previous, created_at)
VALUES (@Id, @RouteId, @SequenceNumber, @Latitude, @Longitude,
@PointType, @SegmentIndex, @DistanceFromPrevious, @CreatedAt)";
var pointsList = points.ToList();
await connection.ExecuteAsync(sql, pointsList);
}
@@ -99,7 +99,7 @@ public class RouteRepository : IRouteRepository
tiles_zip_path = @TilesZipPath,
updated_at = @UpdatedAt
WHERE id = @Id";
return await connection.ExecuteAsync(sql, route);
}
@@ -117,7 +117,7 @@ public class RouteRepository : IRouteRepository
INSERT INTO route_regions (route_id, region_id, is_geofence, geofence_polygon_index, created_at)
VALUES (@RouteId, @RegionId, @IsGeofence, @GeofencePolygonIndex, @CreatedAt)
ON CONFLICT (route_id, region_id) DO NOTHING";
await connection.ExecuteAsync(sql, new { RouteId = routeId, RegionId = regionId, IsGeofence = isGeofence, GeofencePolygonIndex = geofencePolygonIndex, CreatedAt = DateTime.UtcNow });
}
@@ -128,7 +128,7 @@ public class RouteRepository : IRouteRepository
SELECT region_id
FROM route_regions
WHERE route_id = @RouteId AND (is_geofence = false OR is_geofence IS NULL)";
return await connection.QueryAsync<Guid>(sql, new { RouteId = routeId });
}
@@ -139,7 +139,7 @@ public class RouteRepository : IRouteRepository
SELECT region_id
FROM route_regions
WHERE route_id = @RouteId AND is_geofence = true";
return await connection.QueryAsync<Guid>(sql, new { RouteId = routeId });
}
@@ -157,7 +157,7 @@ public class RouteRepository : IRouteRepository
created_at as CreatedAt, updated_at as UpdatedAt
FROM routes
WHERE request_maps = true AND maps_ready = false";
return await connection.QueryAsync<RouteEntity>(sql);
}
@@ -169,9 +169,9 @@ public class RouteRepository : IRouteRepository
FROM route_regions
WHERE route_id = @RouteId AND is_geofence = true AND geofence_polygon_index IS NOT NULL
ORDER BY geofence_polygon_index";
var results = await connection.QueryAsync<(Guid RegionId, int PolygonIndex)>(sql, new { RouteId = routeId });
var grouped = new Dictionary<int, List<Guid>>();
foreach (var (regionId, polygonIndex) in results)
{
@@ -181,7 +181,7 @@ public class RouteRepository : IRouteRepository
}
grouped[polygonIndex].Add(regionId);
}
return grouped;
}
}
@@ -27,7 +27,7 @@ public class TileRepository : ITileRepository
file_path as FilePath, created_at as CreatedAt, updated_at as UpdatedAt
FROM tiles
WHERE id = @Id";
return await connection.QuerySingleOrDefaultAsync<TileEntity>(sql, new { Id = id });
}
@@ -44,7 +44,7 @@ public class TileRepository : ITileRepository
WHERE tile_zoom = @TileZoom AND tile_x = @TileX AND tile_y = @TileY
ORDER BY updated_at DESC
LIMIT 1";
return await connection.QuerySingleOrDefaultAsync<TileEntity>(sql, new { TileZoom = tileZoom, TileX = tileX, TileY = tileY });
}
@@ -64,11 +64,11 @@ public class TileRepository : ITileRepository
AND tile_zoom = @TileZoom
AND version = @Version
LIMIT 1";
return await connection.QuerySingleOrDefaultAsync<TileEntity>(sql, new
{
Latitude = latitude,
Longitude = longitude,
return await connection.QuerySingleOrDefaultAsync<TileEntity>(sql, new
{
Latitude = latitude,
Longitude = longitude,
TileSizeMeters = tileSizeMeters,
TileZoom = zoomLevel,
Version = version
@@ -78,18 +78,18 @@ public class TileRepository : ITileRepository
public async Task<IEnumerable<TileEntity>> GetTilesByRegionAsync(double latitude, double longitude, double sizeMeters, int zoomLevel)
{
using var connection = new NpgsqlConnection(_connectionString);
const double EARTH_CIRCUMFERENCE_METERS = 40075016.686;
const int TILE_SIZE_PIXELS = 256;
var latRad = latitude * Math.PI / 180.0;
var metersPerPixel = (EARTH_CIRCUMFERENCE_METERS * Math.Cos(latRad)) / (Math.Pow(2, zoomLevel) * TILE_SIZE_PIXELS);
var tileSizeMeters = metersPerPixel * TILE_SIZE_PIXELS;
var expandedSizeMeters = sizeMeters + (tileSizeMeters * 2);
var latRange = expandedSizeMeters / 111000.0;
var lonRange = expandedSizeMeters / (111000.0 * Math.Cos(latitude * Math.PI / 180.0));
const string sql = @"
SELECT id, tile_zoom as TileZoom, tile_x as TileX, tile_y as TileY,
latitude, longitude,
@@ -101,7 +101,7 @@ public class TileRepository : ITileRepository
AND longitude BETWEEN @MinLon AND @MaxLon
AND tile_zoom = @TileZoom
ORDER BY latitude DESC, longitude ASC, updated_at DESC";
return await connection.QueryAsync<TileEntity>(sql, new
{
MinLat = latitude - latRange / 2,
@@ -129,7 +129,7 @@ public class TileRepository : ITileRepository
tile_y = EXCLUDED.tile_y,
updated_at = EXCLUDED.updated_at
RETURNING id";
return await connection.ExecuteScalarAsync<Guid>(sql, tile);
}
@@ -151,7 +151,7 @@ public class TileRepository : ITileRepository
file_path = @FilePath,
updated_at = @UpdatedAt
WHERE id = @Id";
return await connection.ExecuteAsync(sql, tile);
}