Files
repo-home/apps/backend/src/inventory/_controllers/stock-content.controller.ts
T

34 lines
811 B
TypeScript

import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
import { StockContentService } from '../stock-content/stock-content.service';
import { StockSummaryQuery } from '../_queries/stock-summary.query';
@Controller('stock-content')
export class StockContentController {
constructor(
private readonly stockService: StockContentService,
private readonly stockSummaryQuery: StockSummaryQuery,
) { }
@Get()
findAll() {
return this.stockService.findAll();
}
@Get(':id')
findOne(@Param('id') id: string) {
return this.stockService.findOne(id);
}
@Delete(':id')
remove(@Param('id') id: string) {
return this.stockService.remove(id);
}
@Get('summary/by-variant')
getStockByVariant() {
return this.stockSummaryQuery.byArticle();
}
}