سامانه صدور فاکتور و حسابداری

Guard settlement and security invariants

davoodmehraban89 committed Sep 28, 2026 at 14:29 UTC 089476bcaa4b8f3ad147cdad951fabd46c2a9e8d
1 file changed +5 -2
scripts/quality-check.mjs
+5 -2
@@ -21,11 +21,14 @@ const must={
21 'purchases.js':['window.purSave=function','window.purEdit=function','window.purPrint=function','window.purRefreshProjects=function','pur-payment-method'],
22 'projects.js':['editContactProject','deleteContactProject','addSubproject','editSubproject','deleteSubproject'],
23 'operations.js':['editContact','editProduct','editCheque','editExpense','deleteInvoice'],
24 - 'drilldown.js':['openContactLedger','openDashboardDetail','openReportDetail'],
24 + 'drilldown.js':['openContactLedger','openDashboardDetail','openReportDetail',"status==='cleared'"],
25 'sync.js':['getMyPurchases'],
26 'backup.js':['purchases:getMyPurchases()']
27 };
28 for(const [file,needles] of Object.entries(must)){
29 for(const needle of needles)if(!all[file]?.includes(needle))throw new Error(file+' missing '+needle);
30 }
31 -console.log('Static quality checks passed for '+files.length+' JavaScript modules.');
\ No newline at end of file
31 +const securityWorkflow=fs.readFileSync(path.join(root,'.github','workflows','security.yml'),'utf8');
32 +for(const needle of ['github/codeql-action/init@v3','github/codeql-action/analyze@v3','actions/dependency-review-action@v4'])if(!securityWorkflow.includes(needle))throw new Error('Security workflow missing '+needle);
33 +if(!all['invoices.js']?.includes("q.status==='cleared'"))throw new Error('Dashboard must only settle cleared cheques');
34 +console.log('Static quality and security invariants passed for '+files.length+' JavaScript modules.');
\ No newline at end of file