mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
refactor: migrate credit note and vendor credit services to nestjs
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { Body, Controller, Delete, Get, Param, Post, Put } from '@nestjs/common';
|
||||
import { VendorCreditsApplicationService } from './VendorCreditsApplication.service';
|
||||
import { IVendorCreditCreateDTO, IVendorCreditEditDTO } from './types/VendorCredit.types';
|
||||
|
||||
@Controller('vendor-credits')
|
||||
export class VendorCreditsController {
|
||||
constructor(
|
||||
private readonly vendorCreditsApplication: VendorCreditsApplicationService,
|
||||
) {}
|
||||
|
||||
@Post()
|
||||
async createVendorCredit(@Body() dto: IVendorCreditCreateDTO) {
|
||||
return this.vendorCreditsApplication.createVendorCredit(dto);
|
||||
}
|
||||
|
||||
@Put(':id')
|
||||
async editVendorCredit(
|
||||
@Param('id') vendorCreditId: number,
|
||||
@Body() dto: IVendorCreditEditDTO,
|
||||
) {
|
||||
return this.vendorCreditsApplication.editVendorCredit(vendorCreditId, dto);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
async deleteVendorCredit(@Param('id') vendorCreditId: number) {
|
||||
return this.vendorCreditsApplication.deleteVendorCredit(vendorCreditId);
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
async getVendorCredit(@Param('id') vendorCreditId: number) {
|
||||
return this.vendorCreditsApplication.getVendorCredit(vendorCreditId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user