chore: add order to the service category
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
|
||||
import { IsBoolean, IsNotEmpty, IsOptional, IsString, IsUUID, IsUrl, Length } from "class-validator";
|
||||
import { IsBoolean, IsInt, IsNotEmpty, IsOptional, IsString, IsUUID, IsUrl, Length } from "class-validator";
|
||||
|
||||
import { CategoryMessage } from "../../../common/enums/message.enum";
|
||||
|
||||
@@ -25,4 +25,9 @@ export class CreateCategoryDto {
|
||||
@IsUUID("4", { message: CategoryMessage.PARENT_ID_SHOULD_BE_UUID })
|
||||
@ApiPropertyOptional({ description: "Parent category id", example: "8b1e8b1e-8b1e-8b1e-8b1e-8b1e8b1e8b1e" })
|
||||
parentId?: string;
|
||||
|
||||
@IsNotEmpty({ message: CategoryMessage.ORDER_REQUIRED })
|
||||
@IsInt({ message: CategoryMessage.ORDER_SHOULD_BE_INT })
|
||||
@ApiProperty({ description: "Category order", example: 1 })
|
||||
order: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user