chore: add business logic

This commit is contained in:
Mahyargdz
2025-05-18 10:19:16 +03:30
parent 1bc8b23452
commit b5c90e8c2e
12 changed files with 119 additions and 187 deletions
@@ -46,24 +46,12 @@ export class DashboardService {
const invoicesCount = await this.getInvoicesCount();
const unreadTickets = await this.unreadTickets();
const adsCount = await this.getAdsCount();
const planRevenueAverage = await this.getPlanRevenueAverage();
const plansSalesCount = await this.getPlansSalesCount();
const subscriptionGrowthRate = await this.getSubscriptionGrowthRate();
const plansSalesCountByMonthsInYear = await this.getPlansSalesCountByMonthsInYear();
const plansSalesCountByDaysInMonth = await this.getPlansSalesCountByDaysInMonth();
const plansSalesCountByDaysInWeek = await this.getPlansSalesCountByDaysInWeek();
return {
danakServicesCount,
customersCount,
invoicesCount,
unreadTickets,
adsCount,
planRevenueAverage,
plansSalesCount,
subscriptionGrowthRate,
plansSalesCountByMonthsInYear,
plansSalesCountByDaysInMonth,
plansSalesCountByDaysInWeek,
};
}
@@ -103,44 +91,4 @@ export class DashboardService {
}
//************************************ */
private async getPlanRevenueAverage() {
const planRevenueCount = await this.subscriptionsService.getPlanRevenueAverage();
return planRevenueCount;
}
//************************************ */
private async getPlansSalesCount() {
const plansSalesCount = await this.subscriptionsService.getPlansSalesCount();
return plansSalesCount;
}
//************************************ */
private async getSubscriptionGrowthRate() {
const subscriptionGrowthRate = await this.subscriptionsService.getSubscriptionGrowthRate();
return subscriptionGrowthRate;
}
//************************************ */
private async getPlansSalesCountByMonthsInYear() {
const plansSalesCountByMonthsInYear = await this.subscriptionsService.getPlansSalesCountByMonthsInYear();
return plansSalesCountByMonthsInYear;
}
//************************************ */
private async getPlansSalesCountByDaysInMonth() {
const plansSalesCountByDaysInMonth = await this.subscriptionsService.getPlansSalesCountByDaysInMonth();
return plansSalesCountByDaysInMonth;
}
//************************************ */
private async getPlansSalesCountByDaysInWeek() {
const plansSalesCountByDaysInWeek = await this.subscriptionsService.getPlansSalesCountByDaysInWeek();
return plansSalesCountByDaysInWeek;
}
}