diff --git a/api-v3/src/asset-master/inventory-family-catalog.controller.ts b/api-v3/src/asset-master/inventory-family-catalog.controller.ts index 88708c2..1e03d3e 100644 --- a/api-v3/src/asset-master/inventory-family-catalog.controller.ts +++ b/api-v3/src/asset-master/inventory-family-catalog.controller.ts @@ -17,6 +17,10 @@ import { ReplaceInventoryFamilyFindingsDto, UpdateInventoryFamilyDto, } from './dto/inventory-family-admin.dto'; +import { + CreateInventoryFamilyAttributeDto, + UpdateInventoryFamilyAttributeDto, +} from './dto/inventory-family-attribute.dto'; import { InventoryFamilyCatalogService } from './inventory-family-catalog.service'; @Controller('inventory-families') @@ -50,6 +54,35 @@ export class InventoryFamilyCatalogController { return this.families.update(familyId,dto,principal,request); } + @Get(':familyId/attributes') + @RequirePermissions('asset_types.read') + attributes(@Param('familyId',new ParseUUIDPipe({version:'4'})) familyId:string) { + return this.families.attributes(familyId); + } + + @Post(':familyId/attributes') + @RequirePermissions('asset_types.manage') + createAttribute( + @Param('familyId',new ParseUUIDPipe({version:'4'})) familyId:string, + @Body() dto:CreateInventoryFamilyAttributeDto, + @CurrentAuth() principal:AuthPrincipal, + @Req() request:RequestWithContext, + ) { + return this.families.createAttribute(familyId,dto,principal,request); + } + + @Patch(':familyId/attributes/:attributeId') + @RequirePermissions('asset_types.manage') + updateAttribute( + @Param('familyId',new ParseUUIDPipe({version:'4'})) familyId:string, + @Param('attributeId',new ParseUUIDPipe({version:'4'})) attributeId:string, + @Body() dto:UpdateInventoryFamilyAttributeDto, + @CurrentAuth() principal:AuthPrincipal, + @Req() request:RequestWithContext, + ) { + return this.families.updateAttribute(familyId,attributeId,dto,principal,request); + } + @Put(':familyId/findings') @RequirePermissions('finding_catalog.manage') replaceFindings(