Commit 964853eb authored by Almouhannad's avatar Almouhannad

(B) Update family member entity

parent 56077e5a
......@@ -3,11 +3,47 @@ using Domain.Primitives;
namespace Domain.Entities.People.FamilyMembers;
public sealed class FamilyMember(int id) : Entity(id)
public sealed class FamilyMember : Entity
{
#region Private ctor
private FamilyMember(int id) : base(id)
{
}
private FamilyMember(int id, Patient patient) : base(id)
{
Patient = patient;
}
#endregion
#region Properties
public Patient Patient { get; set; } = null!;
#endregion
#region Methods
#region Static factory
public static FamilyMember Create(string firstName, string middleName, string lastName,
DateOnly dateOfBirth,
string gender
)
{
Patient patient;
try
{
patient = Patient.Create(firstName, middleName, lastName, dateOfBirth, gender);
}
catch
{
throw;
}
return new FamilyMember(0, patient);
}
#endregion
#endregion
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment