namespace TakeoutSaaS.Application.App.Common.Geo;

/// <summary>
/// 地址地理编码结果。
/// </summary>
public sealed record AddressGeocodingResult(
    bool Succeeded,
    decimal? Latitude,
    decimal? Longitude,
    string? Message)
{
    /// <summary>
    /// 构建成功结果。
    /// </summary>
    public static AddressGeocodingResult Success(decimal latitude, decimal longitude)
        => new(true, latitude, longitude, null);

    /// <summary>
    /// 构建失败结果。
    /// </summary>
    public static AddressGeocodingResult Failed(string? message)
        => new(false, null, null, message);
}
