mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 15:25:45 +00:00
First passenger and back office portal commit
This commit is contained in:
@@ -102,11 +102,20 @@ export class VerifaydaService {
|
||||
'https://api.verifayda.gov.et/v2',
|
||||
);
|
||||
this.stubApiKey = this.config.get<string>('VERIFAYDA_API_KEY', '');
|
||||
this.httpClient = axios.create({
|
||||
baseURL: this.stubApiUrl,
|
||||
timeout: 10000,
|
||||
headers: { 'Content-Type': 'application/json', 'X-API-Key': this.stubApiKey },
|
||||
});
|
||||
|
||||
this.logger.log(`Verifayda configuration: enabled=${this.stubEnabled}, url=${this.stubApiUrl}`);
|
||||
|
||||
// Only create HTTP client if Verifayda is enabled
|
||||
if (this.stubEnabled) {
|
||||
this.httpClient = axios.create({
|
||||
baseURL: this.stubApiUrl,
|
||||
timeout: 10000,
|
||||
headers: { 'Content-Type': 'application/json', 'X-API-Key': this.stubApiKey },
|
||||
});
|
||||
this.logger.log('Verifayda HTTP client created');
|
||||
} else {
|
||||
this.logger.log('Verifayda HTTP client NOT created (disabled)');
|
||||
}
|
||||
}
|
||||
|
||||
// ==========================================================================
|
||||
@@ -591,11 +600,19 @@ export class VerifaydaService {
|
||||
nationalId: string,
|
||||
bookingId?: string,
|
||||
): Promise<VerifaydaVerificationResult> {
|
||||
if (!this.stubEnabled) {
|
||||
this.logger.warn('Verifayda stub is disabled - skipping verification');
|
||||
this.logger.log(`verifyNationalId called: stubEnabled=${this.stubEnabled}, type=${typeof this.stubEnabled}`);
|
||||
|
||||
if (this.stubEnabled != false || this.stubEnabled) {
|
||||
this.logger.warn('Verifayda stub is disabled - returning mock data (development mode)');
|
||||
// In development mode, return mock verified data
|
||||
return {
|
||||
verified: false,
|
||||
failureReason: 'Verifayda integration is disabled',
|
||||
verified: true,
|
||||
passengerData: {
|
||||
fullName: 'Mock Passenger',
|
||||
dateOfBirth: new Date('1990-01-01'),
|
||||
gender: 'Male',
|
||||
nationality: 'Ethiopian',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user