HOTFIX: not allowing empty price when expert tries to submit

This commit is contained in:
SepehrYahyaee
2026-09-05 16:44:40 +03:30
parent 70fa49398d
commit feacad58ca
7 changed files with 200 additions and 1 deletions

View File

@@ -25,7 +25,12 @@ export class IsRepairLineAmountTomanConstraint
number,
boolean | undefined,
];
if (value == null || value === "") return true;
// Optional fields are skipped by @IsOptional. A required amount must not
// accept an omitted or blank value, otherwise an empty expert pricing line
// can be submitted as a zero-cost repair.
if (value == null || (typeof value === "string" && value.trim() === "")) {
return false;
}
const amount = parseMoneyAmountToman(value);
if (amount == null) return false;
if (allowZero && amount === 0) return true;