سامانه صدور فاکتور و حسابداری
Mirrored from https://github.com/davoodmehraban89/Factor-easy.git
Synced Dec 3, 22:00 UTC
Gate referenced master-data deletion protection
davoodmehraban89 committed
Sep 29, 2026 at 22:34 UTC
6b727b3a3136aa14d50a77bae16854df92ace939
1 file changed
+2
scripts/phase2-check.mjs
+2
@@ -3,6 +3,7 @@ import vm from 'node:vm';
3
const af=fs.readFileSync('js/accounting-foundation.js','utf8');
4
const render=fs.readFileSync('js/accounting-foundation-render.js','utf8');
5
const companies=fs.readFileSync('js/companies.js','utf8');
6
+const contacts=fs.readFileSync('js/contacts.js','utf8'),products=fs.readFileSync('js/products.js','utf8');
7
const index=fs.readFileSync('index.html','utf8');
8
const core=fs.readFileSync('js/core.js','utf8');
9
const backup=fs.readFileSync('js/backup.js','utf8');
@@ -21,6 +22,7 @@ must(phase4,['contractId:c.id'],'contracting analytic source context');
22
must(companies,['afEnsureFloatingSlotCompatibility','Object.entries(datastore)','دارای کدینگ، سال مالی، تفصیلی، اسناد یا سایر سوابق وابسته است'],'company master integrity');
23
must(companies,['comp.accountingTemplate&&comp.activityType&&comp.activityType!==activityType','مهاجرت کنترلشده کدینگ'],'company activity/chart semantic guard');
24
if(af.includes('!d&&company.accountingTemplate'))throw new Error('four contractual floating slots must not depend on accepting a starter chart');
25
+must(contacts,['Object.entries(datastore)',"key!=='contacts'",'برای حفظ تاریخچه قابل حذف نیست'],'counterparty deletion integrity');must(products,['Object.entries(datastore)',"key!=='products'",'برای حفظ تاریخچه قابل حذف نیست'],'product deletion integrity');
26
for(const coll of ['fiscalYears','accounts','dimensionTypes','dimensionValues','accountDimensionRules','branches','projects','projectLinks']){
27
if(!core.includes("'"+coll+"'")||!sync.includes(coll)||!backup.includes(coll))throw new Error('Phase 2 persistence missing '+coll);
28
}