Commit 75e9514b authored by Almouhannad's avatar Almouhannad

(B) Add people related entities

parent 5cbf06a4
using Domain.Primitives;
namespace Domain.Entities.People.Doctors.Shared.Constants.DoctorStatusValues;
public sealed class DoctorStatus(int id) : Entity(id)
{
#region Properties
public string Name { get; set; } = null!;
#endregion
}
namespace Domain.Entities.People.Doctors.Shared.Constants.DoctorStatusValues;
public static class DoctorStatuses
{
#region Constant id values
public static int Available => 1;
public static int Working => 2;
public static int Busy => 3;
#endregion
}
using Domain.Primitives;
namespace Domain.Entities.People.Doctors.Shared;
// TODO: Convert phone property to a value object
public sealed class DoctorPhone(int id) : Entity(id)
{
#region Properties
public string? Name { get; set; }
public string Phone { get; set; } = null!;
#endregion
}
using Domain.Entities.People.Employees.Shared;
using Domain.Entities.People.Patients;
using Domain.Primitives;
namespace Domain.Entities.People.Employees;
public sealed class Employee(int id) : Entity(id)
{
#region Properties
public Patient Patient { get; set; } = null!;
public EmployeeAdditionalInfo? AdditionalInfo { get; set; }
public string SerialNumber { get; set; } = null!;
public string CenterStatus { get; set; } = null!;
public bool IsMarried { get; set; } = false;
#region Navigations
public ICollection<EmployeeFamilyMember> FamilyMembers { get; set; } = [];
public ICollection<Employee> RelatedEmployees { get; set; } = [];
public ICollection<Employee> RelatedTo { get; set; } = [];
#endregion
#endregion
}
using Domain.Entities.People.Employees.Relations.EmployeeFamilyMembers.FamilyRoleValues;
using Domain.Entities.People.FamilyMembers;
using Domain.Primitives;
namespace Domain.Entities.People.Employees.Relations.EmployeeFamilyMembers;
public sealed class EmployeeFamilyMember(int id) : Entity(id)
{
#region Properties
#region Employee
public int EmployeeId { get; set; }
public Employee Employee { get; set; } = null!;
#endregion
#region Family member
public int FamilyMemberId { get; set; }
public FamilyMember FamilyMember { get; set; } = null!;
#endregion
#region Additional
public FamilyRole Role { get; set; } = null!;
#endregion
#endregion
}
using Domain.Primitives;
namespace Domain.Entities.People.Employees.Relations.EmployeeFamilyMembers.FamilyRoleValues;
public sealed class FamilyRole(int id) : Entity(id)
{
#region Properties
public string Name { get; set; } = null!;
#endregion
}
namespace Domain.Entities.People.Employees.Relations.EmployeeFamilyMembers.FamilyRoleValues;
public static class FamilyRoles
{
#region Constant id values
public static int Husband => 1;
public static int Wife => 2;
public static int Son => 3;
public static int Daughter => 4;
#endregion
}
using Domain.Primitives;
namespace Domain.Entities.People.Employees.Shared;
// TODO: Convert to a value object containig value objects
public sealed class EmployeeAdditionalInfo(int id) : Entity(id)
{
#region Properties
public DateOnly? StartDate { get; set; }
public string? AcademicQualification { get; set; }
public string? WorkPhone { get; set; }
public string? Location { get; set; }
public string? Specialization { get; set; }
public string? JobStatus { get; set; }
public string? ImageUrl { get; set; }
#endregion
}
using Domain.Entities.People.Patients;
using Domain.Primitives;
namespace Domain.Entities.People.FamilyMembers;
public sealed class FamilyMember(int id) : Entity(id)
{
#region Properties
public Patient Patient { get; set; } = null!;
#endregion
}
using Domain.Entities.People.Patients.Relations.PatientDiseases;
using Domain.Entities.People.Shared;
using Domain.Entities.People.Shared.Constants.GenderValues;
using Domain.Primitives;
namespace Domain.Entities.People.Patients;
// TODO: Potential aggregate?
public sealed class Patient(int id) : Entity(id)
{
#region Properties
public PersonalInfo PersonalInfo { get; set; } = null!;
public DateOnly DateOfBirth { get; set; }
public Gender Gender { get; set; } = null!;
#region Navigations
public ICollection<PatientDisease> Diseases { get; set; } = [];
public ICollection<PatientMedicine> Medicines { get; set; } = [];
public ICollection<Visit> Visits { get; set; } = [];
#endregion
#endregion
}
using Domain.Primitives;
namespace Domain.Entities.People.Patients.Relations.PatientDiseases;
public sealed class PatientDisease(int id) : Entity(id)
{
#region Properties
#region Patient
public int PatientId { get; set; }
public Patient Patient { get; set; } = null!;
#endregion
#region Disease
public int DiseaseId { get; set; }
public Disease Disease { get; set; } = null!;
#endregion
#region Additional
#endregion
#endregion
}
using Domain.Primitives;
namespace Domain.Entities.People.Patients.Relations.PatientMedicines;
public sealed class PatientMedicine(int id) : Entity(id)
{
#region Properties
#region Patient
public int PatientId { get; set; }
public Patient Patient { get; set; } = null!;
#endregion
#region Medicine
public int MedicineId { get; set; }
public Medicine Medicine { get; set; } = null!;
#endregion
#region Additional
public int Number { get; set; }
#endregion
#endregion
}
using Domain.Primitives;
namespace Domain.Entities.People.Shared.Constants.GenderValues;
// TODO: Convert to a value object
public sealed class Gender(int id) : Entity(id)
{
#region Properties
public string Name { get; set; } = null!;
#endregion
}
namespace Domain.Entities.People.Shared.Constants.GenderValues;
public static class Genders
{
#region Constant id values
public static int Male => 1;
public static int Female => 2;
#endregion
}
using Domain.Primitives;
namespace Domain.Entities.People.Shared;
// TODO: Convert props to value objects
public sealed class PersonalInfo(int id) : Entity(id)
{
#region Properties
public string FirstName { get; set; } = null!;
public string MiddleName { get; set; } = null!;
public string LastName { get; set; } = null!;
#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