namespace Health.Domain.Entities;

/// <summary>
/// 用户（支持用户/医生双角色）
/// </summary>
public sealed class User
{
    public Guid Id { get; set; }
    public string Phone { get; set; } = string.Empty;
    public string Role { get; set; } = "User"; // "User" | "Doctor" | "Admin"
    public Guid? DoctorId { get; set; }  // 患者选择的医生
    public string? Name { get; set; }
    public Doctor? Doctor { get; set; }  // 导航属性
    public string? Gender { get; set; }
    public DateOnly? BirthDate { get; set; }
    public string? AvatarUrl { get; set; }
    public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
    public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;

    // 导航属性
    public ICollection<HealthRecord> HealthRecords { get; set; } = [];
    public ICollection<Medication> Medications { get; set; } = [];
    public ICollection<DietRecord> DietRecords { get; set; } = [];
    public ICollection<ExercisePlan> ExercisePlans { get; set; } = [];
    public ICollection<Report> Reports { get; set; } = [];
    public ICollection<Conversation> Conversations { get; set; } = [];
    public ICollection<Consultation> Consultations { get; set; } = [];
    public ICollection<FollowUp> FollowUps { get; set; } = [];
    public ICollection<DeviceToken> DeviceTokens { get; set; } = [];
    public HealthArchive? HealthArchive { get; set; }
    public NotificationPreference? NotificationPreference { get; set; }
    public DoctorProfile? DoctorProfile { get; set; }
}
