Files
zod-backend/src/common/modules/neoleap/controllers/neoleap-webhooks.controller.ts
Abdalhamid Alhamad ee7b365527 feat: kyc process
2025-08-07 14:23:33 +03:00

41 lines
1.7 KiB
TypeScript

import { Body, Controller, Post } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { ResponseFactory } from '~/core/utils';
import {
AccountCardStatusChangedWebhookRequest,
AccountTransactionWebhookRequest,
CardTransactionWebhookRequest,
KycWebhookRequest,
} from '../dtos/requests';
import { NeoLeapWebhookService } from '../services';
@Controller('neoleap-webhooks')
@ApiTags('Neoleap Webhooks')
export class NeoLeapWebhooksController {
constructor(private readonly neoleapWebhookService: NeoLeapWebhookService) {}
@Post('card-transaction')
async handleCardTransactionWebhook(@Body() body: CardTransactionWebhookRequest) {
await this.neoleapWebhookService.handleCardTransactionWebhook(body);
return ResponseFactory.data({ message: 'Card transaction processed successfully', status: 'success' });
}
@Post('account-transaction')
async handleAccountTransactionWebhook(@Body() body: AccountTransactionWebhookRequest) {
await this.neoleapWebhookService.handleAccountTransactionWebhook(body);
return ResponseFactory.data({ message: 'Account transaction processed successfully', status: 'success' });
}
@Post('account-card-status-changed')
async handleAccountCardStatusChangedWebhook(@Body() body: AccountCardStatusChangedWebhookRequest) {
await this.neoleapWebhookService.handleAccountCardStatusChangedWebhook(body);
return ResponseFactory.data({ message: 'Card status updated successfully', status: 'success' });
}
@Post('kyc')
async handleKycWebhook(@Body() body: KycWebhookRequest) {
await this.neoleapWebhookService.handleKycWebhook(body);
return ResponseFactory.data({ message: 'KYC processed successfully', status: 'success' });
}
}