chore: add danak services and admin login
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
|
||||
import { IsNotEmpty, IsOptional, IsString, IsUUID, IsUrl, Length } from "class-validator";
|
||||
|
||||
import { CategoryMessage } from "../../../common/enums/message.enum";
|
||||
|
||||
export class CreateCategoryDto {
|
||||
@IsNotEmpty({ message: CategoryMessage.TITLE_REQUIRED })
|
||||
@IsString({ message: CategoryMessage.TITLE_STRING })
|
||||
@Length(3, 50, { message: CategoryMessage.TITLE_LENGTH })
|
||||
@ApiProperty({ description: "Category title", example: "business" })
|
||||
title: string;
|
||||
|
||||
@IsNotEmpty({ message: CategoryMessage.ICON_REQUIRED })
|
||||
@IsUrl({ protocols: ["http", "https"], require_protocol: true }, { message: CategoryMessage.ICON_SHOULD_BE_URL })
|
||||
@ApiProperty({ description: "Category icon", example: "https://example.com/icon.png" })
|
||||
icon: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsNotEmpty({ message: CategoryMessage.PARENT_ID_REQUIRED })
|
||||
@IsUUID("4", { message: CategoryMessage.PARENT_ID_SHOULD_BE_UUID })
|
||||
@ApiPropertyOptional({ description: "Parent category id", example: "8b1e8b1e-8b1e-8b1e-8b1e-8b1e8b1e8b1e" })
|
||||
parentId?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user