From a758c9528a16a8f6fb24b8ee70445058068d4e59 Mon Sep 17 00:00:00 2001 From: enlineawork Date: Wed, 9 Sep 2026 09:33:39 -0300 Subject: [PATCH] =?UTF-8?q?feat(f6):=20exponer=20valores=20t=C3=A9cnicos?= =?UTF-8?q?=20por=20objeto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inventory-technical-values.controller.ts | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 api-v3/src/asset-master/inventory-technical-values.controller.ts diff --git a/api-v3/src/asset-master/inventory-technical-values.controller.ts b/api-v3/src/asset-master/inventory-technical-values.controller.ts new file mode 100644 index 0000000..18aee2b --- /dev/null +++ b/api-v3/src/asset-master/inventory-technical-values.controller.ts @@ -0,0 +1,28 @@ +import { Body, Controller, Get, Param, ParseUUIDPipe, Put, Req } from '@nestjs/common'; +import { CurrentAuth } from '../auth/decorators/current-auth.decorator'; +import { RequirePermissions } from '../authorization/decorators/require-permissions.decorator'; +import type { AuthPrincipal, RequestWithContext } from '../common/http/request-context'; +import { UpdateInventoryTechnicalValuesDto } from './dto/update-inventory-technical-values.dto'; +import { InventoryTechnicalValuesService } from './inventory-technical-values.service'; + +@Controller('assets/:assetId/technical-values') +export class InventoryTechnicalValuesController { + constructor(private readonly technical:InventoryTechnicalValuesService) {} + + @Get() + @RequirePermissions('assets.read') + get(@Param('assetId',new ParseUUIDPipe({version:'4'})) assetId:string) { + return this.technical.get(assetId); + } + + @Put() + @RequirePermissions('assets.update') + replace( + @Param('assetId',new ParseUUIDPipe({version:'4'})) assetId:string, + @Body() dto:UpdateInventoryTechnicalValuesDto, + @CurrentAuth() principal:AuthPrincipal, + @Req() request:RequestWithContext, + ) { + return this.technical.replace(assetId,dto,principal,request); + } +}