fix: align inquiry errors and expert review rules

This commit is contained in:
SepehrYahyaee
2026-09-19 12:11:43 +03:30
parent 45e0ad883a
commit 406b139b3d
21 changed files with 457 additions and 55 deletions

View File

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