# Refactor: split SatelliteProvider.Services into per-component csprojs

**Task**: AZ-312_refactor_split_services_csprojs
**Name**: Split Services into TileDownloader + RegionProcessing + RouteManagement
**Description**: Replace the single `SatelliteProvider.Services` csproj with three per-component csprojs to add a compiler-enforced module boundary.
**Complexity**: 5 points
**Dependencies**: AZ-311
**Component**: All Services components
**Tracker**: AZ-312
**Epic**: AZ-309

## Problem

`SatelliteProvider.Services.csproj` packs three logical components (TileDownloader, RegionProcessing, RouteManagement) into one project. No compiler-enforced boundary prevents accidental cross-component coupling. This is architecture baseline finding F4 (Medium).

## Outcome

- Three new csprojs exist:
  - `SatelliteProvider.Services.TileDownloader/SatelliteProvider.Services.TileDownloader.csproj`
  - `SatelliteProvider.Services.RegionProcessing/SatelliteProvider.Services.RegionProcessing.csproj`
  - `SatelliteProvider.Services.RouteManagement/SatelliteProvider.Services.RouteManagement.csproj`
- Seven source files moved into the matching project.
- `SatelliteProvider.Services.csproj` deleted.
- Each new csproj `ProjectReference`s only what it needs.
- Solution file `SatelliteProvider.sln` updated.

## Scope

### Included
- File moves:
  - `TileService.cs`, `GoogleMapsDownloaderV2.cs` → `SatelliteProvider.Services.TileDownloader/`
  - `RegionService.cs`, `RegionProcessingService.cs`, `RegionRequestQueue.cs` → `SatelliteProvider.Services.RegionProcessing/`
  - `RouteService.cs`, `RouteProcessingService.cs` → `SatelliteProvider.Services.RouteManagement/`
- Namespace changes:
  - `SatelliteProvider.Services` → `SatelliteProvider.Services.TileDownloader` (in TileService, GoogleMapsDownloaderV2)
  - `SatelliteProvider.Services` → `SatelliteProvider.Services.RegionProcessing` (in three Region* files)
  - `SatelliteProvider.Services` → `SatelliteProvider.Services.RouteManagement` (in two Route* files)
- Add `ProjectReference` entries in each new csproj as required by its members.
- Delete `SatelliteProvider.Services/` directory once empty.
- Update `SatelliteProvider.sln` (add new projects, remove old).

### Excluded
- Updating consumers (Tests, IntegrationTests, Api csprojs and their `using` directives) — those go in AZ-313 and AZ-314.
- Any logic change inside the moved files.

## Acceptance Criteria

**AC-1: Three new csprojs exist with correct contents**
Given the post-refactor tree
When listing the new csproj directories
Then each contains only the files listed in the `Included` section, plus its csproj file.

**AC-2: Old project deleted**
Given the post-refactor tree
When searching for `SatelliteProvider.Services.csproj` or `SatelliteProvider.Services/` directory
Then neither exists.

**AC-3: Solution-level build succeeds with the new csprojs unreferenced**
Given the new csprojs exist but no consumer has been updated yet
When `dotnet build SatelliteProvider.sln` is run
Then build fails ONLY for the unreferenced consumers (Api, Tests, IntegrationTests). The three new csprojs themselves compile clean.

**AC-4: No cross-component reference between the three new csprojs**
Given the three new csproj files
When inspecting their `ProjectReference` entries
Then none of TileDownloader, RegionProcessing, or RouteManagement references another of the three. They all reference only `SatelliteProvider.Common` and (where needed) `SatelliteProvider.DataAccess`.

## Constraints

- No code logic changes inside the moved files.
- Namespaces follow `SatelliteProvider.Services.<Component>` pattern.
- Existing public API of `ITileService`, `IRegionService`, `IRouteService`, `IRegionRequestQueue` (in Common) unchanged.

## Risks & Mitigation

**Risk 1: Hidden cross-component coupling**
- *Risk*: A move reveals that a Region* class actually `using SatelliteProvider.Services` for a TileDownloader-only type.
- *Mitigation*: If found, the cleanest fix is to lift the shared type into `SatelliteProvider.Common` (extend in this task) or add a `ProjectReference` (last resort, document why). Stop and ask if this surfaces.

**Risk 2: SatelliteProvider.sln drift**
- *Risk*: Forgetting to update the solution file leaves the new csprojs invisible to Docker/CI.
- *Mitigation*: Use `dotnet sln add` and `dotnet sln remove` exactly once for each project; assert via `dotnet sln list`.
