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

@Controller('performance')
@UseGuards(JwtAuthGuard)
export class PerformanceController {
    constructor(private readonly performanceService: PerformanceService) { }

    /**
     * GET /performance/sellers
     * List all sellers with performance scores
     */
    @Get('sellers')
    async listSellerScores() {
        return this.performanceService.getSellerScores();
    }

    /**
     * GET /performance/sellers/:id
     * Get detailed performance metrics for a specific seller
     */
    @Get('sellers/:id')
    async getSellerScore(@Param('id') id: string) {
        return this.performanceService.getSellerDetails(id);
    }

    /**
     * GET /performance/leaderboard
     * Top 10 sellers by performance
     */
    @Get('leaderboard')
    async getLeaderboard() {
        return this.performanceService.getLeaderboard();
    }
}
