Allow negative SMS auto-block threshold in API.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -20,7 +20,7 @@ export class UpdateSmsAccountDto {
|
|||||||
@IsBoolean()
|
@IsBoolean()
|
||||||
isBlocked?: boolean;
|
isBlocked?: boolean;
|
||||||
|
|
||||||
/** Null clears auto-block; omit leaves unchanged. UI sends tomans×10 as rials. */
|
/** Null clears auto-block; omit leaves unchanged. May be negative (credit limit). UI sends tomans×10 as rials. */
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@Transform(({ value }) => {
|
@Transform(({ value }) => {
|
||||||
if (value === null || value === '' || value === undefined) return value === undefined ? undefined : null;
|
if (value === null || value === '' || value === undefined) return value === undefined ? undefined : null;
|
||||||
@@ -29,7 +29,6 @@ export class UpdateSmsAccountDto {
|
|||||||
})
|
})
|
||||||
@ValidateIf((_, v) => v !== null && v !== undefined)
|
@ValidateIf((_, v) => v !== null && v !== undefined)
|
||||||
@IsInt()
|
@IsInt()
|
||||||
@Min(0)
|
|
||||||
autoBlockBelowRials?: number | null;
|
autoBlockBelowRials?: number | null;
|
||||||
|
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
|
|||||||
Reference in New Issue
Block a user