using HoneyBox.Model.Models.Address;

namespace HoneyBox.Core.Interfaces;

/// <summary>
/// 地址服务接口
/// </summary>
public interface IAddressService
{
    /// <summary>
    /// 添加收货地址
    /// </summary>
    /// <param name="userId">用户ID</param>
    /// <param name="request">添加地址请求</param>
    /// <returns>新创建的地址</returns>
    Task<AddressDto> AddAddressAsync(int userId, AddAddressRequest request);

    /// <summary>
    /// 更新收货地址
    /// </summary>
    /// <param name="userId">用户ID</param>
    /// <param name="request">更新地址请求</param>
    /// <returns>更新后的地址</returns>
    Task<AddressDto> UpdateAddressAsync(int userId, UpdateAddressRequest request);

    /// <summary>
    /// 获取默认收货地址
    /// </summary>
    /// <param name="userId">用户ID</param>
    /// <returns>默认地址，如果没有则返回最新的一条</returns>
    Task<AddressDto?> GetDefaultAddressAsync(int userId);

    /// <summary>
    /// 获取收货地址列表
    /// </summary>
    /// <param name="userId">用户ID</param>
    /// <returns>地址列表</returns>
    Task<List<AddressDto>> GetAddressListAsync(int userId);

    /// <summary>
    /// 删除收货地址
    /// </summary>
    /// <param name="userId">用户ID</param>
    /// <param name="addressId">地址ID</param>
    /// <returns>是否删除成功</returns>
    Task<bool> DeleteAddressAsync(int userId, int addressId);

    /// <summary>
    /// 设置默认收货地址
    /// </summary>
    /// <param name="userId">用户ID</param>
    /// <param name="addressId">地址ID</param>
    /// <returns>是否设置成功</returns>
    Task<bool> SetDefaultAddressAsync(int userId, int addressId);

    /// <summary>
    /// 获取地址详情
    /// </summary>
    /// <param name="userId">用户ID</param>
    /// <param name="addressId">地址ID</param>
    /// <returns>地址详情</returns>
    Task<AddressDto?> GetAddressDetailAsync(int userId, int addressId);
}
