39 lines
784 B
TypeScript
39 lines
784 B
TypeScript
import { ApiProperty, ApiPropertyOptional, PartialType } from '@nestjs/swagger';
|
|
import {
|
|
IsEnum,
|
|
IsOptional,
|
|
IsString,
|
|
MaxLength,
|
|
MinLength,
|
|
} from 'class-validator';
|
|
import { StorageSetType } from 'src/objects/storage/enums/storage-set-type.enum';
|
|
|
|
export class StorageSetCreateRequestDto {
|
|
@ApiProperty()
|
|
@IsString()
|
|
@MinLength(3)
|
|
@MaxLength(32)
|
|
displayName: string;
|
|
|
|
@ApiProperty({ type: String, enum: StorageSetType })
|
|
@IsEnum(StorageSetType)
|
|
type: StorageSetType;
|
|
|
|
@ApiProperty()
|
|
@IsString()
|
|
location: string;
|
|
|
|
@ApiPropertyOptional()
|
|
@IsString()
|
|
@IsOptional()
|
|
locationDescription?: string;
|
|
|
|
@ApiProperty()
|
|
@IsString()
|
|
color: string;
|
|
}
|
|
|
|
export class StorageSetUpdateRequestDto extends PartialType(
|
|
StorageSetCreateRequestDto,
|
|
) {}
|