Files
satellite-provider/_docs/02_document/modules/dataaccess_models.md
T
Oleksandr Bezdieniezhnykh 51b572108a
ci/woodpecker/push/01-test Pipeline was successful
ci/woodpecker/push/02-build-push Pipeline was successful
[AZ-484] Cycle 1 Steps 12-16: docs, security, perf, deploy report
Captures the post-implementation autodev gates for AZ-484 multi-source
tile storage:

- Step 12 (Test-Spec Sync): added 7 AC rows (AZ-484 AC-1..AC-7) and a
  PT-07 NFR row to traceability-matrix.md; added PT-07 scenario to
  performance-tests.md.
- Step 13 (Update Docs): refreshed data_model.md (tiles columns +
  indexes + selection rule + UPSERT contract + migrations 012/013),
  module-layout.md (Common/Enums section with L-001 guidance,
  DataAccess imports-from now lists 6 sites), 6 module / component
  docs to reflect the new repo signatures, source/captured_at fields,
  and Dapper enum bypass workaround. ripple_log_cycle1.md records
  zero out-of-scope ripple.
- Step 14 (Security Audit): PASS_WITH_WARNINGS - 0 Critical, 0 High,
  5 Medium, 5 Low. AZ-484 itself added zero new findings. Hardening
  items (Postgres default creds, .env in build context, GMaps key
  rotation, ASP.NET Core 8.0.21 -> 8.0.25, rate limiter) recorded
  for separate tickets.
- Step 15 (Performance Test): all PT-01..PT-07 scenarios Unverified
  (non-blocking); PT-07 baseline-comparison harness deferred to a
  leftover for next cycle.
- Step 16 (Deploy): cycle deploy report covering migration safety,
  rollback path, post-deploy verification, security caveats.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-11 10:03:05 +03:00

2.7 KiB

Module: DataAccess/Models

Purpose

Database entity classes that map directly to PostgreSQL tables via Dapper. Property names use PascalCase; column mapping is done with SQL aliases in repository queries.

Public Interface

TileEntity

Maps to tiles table.

  • Id (Guid), TileZoom (int), TileX (int), TileY (int)
  • Latitude, Longitude (double), TileSizeMeters (double), TileSizePixels (int)
  • ImageType (string), MapsVersion (string?), Version (int) — MapsVersion/Version are vestigial post-AZ-484 (kept nullable for backward compatibility; no longer part of the unique key)
  • Source (string) — AZ-484 producer wire value, defaults to TileSourceConverter.GoogleMapsWireValue ("google_maps"). Stored as plain string (not the TileSource enum) due to Dapper issue #259 — see _docs/LESSONS.md L-001. Convert via SatelliteProvider.Common.Enums.TileSourceConverter.{ToWireValue,FromWireValue}.
  • CapturedAt (DateTime, UTC) — AZ-484 imagery acquisition timestamp; drives the most-recent-across-sources selection.
  • FilePath (string), CreatedAt, UpdatedAt (DateTime)

RegionEntity

Maps to regions table.

  • Id (Guid), Latitude, Longitude (double), SizeMeters (double)
  • ZoomLevel (int), Status (string: "queued"/"processing"/"completed"/"failed")
  • CsvFilePath, SummaryFilePath (string?)
  • TilesDownloaded, TilesReused (int), StitchTiles (bool)
  • CreatedAt, UpdatedAt (DateTime)

RouteEntity

Maps to routes table.

  • Id (Guid), Name (string), Description (string?)
  • RegionSizeMeters (double), ZoomLevel (int)
  • TotalDistanceMeters (double), TotalPoints (int)
  • RequestMaps, MapsReady, CreateTilesZip (bool)
  • CsvFilePath, SummaryFilePath, StitchedImagePath, TilesZipPath (string?)
  • CreatedAt, UpdatedAt (DateTime)

RoutePointEntity

Maps to route_points table.

  • Id (Guid), RouteId (Guid), SequenceNumber (int)
  • Latitude, Longitude (double), PointType (string)
  • SegmentIndex (int), DistanceFromPrevious (double?)
  • CreatedAt (DateTime)

Internal Logic

Plain POCOs with no logic.

Dependencies

None.

Consumers

  • All repository implementations (TileRepository, RegionRepository, RouteRepository)
  • TileService — creates TileEntity instances for persistence
  • RegionService — creates/updates RegionEntity
  • RouteService — creates RouteEntity and RoutePointEntity
  • RouteProcessingService — reads entities from repositories
  • GoogleMapsDownloaderV2.GetTilesWithMetadataAsync — accepts IEnumerable<TileEntity> to check existing tiles

Data Models

These ARE the data model.

Configuration

None.

External Integrations

None.

Security

None.

Tests

No dedicated tests.