Merge pull request 'YARA-1154' (#219) from s.yahyaee/yara724-api:main into main

Reviewed-on: Yara724/api#219
This commit is contained in:
2026-07-27 09:39:08 +03:30
4 changed files with 20 additions and 8 deletions

View File

@@ -1871,6 +1871,7 @@ export class ExpertBlameService {
link: this.smsOrchestrationService.buildBlamePartyLink(
requestIdToken,
role,
"v1",
),
});
}
@@ -2065,6 +2066,7 @@ export class ExpertBlameService {
link: this.smsOrchestrationService.buildBlamePartyLink(
requestIdToken,
linkRole,
"v1",
),
});
}

View File

@@ -3164,7 +3164,7 @@ export class ExpertClaimService {
receptor: ownerPhoneResend,
fileKind: "claim",
publicId: claim.publicId,
link: this.smsOrchestrationService.buildClaimLink(String(claim._id)),
link: this.smsOrchestrationService.buildClaimLink(String(claim._id), "v1"),
});
}
@@ -3462,7 +3462,7 @@ export class ExpertClaimService {
fileKind: "claim",
publicId: claim.publicId,
expertLastName,
link: this.smsOrchestrationService.buildClaimLink(String(claim._id)),
link: this.smsOrchestrationService.buildClaimLink(String(claim._id), "v1"),
});
}

View File

@@ -2319,6 +2319,7 @@ export class RequestManagementService {
const url = this.smsOrchestrationService.buildInviteLink(
frontendRoute,
requestId,
"v1",
);
await this.smsOrchestrationService.sendInviteLink(
secondPartyPhone,
@@ -2372,6 +2373,7 @@ export class RequestManagementService {
const url = this.smsOrchestrationService.buildInviteLink(
frontendRoute,
requestId,
"v1",
);
await this.smsOrchestrationService.sendInviteLink(
phoneNumber,
@@ -3485,6 +3487,7 @@ export class RequestManagementService {
const URL = this.smsOrchestrationService.buildInviteLink(
frontendRoutes,
requestId,
"v1",
);
await this.smsOrchestrationService.sendInviteLink(
phoneNumber,
@@ -4927,6 +4930,7 @@ export class RequestManagementService {
const firstLink = this.smsOrchestrationService.buildBlamePartyLink(
requestId,
"FIRST",
"v2",
);
const smsSent = await this.smsOrchestrationService.sendFieldExpertLink({
receptor: phone,
@@ -8365,6 +8369,7 @@ export class RequestManagementService {
targetPhone === request?.parties[0]?.person.phoneNumber
? "FIRST"
: "SECOND",
"v1",
);
await this.smsOrchestrationService.sendThirdPartyDamagedPartyClaimLinkNotice(
{
@@ -10229,7 +10234,7 @@ export class RequestManagementService {
req.parties[firstIdx].person.userId = userId;
const expertName = `${agent?.lastName || ""}`.trim() || "اپراتور";
const firstLink = this.smsOrchestrationService.buildBlamePartyLink(requestId, "FIRST");
const firstLink = this.smsOrchestrationService.buildBlamePartyLink(requestId, "FIRST", "v6");
const smsSent = await this.smsOrchestrationService.sendFieldExpertLink({
receptor: phone,
type: req.type,

View File

@@ -37,20 +37,25 @@ export class SmsOrchestrationService implements OnModuleInit {
);
}
buildInviteLink(frontendRoute: string, requestId: string): string {
return `${process.env.URL}/${process.env.USER_BASE_PATH}/${frontendRoute}?token=${requestId}`;
buildInviteLink(
frontendRoute: string,
requestId: string,
versionPrefix: string,
): string {
return `${process.env.URL}/${versionPrefix}/${frontendRoute}?token=${requestId}`;
}
buildBlamePartyLink(
requestId: string,
partyRole: "FIRST" | "SECOND",
versionPrefix: string,
): string {
const route = partyRole === "SECOND" ? "user2" : "user";
return `${process.env.URL}/${process.env.USER_BASE_PATH}/${route}?token=${requestId}`;
return `${process.env.URL}/${versionPrefix}/${route}?token=${requestId}`;
}
buildClaimLink(claimRequestId: string): string {
return `${process.env.URL}/${process.env.USER_BASE_PATH}/caseClaim?token=${claimRequestId}`;
buildClaimLink(claimRequestId: string, versionPrefix: string): string {
return `${process.env.URL}/${versionPrefix}/caseClaim?token=${claimRequestId}`;
}
async sendInviteLink(