Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d17b153808 | ||
|
|
2cfabe0cf0 | ||
|
|
699becc13e |
@@ -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,
|
||||
|
||||
@@ -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',
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user