forked from Yara724/api
fix: align inquiry errors and expert review rules
This commit is contained in:
@@ -147,6 +147,13 @@ import {
|
||||
getInquiryErrorMessage,
|
||||
} from "src/common/utils/inquiry-error";
|
||||
|
||||
function mappedInquiryErrorMessage(value: any): string | undefined {
|
||||
const message = value?.mapped?.Error?.Message;
|
||||
return typeof message === "string" && message.trim()
|
||||
? message.trim()
|
||||
: undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats a compact Jalali date (number or string like 13780624) as YYYY/MM/DD.
|
||||
* Returns the original value as a string if it cannot be parsed.
|
||||
@@ -401,6 +408,7 @@ export class RequestManagementService {
|
||||
!value?.mapped?.Error &&
|
||||
!!value?.mapped?.CompanyName &&
|
||||
isMappedPolicyCurrent(value.mapped),
|
||||
errorMessage: mappedInquiryErrorMessage,
|
||||
});
|
||||
return {
|
||||
...result.value,
|
||||
@@ -435,6 +443,7 @@ export class RequestManagementService {
|
||||
value.mapped.CompanyName ||
|
||||
value.mapped.companyId
|
||||
),
|
||||
errorMessage: mappedInquiryErrorMessage,
|
||||
});
|
||||
return {
|
||||
...result.value,
|
||||
|
||||
Reference in New Issue
Block a user