import { Controller, Get, Patch, Param, Body, UseGuards, Query } from '@nestjs/common';
import { KycService } from './kyc.service';
import { JwtAuthGuard } from '../auth/guards/jwt-auth.guard';
// import { RolesGuard } from '../auth/guards/roles.guard';
// import { Roles } from '../auth/decorators/roles.decorator';

@Controller('admin/kyc')
@UseGuards(JwtAuthGuard)
export class KycController {
    constructor(private readonly kycService: KycService) { }

    @Get('pending')
    // @Roles('ADMIN')
    async listPending(@Query('page') page = '1', @Query('limit') limit = '10') {
        return this.kycService.listPendingDocuments(Number(page), Number(limit));
    }

    @Patch(':id/verify')
    // @Roles('ADMIN')
    async verifyDocument(
        @Param('id') id: string,
        @Body('status') status: 'APPROVED' | 'REJECTED',
        @Body('reason') reason?: string,
    ) {
        return this.kycService.reviewDocument(id, status, reason);
    }
}
