using SatelliteProvider.Common.Enums;

namespace SatelliteProvider.DataAccess.Models;

public class TileEntity
{
    public Guid Id { get; set; }
    public int TileZoom { get; set; }
    public int TileX { get; set; }
    public int TileY { get; set; }
    public double Latitude { get; set; }
    public double Longitude { get; set; }
    public double TileSizeMeters { get; set; }
    public int TileSizePixels { get; set; }
    public string ImageType { get; set; } = string.Empty;
    public string? MapsVersion { get; set; }
    public int? Version { get; set; }
    public string FilePath { get; set; } = string.Empty;
    // AZ-484: stored as the contract wire value (snake_case string). See
    // TileSourceConverter for enum<->wire conversion. Cannot use the
    // TileSource enum directly because Dapper bypasses TypeHandler<T> for
    // enum types during read deserialization (Dapper issue #259).
    public string Source { get; set; } = TileSourceConverter.GoogleMapsWireValue;
    public DateTime CapturedAt { get; set; }
    public DateTime CreatedAt { get; set; }
    public DateTime UpdatedAt { get; set; }
}
