From 3d835450332c8683f04a991b5b53012aadc00a45 Mon Sep 17 00:00:00 2001 From: enlineawork Date: Wed, 9 Sep 2026 07:04:46 -0300 Subject: [PATCH] =?UTF-8?q?F5=20hotfix=20=C2=B7=20restaurar=20provider=20i?= =?UTF-8?q?nterno=20del=20dossier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Restaura únicamente InventoryFunctionService como provider interno requerido por el dossier fusionado, sin reabrir el catálogo de funciones, y agrega regresión de arranque. --- .../src/asset-master/asset-master.module.ts | 2 ++ .../test/unit/f5-runtime-di-contract.test.ts | 31 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 api-v3/test/unit/f5-runtime-di-contract.test.ts diff --git a/api-v3/src/asset-master/asset-master.module.ts b/api-v3/src/asset-master/asset-master.module.ts index 44982eb..1fba3d4 100644 --- a/api-v3/src/asset-master/asset-master.module.ts +++ b/api-v3/src/asset-master/asset-master.module.ts @@ -26,6 +26,7 @@ import { InventoryStructureController } from './inventory-structure.controller'; import { InventoryStructureService } from './inventory-structure.service'; import { InventoryFamilyCatalogController } from './inventory-family-catalog.controller'; import { InventoryFamilyCatalogService } from './inventory-family-catalog.service'; +import { InventoryFunctionService } from './inventory-function.service'; import { FieldInventoryMergeController, InventoryMergeController } from './inventory-merge.controller'; import { InventoryMergeService } from './inventory-merge.service'; import { MergedInventoryDossierService } from './merged-inventory-dossier.service'; @@ -56,6 +57,7 @@ import { InventoryBrowserService } from './inventory-browser.service'; AssetsService, InventoryStructureService, InventoryFamilyCatalogService, + InventoryFunctionService, InventoryBrowserService, InventoryMergeService, MergedInventoryDossierService, diff --git a/api-v3/test/unit/f5-runtime-di-contract.test.ts b/api-v3/test/unit/f5-runtime-di-contract.test.ts new file mode 100644 index 0000000..462c531 --- /dev/null +++ b/api-v3/test/unit/f5-runtime-di-contract.test.ts @@ -0,0 +1,31 @@ +import assert from 'node:assert/strict'; +import { readFileSync } from 'node:fs'; +import { resolve } from 'node:path'; +import test from 'node:test'; +import { MODULE_METADATA } from '@nestjs/common/constants'; +import { AssetMasterModule } from '../../src/asset-master/asset-master.module'; +import { InventoryFunctionService } from '../../src/asset-master/inventory-function.service'; + +test('F5 AssetMasterModule keeps dossier-only function dependency injectable without reopening its controller', () => { + const providers = (Reflect.getMetadata(MODULE_METADATA.PROVIDERS, AssetMasterModule) ?? []) as unknown[]; + const controllers = (Reflect.getMetadata(MODULE_METADATA.CONTROLLERS, AssetMasterModule) ?? []) as Array<{ name?: string }>; + const dossierSource = readFileSync( + resolve(process.cwd(), 'src/asset-master/merged-inventory-dossier.service.ts'), + 'utf8', + ); + + assert.match( + dossierSource, + /private readonly functions: InventoryFunctionService/, + 'MergedInventoryDossierService must still depend on InventoryFunctionService for historical dossier data', + ); + assert.ok( + providers.includes(InventoryFunctionService), + 'AssetMasterModule must provide InventoryFunctionService so production Nest bootstrap can resolve the dossier', + ); + assert.equal( + controllers.some((controller) => controller?.name === 'InventoryFunctionController'), + false, + 'F5 must not reopen the retired Inventory Function controller', + ); +});