feat: add domains, ideas, layouts, widgets API modules
- Add DomainsModule with full CRUD, search, and activity logging - Add IdeasModule with quick capture endpoint - Add LayoutsModule for user dashboard layouts - Add WidgetsModule for widget definitions (read-only) - Update ActivityService with domain/idea logging methods - Register all new modules in AppModule
This commit is contained in:
56
apps/api/src/ideas/dto/create-idea.dto.ts
Normal file
56
apps/api/src/ideas/dto/create-idea.dto.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
import { IdeaStatus, TaskPriority } from "@prisma/client";
|
||||
import {
|
||||
IsString,
|
||||
IsOptional,
|
||||
IsEnum,
|
||||
IsArray,
|
||||
IsUUID,
|
||||
IsObject,
|
||||
MinLength,
|
||||
MaxLength,
|
||||
} from "class-validator";
|
||||
|
||||
/**
|
||||
* DTO for creating a new idea
|
||||
*/
|
||||
export class CreateIdeaDto {
|
||||
@IsOptional()
|
||||
@IsString({ message: "title must be a string" })
|
||||
@MaxLength(500, { message: "title must not exceed 500 characters" })
|
||||
title?: string;
|
||||
|
||||
@IsString({ message: "content must be a string" })
|
||||
@MinLength(1, { message: "content must not be empty" })
|
||||
@MaxLength(50000, { message: "content must not exceed 50000 characters" })
|
||||
content!: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsUUID("4", { message: "domainId must be a valid UUID" })
|
||||
domainId?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsUUID("4", { message: "projectId must be a valid UUID" })
|
||||
projectId?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsEnum(IdeaStatus, { message: "status must be a valid IdeaStatus" })
|
||||
status?: IdeaStatus;
|
||||
|
||||
@IsOptional()
|
||||
@IsEnum(TaskPriority, { message: "priority must be a valid TaskPriority" })
|
||||
priority?: TaskPriority;
|
||||
|
||||
@IsOptional()
|
||||
@IsString({ message: "category must be a string" })
|
||||
@MaxLength(100, { message: "category must not exceed 100 characters" })
|
||||
category?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsArray({ message: "tags must be an array" })
|
||||
@IsString({ each: true, message: "each tag must be a string" })
|
||||
tags?: string[];
|
||||
|
||||
@IsOptional()
|
||||
@IsObject({ message: "metadata must be an object" })
|
||||
metadata?: Record<string, unknown>;
|
||||
}
|
||||
Reference in New Issue
Block a user