forked from Yara724/api
fix: align inquiry errors and expert review rules
This commit is contained in:
@@ -446,6 +446,7 @@ export async function runCurrentPlateInquiry<T>(options: {
|
||||
vin?: string;
|
||||
query: (plate: InquiryVehicleInputDto["currentPlate"]) => Promise<T>;
|
||||
isUsable: (value: T) => boolean;
|
||||
errorMessage?: (value: T) => string | undefined;
|
||||
}): Promise<{
|
||||
value: T;
|
||||
plateKind: "CURRENT";
|
||||
@@ -479,7 +480,8 @@ export async function runCurrentPlateInquiry<T>(options: {
|
||||
usable: false,
|
||||
});
|
||||
const error = new BadRequestException(
|
||||
"بیمهنامه معتبر و فعالی مطابق مشخصات خودرو و کد ملی واردشده یافت نشد.",
|
||||
options.errorMessage?.(value) ||
|
||||
"بیمهنامه معتبر و فعالی مطابق مشخصات خودرو و کد ملی واردشده یافت نشد.",
|
||||
) as BadRequestException & { attempts?: typeof attempts };
|
||||
error.attempts = attempts;
|
||||
throw error;
|
||||
|
||||
Reference in New Issue
Block a user