using Baya.Domain.Common;

namespace Baya.Domain.Entities.Identity;

/// <summary>
/// The <b>family-owned</b> care plan for a patient — the customer's editable medications / daily routine /
/// task checklist. Distinct from the nurse-authored, encrypted clinical visit notes (<c>PatientCareRecord</c>):
/// this is patient-scoped (one row per patient, persists across nurse changes) and owned/edited by the paying
/// customer. The three lists are stored as JSON because they are always read/written whole with the plan (no
/// server-side querying into them). Not encrypted — it is the family's own working list, not clinical PII the
/// nurse authored.
/// </summary>
public class PatientCarePlan : BaseEntity<long>
{
    public long PatientId { get; set; }

    /// <summary>JSON array of <c>{ id, name, dosage?, frequency, timingNote? }</c>.</summary>
    public string MedicationsJson { get; set; } = "[]";

    /// <summary>JSON array of <c>{ id, label, timeOfDay?, note? }</c>.</summary>
    public string RoutineJson { get; set; } = "[]";

    /// <summary>JSON array of <c>{ id, label, done }</c>.</summary>
    public string TasksJson { get; set; } = "[]";

    public DateTimeOffset? DeletedAt { get; set; }
}
