refactor: import resource module to nestjs

This commit is contained in:
Ahmed Bouhuolia
2025-01-13 10:15:57 +02:00
parent 270b421a6c
commit 72818759a5
38 changed files with 479 additions and 424 deletions

View File

@@ -1,8 +1,18 @@
import { Body, Controller, Delete, Param, Post, Put } from '@nestjs/common';
import {
Body,
Controller,
Delete,
Get,
Param,
Post,
Put,
Query,
} from '@nestjs/common';
import { CreditNoteApplication } from './CreditNoteApplication.service';
import {
ICreditNoteEditDTO,
ICreditNoteNewDTO,
ICreditNotesQueryDTO,
} from './types/CreditNotes.types';
import { PublicRoute } from '../Auth/Jwt.guard';
@@ -19,6 +29,11 @@ export class CreditNotesController {
return this.creditNoteApplication.createCreditNote(creditNoteDTO);
}
@Get()
getCreditNotes(@Query() creditNotesQuery: ICreditNotesQueryDTO) {
return this.creditNoteApplication.getCreditNotes(creditNotesQuery);
}
@Put(':id')
editCreditNote(
@Param('id') creditNoteId: number,