feat(server): endpoints swagger docs

This commit is contained in:
Ahmed Bouhuolia
2025-06-30 16:30:55 +02:00
parent 83e698acf3
commit 9f6e9e85a5
23 changed files with 1248 additions and 23 deletions

View File

@@ -11,7 +11,7 @@ import {
import { AccountsApplication } from './AccountsApplication.service';
import { CreateAccountDTO } from './CreateAccount.dto';
import { EditAccountDTO } from './EditAccount.dto';
import { IAccountsFilter, IAccountsTransactionsFilter } from './Accounts.types';
import { IAccountsFilter } from './Accounts.types';
import {
ApiExtraModels,
ApiOperation,
@@ -22,11 +22,14 @@ import {
} from '@nestjs/swagger';
import { AccountResponseDto } from './dtos/AccountResponse.dto';
import { AccountTypeResponseDto } from './dtos/AccountTypeResponse.dto';
import { GetAccountTransactionResponseDto } from './dtos/GetAccountTransactionResponse.dto';
import { GetAccountTransactionsQueryDto } from './dtos/GetAccountTransactionsQuery.dto';
@Controller('accounts')
@ApiTags('Accounts')
@ApiExtraModels(AccountResponseDto)
@ApiExtraModels(AccountTypeResponseDto)
@ApiExtraModels(GetAccountTransactionResponseDto)
export class AccountsController {
constructor(private readonly accountsApplication: AccountsApplication) {}
@@ -132,8 +135,16 @@ export class AccountsController {
@ApiResponse({
status: 200,
description: 'The account transactions have been successfully retrieved.',
schema: {
type: 'array',
items: {
$ref: getSchemaPath(GetAccountTransactionResponseDto),
},
},
})
async getAccountTransactions(@Query() filter: IAccountsTransactionsFilter) {
async getAccountTransactions(
@Query() filter: GetAccountTransactionsQueryDto,
) {
return this.accountsApplication.getAccountsTransactions(filter);
}