using System.ComponentModel.DataAnnotations;

namespace DramaLing.Api.Models.Entities;

public class PronunciationAssessment
{
    [Key]
    public Guid Id { get; set; } = Guid.NewGuid();

    [Required]
    public Guid UserId { get; set; }

    public Guid? FlashcardId { get; set; }

    [Required]
    public string TargetText { get; set; } = string.Empty;

    public string? AudioUrl { get; set; }

    // 評分結果
    public int OverallScore { get; set; }
    public decimal AccuracyScore { get; set; }
    public decimal FluencyScore { get; set; }
    public decimal CompletenessScore { get; set; }
    public decimal ProsodyScore { get; set; }

    // 詳細分析 (JSON)
    public string? PhonemeScores { get; set; }
    public string[]? Suggestions { get; set; }

    // 學習情境
    public Guid? StudySessionId { get; set; }

    [MaxLength(20)]
    public string PracticeMode { get; set; } = "word"; // 'word', 'sentence', 'conversation'

    public DateTime CreatedAt { get; set; } = DateTime.UtcNow;

    // Navigation properties
    public User User { get; set; } = null!;
    public Flashcard? Flashcard { get; set; }
    public StudySession? StudySession { get; set; }
}