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 { ISaleReceiptState } from '@/interfaces';
|
||||
|
||||
@Service()
|
||||
export class GetSaleReceiptState {
|
||||
/**
|
||||
* Retireves the sale receipt state.
|
||||
* @param {Number} tenantId -
|
||||
* @return {Promise<ISaleReceiptState>}
|
||||
*/
|
||||
public async getSaleReceiptState(
|
||||
tenantId: number
|
||||
): Promise<ISaleReceiptState> {
|
||||
return {
|
||||
defaultTemplateId: 1,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import {
|
||||
IFilterMeta,
|
||||
IPaginationMeta,
|
||||
ISaleReceipt,
|
||||
ISaleReceiptState,
|
||||
ISalesReceiptsFilter,
|
||||
SaleReceiptMailOpts,
|
||||
SaleReceiptMailOptsDTO,
|
||||
@@ -16,6 +17,7 @@ import { CloseSaleReceipt } from './CloseSaleReceipt';
|
||||
import { SaleReceiptsPdf } from './SaleReceiptsPdfService';
|
||||
import { SaleReceiptNotifyBySms } from './SaleReceiptNotifyBySms';
|
||||
import { SaleReceiptMailNotification } from './SaleReceiptMailNotification';
|
||||
import { GetSaleReceiptState } from './GetSaleReceiptState';
|
||||
|
||||
@Service()
|
||||
export class SaleReceiptApplication {
|
||||
@@ -46,6 +48,9 @@ export class SaleReceiptApplication {
|
||||
@Inject()
|
||||
private saleReceiptNotifyByMailService: SaleReceiptMailNotification;
|
||||
|
||||
@Inject()
|
||||
private getSaleReceiptStateService: GetSaleReceiptState;
|
||||
|
||||
/**
|
||||
* Creates a new sale receipt with associated entries.
|
||||
* @param {number} tenantId
|
||||
@@ -207,4 +212,13 @@ export class SaleReceiptApplication {
|
||||
saleReceiptId
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the current state of the sale receipt.
|
||||
* @param {number} tenantId - The ID of the tenant.
|
||||
* @returns {Promise<ISaleReceiptState>} - A promise resolving to the sale receipt state.
|
||||
*/
|
||||
public getSaleReceiptState(tenantId: number): Promise<ISaleReceiptState> {
|
||||
return this.getSaleReceiptStateService.getSaleReceiptState(tenantId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user