mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 20:30:33 +00:00
60 lines
1.6 KiB
TypeScript
60 lines
1.6 KiB
TypeScript
import { Inject } from 'typedi';
|
|
import { JournalSheetService } from './JournalSheetService';
|
|
import { JournalSheetTableInjectable } from './JournalSheetTableInjectable';
|
|
import { IJournalReportQuery, IJournalTable } from '@/interfaces';
|
|
import { JournalSheetExportInjectable } from './JournalSheetExport';
|
|
|
|
export class JournalSheetApplication {
|
|
@Inject()
|
|
private journalSheetTable: JournalSheetTableInjectable;
|
|
|
|
@Inject()
|
|
private journalSheet: JournalSheetService;
|
|
|
|
@Inject()
|
|
private journalExport: JournalSheetExportInjectable;
|
|
|
|
/**
|
|
* Retrieves the journal sheet.
|
|
* @param {number} tenantId
|
|
* @param {IJournalReportQuery} query
|
|
* @returns {}
|
|
*/
|
|
public sheet(tenantId: number, query: IJournalReportQuery) {
|
|
return this.journalSheet.journalSheet(tenantId, query);
|
|
}
|
|
|
|
/**
|
|
* Retrieves the journal sheet in table format.
|
|
* @param {number} tenantId
|
|
* @param {IJournalReportQuery} query
|
|
* @returns {Promise<IJournalTable>}
|
|
*/
|
|
public table(
|
|
tenantId: number,
|
|
query: IJournalReportQuery
|
|
): Promise<IJournalTable> {
|
|
return this.journalSheetTable.table(tenantId, query);
|
|
}
|
|
|
|
/**
|
|
* Retrieves the journal sheet in xlsx format.
|
|
* @param {number} tenantId
|
|
* @param {IJournalReportQuery} query
|
|
* @returns
|
|
*/
|
|
public xlsx(tenantId: number, query: IJournalReportQuery) {
|
|
return this.journalExport.xlsx(tenantId, query);
|
|
}
|
|
|
|
/**
|
|
* Retrieves the journal sheet in csv format.
|
|
* @param {number} tenantId
|
|
* @param {IJournalReportQuery} query
|
|
* @returns
|
|
*/
|
|
public csv(tenantId: number, query: IJournalReportQuery) {
|
|
return this.journalExport.csv(tenantId, query);
|
|
}
|
|
}
|