test(F6.1): lock area-owned DB context constraint
This commit is contained in:
@@ -0,0 +1,13 @@
|
|||||||
|
import assert from 'node:assert/strict';
|
||||||
|
import { readFileSync } from 'node:fs';
|
||||||
|
import { resolve } from 'node:path';
|
||||||
|
import test from 'node:test';
|
||||||
|
|
||||||
|
test('F6.1 DB check allows Área-only physical context and rejects Company without Área', () => {
|
||||||
|
const migration=readFileSync(
|
||||||
|
resolve(process.cwd(),'src/database/migrations/1790094500000-f6-1-area-owned-operational-context-check.ts'),
|
||||||
|
'utf8',
|
||||||
|
);
|
||||||
|
assert.match(migration,/CHECK \(operator_company_id IS NULL OR operational_area_id IS NOT NULL\)/);
|
||||||
|
assert.doesNotMatch(migration,/operational_area_id IS NULL OR operator_company_id IS NULL/);
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user