import { Controller, Get, UseGuards } from '@nestjs/common';
import { DashboardService } from './dashboard.service';
import { JwtAuthGuard } from '../auth/guards/jwt-auth.guard';

@Controller('dashboard')
@UseGuards(JwtAuthGuard)
export class DashboardController {
    constructor(private readonly dashboardService: DashboardService) { }

    /**
     * GET /dashboard/kpis
     * Returns KPIs: GMV, Net Revenue, Pending Payouts, Order counts
     */
    @Get('kpis')
    async getKpis() {
        return this.dashboardService.getKpis();
    }

    /**
     * GET /dashboard/revenue-chart
     * Returns daily revenue data for charts
     */
    @Get('revenue-chart')
    async getRevenueChart() {
        return this.dashboardService.getRevenueChart();
    }
}
