refactor: handle kyc journey for customers

This commit is contained in:
Abdalhamid Alhamad
2025-02-20 16:18:06 +03:00
parent 270753cfd7
commit dae9cb6323
74 changed files with 1116 additions and 477 deletions

View File

@ -0,0 +1,32 @@
import { Body, Controller, Headers, HttpCode, HttpStatus, Patch, Post, UseGuards } from '@nestjs/common';
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';
import { IJwtPayload } from '~/auth/interfaces';
import { DEVICE_ID_HEADER } from '~/common/constants';
import { AuthenticatedUser, Public } from '~/common/decorators';
import { AccessTokenGuard } from '~/common/guards';
import { SetInternalPasswordRequestDto, UpdateNotificationsSettingsRequestDto } from '../dtos/request';
import { UserService } from '../services';
@Controller('users')
@ApiTags('Users')
@UseGuards(AccessTokenGuard)
@ApiBearerAuth()
export class UserController {
constructor(private userService: UserService) {}
@Patch('notifications-settings')
async updateNotificationSettings(
@AuthenticatedUser() user: IJwtPayload,
@Body() data: UpdateNotificationsSettingsRequestDto,
@Headers(DEVICE_ID_HEADER) deviceId: string,
) {
return this.userService.updateNotificationSettings(user.sub, data, deviceId);
}
@Post('internal/set-password')
@Public()
@HttpCode(HttpStatus.NO_CONTENT)
async setPassword(@Body() data: SetInternalPasswordRequestDto) {
return this.userService.setCheckerPassword(data);
}
}