public async Task <HostDashboardData> GetDashboardStatisticsData(GetDashboardDataInput input) { var subscriptionEndDateEndUtc = Clock.Now.ToUniversalTime().AddDays(SubscriptionEndAlertDayCount); var subscriptionEndDateStartUtc = Clock.Now.ToUniversalTime(); var tenantCreationStartDate = Clock.Now.ToUniversalTime().AddDays(-RecentTenantsDayCount); return(new HostDashboardData { DashboardPlaceholder1 = 125, DashboardPlaceholder2 = 830, NewTenantsCount = await GetTenantsCountByDate(input.StartDate, input.EndDate), NewSubscriptionAmount = await GetNewSubscriptionAmount(input.StartDate, input.EndDate), IncomeStatistics = await _incomeStatisticsService.GetIncomeStatisticsData(input.StartDate, input.EndDate, input.IncomeStatisticsDateInterval), EditionStatistics = await GetEditionTenantStatisticsData(input.StartDate, input.EndDate), ExpiringTenants = await GetExpiringTenantsData(subscriptionEndDateStartUtc, subscriptionEndDateEndUtc, MaxExpiringTenantsShownCount), RecentTenants = await GetRecentTenantsData(tenantCreationStartDate, MaxRecentTenantsShownCount), MaxExpiringTenantsShownCount = MaxExpiringTenantsShownCount, MaxRecentTenantsShownCount = MaxRecentTenantsShownCount, SubscriptionEndAlertDayCount = SubscriptionEndAlertDayCount, RecentTenantsDayCount = RecentTenantsDayCount, SubscriptionEndDateStart = subscriptionEndDateStartUtc, SubscriptionEndDateEnd = subscriptionEndDateEndUtc, TenantCreationStartDate = tenantCreationStartDate }); }
public GetDashboardDataOutput GetDashboardData(GetDashboardDataInput input) { var tenantInfo = TenantManager.GetTenantInfo().Result; var quotations = GetQuotationsInfo(tenantInfo); var incidents = GetIncidentsInfo(tenantInfo); var estimates = GetEstimatesInfo(tenantInfo); var workOrders = GetWorkOrdersInfo(tenantInfo); var agedReceivables = GetAgedReceivablesData(input.AgedReceivablesDatePeriod, tenantInfo); var revenueForecast = GetRevenueForecastData(tenantInfo); var newEstimates = estimates[0]; var newEstimatesChange = estimates[1]; var newWorkOrders = workOrders[0]; var newWorkOrdersChange = workOrders[1]; var newIncidents = incidents[0]; var newIncidentsChange = incidents[1]; var newQuotations = quotations[0]; var newQuotationsChange = quotations[1]; var output = new GetDashboardDataOutput { NewEstimates = newEstimates, // DashboardRandomDataGenerator.GetRandomInt(5, 10), NewEstimatesChange = newEstimatesChange, // DashboardRandomDataGenerator.GetRandomInt(30, 80), NewWorkOrders = newWorkOrders, // DashboardRandomDataGenerator.GetRandomInt(5, 10), NewWorkOrdersChange = newWorkOrdersChange, // DashboardRandomDataGenerator.GetRandomInt(30, 80), NewIncidents = newIncidents, // DashboardRandomDataGenerator.GetRandomInt(5, 10), NewIncidentsChange = newIncidentsChange, // DashboardRandomDataGenerator.GetRandomInt(30, 80), NewQuotations = newQuotations, // DashboardRandomDataGenerator.GetRandomInt(5, 10), NewQuotationsChange = newQuotationsChange, //DashboardRandomDataGenerator.GetRandomInt(30, 80), AgedReceivables = agedReceivables, RevenueForecast = revenueForecast, TotalProfit = DashboardRandomDataGenerator.GetRandomInt(500000, 900000), NewFeedbacks = DashboardRandomDataGenerator.GetRandomInt(1000, 5000), NewOrders = DashboardRandomDataGenerator.GetRandomInt(100, 900), NewUsers = DashboardRandomDataGenerator.GetRandomInt(50, 500), SalesSummary = DashboardRandomDataGenerator.GenerateSalesSummaryData(input.SalesSummaryDatePeriod), Expenses = DashboardRandomDataGenerator.GetRandomInt(5000, 10000), Growth = DashboardRandomDataGenerator.GetRandomInt(5000, 10000), Revenue = DashboardRandomDataGenerator.GetRandomInt(1000, 9000), TotalSales = DashboardRandomDataGenerator.GetRandomInt(10000, 90000), TransactionPercent = DashboardRandomDataGenerator.GetRandomInt(10, 100), NewVisitPercent = DashboardRandomDataGenerator.GetRandomInt(10, 100), BouncePercent = DashboardRandomDataGenerator.GetRandomInt(10, 100), DailySales = DashboardRandomDataGenerator.GetRandomArray(30, 10, 50), ProfitShares = DashboardRandomDataGenerator.GetRandomPercentageArray(3) }; return(output); }
public GetDashboardDataOutput GetDashboardData(GetDashboardDataInput input) { var output = new GetDashboardDataOutput { TotalProfit = DashboardRandomDataGenerator.GetRandomInt(5000, 9000), NewFeedbacks = DashboardRandomDataGenerator.GetRandomInt(1000, 5000), NewOrders = DashboardRandomDataGenerator.GetRandomInt(100, 900), NewUsers = DashboardRandomDataGenerator.GetRandomInt(50, 500), SalesSummary = DashboardRandomDataGenerator.GenerateSalesSummaryData(input.SalesSummaryDatePeriod), Expenses = DashboardRandomDataGenerator.GetRandomInt(5000, 10000), Growth = DashboardRandomDataGenerator.GetRandomInt(5000, 10000), Revenue = DashboardRandomDataGenerator.GetRandomInt(1000, 9000), TotalSales = DashboardRandomDataGenerator.GetRandomInt(10000, 90000), TransactionPercent = DashboardRandomDataGenerator.GetRandomInt(10, 100), NewVisitPercent = DashboardRandomDataGenerator.GetRandomInt(10, 100), BouncePercent = DashboardRandomDataGenerator.GetRandomInt(10, 100), DailySales = DashboardRandomDataGenerator.GetRandomArray(30, 10, 50), ProfitShares = DashboardRandomDataGenerator.GetRandomPercentageArray(3) }; return(output); }
public GetDashboardDataOutput GetDashboardData(GetDashboardDataInput input) { var output = new GetDashboardDataOutput { TotalProfit = DashboardRandomDataGenerator.GetRandomInt(5000, 9000), NewFeedbacks = DashboardRandomDataGenerator.GetRandomInt(1000, 5000), NewOrders = DashboardRandomDataGenerator.GetRandomInt(100, 900), NewUsers = DashboardRandomDataGenerator.GetRandomInt(50, 500), SalesSummary = DashboardRandomDataGenerator.GenerateSalesSummaryData(input.SalesSummaryDatePeriod), Expenses = DashboardRandomDataGenerator.GetRandomInt(5000, 10000), Growth = DashboardRandomDataGenerator.GetRandomInt(5000, 10000), Revenue = DashboardRandomDataGenerator.GetRandomInt(1000, 9000), TotalSales = DashboardRandomDataGenerator.GetRandomInt(10000, 90000), TransactionPercent = DashboardRandomDataGenerator.GetRandomInt(10, 100), NewVisitPercent = DashboardRandomDataGenerator.GetRandomInt(10, 100), BouncePercent = DashboardRandomDataGenerator.GetRandomInt(10, 100), NetworkLoad = DashboardRandomDataGenerator.GetRandomArray(20, 8, 15), CpuLoad = DashboardRandomDataGenerator.GetRandomArray(20, 8, 15), LoadRate = DashboardRandomDataGenerator.GetRandomArray(20, 8, 15), TimeLineItems = DashboardRandomDataGenerator.GenerateTimeLineItems() }; return(output); }