mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 22:00:31 +00:00
feat: Assign default PDF template automatically
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { Service } from 'typedi';
|
||||
import { IPaymentReceivedState } from '@/interfaces';
|
||||
|
||||
@Service()
|
||||
export class GetPaymentReceivedState {
|
||||
/**
|
||||
* Retrieves the current state of the payment received.
|
||||
* @param {number} tenantId - The ID of the tenant.
|
||||
* @returns {Promise<IPaymentReceivedState>} - A promise resolving to the payment received state.
|
||||
*/
|
||||
public async getPaymentReceivedState(
|
||||
tenantId: number
|
||||
): Promise<IPaymentReceivedState> {
|
||||
return {
|
||||
defaultTemplateId: 1,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,7 @@ import { GetPaymentReceivedInvoices } from './GetPaymentReceivedInvoices';
|
||||
import { PaymentReceiveNotifyBySms } from './PaymentReceivedSmsNotify';
|
||||
import GetPaymentReceivedPdf from './GetPaymentReceivedPdf';
|
||||
import { SendPaymentReceiveMailNotification } from './PaymentReceivedMailNotification';
|
||||
import { GetPaymentReceivedState } from './GetPaymentReceivedState';
|
||||
|
||||
@Service()
|
||||
export class PaymentReceivesApplication {
|
||||
@@ -49,6 +50,9 @@ export class PaymentReceivesApplication {
|
||||
@Inject()
|
||||
private getPaymentReceivePdfService: GetPaymentReceivedPdf;
|
||||
|
||||
@Inject()
|
||||
private getPaymentReceivedStateService: GetPaymentReceivedState;
|
||||
|
||||
/**
|
||||
* Creates a new payment receive.
|
||||
* @param {number} tenantId
|
||||
@@ -223,4 +227,10 @@ export class PaymentReceivesApplication {
|
||||
paymentReceiveId
|
||||
);
|
||||
};
|
||||
|
||||
public getPaymentReceivedState = (tenantId: number) => {
|
||||
return this.getPaymentReceivedStateService.getPaymentReceivedState(
|
||||
tenantId
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user