using System.Text.Json.Serialization;

namespace SatelliteProvider.Common.DTO;

// AZ-812 (cycle 8): wire-format renamed Latitude/Longitude → Lat/Lon (OSM
// convention) and added [JsonPropertyName("lat"/"lon")] so the wire is
// unambiguous under JsonSerializerOptions.UnmappedMemberHandling.Disallow
// (AZ-795 cycle 7).
//
// AZ-808 (cycle 8): switched [Required] → [JsonRequired] on every property.
// [Required] is DataAnnotations and is NOT enforced by System.Text.Json — the
// 2026-05-22 black-box probe confirmed it: omitting `id` returned HTTP 200
// with id=Guid.Empty (silent coercion). [JsonRequired] is enforced by the
// STJ deserializer and fails with BadHttpRequestException(JsonException),
// which the GlobalExceptionHandler converts to RFC 7807 ValidationProblemDetails.
// Removed the in-property defaults (= 18 for ZoomLevel, = false for StitchTiles)
// because [JsonRequired] forces the caller to declare intent.
public record RequestRegionRequest
{
    [JsonRequired]
    public Guid Id { get; set; }

    [JsonRequired]
    [JsonPropertyName("lat")]
    public double Lat { get; set; }

    [JsonRequired]
    [JsonPropertyName("lon")]
    public double Lon { get; set; }

    [JsonRequired]
    public double SizeMeters { get; set; }

    [JsonRequired]
    public int ZoomLevel { get; set; }

    [JsonRequired]
    public bool StitchTiles { get; set; }
}
