# Module: DataAccess/Repositories/RegionRepository ## Purpose Dapper-based repository for the `regions` table. Tracks region processing requests and their status lifecycle. ## Public Interface ### IRegionRepository (interface) - `GetByIdAsync(Guid id) → Task` - `GetByStatusAsync(string status) → Task>`: retrieves all regions with a given status, ordered by creation date ASC - `InsertAsync(RegionEntity region) → Task` - `UpdateAsync(RegionEntity region) → Task` - `DeleteAsync(Guid id) → Task` ### RegionRepository (implementation) Same connection-per-call pattern as TileRepository. ## Internal Logic Standard CRUD. `GetByStatusAsync` orders by `created_at ASC` to process oldest requests first. ## Dependencies - NuGet: `Dapper`, `Npgsql` - `SatelliteProvider.DataAccess.Models.RegionEntity` - `Microsoft.Extensions.Logging` ## Consumers - `RegionService` — insert on request, update during processing - `RouteProcessingService` — reads region records to check status and get CSV paths ## Data Models Operates on `RegionEntity`. ## Configuration Connection string via constructor. ## External Integrations PostgreSQL. ## Security None. ## Tests No dedicated tests.