diff --git a/api-v3/test/unit/asset-operational-relations-integrity.test.ts b/api-v3/test/unit/asset-operational-relations-integrity.test.ts index 9e66d53..dbbf197 100644 --- a/api-v3/test/unit/asset-operational-relations-integrity.test.ts +++ b/api-v3/test/unit/asset-operational-relations-integrity.test.ts @@ -33,13 +33,15 @@ test('D5.3 API enforces active relation, exclusive pair and physical ancestry', assert.match(assets, /OPERATIONAL_ANCHOR_IN_USE/); }); -test('D5.3/F5 relation lifecycle stays historical and audited without making Empresa physical ownership', async () => { +test('D5.3/F6.1 relation lifecycle stays historical and audited without making Empresa physical ownership', async () => { const service = await source('asset-master/asset-operational-relations.service.ts'); assert.match(service, /INSERT INTO area_company_relations/); assert.match(service, /valid_until = CURRENT_TIMESTAMP/); - assert.match(service, /Ending an operator relation must never be blocked by existing Inventory/); + assert.match(service, /Ending an operator relation never moves, rewrites or blocks existing Inventory/); + assert.match(service, /operatorSnapshotPreserved:true/); assert.match(service, /retainedCompatibilitySnapshotCount: before\.assignedAssetCount/); assert.doesNotMatch(service, /AREA_COMPANY_RELATION_IN_USE/); + assert.doesNotMatch(service, /UPDATE assets asset[\s\S]*SET operator_company_id=/); assert.match(service, /ASSET_AREA_COMPANY_RELATION_CREATED/); assert.match(service, /ASSET_AREA_COMPANY_RELATION_ENDED/); });