Skip to content

Commit

Permalink
Merge pull request #850 from credebl/feat/issuance-email-template
Browse files Browse the repository at this point in the history
feat:refactored `retry-bulk-credentials` api to add dynamic support to email template
  • Loading branch information
ganeshawle25 authored Jul 17, 2024
2 parents 29eb16b + 2b439ff commit 95129a3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
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

0 comments on commit 95129a3

Please sign in to comment.