mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2026-03-10 20:41:46 +00:00
- Added address fields to registration (verify-user DTO) - Added address fields to KYC initiation (initiate-kyc DTO) - Added national_id column to kyc_transactions table - Changed duplicate KYC check from customerId to nationalId - Added KYC webhook endpoint (/api/neoleap-webhooks/kyc) - Added webhook processing logic - Updated customer service to save address during registration and KYC - Added validation to require address before card creation - Removed duplicate src/migrations/ directory
51 lines
1.4 KiB
TypeScript
51 lines
1.4 KiB
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
|
import { IsEnum, IsObject, IsString } from 'class-validator';
|
|
|
|
export enum NeoleapKycWebhookStatus {
|
|
ONBOARDING_SUCCESS = 'ONBOARDING_SUCCESS',
|
|
ONBOARDING_FAILURE = 'ONBOARDING_FAILURE',
|
|
IN_PROGRESS = 'IN_PROGRESS',
|
|
}
|
|
|
|
class KycEntityDto {
|
|
@ApiProperty({ example: 'INDIVIDUAL', description: 'Entity type - INDIVIDUAL for KYC' })
|
|
@IsString()
|
|
type!: string;
|
|
|
|
@ApiProperty({ example: 'FIN-TECK-CUSTOMER-20393', description: 'Customer external ID from Neoleap' })
|
|
@IsString()
|
|
externalId!: string;
|
|
}
|
|
|
|
export class KycWebhookRequest {
|
|
@ApiProperty({
|
|
example: '8a745b1b-1252-4921-a569-b3d4406c25fd',
|
|
description: 'Transaction ID, the same as returned from onboard API response'
|
|
})
|
|
@IsString()
|
|
stateId!: string;
|
|
|
|
@ApiProperty({
|
|
example: '8a745b1b-1252-4921-a569-b3d4406c25fd',
|
|
description: 'Unique callback ID used as reference and for tracking'
|
|
})
|
|
@IsString()
|
|
callbackId!: string;
|
|
|
|
@ApiProperty({ example: '1100', description: 'Fintech ID (1100 for ZOD)' })
|
|
@IsString()
|
|
externalFintechId!: string;
|
|
|
|
@ApiProperty({ type: KycEntityDto })
|
|
@IsObject()
|
|
entity!: KycEntityDto;
|
|
|
|
@ApiProperty({
|
|
enum: NeoleapKycWebhookStatus,
|
|
example: NeoleapKycWebhookStatus.ONBOARDING_SUCCESS,
|
|
description: 'Status of onboarding: ONBOARDING_SUCCESS or ONBOARDING_FAILURE'
|
|
})
|
|
@IsEnum(NeoleapKycWebhookStatus)
|
|
status!: NeoleapKycWebhookStatus;
|
|
}
|