40 lines
1.2 KiB
C#
40 lines
1.2 KiB
C#
namespace Domain.Entities;
|
|
|
|
public class Appointment
|
|
{
|
|
public string Id { get; private set; } = string.Empty;
|
|
public string PatientId { get; private set; } = string.Empty;
|
|
public string DoctorId { get; private set; } = string.Empty;
|
|
public List<DateTime> AppointmentsList { get; set; } = [];
|
|
|
|
public void SetId(string id)
|
|
{
|
|
Id = id;
|
|
}
|
|
|
|
public void SetPatientId(string patientId)
|
|
{
|
|
PatientId = patientId;
|
|
}
|
|
|
|
public void SetDoctorIid(string doctorId)
|
|
{
|
|
DoctorId = doctorId;
|
|
}
|
|
|
|
public void AddAppointment(DateTime appointmentDate)
|
|
{
|
|
var utcAppointmentDate = new DateTime(appointmentDate.Year, appointmentDate.Month, appointmentDate.Day,
|
|
appointmentDate.Hour, appointmentDate.Minute, 0,
|
|
DateTimeKind.Utc);
|
|
AppointmentsList.Add(utcAppointmentDate);
|
|
}
|
|
|
|
public void RemoveAppointment(DateTime appointmentDate)
|
|
{
|
|
var utcAppointmentDate = new DateTime(appointmentDate.Year, appointmentDate.Month, appointmentDate.Day,
|
|
appointmentDate.Hour, appointmentDate.Minute, 0,
|
|
DateTimeKind.Utc);
|
|
AppointmentsList.Remove(utcAppointmentDate);
|
|
}
|
|
} |