Newer
Older
import {
IsString,
IsDateString,
IsJSON,
IsNotEmpty,
Length,
import { ArrayLength } from 'src/shared/array-validation';
// uses class-validator built in validations
// see https://github.com/typestack/class-validator
@IsString()
@IsNotEmpty()
@Length(2, 31)
name: string;
@IsString()
@IsNotEmpty()
@Length(1, 255)
desc: string;
//@IsJSON()
// doesn't accept with IsJSON, WIP to get validation for map
@IsDateString()
@IsNotEmpty()
startdate: string;
@IsDateString()
@IsNotEmpty()
enddate: string;
@IsArray()
@IsNotEmpty()
@Length(5, 15, {
each: true,
})
// custom validation for array length (arr>min, arr<max)