Files
backend/src/business-admin/dto/update-business.dto.ts
T
Alireza HassaniandCursor b1dcecc468 Add customer Excel import/export and Gama bulk SMS sending.
Business SMS uses optional settings.sms.senderNumber (else advertising shortcode) with SendQuick for one recipient and SendBulk for quantity.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-08 14:12:48 +03:30

75 lines
1.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import {
ArrayMinSize,
IsArray,
IsDateString,
IsInt,
IsOptional,
IsPositive,
IsString,
Matches,
MinLength,
ValidateIf,
} from 'class-validator';
import { Type } from 'class-transformer';
export class UpdateBusinessDto {
@IsOptional()
@IsString()
@MinLength(2)
nameFa?: string;
@IsOptional()
@IsString()
@MinLength(2)
name?: string;
@IsOptional()
@IsString()
about?: string;
@IsOptional()
@IsString()
@Matches(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, {
message: 'slug must be lowercase letters, numbers, and hyphens',
})
slug?: string;
@IsOptional()
@IsArray()
@ArrayMinSize(1)
@Type(() => Number)
@IsInt({ each: true })
categoryIds?: number[];
@IsOptional()
@ValidateIf((_, value) => value !== null)
@Type(() => Number)
@IsInt()
ownerUserId?: number | null;
/** Legacy WillaEngine businesses.id; null clears the link. */
@IsOptional()
@ValidateIf((_, value) => value !== null)
@Type(() => Number)
@IsInt()
@IsPositive()
oldBusinessId?: number | null;
@IsOptional()
@ValidateIf((_, value) => value !== null)
@IsDateString()
annualRenewalAt?: string | null;
/**
* Business SMS shortcode for customer messages (e.g. 5000123456).
* Empty string or null clears it (falls back to Meshkee advertising number).
*/
@IsOptional()
@ValidateIf((_, value) => value !== null && value !== '')
@IsString()
@Matches(/^\d{8,16}$/, {
message: 'smsSenderNumber must be an 8–16 digit shortcode',
})
smsSenderNumber?: string | null;
}