1
0
forked from Yara724/api

Fixed mismatched userId on field expert for claim

This commit is contained in:
SepehrYahyaee
2026-06-20 11:53:18 +03:30
parent d355771518
commit 5a89a0ff16
26 changed files with 144 additions and 414 deletions

View File

@@ -440,12 +440,13 @@ export class ExpertClaimService {
return fallback;
}
/** Owner mobile: linked blame party phone when available, else `users.mobile`. */
/** Damaged-party mobile for claim SMS: prefer `damagedPartyUserId`, else `owner.userId`. */
private async resolveClaimOwnerPhone(
claim: any,
): Promise<string | undefined> {
if (!claim?.owner?.userId) return undefined;
const ownerUserId = String(claim.owner.userId);
const notifyUserId = claim?.damagedPartyUserId ?? claim?.owner?.userId;
if (!notifyUserId) return undefined;
const ownerUserId = String(notifyUserId);
if (claim.blameRequestId) {
const blame = await this.blameRequestDbService.findById(
claim.blameRequestId.toString(),