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

Gate prepared accounting master uniqueness migration

davoodmehraban89 committed Sep 29, 2026 at 22:43 UTC d8325060c065e875cfd0a51701c4d6818b88da0a
1 file changed +2
scripts/phase2-check.mjs
+2
@@ -10,6 +10,7 @@ const backup=fs.readFileSync('js/backup.js','utf8');
10 const journal=fs.readFileSync('js/journal-engine.js','utf8');
11 const companies=fs.readFileSync('js/companies.js','utf8');
12 const phase4=fs.readFileSync('js/phase4-contracting.js','utf8');
13 +const masterUnique=fs.readFileSync('supabase/migrations/20260929190500_accounting_master_uniqueness.sql','utf8');
14 const sync=fs.readFileSync('js/sync.js','utf8');
15 const must=(src,needles,label)=>{for(const n of needles)if(!src.includes(n))throw new Error(label+' missing '+n)};
16 must(af,['AF_COMPANY_TYPES','AF_BASE_ACCOUNTS','AF_SPECIAL_ACCOUNTS','afApplyTemplate','afDimensionValuePostable','afDimensionHasValues','afDimensionValueReferenced','postingProfiles','afChangeDimensionDepth','depthLocked','maxDepth','startDate>=endDate','afNormalizeAccountImportRows','afImportAccountsFromExcel','downloadAccountsExcelTemplate',"'CONTRACT','قرارداد / پیمان','contract',1,4",'slot:Number(slot)||0','if(!d){d=afCreateDimension','afAccountTypeForCode','accountType',"['1108','مالیات و عوارض دریافتنی'"],'accounting foundation');
@@ -19,6 +20,7 @@ must(index,['company-activity-type','company-accounting-template','بازرگا
20 must(fs.readFileSync('js/accounting-foundation-ui.js','utf8'),['ورود کدینگ از Excel','نمونه Excel کدینگ','شناور ۱ شعبه','شناور ۴ قرارداد/پیمان','value="contract"','af-account-type','<th>نوع</th>'],'accounting contract UI');
21 must(journal,["t.sourceEntity==='contract'","contractId:source.contractId||''"],'contract analytic posting context');
22 must(phase4,['contractId:c.id'],'contracting analytic source context');
23 +must(masterUnique,['ux_finora_account_code','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');
24 must(companies,['afEnsureFloatingSlotCompatibility','Object.entries(datastore)','دارای کدینگ، سال مالی، تفصیلی، اسناد یا سایر سوابق وابسته است'],'company master integrity');
25 must(companies,['comp.accountingTemplate&&comp.activityType&&comp.activityType!==activityType','مهاجرت کنترل‌شده کدینگ'],'company activity/chart semantic guard');
26 if(af.includes('!d&&company.accountingTemplate'))throw new Error('four contractual floating slots must not depend on accepting a starter chart');