chore: add order to the service category

This commit is contained in:
mahyargdz
2025-03-09 16:56:43 +03:30
parent cdeca5375e
commit cb8ecd770c
4 changed files with 100 additions and 23 deletions
@@ -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;
}