Files
stack/apps/api/src/ideas/dto/create-idea.dto.ts
Jason Woltje f47dd8bc92 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
2026-01-29 13:47:03 -06:00

57 lines
1.5 KiB
TypeScript

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>;
}