mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
refactor(nestjs): wip
This commit is contained in:
@@ -18,6 +18,7 @@ import {
|
||||
CreatePaymentReceivedDto,
|
||||
EditPaymentReceivedDto,
|
||||
} from './dtos/PaymentReceived.dto';
|
||||
import { PaymentsReceivedPagesService } from './queries/PaymentsReceivedPages.service';
|
||||
|
||||
@Injectable()
|
||||
export class PaymentReceivesApplication {
|
||||
@@ -31,6 +32,7 @@ export class PaymentReceivesApplication {
|
||||
private sendPaymentReceiveMailNotification: SendPaymentReceiveMailNotification,
|
||||
private getPaymentReceivePdfService: GetPaymentReceivedPdfService,
|
||||
private getPaymentReceivedStateService: GetPaymentReceivedStateService,
|
||||
private paymentsReceivedPagesService: PaymentsReceivedPagesService,
|
||||
) {}
|
||||
|
||||
/**
|
||||
@@ -147,4 +149,14 @@ export class PaymentReceivesApplication {
|
||||
public getPaymentReceivedState() {
|
||||
return this.getPaymentReceivedStateService.getPaymentReceivedState();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the payment received edit page.
|
||||
* @param {number} paymentReceiveId - Payment receive id.
|
||||
*/
|
||||
public getPaymentReceivedEditPage(paymentReceiveId: number) {
|
||||
return this.paymentsReceivedPagesService.getPaymentReceiveEditPage(
|
||||
paymentReceiveId,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,20 @@ export class PaymentReceivesController {
|
||||
);
|
||||
}
|
||||
|
||||
@Get(':id/edit-page')
|
||||
@ApiResponse({
|
||||
status: 200,
|
||||
description:
|
||||
'The payment received edit page has been successfully retrieved.',
|
||||
})
|
||||
public getPaymentReceiveEditPage(
|
||||
@Param('id', ParseIntPipe) paymentReceiveId: number,
|
||||
) {
|
||||
return this.paymentReceivesApplication.getPaymentReceivedEditPage(
|
||||
paymentReceiveId,
|
||||
);
|
||||
}
|
||||
|
||||
@Get(':id/mail')
|
||||
@ApiResponse({
|
||||
status: 200,
|
||||
|
||||
@@ -36,6 +36,7 @@ import { SendPaymentReceivedMailProcessor } from './processors/PaymentReceivedMa
|
||||
import { SEND_PAYMENT_RECEIVED_MAIL_QUEUE } from './constants';
|
||||
import { PaymentsReceivedExportable } from './commands/PaymentsReceivedExportable';
|
||||
import { PaymentsReceivedImportable } from './commands/PaymentsReceivedImportable';
|
||||
import { PaymentsReceivedPagesService } from './queries/PaymentsReceivedPages.service';
|
||||
|
||||
@Module({
|
||||
controllers: [PaymentReceivesController],
|
||||
@@ -63,6 +64,7 @@ import { PaymentsReceivedImportable } from './commands/PaymentsReceivedImportabl
|
||||
SendPaymentReceivedMailProcessor,
|
||||
PaymentsReceivedExportable,
|
||||
PaymentsReceivedImportable,
|
||||
PaymentsReceivedPagesService
|
||||
],
|
||||
exports: [
|
||||
PaymentReceivesApplication,
|
||||
|
||||
@@ -41,11 +41,10 @@ export class PaymentsReceivedPagesService {
|
||||
|
||||
/**
|
||||
* Retrieve payment receive new page receivable entries.
|
||||
* @param {number} tenantId - Tenant id.
|
||||
* @param {number} vendorId - Vendor id.
|
||||
* @return {IPaymentReceivePageEntry[]}
|
||||
*/
|
||||
public async getNewPageEntries(tenantId: number, customerId: number) {
|
||||
public async getNewPageEntries(customerId: number) {
|
||||
// Retrieve due invoices.
|
||||
const entries = await this.saleInvoice()
|
||||
.query()
|
||||
@@ -62,10 +61,7 @@ export class PaymentsReceivedPagesService {
|
||||
* @param {number} tenantId - Tenant id.
|
||||
* @param {Integer} paymentReceiveId - Payment receive id.
|
||||
*/
|
||||
public async getPaymentReceiveEditPage(
|
||||
tenantId: number,
|
||||
paymentReceiveId: number,
|
||||
): Promise<{
|
||||
public async getPaymentReceiveEditPage(paymentReceiveId: number): Promise<{
|
||||
paymentReceive: Omit<PaymentReceived, 'entries'>;
|
||||
entries: IPaymentReceivePageEntry[];
|
||||
}> {
|
||||
|
||||
Reference in New Issue
Block a user