feat: add CategoriesModule with CRUD operations

Implemented CategoriesModule with controller, service, and DTOs for managing categories. Includes endpoints for creation, retrieval, updating, and deletion, integrated with database logic.
This commit is contained in:
Mathis HERRIOT
2026-01-08 15:24:48 +01:00
parent 42805e371e
commit 705f1ad6e0
5 changed files with 138 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
import { IsNotEmpty, IsOptional, IsString } from "class-validator";
export class CreateCategoryDto {
@IsString()
@IsNotEmpty()
name!: string;
@IsOptional()
@IsString()
description?: string;
@IsOptional()
@IsString()
iconUrl?: string;
}

View File

@@ -0,0 +1,4 @@
import { PartialType } from "@nestjs/mapped-types";
import { CreateCategoryDto } from "./create-category.dto";
export class UpdateCategoryDto extends PartialType(CreateCategoryDto) {}