mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
feat(nestjs): migrate to NestJS
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
import { Body, Controller, Delete, Get, Param, Post } from '@nestjs/common';
|
||||
import { VendorCreditApplyBillsApplicationService } from './VendorCreditApplyBillsApplication.service';
|
||||
import { IVendorCreditApplyToInvoicesDTO } from './types/VendorCreditApplyBills.types';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
|
||||
@Controller('vendor-credits')
|
||||
@ApiTags('vendor-credits-apply-bills')
|
||||
export class VendorCreditApplyBillsController {
|
||||
constructor(
|
||||
private readonly vendorCreditApplyBillsApplication: VendorCreditApplyBillsApplicationService,
|
||||
) {}
|
||||
|
||||
@Get(':vendorCreditId/bills-to-apply')
|
||||
async getVendorCreditToApplyBills(
|
||||
@Param('vendorCreditId') vendorCreditId: number,
|
||||
) {
|
||||
return this.vendorCreditApplyBillsApplication.getVendorCreditToApplyBills(
|
||||
vendorCreditId,
|
||||
);
|
||||
}
|
||||
|
||||
@Post(':vendorCreditId/apply-to-bills')
|
||||
async applyVendorCreditToBills(
|
||||
@Param('vendorCreditId') vendorCreditId: number,
|
||||
@Body() applyCreditToBillsDTO: IVendorCreditApplyToInvoicesDTO,
|
||||
) {
|
||||
return this.vendorCreditApplyBillsApplication.applyVendorCreditToBills(
|
||||
vendorCreditId,
|
||||
applyCreditToBillsDTO,
|
||||
);
|
||||
}
|
||||
|
||||
@Delete('applied-bills/:vendorCreditAppliedBillId')
|
||||
async deleteAppliedBillToVendorCredit(
|
||||
@Param('vendorCreditAppliedBillId') vendorCreditAppliedBillId: number,
|
||||
) {
|
||||
return this.vendorCreditApplyBillsApplication.deleteAppliedBillToVendorCredit(
|
||||
vendorCreditAppliedBillId,
|
||||
);
|
||||
}
|
||||
|
||||
@Get(':vendorCreditId/applied-bills')
|
||||
async getAppliedBillsToVendorCredit(
|
||||
@Param('vendorCreditId') vendorCreditId: number,
|
||||
) {
|
||||
return this.vendorCreditApplyBillsApplication.getAppliedBillsToVendorCredit(
|
||||
vendorCreditId,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user