# Refactor: move inline DTOs from Program.cs to Common/DTO

**Task**: AZ-369_refactor_move_inline_dtos
**Name**: Relocate inline DTOs and Swagger filter
**Description**: Move six DTOs from `Program.cs` to `SatelliteProvider.Common/DTO/`; move `ParameterDescriptionFilter` to `SatelliteProvider.Api/Swagger/`.
**Complexity**: 2 points
**Dependencies**: None
**Component**: Api + Common
**Tracker**: AZ-369
**Epic**: AZ-350

## Problem

`SatelliteProvider.Api/Program.cs:272-353` declares six DTOs (`GetSatelliteTilesResponse`, `SatelliteTile`, `UploadImageRequest`, `SaveResult`, `DownloadTileResponse`, `RequestRegionRequest`) and one Swagger filter (`ParameterDescriptionFilter`) at the bottom of the API host file. SRP: the host file should only wire endpoints; data shapes belong in `Common/DTO/`.

## Outcome

- `Program.cs` no longer declares any DTOs or Swagger filters.
- Six DTOs live in `SatelliteProvider.Common/DTO/`.
- `ParameterDescriptionFilter` lives in `SatelliteProvider.Api/Swagger/ParameterDescriptionFilter.cs`.
- Public OpenAPI shape unchanged; only namespaces change.
- 37 unit + 5 smoke tests stay green.

## Scope

### Included
- Move each DTO to its own file under `SatelliteProvider.Common/DTO/`.
- Move `ParameterDescriptionFilter` to `SatelliteProvider.Api/Swagger/`.
- Update `using` directives in `Program.cs` and any tests that consume the DTOs.

### Excluded
- Changing the DTO field names, types, or order.
- Changing the OpenAPI metadata.

## Acceptance Criteria

**AC-1: Program.cs is endpoint-only**
Given the post-refactor `Program.cs`
When inspected
Then it contains no top-level type declarations beyond endpoint wiring.

**AC-2: OpenAPI shape unchanged**
Given the generated `swagger.json`
When diffed against the pre-refactor version
Then no fields are added, removed, or reordered.

**AC-3: Tests stay green**
Given the post-refactor build
When `scripts/run-tests.sh --smoke` runs
Then all 37 unit + 5 smoke scenarios pass.

## Constraints

- DTO names and shapes preserved.

## Risks & Mitigation

**Risk 1: System.Text.Json source-gen sees a namespace change**
- *Risk*: STJ `[JsonSerializable]` attributes (if any) may need updating.
- *Mitigation*: grep for any `JsonSerializable` referencing the moved types and update.

Full change entry: `_docs/04_refactoring/03-code-quality-refactoring/list-of-changes.md` (C16).
