feat: export resource data to csv, xlsx

This commit is contained in:
Ahmed Bouhuolia
2024-04-29 23:45:11 +02:00
parent 4a713980bf
commit 8a96c41258
9 changed files with 345 additions and 0 deletions

View 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);
}
}