فینورا پرو - سامانه جامع حسابداری و صدور فاکتور

fix/phase-a-pack5-integrated-evidence-20261101
a02/strict-export-preflight-20261018 audit/a01-readonly-invoice-metadata-20261101 ci/a06-require-trusted-issuer-for-release ci/main-postmerge-phase-a-validation-20261020 ci/phase-a-controlled-public-release design/issue-5-commercial-corrections-adr docs/a01-a02-a05-oct23-verified-evidence docs/a01-cheque-endorsement-evidence-20261022 docs/a01-cheque-event-date-evidence-20261021 docs/a01-explicit-refund-reason-evidence-20261021 docs/a01-refund-auth-status-20261020 docs/a01-refund-trace-evidence-20261020 docs/a02-102-evidence-20261018 docs/a02-pr104-evidence-20261018 docs/a02-pr106-evidence-20261019 docs/a02-pr108-ten-tests-20261019 docs/a02-private-sql-backup-evidence-20261111 docs/a03-merge-status-sync-20261020 docs/a04-software-gate-acceptance-20261020 docs/feature-matrix-20261014 docs/finora-master-execution-playbook docs/four-phase-execution-20261014 docs/four-phase-roadmap-20261014 docs/holoo-lab-stabilization-phase1-20261111 docs/holoo-runtime-schema-audit-20261111 docs/ops-142-governance-5-1-3-20261030 docs/phase-a-a01-a02-a06-a08-verified-evidence-20261023 docs/phase-a-a01-a05-a06-evidence-20261023 docs/phase-a-independent-acceptance-evidence docs/phase-a-pr110-evidence-20261019 docs/project-status-phase-a-20261014 feat/a01-referenced-return-corrections feat/a01-referenced-returns-on-main feat/a02-atomic-opening-ledger-preflight feat/a02-holoo-compatibility-preflight feat/a02-holoo-declared-control-totals feat/a02-holoo-explicit-csv-gate feat/a02-holoo-safe-zip-intake-offline-webview2-20261030 feat/a02-offline-sql-server-provisioning-20261030 feat/a02-opening-balance-dry-run feat/a02-opening-ledger-admin-ui feat/a02-opt-in-isolated-sql-restore-executor-20261030 feat/a02-private-holoo-zip-staging-20261030 feat/a02-safe-isolated-restore-plan-20261030 feat/a02-sql-backup-header-verifyonly-20261030 feat/a03-audit-schema-atomic-events feat/a03-complete-manual-journal-audit feat/a05-cheque-treasury-reconciliation feat/a06-signed-offline-license-activation feat/a08-synthetic-performance-baseline feat/phase-a-accounting-benchmark-return-preview feat/phase-a-ledger-settlement-diagnostics feature/v2-reconciliation-20261013 fix/a01-atomic-confirm-ui-one-shot-20261031 fix/a01-cheque-clearance-explicit-account-20261023 fix/a01-cheque-contractual-due-date-validity-20261023 fix/a01-cheque-endorsement-counterparty-20261022 fix/a01-cheque-event-date-open-period-20261021 fix/a01-cumulative-return-amount-cap fix/a01-explicit-refund-reason-approval-20261021 fix/a01-manager-authorized-customer-refunds-20261020 fix/a01-no-implicit-refund fix/a01-one-shot-confirm-on-atomic-import-20261031 fix/a01-refund-and-overcollection-net-cash fix/a01-refund-correction-trace-20261020 fix/a02-atomic-excel-master-merge-20261031 fix/a02-canonical-mapping-contract-20261018 fix/a02-disable-destructive-excel-replace-20261031 fix/a02-holoo-invoice-line-coverage-20261023 fix/a02-holoo-preflight-required-invoice-lines-20261023 fix/a02-mapping-contract-20261018 fix/a02-opening-preflight-unbalanced-report fix/a02-orphan-mapping-20261018 fix/a02-private-excel-import-session-20261031 fix/a02-strict-export-input-20261019 fix/a03-append-only-full-backup-import fix/a03-append-only-write-guard fix/a03-block-transaction-clear-append-only-20261016 fix/a03-chain-validation-20261020 fix/a03-company-scoped-audit-data-access fix/a03-deny-direct-audit-write-20261019 fix/a03-escaped-expense-list-20261031 fix/a03-escaped-financial-record-ids-20261031 fix/a03-financial-ledger-actions-and-print-20261031 fix/a04-backup-checksum-preflight fix/a04-company-audit-replay-stable-compare fix/a04-company-backup-source-isolation-20261020 fix/a04-full-restore-posted-financial-integrity fix/a04-reject-mixed-company-backup-20261019 fix/a04-replace-immutable-posted-ledger fix/a04-restore-financial-journal-references fix/a04-service-source-company-boundary-20261020 fix/a05-block-inactive-treasury-settlements fix/a05-cheque-cash-evidence-reconciliation-20261023 fix/a05-cheque-ledger-and-bank-reconciliation-20261023 fix/a05-fiscal-close-invariant-gates fix/a06-backup-restore-user-privileges fix/a06-license-user-company-quota-20261023 fix/a06-malformed-trial-state-fail-closed fix/a06-offline-clock-fail-closed-20261019 fix/a07-indexeddb-blocked-startup fix/a07-offline-bundled-assets fix/a07-version-and-startup-banner fix/issue-7-company-backup-isolation fix/p0-deterministic-fractional-invoice-money-20261031 fix/p0-fractional-quantity-input-20261031 fix/p0-fractional-quantity-integrated-20261031 fix/p0-invoice-posting-invariants-20261031 fix/p0-legacy-stock-and-product-inputs-20261031 fix/p0-reports-immutable-cogs-20261101 fix/p0-verified-financial-percent-20261031 fix/p0-zero-discount-report-revenue-20261101 fix/phase-a-backup-app-version fix/phase-a-backup-integrity-checksum fix/phase-a-backup-record-id-validation-20261014 fix/phase-a-backup-version-validation-20261014 fix/phase-a-closure-pack3-20261101 fix/phase-a-entitlement-payload-validation fix/phase-a-gate-exact-evidence-20261019 fix/phase-a-pack4-stock-scope-20261101 fix/phase-a-pack5-integrated-evidence-20261101 fix/phase-a-pack6-atomic-legacy-20261101 fix/phase-a-restore-envelope-and-rollback fix/phase-a-settings-admin-gate fix/print-browser-header-footer-20261014 fix/q01-expense-security-probe-exact-option-20261031 fix/q01-financial-grid-labels-20261031 fix/q01-form-label-association-20261031 fix/q01-native-evidence-integrity-20261030 fix/q01-number-input-persian-decimal-20261031 fix/q01-responsive-dashboard-and-cheque-table-20261031 fix/q01-safe-ui-action-audit-coverage-20261031 fix/q01-visible-desktop-sidebar-and-safe-confirm-20261030 fix/roadmap-metadata-sync-20261014 gate/a03-audit-metadata-validation-20261019 integration/a02-windows-holoo-setup-candidate-20261030 license-server main perf/a07-lazy-load-excel perf/a08-cheque-reconciliation-account-index-20261023 perf/a08-paginated-reports-20261101 phase1-restore-hardening planning/holoo-execution-20261013 planning/roadmap-project-management-20261014 qa/native-click-coverage-audit-20261030 release/v2.0.0 test/a01-native-endorsement-mandatory-20261023 test/a01-native-purchase-return-guardrails test/a01-native-sale-return-financial-guardrails test/a01-safe-integer-boundary-20261019 test/a02-native-opening-dry-run-rejections test/a02-native-positive-opening-ledger test/a04-native-corrupt-fbackup-20261016 test/a04-native-encrypted-company-backup test/a04-native-encrypted-company-backup-main test/a04-native-late-transaction-rollback test/a04-native-windows-backup-recovery test/a04-real-edge-v6-v7-migration test/a04-real-native-interrupted-restore test/a05-native-draft-ledger-and-repeat-close-20261016 test/a05-native-fiscal-close-guardrails test/a07-native-multipage-print-engine test/a07-native-origin-provenance test/a07-native-webview2-offline-routes test/a07-windows-offline-startup-smoke test/a08-installed-webview2-60k-baseline test/a08-native-webview2-heap-metrics test/a08-windows-synthetic-performance-baseline test/github-write-access-20261009 test/native-win-ui-routes-after-finance-backup test/phase-a-combined-a01-a05-a08-final-evidence test/phase-a-combined-native-acceptance-matrix test/phase-a-ledger-invariants-20261014 test/phase-a-native-all-routes-on-merged-lab test/phase-a-native-encrypted-backup test/phase-a-native-finance-backup-matrix test/phase-a-native-ui-and-backup-smoke test/phase-a-windows-native-installer-lab work/a08-dispatch-activation-20261123 work/a08-memory-stability-20261123 work/finance-curated-20261123
cjs 267 lines 18.8 KB
Raw
1 'use strict';
2
3 const RULES = [
4 { match:'window.InvoiceFormView._save(false)', checks:{
5 'purchase-and-post-ledger':['purchasePosted'],
6 'partial-sale-and-inventory':['salePosted'],
7 'sale-return-immutable-stock-and-ledger':['separatePostedReturn','balancedLedgerAndReturnedStock','postedOriginalImmutable'],
8 'purchase-return-and-stock-guardrails':['postedSupplierReturn','balancedLedger','stockIssued','originalPurchaseImmutable']
9 }, kind:'native-fixture-positive-and-negative',
10 note:'ثبت خرید، فروش و مرجوعی با سند متوازن، موجودی و حفظ سند اولیه در نصب واقعی' },
11 { match:'window.ContactsView.saveContact(', checks:{
12 'contacts-crud-form-and-tags':['createdThroughForm','editedThroughForm','tagPersisted']
13 }, kind:'native-ui-create-and-update',
14 note:'ثبت و ویرایش شخص از فرم واقعی و ماندگاری برچسب در WebView2' },
15 { match:'window.ProductsView.saveProduct(', checks:{
16 'products-crud-form-and-nested-classifiers':['createdThroughForm','editedThroughForm','fractionalReorderPointPreserved','nestedUnitSavedAndSelected','nestedCategorySavedAndSelected']
17 }, kind:'native-ui-create-and-update',
18 note:'ثبت و ویرایش کالا از فرم واقعی با قیمت، نقطه سفارش و طبقه‌بندی انتخاب‌شده' },
19 { match:'window.ProductsView.saveUnit(true)', checks:{
20 'products-crud-form-and-nested-classifiers':['nestedUnitSavedAndSelected']
21 }, kind:'native-ui-nested-create',
22 note:'ایجاد واحد از پنجره تو‌در‌تو و انتخاب آن در فرم والد کالا' },
23 { match:'window.ProductsView.saveCategory(true)', checks:{
24 'products-crud-form-and-nested-classifiers':['nestedCategorySavedAndSelected']
25 }, kind:'native-ui-nested-create',
26 note:'ایجاد گروه از پنجره تو‌در‌تو و انتخاب آن در فرم والد کالا' },
27 { match:'window.StockKardexModal.openAdjustModal(', checks:{
28 'legacy-stock-adjustment-form-and-validation':['validAdjustmentPosted'],
29 'integrated-stock-adjustment-guard':['manualAdjustmentHidden','directOpenBlocked','directSaveBlocked']
30 }, kind:'native-ui-guarded-action',
31 note:'اصلاح دستی در حالت قدیمی و جلوگیری از نمایش و اجرای آن در حسابداری یکپارچه' },
32 { match:'window.StockKardexModal.saveAdjust(', checks:{
33 'legacy-stock-adjustment-form-and-validation':['overPrecisionRejectedWithoutWrites','negativeRejectedWithoutWrites','validAdjustmentPosted','fractionalQuantityPreserved']
34 }, kind:'native-ui-stock-posting',
35 note:'رد مقدار منفی و دقت بیش از سه رقم و ثبت موجودی واقعی در نصب ویندوز' },
36 { match:'window.TreasuryView.saveAccount(null)', checks:{
37 'inactive-treasury-cheque-settlement':['treasuryAccountCreatedThroughForm']
38 }, kind:'native-ui-create',
39 note:'ایجاد حساب خزانه ساختگی از فرم واقعی و اتصال آن به معین' },
40 { match:'window.TreasuryView.saveAccount(', exclude:'window.TreasuryView.saveAccount(null)', checks:{
41 'inactive-treasury-cheque-settlement':['treasuryAccountEditPersisted']
42 }, kind:'native-ui-update',
43 note:'ویرایش حساب خزانه از فرم واقعی در شرکت ساختگی' },
44 { match:"window.TreasuryView._saveTransaction('transfer')", checks:{
45 'inactive-treasury-cheque-settlement':['inactiveTransferRejected','invalidTransferRolledBack','validTransferPosted']
46 }, kind:'native-fixture-positive-and-negative',
47 note:'رد انتقال به حساب غیرفعال و ثبت دقیق انتقال بین دو حساب فعال' },
48 { match:"window.TreasuryView._saveTransaction('receipt')", checks:{
49 'return-cash-settlement-net-credit':['overcollectionRejectedWithoutWrites','netReceiptAccepted']
50 }, kind:'native-fixture-positive-and-negative',
51 note:'رد دریافت بیش از مانده و ثبت دریافت مجاز' },
52 { match:"window.TreasuryView._saveTransaction('payment')", checks:{
53 'return-cash-settlement-net-credit':['nonexistentRefundCreditRejected','authorizedRefundTracedInInstalledWebView2']
54 }, kind:'native-fixture-positive-and-negative',
55 note:'رد بازپرداخت بدون اعتبار واقعی و ثبت بازپرداخت مجاز با ردپای تأیید' },
56 { match:'window.ChequesView.saveCheque(null)', checks:{
57 'inactive-treasury-cheque-settlement':['chequeCreatedThroughForm']
58 }, kind:'native-ui-cheque-create',
59 note:'ایجاد چک ساختگی از فرم واقعی و ثبت سند دفتر کل' },
60 { match:'window.ChequesView.changeStatus(', checks:{
61 'inactive-treasury-cheque-settlement':['disabledChequeClearingRejected','validChequeClearedExactlyOnce','confirmationRequiredBeforeCash'],
62 'cheque-third-party-endorsement':['missingEndorseeRejected','confirmationRequiredBeforeWrite','endorseeLedgerDimensionCorrect','appendOnlyEndorsementCorrelated','noPhantomCash']
63 }, kind:'native-fixture-positive-and-negative',
64 note:'رد وصول بدون بانک فعال، وصول با حساب منتخب و واگذاری چک با تأیید' },
65 { match:'window.AccountingView.savePeriod()', checks:{
66 'activate-accounting-and-inventory':['periodCreatedByForm'],
67 'fiscal-close-atomic-guardrails':['successfulCloseCommitted','duplicateCloseRejected']
68 }, kind:'native-ui-period-create',
69 note:'ایجاد دوره مالی از فرم واقعی و آزمون بستن اتمیک دوره' },
70 { match:'window.AccountingView.saveWarehouse()', checks:{
71 'activate-accounting-and-inventory':['warehouseCreatedByForm']
72 }, kind:'native-ui-warehouse-create',
73 note:'ایجاد انبار ساختگی از فرم و تأیید ماندگاری' },
74 { match:'window.AccountingView.previewOpeningFile()', checks:{
75 'positive-opening-ledger-and-idempotency':['dryRunFirst','postedBalancedOpening','repeatPostingBlocked'],
76 'opening-dry-run-rejects-existing-postings':['priorActivityBlocked','discrepancyCodesVisible','zeroWrites']
77 }, kind:'native-fixture-positive-and-negative',
78 note:'پیش‌نمایش و ثبت افتتاحیه، جلوگیری از تکرار و رد داده ناسازگار' },
79 { match:'window.InvoiceFormView._save(true)', checks:{
80 'invoice-quick-add-and-save-print':['quickContactCreated','quickProductCreated','saveAndPrintOpened','invoicePrintRendered','invoicePosted']
81 }, kind:'native-ui-create-and-print',
82 note:'ثبت فاکتور از فرم و بازشدن تنظیمات چاپ با کالای و شخصی که در همان فرم سریع ساخته شده‌اند' },
83 { match:'window.InvoiceFormView._saveQuickContact()', checks:{
84 'invoice-quick-add-and-save-print':['quickContactCreated']
85 }, kind:'native-ui-nested-create',
86 note:'ساخت شخص از پنجره سریع و انتخاب آن در فاکتور والد' },
87 { match:'window.InvoiceFormView._saveQuickProduct()', checks:{
88 'invoice-quick-add-and-save-print':['quickProductCreated']
89 }, kind:'native-ui-nested-create',
90 note:'ساخت خدمت از پنجره سریع و افزودن آن به ردیف فاکتور والد' },
91 { match:'window.InvoicePrint._print()', checks:{
92 'invoice-quick-add-and-save-print':['invoicePrintRendered','invoicePosted']
93 }, kind:'native-rtl-print-render',
94 note:'ساخت HTML چاپ فاکتور ذخیره‌شده با محتوای فارسی و راست‌به‌چپ؛ چاپگر فیزیکی آزمایش نشده' },
95 { match:'window.StockKardexModal._printKardex(', checks:{
96 'auxiliary-rtl-print-rendering':['kardexPrints','allDocumentsRtl']
97 }, kind:'native-rtl-print-render',
98 note:'تولید و ارسال سند چاپ راست‌به‌چپ کاردکس برای کالاهای ساختگی' },
99 { match:'window.ContactLedgerModal._printLedger(', checks:{
100 'auxiliary-rtl-print-rendering':['contactLedgerPrints','allDocumentsRtl']
101 }, kind:'native-rtl-print-render',
102 note:'تولید سند چاپ راست‌به‌چپ دفتر اشخاص برای اشخاص ساختگی' },
103 { match:'window.ReportsView._printReport()', checks:{
104 'auxiliary-rtl-print-rendering':['reportsPrintRendered','allDocumentsRtl']
105 }, kind:'native-rtl-print-render',
106 note:'تولید سند چاپ راست‌به‌چپ گزارش مالی؛ چاپگر فیزیکی آزمایش نشده' },
107 { match:'window.ExpensesView._promptNewCategory()', checks:{
108 'expense-form-category-and-posting':['customCategorySelected']
109 }, kind:'native-ui-category-create',
110 note:'افزودن سرفصل ساختگی در فرم هزینه و انتخاب آن قبل از ثبت' },
111 { match:'window.ExpensesView.saveExpense(null)', checks:{
112 'expense-form-category-and-posting':['expenseCreatedThroughForm','expenseJournalPosted']
113 }, kind:'native-ui-financial-posting',
114 note:'ثبت هزینه از فرم واقعی و تطبیق سند قطعی دفتر کل' },
115 { match:'window.AccountingView.addJournalRow()', checks:{
116 'manual-journal-reversal-and-exports':['journalRowAdded']
117 }, kind:'native-ui-row-edit',
118 note:'افزودن ردیف به فرم سند دستی حسابداری' },
119 { match:"window.AccountingView.saveJournal('draft')", checks:{
120 'manual-journal-reversal-and-exports':['draftJournalSaved']
121 }, kind:'native-ui-draft-posting',
122 note:'ثبت پیش‌نویس سند دستی در دوره باز' },
123 { match:"window.AccountingView.saveJournal('posted')", checks:{
124 'manual-journal-reversal-and-exports':['journalPosted']
125 }, kind:'native-ui-final-posting',
126 note:'قطعی‌سازی سند دستی متوازن از پیش‌نویس' },
127 { match:'window.AccountingView.saveReversal()', checks:{
128 'manual-journal-reversal-and-exports':['reversalPosted']
129 }, kind:'native-ui-reversal-posting',
130 note:'ثبت سند معکوس مستقل و حفظ سند اصلی' },
131 { match:'window.AccountingView.saveAccount()', checks:{
132 'manual-journal-reversal-and-exports':['chartAccountCreated']
133 }, kind:'native-ui-chart-account-create',
134 note:'ایجاد گروه کدینگ ساختگی از فرم حسابداری' },
135 { match:'window.AccountingView.exportReports()', checks:{
136 'manual-journal-reversal-and-exports':['ledgerCsvExported']
137 }, kind:'native-csv-export',
138 note:'خروجی CSV دفتر کل با سند ساختگی قطعی' },
139 { match:'window.AccountingView.exportReconciliation()', checks:{
140 'manual-journal-reversal-and-exports':['reconciliationCsvExported']
141 }, kind:'native-csv-export',
142 note:'خروجی CSV کنترل مغایرت با شمای مورد انتظار' },
143 { match:'window.AccountingView.saveTransfer()', checks:{
144 'inventory-transfer-and-stocktake':['secondWarehouseCreated','transferPosted','exactInventoryMoved']
145 }, kind:'native-ui-inventory-transfer',
146 note:'انتقال مقدار دقیق کالا بین دو انبار واقعی ساختگی' },
147 { match:'window.AccountingView.createStocktake()', checks:{
148 'inventory-transfer-and-stocktake':['stocktakeCreated']
149 }, kind:'native-ui-stocktake-create',
150 note:'ایجاد جلسه انبارگردانی از فرم واقعی' },
151 { match:'window.AccountingView.saveStocktake()', checks:{
152 'inventory-transfer-and-stocktake':['stocktakeCountsSaved']
153 }, kind:'native-ui-stocktake-save',
154 note:'ذخیره شمارش همه اقلام جلسه ساختگی' },
155 { match:'window.AccountingView.finishStocktake()', checks:{
156 'inventory-transfer-and-stocktake':['stocktakeFinalized']
157 }, kind:'native-ui-stocktake-finalize',
158 note:'تأیید نهایی شمارش همسان با موجودی و بستن جلسه' },
159 { match:'window.SettingsView.downloadBackup()', flag:'encryptedCompanyBackup',
160 kind:'native-encrypted-backup-ui',note:'خروجی رمزگذاری‌شده fbackup از رابط تنظیمات' },
161 { match:'window.SettingsView.restoreBackup()', flag:'encryptedCompanyBackup',
162 kind:'native-encrypted-backup-ui',note:'بازیابی رابط کاربری، رد رمز و فایل خراب و rollback تراکنشی' },
163 { match:'window.ProductsView.saveUnit(false)', checks:{
164 'products-crud-form-and-nested-classifiers':['standaloneUnitCreatedAndDeleted']
165 }, kind:'native-ui-standalone-create',
166 note:'ایجاد واحد از تب مستقل واحدها و ثبت در فهرست' },
167 { match:'window.ProductsView.saveCategory(false)', checks:{
168 'products-crud-form-and-nested-classifiers':['standaloneCategoryCreatedAndDeleted']
169 }, kind:'native-ui-standalone-create',
170 note:'ایجاد گروه از تب مستقل گروه‌ها و ثبت در فهرست' },
171 { match:'window.ProductsView.deleteUnit(', checks:{
172 'products-crud-form-and-nested-classifiers':['standaloneUnitCreatedAndDeleted']
173 }, kind:'native-ui-synthetic-delete',
174 note:'حذف واحد ساختگی و بدون ارجاع از دکمه ردیف و تأیید صریح' },
175 { match:'window.ProductsView.deleteCategory(', checks:{
176 'products-crud-form-and-nested-classifiers':['standaloneCategoryCreatedAndDeleted']
177 }, kind:'native-ui-synthetic-delete',
178 note:'حذف گروه ساختگی و بدون ارجاع از دکمه ردیف و تأیید صریح' },
179 { match:'window.ExpensesView.editExpense(', checks:{
180 'expense-form-category-and-posting':['draftExpenseEditedThroughForm','postedExpenseEditRejected']
181 }, kind:'native-ui-draft-edit',
182 note:'ویرایش پیش‌نویس ساختگی و رد ویرایش سند قطعی مالی از فرم' },
183 { match:'window.AccountingView.showJournal(', checks:{
184 'manual-journal-reversal-and-exports':['journalDetailsOpened']
185 }, kind:'native-ui-read-only-details',
186 note:'نمایش جزئیات سند قطعی ساختگی از صفحه اسناد' },
187 { match:'window.AccountingView.openReversal(', checks:{
188 'manual-journal-reversal-and-exports':['reversalFormOpened','reversalPosted']
189 }, kind:'native-ui-reversal-form',
190 note:'بازکردن فرم برگشت برای سند ساختگی و ثبت برگشت متوازن مستقل' },
191 { match:"this.closest('tr').remove()", checks:{
192 'manual-journal-reversal-and-exports':['journalRowRemoveButtonClicked']
193 }, kind:'native-ui-draft-row-remove',
194 note:'حذف ردیف اضافه از فرم پیش‌نویس بدون ثبت سند' },
195 { match:'FINORA.Modal.close()', probe:'modalKeyboard',
196 checks:['escapeClosesWithoutConfirm','focusReturnsToTrigger','cancelDoesNotConfirmAndRestoresFocus','nestedDialogIsolation'],
197 kind:'native-shared-modal-close-contract',
198 note:'رفتار مشترک بستن مودال با Escape و لغو، حفظ فوکوس و جداسازی مودال تو‌در‌تو؛ کلیک مستقیم تک‌تک دکمه‌های بستن مشاهده نشده' },
199 { match:"FINORA.Router.go('invoices')", probe:'routesVisited', expected:10,
200 kind:'native-route-navigation',
201 note:'دسترسی واقعی به هر ۱۰ مسیر اصلی در WebView2؛ این شاهد کلیک مستقیم تک‌تک لینک‌ها نیست' }
202 ];
203
204 function positiveEvidence(value) {
205 return value === true || (typeof value === 'number' && value > 0);
206 }
207 function hasEvidence(rule, evidence) {
208 if (rule.flag) return evidence[rule.flag] === true;
209 if (rule.probe === 'modalKeyboard') {
210 const probe = evidence.modalKeyboard || {};
211 return rule.checks.every(key => probe[key] === true);
212 }
213 if (rule.probe === 'routesVisited') return evidence.routesVisited === rule.expected;
214 if (!rule.checks) return false;
215 const results = evidence.nativeFunctional || {};
216 return Object.entries(rule.checks).every(([scenario, fields]) =>
217 fields.every(field => positiveEvidence(results[scenario]?.[field]))
218 );
219 }
220 function coverageFor(handler, evidence = {}) {
221 if (!handler) return null;
222 const rule = RULES.find(item => handler.includes(item.match) &&
223 (!item.exclude || !handler.includes(item.exclude)) && hasEvidence(item, evidence));
224 return rule ? { kind: rule.kind, scenarios: rule.scenarios || Object.keys(rule.checks || {}),
225 summary: rule.note } : null;
226 }
227 function annotateAudit(audit, evidence = {}) {
228 if (!audit || !Array.isArray(audit.uniqueActions) || !Array.isArray(audit.controls))
229 throw Error('Q01_FIXTURE_COVERAGE_INVALID_AUDIT');
230 for (const row of [...audit.uniqueActions, ...audit.controls])
231 row.fixtureCoverage = coverageFor(row.handler, evidence);
232 const pending = audit.uniqueActions.filter(row => row.status === 'not-clicked');
233 const covered = pending.filter(row => row.fixtureCoverage);
234 const uncovered = pending.filter(row => !row.fixtureCoverage);
235 return {
236 uniqueActionCount: audit.uniqueActions.length,
237 notClicked: pending.length,
238 disabled: audit.uniqueActions.filter(row => row.status === 'disabled').length,
239 fixtureCoveredNotClicked: covered.length,
240 withoutFixtureEvidence: uncovered.length,
241 entries: covered.map(row => ({
242 route: row.route, label: row.label, handler: row.handler,
243 status: row.status, coverage: row.fixtureCoverage
244 }))
245 };
246 }
247 function buildCoverageReport(result) {
248 if (!result || !Array.isArray(result.entries)) throw Error('Q01_FIXTURE_COVERAGE_INVALID_REPORT');
249 const lines = [
250 '# Q01 — شواهد سناریوهای مستقل برای کنترل‌های کلیک‌نشده', '',
251 'این گزارش جایگزین کلیک مستقیم یا تأیید تک‌تک دکمه‌ها نیست؛ فقط شواهد مستقل همان handler یا قرارداد مشترک رابط را در نصب واقعی WebView2 نشان می‌دهد.', '',
252 '- امضاهای متمایز: ' + result.uniqueActionCount,
253 '- امضاهای کلیک‌نشده: ' + result.notClicked,
254 '- کنترل‌های غیرفعال: ' + (result.disabled || 0),
255 '- دارای شواهد سناریوی مستقل: ' + result.fixtureCoveredNotClicked,
256 '- بدون شواهد سناریوی مستقل: ' + result.withoutFixtureEvidence, '',
257 '| صفحه | کنترل | هندلر | نوع پوشش | شواهد |', '|---|---|---|---|---|'
258 ];
259 for (const row of result.entries)
260 lines.push('| ' + row.route + ' | ' + row.label + ' | "' + row.handler + '" | ' +
261 row.coverage.kind + ' | ' + row.coverage.summary + ' |');
262 lines.push('', '- پوشش قرارداد مشترک مودال به معنی مشاهده کلیک مستقیم تک‌تک دکمه‌ها نیست.',
263 '- سناریوی متد-محور به‌معنای مشاهده کلیک مستقیم دکمه نیست.',
264 '- کنترل‌های فاقد نگاشت همچنان نیازمند آزمون fixture مستقل یا بررسی دستی‌اند.', '');
265 return lines.join('\n');
266 }
267 module.exports = { annotateAudit, buildCoverageReport, coverageFor };