mirror of
https://github.com/azaion/satellite-provider.git
synced 2026-06-21 20:41:15 +00:00
b0fffa6d42
Phase A baseline outputs from /autodev (Steps 1-5): - Problem & solution docs (_docs/00_problem, _docs/01_solution) - Codebase documentation (_docs/02_document) incl. architecture, module-layout, glossary, system-flows, baseline compliance scan - Test specs (blackbox, performance, resilience, security, resource, traceability matrix) - Test task decomposition (_docs/02_tasks/todo): AZ-285..AZ-290 - Testability refactor (_docs/04_refactoring/01-testability-refactoring): - TC-01 Move DownloadedTileInfoV2 + new ExistingTileInfo to Common.DTO - TC-02 Replace dead ISatelliteDownloader API with real signatures - TC-03 GoogleMapsDownloaderV2 implements ISatelliteDownloader - TC-04 TileService depends on ISatelliteDownloader (mockable) - TC-05 DI + endpoints use ISatelliteDownloader - Test runner scripts (scripts/run-tests.sh, run-performance-tests.sh) - Autodev state pointer (_docs/_autodev_state.md) Prepares the codebase for AZ-285..AZ-290 unit/integration test work. Co-authored-by: Cursor <cursoragent@cursor.com>
57 lines
2.5 KiB
Markdown
57 lines
2.5 KiB
Markdown
# Module: Common/Interfaces
|
|
|
|
## Purpose
|
|
Service contracts defining the application's core operations. Implementations live in `SatelliteProvider.Services`.
|
|
|
|
## Public Interface
|
|
|
|
### ITileService
|
|
- `DownloadAndStoreTilesAsync(double lat, double lon, double sizeMeters, int zoomLevel, CancellationToken) → Task<List<TileMetadata>>`: downloads missing tiles for a region and returns all tile metadata (existing + new)
|
|
- `GetTileAsync(Guid id) → Task<TileMetadata?>`: retrieve a single tile by ID
|
|
- `GetTilesByRegionAsync(double lat, double lon, double sizeMeters, int zoomLevel) → Task<IEnumerable<TileMetadata>>`: query tiles within a geographic region
|
|
|
|
### IRegionService
|
|
- `RequestRegionAsync(Guid id, double lat, double lon, double sizeMeters, int zoomLevel, bool stitchTiles) → Task<RegionStatus>`: creates a region record and enqueues for async processing
|
|
- `GetRegionStatusAsync(Guid id) → Task<RegionStatus?>`: retrieves current status of a region request
|
|
- `ProcessRegionAsync(Guid id, CancellationToken) → Task`: executes tile downloading, CSV/summary generation, optional stitching
|
|
|
|
### IRouteService
|
|
- `CreateRouteAsync(CreateRouteRequest request) → Task<RouteResponse>`: validates input, calculates intermediate points, persists route + points, optionally creates geofence regions
|
|
- `GetRouteAsync(Guid id) → Task<RouteResponse?>`: retrieves route with all points
|
|
|
|
### ISatelliteDownloader
|
|
- `GetTiles(GeoPoint geoPoint, double radiusM, int zoomLevel, CancellationToken) → Task`: legacy interface for tile downloading (not directly implemented by `GoogleMapsDownloaderV2`)
|
|
|
|
### IRegionRequestQueue
|
|
- `EnqueueAsync(RegionRequest request, CancellationToken) → ValueTask`: add region request to the bounded queue
|
|
- `DequeueAsync(CancellationToken) → ValueTask<RegionRequest?>`: consume next request (blocks until available)
|
|
- `Count` (int): current queue depth
|
|
|
|
## Internal Logic
|
|
Pure interface definitions — no logic.
|
|
|
|
## Dependencies
|
|
- All interfaces reference DTOs from `SatelliteProvider.Common.DTO`
|
|
|
|
## Consumers
|
|
- `Program.cs` — DI registration of implementations
|
|
- `RegionProcessingService` — consumes `IRegionRequestQueue` and `IRegionService`
|
|
- `RouteService` — consumes `IRegionService` (for geofence region creation)
|
|
- `RouteProcessingService` — consumes `IRegionService` via service provider scope
|
|
- API endpoints — consume `ITileService`, `IRegionService`, `IRouteService`
|
|
|
|
## Data Models
|
|
None defined here.
|
|
|
|
## Configuration
|
|
None.
|
|
|
|
## External Integrations
|
|
None.
|
|
|
|
## Security
|
|
None.
|
|
|
|
## Tests
|
|
No dedicated interface tests.
|