mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
refactor: dynamic list to nestjs
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { IInventoryItemCostMeta } from '@/interfaces';
|
||||
import { Service, Inject } from 'typedi';
|
||||
import { InventoryItemCostService } from './InventoryCosts.service';
|
||||
|
||||
@Service()
|
||||
export class InventoryCostApplication {
|
||||
@Inject()
|
||||
inventoryCost: InventoryItemCostService;
|
||||
|
||||
/**
|
||||
* Retrieves the items inventory valuation list.
|
||||
* @param {number} tenantId
|
||||
* @param {number[]} itemsId
|
||||
* @param {Date} date
|
||||
* @returns {Promise<IInventoryItemCostMeta[]>}
|
||||
*/
|
||||
public getItemsInventoryValuationList = async (
|
||||
itemsId: number[],
|
||||
date: Date
|
||||
): Promise<IInventoryItemCostMeta[]> => {
|
||||
const itemsMap = await this.inventoryCost.getItemsInventoryValuation(
|
||||
tenantId,
|
||||
itemsId,
|
||||
date
|
||||
);
|
||||
return [...itemsMap.values()];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user