public async Task <Staff> AddAvailability(AddAvailabilityCommand addAvailabilityCommand) { Staff staff = FindExistingStaff(addAvailabilityCommand.SiteId, addAvailabilityCommand.StaffId); Availability availability = staff.AddAvailability(addAvailabilityCommand.ServiceItemId, addAvailabilityCommand.LocationId, addAvailabilityCommand.StartDateTime, addAvailabilityCommand.EndDateTime, addAvailabilityCommand.Sunday, addAvailabilityCommand.Monday, addAvailabilityCommand.Tuesday, addAvailabilityCommand.Wednesday, addAvailabilityCommand.Thursday, addAvailabilityCommand.Friday, addAvailabilityCommand.Saturday, addAvailabilityCommand.BookableEndDateTime); await _businessIntegrationEventService.PublishThroughEventBusAsync(new AvailabilityAddedByStaffEvent( availability.StaffId, availability.SiteId, availability.StaffId, availability.ServiceItemId, availability.LocationId, availability.StartDateTime, availability.EndDateTime, addAvailabilityCommand.Sunday, addAvailabilityCommand.Monday, addAvailabilityCommand.Tuesday, addAvailabilityCommand.Wednesday, addAvailabilityCommand.Thursday, addAvailabilityCommand.Friday, addAvailabilityCommand.Saturday, availability.BookableEndDateTime )); //_staffRepository.UnitOfWork.Commit(); return(staff); }