using QYZH.InteractiveMagazine.Models.Dto.CheckIn;
using QYZH.InteractiveMagazine.Models.Entity;

namespace QYZH.InteractiveMagazine.IService;

/// <summary>
/// 签到服务接口
/// </summary>
public interface ICheckInService : IBaseService<CheckInRecord>
{
    /// <summary>
    /// 用户签到
    /// </summary>
    /// <param name="userId">用户Id</param>
    /// <returns>签到结果</returns>
    Task<CheckInOutput> CheckInAsync(long userId);

    /// <summary>
    /// 获取用户签到信息（今日状态 + 连续天数 + 最近记录）
    /// </summary>
    /// <param name="userId">用户Id</param>
    /// <returns>签到信息</returns>
    Task<CheckInInfoOutput> GetCheckInInfoAsync(long userId);

    /// <summary>
    /// 补签（消耗补签卡，补签历史漏签日期）
    /// </summary>
    /// <param name="userId">用户Id</param>
    /// <param name="targetDate">补签目标日期</param>
    /// <returns>补签结果</returns>
    Task<CheckInOutput> MakeUpCheckInAsync(long userId, DateTime targetDate);

    /// <summary>
    /// 获取用户可补签的日期列表（历史漏签日期）
    /// </summary>
    /// <param name="userId">用户Id</param>
    /// <param name="days">往前查看天数（默认30天）</param>
    /// <returns>漏签日期列表</returns>
    Task<List<DateTime>> GetMissedDatesAsync(long userId, int days = 30);
}
