forked from Yara724/api
YARA-836 + 2 more sms
This commit is contained in:
@@ -10,6 +10,7 @@ type TemplateArgs = {
|
||||
token: string;
|
||||
token2?: string;
|
||||
token3?: string;
|
||||
token10?: string;
|
||||
};
|
||||
|
||||
@Injectable()
|
||||
@@ -40,6 +41,15 @@ export class SmsOrchestrationService implements OnModuleInit {
|
||||
return `${process.env.URL}/${frontendRoute}?token=${requestId}`;
|
||||
}
|
||||
|
||||
buildBlamePartyLink(requestId: string, partyRole: "FIRST" | "SECOND"): string {
|
||||
const route = partyRole === "SECOND" ? "user2" : "user";
|
||||
return `${process.env.URL}/${route}?token=${requestId}`;
|
||||
}
|
||||
|
||||
buildClaimLink(claimRequestId: string): string {
|
||||
return `${process.env.URL}/claim?token=${claimRequestId}`;
|
||||
}
|
||||
|
||||
async sendInviteLink(phoneNumber: string, link: string): Promise<boolean> {
|
||||
return this.sendTemplate({
|
||||
template: "yara724-invite-link",
|
||||
@@ -124,6 +134,38 @@ export class SmsOrchestrationService implements OnModuleInit {
|
||||
});
|
||||
}
|
||||
|
||||
async sendResendDocumentsNotice(params: {
|
||||
receptor: string;
|
||||
fileKind: "blame" | "claim";
|
||||
publicId: string;
|
||||
link: string;
|
||||
}): Promise<boolean> {
|
||||
return this.sendTemplate({
|
||||
template: "yara-resend-documents",
|
||||
receptor: params.receptor,
|
||||
token: params.fileKind === "blame" ? "تصادف" : "خسارت",
|
||||
token2: params.publicId,
|
||||
token3: params.link,
|
||||
});
|
||||
}
|
||||
|
||||
async sendSignatureReviewNotice(params: {
|
||||
receptor: string;
|
||||
fileKind: "blame" | "claim";
|
||||
publicId: string;
|
||||
expertLastName: string;
|
||||
link: string;
|
||||
}): Promise<boolean> {
|
||||
return this.sendTemplate({
|
||||
template: "yara-signature",
|
||||
receptor: params.receptor,
|
||||
token: params.fileKind === "blame" ? "تصادف" : "خسارت",
|
||||
token2: params.publicId,
|
||||
token3: params.expertLastName || "کارشناس",
|
||||
token10: params.link,
|
||||
});
|
||||
}
|
||||
|
||||
private async sendTemplate(args: TemplateArgs): Promise<boolean> {
|
||||
try {
|
||||
await this.smsGatewayService.verifyLookUp(args);
|
||||
|
||||
Reference in New Issue
Block a user