mirror of
https://github.com/azaion/satellite-provider.git
synced 2026-06-27 12:41:13 +00:00
[AZ-1126] Migrate capturedAt to DateTimeOffset
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user