30 lines
851 B
TypeScript
30 lines
851 B
TypeScript
import { ApiPropertyOptional } from '@nestjs/swagger';
|
|||
|
|
import { IsBoolean, IsNotEmpty, IsOptional, IsString, IsNumber } from 'class-validator';
|
||
|
|
|
||
|
|
export class CreateOperatorDto {
|
||
|
|
@ApiPropertyOptional({ example: 'EQ', description: 'Unique operator code' })
|
||
|
|
@IsString()
|
||
|
|
@IsNotEmpty()
|
||
|
|
code: string;
|
||
|
|
|
||
|
|
@ApiPropertyOptional({ example: 'Equals', description: 'Display name of the operator' })
|
||
|
|
@IsString()
|
||
|
|
@IsNotEmpty()
|
||
|
|
name: string;
|
||
|
|
|
||
|
|
@ApiPropertyOptional({ example: '=', description: 'Operator symbol' })
|
||
|
|
@IsString()
|
||
|
|
@IsOptional()
|
||
|
|
symbol?: string;
|
||
|
|
|
||
|
|
@ApiPropertyOptional({ example: 1, description: 'Order used for display sorting' })
|
||
|
|
@IsNumber()
|
||
|
|
@IsOptional()
|
||
|
|
displayOrder?: number;
|
||
|
|
|
||
|
|
@ApiPropertyOptional({ example: true, description: 'Whether the operator is active' })
|
||
|
|
@IsBoolean()
|
||
|
|
@IsOptional()
|
||
|
|
isActive?: boolean;
|
||
|
|
}
|