forked from Yara724/api
HOTFIX: not allowing empty price when expert tries to submit
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user