diff --git a/backend/services/ai-service/package.json b/backend/services/ai-service/package.json index 93f9693..99f7cb8 100644 --- a/backend/services/ai-service/package.json +++ b/backend/services/ai-service/package.json @@ -17,6 +17,9 @@ "@nestjs/config": "^3.1.0", "@nestjs/passport": "^10.0.3", "@nestjs/jwt": "^10.2.0", + "passport": "^0.7.0", + "passport-jwt": "^4.0.1", + "@types/passport-jwt": "^4.0.1", "@nestjs/swagger": "^7.2.0", "@nestjs/throttler": "^5.1.0", "typeorm": "^0.3.19", diff --git a/backend/services/user-service/src/interface/http/controllers/user.controller.ts b/backend/services/user-service/src/interface/http/controllers/user.controller.ts index a5cd275..b64d012 100644 --- a/backend/services/user-service/src/interface/http/controllers/user.controller.ts +++ b/backend/services/user-service/src/interface/http/controllers/user.controller.ts @@ -2,13 +2,17 @@ import { Controller, Get, Put, Body, Param, Query, UseGuards, Req } from '@nestj import { ApiTags, ApiOperation, ApiBearerAuth } from '@nestjs/swagger'; import { AuthGuard } from '@nestjs/passport'; import { UserProfileService } from '../../../application/services/user-profile.service'; +import { KycService } from '../../../application/services/kyc.service'; import { UpdateProfileDto } from '../dto/update-profile.dto'; import { UpdateSettingsDto } from '../dto/update-settings.dto'; @ApiTags('Users') @Controller('users') export class UserController { - constructor(private readonly profileService: UserProfileService) {} + constructor( + private readonly profileService: UserProfileService, + private readonly kycService: KycService, + ) {} @Get('me') @UseGuards(AuthGuard('jwt')) @@ -46,6 +50,15 @@ export class UserController { return { code: 0, data: settings }; } + @Get('kyc') + @UseGuards(AuthGuard('jwt')) + @ApiBearerAuth() + @ApiOperation({ summary: 'Get KYC status (alias to avoid :id route conflict)' }) + async getKycStatus(@Req() req: any) { + const result = await this.kycService.getKycStatus(req.user.id); + return { code: 0, data: result }; + } + @Get('payment-methods') @UseGuards(AuthGuard('jwt')) @ApiBearerAuth()