private async Task <bool> ShouldSubmitDailyReport(User user, DateTime userCurrentDate) { var chatId = user.Chat.ChatId; var branchHoliday = (await GetBranchesHolidays(chatId)) .FirstOrDefault(br => br.branchId == user.BranchId && br.date.Date == userCurrentDate.Date); var userDayInfo = await crmService.GetDayInfo(chatId, userCurrentDate); var isOfficeHoliday = branchHoliday != null; bool?isUserWorkDay = null; if (userDayInfo != null) { isUserWorkDay = userDayInfo.isWorkDay; // Temporary fix, remove when CRM API is fixed to correctly return information about vacations if (userDayInfo.description != null && userDayInfo.description.Contains("vacation", StringComparison.InvariantCultureIgnoreCase)) { isUserWorkDay = false; } } if (isOfficeHoliday) { if (isUserWorkDay == true) { return(true); } return(false); } if (isUserWorkDay == false) { return(false); } return(true); }