suggestion module
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
import {
|
||||
IsBoolean,
|
||||
IsEnum,
|
||||
IsInt,
|
||||
IsNotEmpty,
|
||||
IsOptional,
|
||||
IsString,
|
||||
IsUUID,
|
||||
MaxLength,
|
||||
Min,
|
||||
} from 'class-validator';
|
||||
import { SuggestionType } from '../enums/suggestion-type.enum';
|
||||
|
||||
export class CreateServiceSuggestionDto {
|
||||
@IsUUID()
|
||||
serviceId: string;
|
||||
|
||||
@IsUUID()
|
||||
suggestedServiceId: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
isActive?: boolean;
|
||||
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@MaxLength(100)
|
||||
badgeTitle: string;
|
||||
|
||||
@IsInt()
|
||||
@Min(0)
|
||||
displayPriority: number;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MaxLength(500)
|
||||
shortDescription?: string;
|
||||
|
||||
@IsEnum(SuggestionType)
|
||||
type: SuggestionType;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { Transform } from 'class-transformer';
|
||||
import { IsBoolean, IsOptional, IsUUID } from 'class-validator';
|
||||
|
||||
export class FindSuggestionsQueryDto {
|
||||
@IsOptional()
|
||||
@IsUUID()
|
||||
serviceId?: string;
|
||||
|
||||
@IsOptional()
|
||||
@Transform(({ value }) => value === 'true' || value === true)
|
||||
@IsBoolean()
|
||||
isActive?: boolean;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
import {
|
||||
IsBoolean,
|
||||
IsEnum,
|
||||
IsInt,
|
||||
IsOptional,
|
||||
IsString,
|
||||
IsUUID,
|
||||
MaxLength,
|
||||
Min,
|
||||
} from 'class-validator';
|
||||
import { SuggestionType } from '../enums/suggestion-type.enum';
|
||||
|
||||
export class UpdateServiceSuggestionDto {
|
||||
@IsOptional()
|
||||
@IsUUID()
|
||||
serviceId?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsUUID()
|
||||
suggestedServiceId?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
isActive?: boolean;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MaxLength(100)
|
||||
badgeTitle?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(0)
|
||||
displayPriority?: number;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MaxLength(500)
|
||||
shortDescription?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsEnum(SuggestionType)
|
||||
type?: SuggestionType;
|
||||
}
|
||||
Reference in New Issue
Block a user