using System.ComponentModel.DataAnnotations;

namespace DramaLing.Api.Models.DTOs.SpacedRepetition;

/// <summary>
/// 復習結果提交請求
/// </summary>
public class ReviewRequest
{
    /// <summary>
    /// 答題是否正確
    /// </summary>
    [Required]
    public bool IsCorrect { get; set; }

    /// <summary>
    /// 信心程度 (1-5，翻卡題必須)
    /// </summary>
    [Range(1, 5)]
    public int? ConfidenceLevel { get; set; }

    /// <summary>
    /// 題型類型
    /// </summary>
    [Required]
    [RegularExpression("^(flip-memory|vocab-choice|vocab-listening|sentence-listening|sentence-fill|sentence-reorder|sentence-speaking)$")]
    public string QuestionType { get; set; } = string.Empty;

    /// <summary>
    /// 用戶的答案 (可選)
    /// </summary>
    public string? UserAnswer { get; set; }

    /// <summary>
    /// 答題時間 (毫秒)
    /// </summary>
    public long? TimeTaken { get; set; }

    /// <summary>
    /// 時間戳記
    /// </summary>
    public long Timestamp { get; set; } = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
}