[AZ-1126] Migrate capturedAt to DateTimeOffset
ci/woodpecker/push/01-test Pipeline failed
ci/woodpecker/push/02-build-push unknown status

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-06-26 13:34:35 +03:00
parent b055450e40
commit 50d4a76be3
19 changed files with 242 additions and 43 deletions
@@ -91,6 +91,9 @@ public static class UavUploadValidationTests
// Rule 14: type mismatch (lat as string)
await ItemLatTypeMismatch_Returns400(apiUrl, secret);
// AZ-1126: offset-less capturedAt rejected at deserializer
await ItemCapturedAtOffsetLess_Returns400(apiUrl, secret);
Console.WriteLine("✓ UAV upload metadata validation tests: PASSED");
}
@@ -429,6 +432,33 @@ public static class UavUploadValidationTests
Console.WriteLine(" ✓ items[0].capturedAt = now-60d rejected with indexed errors path");
}
private static async Task ItemCapturedAtOffsetLess_Returns400(string apiUrl, string secret)
{
Console.WriteLine();
Console.WriteLine("AZ-1126 AC-2: per-item capturedAt without explicit UTC offset → HTTP 400");
// Arrange
var coord = NextTestCoordinate();
var metadata = new
{
items = new[]
{
new { latitude = coord.Latitude, longitude = coord.Longitude, tileZoom = 18, tileSizeMeters = 200.0, capturedAt = "2026-06-26T12:00:00" },
},
};
using var client = CreateClientWithGpsToken(apiUrl, secret);
// Act
using var response = await PostBatch(client, metadata, new[] { CreateValidJpeg() });
var problem = await ProblemDetailsAssertions.ReadProblemDetailsAsync(response, "AZ-1126 item capturedAt offset-less");
// Assert
ProblemDetailsAssertions.AssertValidationProblem(problem, expectedStatus: 400, label: "AZ-1126 item capturedAt offset-less");
ProblemDetailsAssertions.AssertErrorsContainsMention(problem, expectedMention: "capturedAt", label: "AZ-1126 item capturedAt offset-less");
Console.WriteLine(" ✓ items[0].capturedAt without offset rejected");
}
private static async Task ItemFlightIdMalformed_Returns400(string apiUrl, string secret)
{
Console.WriteLine();