From a92c4bec1f3e1da37207fe8bf54909d6d401936b Mon Sep 17 00:00:00 2001 From: Joe Arndt Date: Fri, 13 Feb 2026 11:55:43 -0600 Subject: [PATCH] annoted dtos for swagger --- src/categories/dto/create-category.dto.ts | 5 +++++ src/categories/dto/update-category.dto.ts | 9 +++++++-- src/expenses/dto/update-expense.dto.ts | 2 +- src/merchants/dto/create-merchant.dto.ts | 5 +++++ src/merchants/dto/update-merchant.dto.ts | 9 +++++++-- src/tags/dto/create-tag.dto.ts | 5 +++++ src/tags/dto/update-tag.dto.ts | 9 +++++++-- 7 files changed, 37 insertions(+), 7 deletions(-) diff --git a/src/categories/dto/create-category.dto.ts b/src/categories/dto/create-category.dto.ts index 2222672..a25029d 100644 --- a/src/categories/dto/create-category.dto.ts +++ b/src/categories/dto/create-category.dto.ts @@ -1,3 +1,8 @@ +import { ApiProperty } from '@nestjs/swagger'; + export class CreateCategoryDto { + @ApiProperty({ + description: 'Category for expenses' + }) name: string; } diff --git a/src/categories/dto/update-category.dto.ts b/src/categories/dto/update-category.dto.ts index 6657a69..d15fbbc 100644 --- a/src/categories/dto/update-category.dto.ts +++ b/src/categories/dto/update-category.dto.ts @@ -1,4 +1,9 @@ -export class UpdateCategoryDto { +import { ApiProperty } from '@nestjs/swagger'; +import { CreateCategoryDto } from './create-category.dto'; + +export class UpdateCategoryDto extends CreateCategoryDto { + @ApiProperty({ + description: 'Unique ID of the category' + }) id: string; - name: string; } diff --git a/src/expenses/dto/update-expense.dto.ts b/src/expenses/dto/update-expense.dto.ts index a03aa4c..2ce99d9 100644 --- a/src/expenses/dto/update-expense.dto.ts +++ b/src/expenses/dto/update-expense.dto.ts @@ -3,7 +3,7 @@ import { ApiProperty } from '@nestjs/swagger'; export class UpdateExpenseDto extends CreateExpenseDto { @ApiProperty({ - description: 'UUID of the expense' + description: 'Unique ID of the expense' }) id: string; } diff --git a/src/merchants/dto/create-merchant.dto.ts b/src/merchants/dto/create-merchant.dto.ts index 3d1c09d..05fe980 100644 --- a/src/merchants/dto/create-merchant.dto.ts +++ b/src/merchants/dto/create-merchant.dto.ts @@ -1,3 +1,8 @@ +import { ApiProperty } from '@nestjs/swagger'; + export class CreateMerchantDto { + @ApiProperty({ + description: 'Merchant name' + }) name: string; } diff --git a/src/merchants/dto/update-merchant.dto.ts b/src/merchants/dto/update-merchant.dto.ts index b02185f..f9da3d5 100644 --- a/src/merchants/dto/update-merchant.dto.ts +++ b/src/merchants/dto/update-merchant.dto.ts @@ -1,4 +1,9 @@ -export class UpdateMerchantDto { +import { CreateMerchantDto } from './create-merchant.dto'; +import { ApiProperty } from '@nestjs/swagger'; + +export class UpdateMerchantDto extends CreateMerchantDto { + @ApiProperty({ + description: 'Unique ID of merchant' + }) id: string; - name: string; } diff --git a/src/tags/dto/create-tag.dto.ts b/src/tags/dto/create-tag.dto.ts index 8235483..c0bddbc 100644 --- a/src/tags/dto/create-tag.dto.ts +++ b/src/tags/dto/create-tag.dto.ts @@ -1,3 +1,8 @@ +import { ApiProperty } from '@nestjs/swagger'; + export class CreateTagDto { + @ApiProperty({ + description: 'Tag for expenses' + }) name: string; } diff --git a/src/tags/dto/update-tag.dto.ts b/src/tags/dto/update-tag.dto.ts index ab32e5f..51da6b6 100644 --- a/src/tags/dto/update-tag.dto.ts +++ b/src/tags/dto/update-tag.dto.ts @@ -1,4 +1,9 @@ -export class UpdateTagDto { +import { CreateTagDto } from './create-tag.dto'; +import { ApiProperty } from '@nestjs/swagger'; + +export class UpdateTagDto extends CreateTagDto { + @ApiProperty({ + description: 'Unique ID of tag' + }) id: string; - name: string; }