mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
25 lines
859 B
TypeScript
25 lines
859 B
TypeScript
import { Controller, Get, Query } from '@nestjs/common';
|
|
import { GetItemsInventoryValuationListService } from './queries/GetItemsInventoryValuationList.service';
|
|
import { GetInventoyItemsCostQueryDto } from './dtos/GetInventoryItemsCostQuery.dto';
|
|
import { ApiOperation, ApiTags } from '@nestjs/swagger';
|
|
|
|
@Controller('inventory-cost')
|
|
@ApiTags('inventory-cost')
|
|
export class InventoryCostController {
|
|
constructor(
|
|
private readonly inventoryItemCost: GetItemsInventoryValuationListService,
|
|
) {}
|
|
|
|
@Get('items')
|
|
@ApiOperation({ summary: 'Get items inventory valuation list' })
|
|
async getItemsCost(
|
|
@Query() itemsCostsQueryDto: GetInventoyItemsCostQueryDto,
|
|
) {
|
|
const costs = await this.inventoryItemCost.getItemsInventoryValuationList(
|
|
itemsCostsQueryDto.itemsIds,
|
|
itemsCostsQueryDto.date,
|
|
);
|
|
return { costs };
|
|
}
|
|
}
|