YARA-836 + 2 more sms

This commit is contained in:
SepehrYahyaee
2026-04-25 16:53:56 +03:30
parent 9c87927e6c
commit 5d2227b00b
7 changed files with 156 additions and 4 deletions

View File

@@ -22,6 +22,7 @@ export interface VerifyLookUpMessage {
token: string;
token2?: string;
token3?: string;
token10?: string;
receptor: string;
}

View File

@@ -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);