Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:refactored retry-bulk-credentials api to add dynamic support to email template #850

Merged
merged 2 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/api-gateway/src/issuance/issuance.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ async downloadBulkIssuanceCSVTemplate(
const bulkIssuanceDetails = await this.issueCredentialService.retryBulkCredential(
fileId,
orgId,
clientDetails.clientId
clientDetails
);
const finalResponse: IResponseType = {
statusCode: HttpStatus.CREATED,
Expand Down
4 changes: 2 additions & 2 deletions apps/api-gateway/src/issuance/issuance.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ export class IssuanceService extends BaseService {
return this.sendNatsMessage(this.issuanceProxy, 'issue-bulk-credentials', payload);
}

async retryBulkCredential(fileId: string, orgId: string, clientId: string): Promise<{ response: object }> {
const payload = { fileId, orgId, clientId };
async retryBulkCredential(fileId: string, orgId: string, clientDetails: ClientDetails): Promise<{ response: object }> {
const payload = { fileId, orgId, clientDetails };
return this.sendNats(this.issuanceProxy, 'retry-bulk-credentials', payload);
}

Expand Down
4 changes: 2 additions & 2 deletions apps/issuance/src/issuance.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ export class IssuanceController {
}

@MessagePattern({ cmd: 'retry-bulk-credentials' })
async retryeBulkCredentials(payload: { fileId: string, orgId: string, clientId: string }): Promise<string> {
return this.issuanceService.retryBulkCredential(payload.fileId, payload.orgId, payload.clientId);
async retryeBulkCredentials(payload: { fileId: string, orgId: string, clientDetails: IClientDetails }): Promise<string> {
return this.issuanceService.retryBulkCredential(payload.fileId, payload.orgId, payload.clientDetails);
}

@MessagePattern({ cmd: 'delete-issuance-records' })
Expand Down
8 changes: 5 additions & 3 deletions apps/issuance/src/issuance.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1407,7 +1407,7 @@ async sendEmailForCredentialOffer(sendEmailCredentialOffer: SendEmailCredentialO
}
}

async retryBulkCredential(fileId: string, orgId: string, clientId: string): Promise<string> {
async retryBulkCredential(fileId: string, orgId: string, clientDetails: IClientDetails): Promise<string> {
let bulkpayloadRetry;
try {
const fileDetails = await this.issuanceRepository.getFileDetailsById(fileId);
Expand All @@ -1422,9 +1422,11 @@ async sendEmailForCredentialOffer(sendEmailCredentialOffer: SendEmailCredentialO

try {
const bulkPayloadDetails: BulkPayloadDetails = {
clientId,
clientId : clientDetails.clientId,
orgId,
isRetry: true
isRetry: true,
organizationLogoUrl: clientDetails?.organizationLogoUrl,
platformName: clientDetails?.platformName
};
this.processInBatches(bulkpayloadRetry, bulkPayloadDetails);
} catch (error) {
Expand Down