فینورا پرو - سامانه جامع حسابداری و صدور فاکتور
test(A03): seed historical audit fixtures through authorized service
davoodmehraban89 committed
Oct 19, 2026 at 18:36 UTC
39e5f2cf63b4df8e295362a04ed38045215c3e17
1 file changed
+3
-1
tests/a03-company-scope-immutable-stores.test.mjs
+3
-1
@@ -2,9 +2,11 @@ import test from 'node:test';
2
import assert from 'node:assert/strict';
3
import 'fake-indexeddb/auto';
4
import { StorageService } from '../src/core/StorageService.js';
5
+import { AuditService } from '../src/core/AuditService.js';
6
7
// Seed historical fixtures atomically; standalone history writes are forbidden.
7
-const seedHistory = (store, row) => StorageService.transaction(store, tx => tx.put(store, row));
8
+const seedHistory = (store, row) => StorageService.transaction(store, tx =>
9
+ store === 'audit_events' ? AuditService.restoreHistorical(tx, row) : tx.put(store, row));
10
import { DataScope } from '../src/core/DataScope.js';
11
import { Auth } from '../src/core/Auth.js';
12
import { CompanyService } from '../src/core/CompanyService.js';