public async Task <Unit> Handle(CreateAppointmentCommand request, CancellationToken cancellationToken) { var calendar = await _calendarRepository.GetByIdAsync(new CalendarId(request.CalendarId)); var appoitment = calendar .AddAppoitment(AppointmentTerm.CreateNewStartAndEnd( request.StartAppoitment, request.EndAppoitment), request.PatientId); await _appointmentRepository.AddAsync(appoitment); await _appointmentRepository.Save(); return(Unit.Value); }
public async Task <Calendar> GetByIdAsync(Guid id) { var calendarDao = await _calendarRepository.GetByIdAsync(id); return(DaoToDomain(calendarDao)); }