mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-14 03:40:31 +00:00
62 lines
1.9 KiB
TypeScript
62 lines
1.9 KiB
TypeScript
import { TrialBalanceSheetTableInjectable } from './TrialBalanceSheetTableInjectable';
|
|
import { TrialBalanceExportInjectable } from './TrialBalanceExportInjectable';
|
|
import { ITrialBalanceSheetQuery, ITrialBalanceStatement } from './TrialBalanceSheet.types';
|
|
import { TrialBalanceSheetService } from './TrialBalanceSheetInjectable';
|
|
import { Injectable } from '@nestjs/common';
|
|
|
|
@Injectable()
|
|
export class TrialBalanceSheetApplication {
|
|
constructor(
|
|
private readonly sheetService: TrialBalanceSheetService,
|
|
private readonly tablable: TrialBalanceSheetTableInjectable,
|
|
private readonly exportable: TrialBalanceExportInjectable,
|
|
) {}
|
|
|
|
/**
|
|
* Retrieves the trial balance sheet.
|
|
* @param {ITrialBalanceSheetQuery} query
|
|
* @returns {Promise<ITrialBalanceStatement>}
|
|
*/
|
|
public sheet(
|
|
query: ITrialBalanceSheetQuery,
|
|
): Promise<ITrialBalanceStatement> {
|
|
return this.sheetService.trialBalanceSheet(query);
|
|
}
|
|
|
|
/**
|
|
* Retrieves the trial balance sheet in table format.
|
|
* @param {ITrialBalanceSheetQuery} query
|
|
* @returns {Promise<ITrialBalanceSheetTable>}
|
|
*/
|
|
public table(query: ITrialBalanceSheetQuery) {
|
|
return this.tablable.table(query);
|
|
}
|
|
|
|
/**
|
|
* Retrieve the trial balance sheet in CSV format.
|
|
* @param {ITrialBalanceSheetQuery} query
|
|
* @returns {Promise<Buffer>}
|
|
*/
|
|
public csv(query: ITrialBalanceSheetQuery) {
|
|
return this.exportable.csv(query);
|
|
}
|
|
|
|
/**
|
|
* Retrieve the trial balance sheet in XLSX format.
|
|
* @param {ITrialBalanceSheetQuery} query
|
|
* @returns {Promise<Buffer>}
|
|
*/
|
|
public async xlsx(query: ITrialBalanceSheetQuery) {
|
|
return this.exportable.xlsx(query);
|
|
}
|
|
|
|
/**
|
|
* Retrieve the trial balance sheet in pdf format.
|
|
* @param {ITrialBalanceSheetQuery} query
|
|
* @returns {Promise<Buffer>}
|
|
*/
|
|
public async pdf(query: ITrialBalanceSheetQuery) {
|
|
return this.exportable.pdf(query);
|
|
}
|
|
}
|