Skip to content

Commit

Permalink
Refactor Schedule.AddNewAppointment to abide by the CQS principle
Browse files Browse the repository at this point in the history
  • Loading branch information
snowfrogdev committed Sep 27, 2022
1 parent 39f48a1 commit 0adbac0
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions FrontDesk/src/FrontDesk.Core/ScheduleAggregate/Schedule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ private Schedule(Guid id, int clinicId) // used by EF

public DateTimeOffsetRange DateRange { get; private set; }

public Appointment AddNewAppointment(Appointment appointment)
public void AddNewAppointment(Appointment appointment)
{
Guard.Against.Null(appointment, nameof(appointment));
Guard.Against.Default(appointment.Id, nameof(appointment.Id));
Expand All @@ -43,8 +43,6 @@ public Appointment AddNewAppointment(Appointment appointment)

var appointmentScheduledEvent = new AppointmentScheduledEvent(appointment);
Events.Add(appointmentScheduledEvent);

return appointment;
}

public void DeleteAppointment(Appointment appointment)
Expand Down

0 comments on commit 0adbac0

Please sign in to comment.