using System.ComponentModel.DataAnnotations;
using DramaLing.Api.Utils;
namespace DramaLing.Api.Models.Entities;
///
/// 簡化的詞卡實體 - 使用數字難度等級
///
public class Flashcard
{
private int? _difficultyLevelNumeric;
public Guid Id { get; set; }
public Guid UserId { get; set; }
// 詞卡內容
[Required]
[MaxLength(255)]
public string Word { get; set; } = string.Empty;
[Required]
public string Translation { get; set; } = string.Empty;
public string? Definition { get; set; }
[MaxLength(50)]
public string? PartOfSpeech { get; set; }
[MaxLength(255)]
public string? Pronunciation { get; set; }
public string? Example { get; set; }
public string? ExampleTranslation { get; set; }
[MaxLength(2000)]
public string? Synonyms { get; set; }
// 基本狀態
public bool IsFavorite { get; set; } = false;
public bool IsArchived { get; set; } = false;
///
/// CEFR 難度等級 (數字格式: 0=未知, 1=A1, 2=A2, 3=B1, 4=B2, 5=C1, 6=C2)
///
public int DifficultyLevelNumeric
{
get => _difficultyLevelNumeric ?? 0;
set => _difficultyLevelNumeric = value;
}
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
// Navigation Properties
public virtual User User { get; set; } = null!;
public virtual ICollection FlashcardTags { get; set; } = new List();
public virtual ICollection ErrorReports { get; set; } = new List();
public virtual ICollection FlashcardExampleImages { get; set; } = new List();
}