Skip to content

Commit

Permalink
[NestJS] Milestone 4: Background check
Browse files Browse the repository at this point in the history
  • Loading branch information
javiertoledo committed May 3, 2023
1 parent 5721aa3 commit b5371fa
Show file tree
Hide file tree
Showing 11 changed files with 252 additions and 88 deletions.
4 changes: 4 additions & 0 deletions kyc-nest/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
OFAC_PROXY_URL="http://localhost:8000"
OFAC_PROXY_API_KEY="1234567890"
PEP_PROXY_URL="http://localhost:8000"
PEP_PROXY_API_KEY="1234567890"
153 changes: 72 additions & 81 deletions kyc-nest/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions kyc-nest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
},
"dependencies": {
"@nestjs/common": "^9.0.0",
"@nestjs/config": "^2.3.1",
"@nestjs/core": "^9.0.0",
"@nestjs/platform-express": "^9.0.0",
"@nestjs/typeorm": "^9.0.1",
Expand Down
2 changes: 2 additions & 0 deletions kyc-nest/src/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { ProfileModule } from './profile/profile.module';
Expand All @@ -7,6 +8,7 @@ import { KycModule } from './kyc/kyc.module';

@Module({
imports: [
ConfigModule.forRoot(),
TypeOrmModule.forRoot({
type: 'sqlite',
database: 'kyc-nest.sqlite',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,10 @@ export interface AddressVerificationWebhookMessage {
result: 'success' | 'rejected';
timestamp: string;
}

export interface ManualBackgroundCheckMessage {
userId: string;
validatorId: string;
resolution: 'passed' | 'rejected';
timestamp: string;
}
10 changes: 9 additions & 1 deletion kyc-nest/src/kyc/kyc.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { KYCService } from './kyc.service';
import {
IDVerificationWebhookMessage,
AddressVerificationWebhookMessage,
} from './webhook-message.interface';
ManualBackgroundCheckMessage,
} from './api-messages.interface';

@Controller('kyc')
export class KYCController {
Expand All @@ -22,4 +23,11 @@ export class KYCController {
): Promise<void> {
await this.kycService.handleAddressVerificationWebhook(message);
}

@Post('submit-manual-background-check')
async submitManualBackgroundCheck(
@Body() payload: ManualBackgroundCheckMessage,
): Promise<void> {
await this.kycService.submitManualBackgroundCheck(payload);
}
}
3 changes: 2 additions & 1 deletion kyc-nest/src/kyc/kyc.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import { Module } from '@nestjs/common';
import { KYCService } from './kyc.service';
import { KYCController } from './kyc.controller';
import { ProfileModule } from 'src/profile/profile.module';
import { ConfigModule } from '@nestjs/config';

@Module({
imports: [ProfileModule],
imports: [ProfileModule, ConfigModule.forRoot()],
providers: [KYCService],
controllers: [KYCController],
})
Expand Down
Loading

0 comments on commit b5371fa

Please sign in to comment.