# Testability Changes Summary

## Applied Changes

### TC-01: Moved DownloadedTileInfoV2 to Common/DTO
- **Created**: `SatelliteProvider.Common/DTO/DownloadedTileInfoV2.cs`
- **Created**: `SatelliteProvider.Common/DTO/ExistingTileInfo.cs`
- **Modified**: `SatelliteProvider.Services/GoogleMapsDownloaderV2.cs` — removed inline record definition, added import
- **Why**: The return type of the downloader must be accessible from the interface in Common

### TC-02: Updated ISatelliteDownloader interface
- **Modified**: `SatelliteProvider.Common/Interfaces/ISatelliteDownloader.cs`
- **Old API**: `Task GetTiles(GeoPoint, double, int, CancellationToken)` — never implemented, dead code
- **New API**: `DownloadSingleTileAsync(...)` + `GetTilesWithMetadataAsync(...)` — matches actual usage
- **Why**: Previous interface was dead code; new interface enables mocking the downloader in tests

### TC-03: GoogleMapsDownloaderV2 implements ISatelliteDownloader
- **Modified**: `SatelliteProvider.Services/GoogleMapsDownloaderV2.cs`
- **Change**: Class declaration now includes `: ISatelliteDownloader`; `GetTilesWithMetadataAsync` parameter changed from `IEnumerable<TileEntity>` to `IEnumerable<ExistingTileInfo>`
- **Why**: Concrete class must implement the interface for DI and mocking to work

### TC-04: TileService depends on ISatelliteDownloader
- **Modified**: `SatelliteProvider.Services/TileService.cs`
- **Change**: Constructor parameter and field type changed from `GoogleMapsDownloaderV2` to `ISatelliteDownloader`; added mapping from `TileEntity` to `ExistingTileInfo` before calling the interface
- **Why**: Unit tests can now mock the downloader via the interface

### TC-05: Updated DI registration and API endpoints
- **Modified**: `SatelliteProvider.Api/Program.cs`
- **Changes**:
  - DI: `AddSingleton<GoogleMapsDownloaderV2>()` → `AddSingleton<ISatelliteDownloader, GoogleMapsDownloaderV2>()`
  - `ServeTile` endpoint: parameter `GoogleMapsDownloaderV2 downloader` → `ISatelliteDownloader downloader`
  - `GetTileByLatLon` endpoint: parameter `GoogleMapsDownloaderV2 downloader` → `ISatelliteDownloader downloader`
- **Why**: Endpoints should inject the interface, not the concrete class

## Deferred to Step 8

- ServeTile and GetTileByLatLon endpoints bypass the service layer (inject repository + downloader directly)
- No physical project boundaries between logical components in the Services project
