سامانه صدور فاکتور و حسابداری
test: enforce company setup-only deletion and blocking operational records
davoodmehraban89 committed
Oct 14, 2026 at 19:17 UTC
f61f10f8f01fd666180d592915f386d7b5a8c5c4
1 file changed
+1
-1
scripts/phase2-check.mjs
+1
-1
@@ -20,7 +20,7 @@ must(fs.readFileSync('js/accounting-foundation-ui.js','utf8'),['ورود کدی
20
must(journal,["t.sourceEntity==='contract'","contractId:source.contractId||''"],'contract analytic posting context');
21
must(phase4,['contractId:c.id'],'contracting analytic source context');
22
must(masterUnique,['ux_finora_account_code','ux_finora_account_system_role','ux_finora_dimension_type_code','ux_finora_dimension_value_code','ux_finora_branch_code','ux_finora_project_code','ux_finora_cost_center_code','ux_finora_contract_number'],'prepared master uniqueness migration');
23
-must(companies,['afEnsureFloatingSlotCompatibility','Object.entries(datastore)','دارای کدینگ، سال مالی، تفصیلی، اسناد یا سایر سوابق وابسته است'],'company master integrity');
23
+must(companies,['afEnsureFloatingSlotCompatibility','Object.entries(datastore)','companyDeleteDependencies','COMPANY_SETUP_COLLECTIONS','blocking.length'],'company master integrity');
24
must(companies,['comp.accountingTemplate&&comp.activityType&&comp.activityType!==activityType','مهاجرت کنترلشده کدینگ','template.disabled=!!comp.accountingTemplate||hasChart',"templateChoice==='recommended'"],'company activity/chart semantic guard');
25
if(af.includes('!d&&company.accountingTemplate'))throw new Error('four contractual floating slots must not depend on accepting a starter chart');
26
must(contacts,['Object.entries(datastore)',"key!=='contacts'",'برای حفظ تاریخچه قابل حذف نیست'],'counterparty deletion integrity');must(products,['Object.entries(datastore)',"key!=='products'",'برای حفظ تاریخچه قابل حذف نیست','5*1024*1024','rows.length>10000'],'product deletion/import integrity');must(invoiceExcel,['5*1024*1024','rows.length>10000'],'sales Excel resource bounds');must(purchases,['5*1024*1024','rows.length>10000'],'purchase Excel resource bounds');must(af,['5*1024*1024','rows.length>10000','default_company_id=previous',"x.companyId===companyId"],'chart Excel resource/context bounds');