Files
satellite-provider/SatelliteProvider.Common/DTO/UavTileMetadata.cs
T
Oleksandr Bezdieniezhnykh 50d4a76be3
ci/woodpecker/push/01-test Pipeline failed
ci/woodpecker/push/02-build-push unknown status
[AZ-1126] Migrate capturedAt to DateTimeOffset
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 13:34:35 +03:00

41 lines
1.6 KiB
C#

using System.Text.Json.Serialization;
using SatelliteProvider.Common.Json;
namespace SatelliteProvider.Common.DTO;
// AZ-488 / `uav-tile-upload.md` — per-tile metadata supplied with each batch
// item. `CapturedAt` is UTC-aware (`DateTimeOffset`) and normalized to UTC
// before persistence (AZ-1126 / F-AZ810-2).
//
// AZ-503: `FlightId` is optional. When provided, two UAVs uploading the same
// (z, x, y) cell from different flights coexist as distinct DB rows and write
// to per-flight on-disk paths (./tiles/uav/{flight_id}/{z}/{x}/{y}.jpg). When
// absent, the row is treated as flight-anonymous and the UPSERT collapses to
// the AZ-484 "single row per (cell, source)" semantics via COALESCE-to-zero.
//
// AZ-810 (cycle 8) added [JsonRequired] to every non-optional axis so the
// deserializer rejects partial payloads with HTTP 400 + ValidationProblemDetails
// via GlobalExceptionHandler BEFORE the FluentValidation + IUavTileQualityGate
// layers run. FlightId stays optional per AZ-503 anonymous-flight semantics.
public record UavTileMetadata
{
[JsonRequired]
public double Latitude { get; init; }
[JsonRequired]
public double Longitude { get; init; }
[JsonRequired]
public int TileZoom { get; init; }
[JsonRequired]
public double TileSizeMeters { get; init; }
[JsonRequired]
[JsonConverter(typeof(UtcOffsetRequiredDateTimeOffsetConverter))]
public DateTimeOffset CapturedAt { get; init; }
public Guid? FlightId { get; init; }
}
public record UavTileBatchMetadataPayload
{
[JsonRequired]
public List<UavTileMetadata> Items { get; init; } = new();
}