public async Task <IActionResult> Get(int employeeId) { var notificationSettings = await _notificationSettingsService.GetByEmployeeId(employeeId); if (notificationSettings == null) { return(NotFound()); } return(Ok(notificationSettings)); }
private async Task <GetEmployeeBirthdayDto> GetBirthdayInformation(Employee employee, DateTime selectedDate) { var notificationSettings = await _notificationSettingsService.GetByEmployeeId(employee.Id); var birthdayDate = employee.BirthdayDate; var adjustedBirthdayDate = new DateTime(selectedDate.Year, birthdayDate.Month, birthdayDate.Day); var birthday = new GetEmployeeBirthdayDto() { FullName = $"{employee.Name} {employee.Surname}", BirthdayDate = adjustedBirthdayDate, IsPublic = notificationSettings.BroadcastOwnBirthday }; return(birthday); }