diff --git a/backoffice/src/admin/admin.controller.ts b/backoffice/src/admin/admin.controller.ts new file mode 100644 index 0000000..34659bd --- /dev/null +++ b/backoffice/src/admin/admin.controller.ts @@ -0,0 +1,18 @@ +import { Controller, Get } from '@nestjs/common'; +import { ApiTags, ApiOperation } from '@nestjs/swagger'; +import { AdminService } from './admin.service'; + +@ApiTags('Admin Dashboard') +@Controller('admin') +export class AdminController { + constructor(private readonly adminService: AdminService) { } + + @Get('stats') @ApiOperation({ summary: 'Get dashboard stats' }) + async getDashboardStats() { return this.adminService.getDashboardStats(); } + + @Get('revenue') @ApiOperation({ summary: 'Get revenue by month' }) + async getRevenueByMonth() { return this.adminService.getRevenueByMonth(); } + + @Get('subscriptions-by-plan') @ApiOperation({ summary: 'Get subscriptions distribution' }) + async getSubscriptionsByPlan() { return this.adminService.getSubscriptionsByPlan(); } +} diff --git a/backoffice/src/admin/admin.module.ts b/backoffice/src/admin/admin.module.ts new file mode 100644 index 0000000..d0b4ba8 --- /dev/null +++ b/backoffice/src/admin/admin.module.ts @@ -0,0 +1,10 @@ +import { Module } from '@nestjs/common'; +import { AdminService } from './admin.service'; +import { AdminController } from './admin.controller'; + +@Module({ + providers: [AdminService], + controllers: [AdminController], + exports: [AdminService], +}) +export class AdminModule { } diff --git a/backoffice/src/admin/admin.service.ts b/backoffice/src/admin/admin.service.ts new file mode 100644 index 0000000..c67fda0 --- /dev/null +++ b/backoffice/src/admin/admin.service.ts @@ -0,0 +1,22 @@ +import { Injectable } from '@nestjs/common'; + +@Injectable() +export class AdminService { + async getDashboardStats() { + return { + totalCompanies: 30, totalUsers: 1250, totalJobs: 990, totalApplications: 3500, + activeSubscriptions: 25, monthlyRevenue: 12500, recentSignups: 45, conversionRate: 8.5, + }; + } + + async getRevenueByMonth() { + return [ + { month: 'Jan', revenue: 8500 }, { month: 'Feb', revenue: 9200 }, + { month: 'Mar', revenue: 10100 }, { month: 'Apr', revenue: 11500 }, { month: 'May', revenue: 12500 }, + ]; + } + + async getSubscriptionsByPlan() { + return [{ plan: 'Starter', count: 10 }, { plan: 'Professional', count: 12 }, { plan: 'Enterprise', count: 3 }]; + } +} diff --git a/backoffice/src/admin/index.ts b/backoffice/src/admin/index.ts new file mode 100644 index 0000000..bac126e --- /dev/null +++ b/backoffice/src/admin/index.ts @@ -0,0 +1,3 @@ +export * from './admin.module'; +export * from './admin.service'; +export * from './admin.controller';