54 lines
1.0 KiB
TypeScript
54 lines
1.0 KiB
TypeScript
import { Transform } from 'class-transformer';
|
|
import {
|
|
IsISO8601,
|
|
IsOptional,
|
|
IsString,
|
|
IsUUID,
|
|
Matches,
|
|
MaxLength,
|
|
MinLength,
|
|
} from 'class-validator';
|
|
|
|
export class UpdateSurveyCampaignDto {
|
|
@IsOptional()
|
|
@Transform(({ value }) =>
|
|
typeof value === 'string' ? value.trim().toUpperCase() : value,
|
|
)
|
|
@IsString()
|
|
@MinLength(1)
|
|
@MaxLength(80)
|
|
@Matches(/^[A-Z0-9][A-Z0-9._/-]*$/)
|
|
code?: string;
|
|
|
|
@IsOptional()
|
|
@Transform(({ value }) => (typeof value === 'string' ? value.trim() : value))
|
|
@IsString()
|
|
@MinLength(1)
|
|
@MaxLength(200)
|
|
name?: string;
|
|
|
|
@IsOptional()
|
|
@Transform(({ value }) =>
|
|
typeof value === 'string' && value.trim() ? value.trim() : null,
|
|
)
|
|
@IsString()
|
|
@MaxLength(4000)
|
|
description?: string | null;
|
|
|
|
@IsOptional()
|
|
@IsISO8601({ strict: true })
|
|
plannedStartAt?: string | null;
|
|
|
|
@IsOptional()
|
|
@IsISO8601({ strict: true })
|
|
plannedEndAt?: string | null;
|
|
|
|
@IsOptional()
|
|
@IsUUID('4')
|
|
scopeAssetId?: string | null;
|
|
|
|
@IsOptional()
|
|
@IsUUID('4')
|
|
coordinatorUserId?: string | null;
|
|
}
|