mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 22:00:31 +00:00
feat: export resource data to csv, xlsx
This commit is contained in:
23
packages/server/src/services/Items/ItemsExportable.ts
Normal file
23
packages/server/src/services/Items/ItemsExportable.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { Inject, Service } from 'typedi';
|
||||
import { Exportable } from '../Export/Exportable';
|
||||
import { IItemsFilter } from '@/interfaces';
|
||||
import { ItemsApplication } from './ItemsApplication';
|
||||
|
||||
@Service()
|
||||
export class ItemsExportable extends Exportable {
|
||||
@Inject()
|
||||
private itemsApplication: ItemsApplication;
|
||||
|
||||
/**
|
||||
* Retrieves the accounts data to exportable sheet.
|
||||
* @param {number} tenantId
|
||||
* @returns
|
||||
*/
|
||||
public exportable(tenantId: number, query: IItemsFilter) {
|
||||
const parsedQuery = {} as IItemsFilter;
|
||||
|
||||
return this.itemsApplication
|
||||
.getItems(tenantId, parsedQuery)
|
||||
.then((output) => output.items);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user