@davoodmehraban89 / Factor-easy-2 Mirror · read-only / commits / 9631f6e
Fork 0

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

Mirrored from https://github.com/davoodmehraban89/Factor-easy.git

Synced Dec 3, 22:00 UTC

Define researched enterprise navigation architecture

davoodmehraban89 committed Sep 29, 2026 at 23:35 UTC 9631f6ef09c4ec9518cdfc8fcbceee84b9cf7c7f
2 files changed +131 -1
PROJECT_STATE.md
+1 -1
@@ -34,7 +34,7 @@ Before doing any project work:
34 ## Current change ledger
35 | Date | Request / decision | Status | Evidence / next action |
36 |---|---|---|---|
37 -| 2026-09-29 | Owner rejected the current workspace-dump navigation. Redesign Finora around the approved two-tier enterprise shell shown in the canonical screenshot: primary module rail + rich contextual subsystem menu; replace `خانه` with `داشبورد`; keep owner-approved domain grouping such as sales/purchases/contacts under بازرگانی; give accounting and every major module organized groups (e.g. پایه/عملیات/دفاتر و گزارش‌ها/ابزارها) with one clear action/view per menu item. Before implementation, research multiple Iranian accounting/ERP products (not one vendor), official product structures/demos plus user/accounting-community feedback, synthesize patterns without copying a vendor, then migrate existing working views into the hierarchy without feature loss or fake modules. | IN PROGRESS | Inspect approved screenshot and live shell, research Hamkaran/System Group, Sepidar, Tadbir, Gheyas, Holoo and accounting-community/user feedback where evidence is available; produce a Finora IA/navigation contract, then implement the first verified shell/navigation slice and real-DOM gates. |
37 +| 2026-09-29 | Owner rejected the current workspace-dump navigation. Redesign Finora around the approved two-tier enterprise shell shown in the canonical screenshot: primary module rail + rich contextual subsystem menu; replace `خانه` with `داشبورد`; keep owner-approved domain grouping such as sales/purchases/contacts under بازرگانی; give accounting and every major module organized groups (e.g. پایه/عملیات/دفاتر و گزارش‌ها/ابزارها) with one clear action/view per menu item. Before implementation, research multiple Iranian accounting/ERP products (not one vendor), official product structures/demos plus user/accounting-community feedback, synthesize patterns without copying a vendor, then migrate existing working views into the hierarchy without feature loss or fake modules. | IN PROGRESS | Research completed across the approved screenshot, live shell, Sepidar official system/accounting pages and training UI, Rahkaran/System Group module structure, Holoo task/report material, Gheyas/user feedback and independent review feedback. Synthesis is recorded in `docs/FINORA_INFORMATION_ARCHITECTURE_V2.md`: nine primary business modules, rich grouped contextual menus, task-level navigation, no `خانه`, no standalone `کالا`, no generic `ERP`, and no fake future modules. Next: implement the contract and real-DOM acceptance gates. |
38 | 2026-09-29 | Continue post-release hardening after the executable accounting/database fixes; close remaining verifiable acceptance gaps without claiming external/manual checks. | IN PROGRESS | Browser checkpoint `2c6bab32` adds real-Chromium expired-license enforcement: expired subscription renders expired, `canWrite()` is false and `requireWrite()` blocks mutation. This checkpoint also adds a deterministic 20,008-line Phase 6 reporting workload covering rollup/trial-balance equality, P&L correctness, ledger row preservation and a 5-second CI regression ceiling. Pre-CI review caught that the dated ledger filter correctly excludes the two February seed lines, so the expected January workload is 20,006 rather than 20,008; the assertion is corrected in this checkpoint before acceptance. Latest executable code head is `9822bad8`: it corrects the dated performance expectation before acceptance. The prior superseded run `36621990092` on `b992e486` confirms syntax, application invariants and Phase 2–5 (including depreciation reversal) all PASS, then fails only on the now-corrected January ledger-row expectation before Golden/DOM steps. Additional live production rollback-only security QA exercised all three admin license mutation RPCs (`cancel`, `extend`, `set`) under a non-admin authenticated JWT; all were denied with the shared internal admin guard, while `is_admin=false`; transaction rolled back. Supabase performance advisor remains clean; security advisor still reports the five intentional SECURITY DEFINER-callability warnings plus leaked-password protection disabled. Latest `9822bad8` push-run ID remains unavailable through the connector and no failure notification has appeared yet, so combined Quality/real-DOM remains NOT VERIFIED. |
39 | 2026-09-29 | Owner supplied another GitHub Actions failure (`golden-accounting-core-check.mjs`: `revenue report mismatch`) and asked for exact current progress plus continuous diagnosis/fix until the hardening work reaches a verified conclusion. Treat repeated run failures as blockers, distinguish superseded-run failures from current-head failures, and do not stop after a single fix while executable work remains. | IMPLEMENTATION COMPLETE / FINAL EXTERNAL VERIFICATION REMAINS | The supplied failure at `19:25:15Z` maps to the custom-chart transition around `d6b293e4`, not the later documentation head. Root accounting/report defect identified: Phase 6 `rollup()` discarded the account-master `accountType`, so `financials()` could not actually use the explicit classification promised by the earlier custom-chart hardening and silently fell back to code/title heuristics. This checkpoint preserves `accountType/systemRole` in report rollups, makes cash-flow use the explicit cash system role, and strengthens the Golden Journey with neutral arbitrary account titles plus diagnostic expected/actual values. CI run `36620001387` on `768f97ab` proves JavaScript syntax, application invariants, Phase 2–6 behavior, Golden Accounting Journey and browser-runtime install all PASS. Its only failure was the new print DOM assertion using Playwright `toContainText()` on a `<style>` element; GitHub log showed the style element actually contained `A4 landscape`. Commit `9d0a3122` corrected the assertion to inspect style `innerHTML`, archived/applied production migrations under exact versions `20260929193348` and `20260929193357`, and production rollback-only QA proved settled-cheque immutability plus case-insensitive account-code uniqueness with zero QA rows left. Depreciation reversal was then implemented without weakening immutable source history at `e70b07a1`; run `36620902948` exposed only a Node-VM harness omission (`getMyJournalVouchers` absent), corrected at `521b0de7`. No GitHub failure notification for `521b0de7` was present in the connected mailbox after the normal failure-notification window, but the exact push-run ID is unavailable through the current connector, so latest-head CI/real-DOM is NOT VERIFIED rather than assumed PASS. |
40 | 2026-09-29 | Owner reported repeated GitHub Actions `run failed` notifications and supplied a Quality log failing on stale static needle `v.status==='posted'`. Diagnose the live CI failure first, repair the gate without weakening accounting safety, verify current CI, then continue the approved hardening backlog. Reduce avoidable CI churn by batching subsequent related durable changes where practical. | FIXED / CI VERIFICATION PENDING | Root cause confirmed: `journal-engine.js` was intentionally hardened from posted-only source locking to posted+reversed locking, while `quality-check.mjs` still searched for the obsolete literal `v.status==='posted'`. The gate is being corrected to require `jeSourceLocked` plus `['posted','reversed'].includes`, which is stronger and matches live semantics. Fix commit `78c6a071` replaced the obsolete posted-only literal with the stronger `jeSourceLocked` + posted/reversed invariant. Follow-up inspection exposed a hidden Phase 2 test-script syntax defect (duplicate `const companies`) that the old syntax gate could not detect because it only parsed `js/*.js`; the next batched checkpoint removes that duplicate, makes syntax CI check every `scripts/*.mjs`, and removes duplicate Phase 6 behavior execution from `quality-check.mjs` now that Phase 6 has its own named workflow step. Root cause fixed at `78c6a071`; follow-up CI repair `20294e31` removed the hidden duplicate Phase 2 declaration, checks syntax of all MJS gates and avoids duplicate Phase 6 execution. `18ea5c8b` added Quality/Security concurrency cancellation plus real-Chromium A4/A5 pagination/page-break checks, reducing superseded-run noise. Subsequent requirement hardening: legacy-company starter-chart fix `3b3ffba2`; custom-chart system posting roles + arbitrary-code Golden Journey `d6b293e4`; role-aware AR/AP/cash-flow/project-contract reporting and prepared role uniqueness `dbe9170c`; incremental self-healing posting profiles `73bd9f3f`. Push-run IDs remain unavailable through the current connector, so latest CI/real-DOM is still NOT VERIFIED; any new failure log must be diagnosed before acceptance. |
docs/FINORA_INFORMATION_ARCHITECTURE_V2.md new
+130
@@ -0,0 +1,130 @@
1 +# Finora Information Architecture v2 — Enterprise Navigation Contract
2 +
3 +Date: 2026-09-29
4 +Status: APPROVED DIRECTION / implementation in progress
5 +
6 +## Owner requirement
7 +The previous shell technically had a module rail and contextual panel, but the contextual panel was too shallow and several workspaces dumped multiple unrelated tasks into one long page. The approved visual target is the canonical 1536×864 Finora screenshot: narrow RTL module rail, a second contextual subsystem panel, top company/fiscal/search context, and a focused central workspace. `خانه` is not a business module and is replaced by `داشبورد`.
8 +
9 +## Research synthesis
10 +This IA is a synthesis, not a copy of one product.
11 +
12 +- Sepidar publicly separates accounting, receipts/payments, suppliers/inventory, customers/sales, fixed assets and other systems; its accounting product emphasizes standard chart coding, legal books, fiscal-year closing and account-turnover/balance reports. Training material also shows a right-side module list and separate module/submenu navigation.
13 +- Rahkaran/System Group structures the ERP as financial, sales, supply/logistics, production, HR and management-accounting solutions; its financial family includes general-ledger concepts rather than mixing every transaction into one page.
14 +- Holoo material repeatedly exposes task/report concepts such as purchase/sales, counterparties, cheques/bank, inventory and separate general/subsidiary/detail ledgers. User-facing material emphasizes quick learnability.
15 +- Gheyas user feedback is useful as a negative constraint: users value quick entry but complain when common actions require too much navigation or UI friction.
16 +- Independent user feedback on Iranian accounting products repeatedly rewards simple/learnable flows and criticizes inconsistent or overly complicated interfaces. Finora therefore prioritizes stable module locations, explicit task names, shallow click depth and no duplicate “mystery” routes.
17 +
18 +## Navigation principles
19 +1. One primary rail item = one business subsystem, not a random feature bucket.
20 +2. Clicking a primary module opens a rich contextual panel; it does not dump every form into the workspace.
21 +3. Context panel groups are domain language: اطلاعات پایه، عملیات، دفاتر و گزارش‌ها، کنترل/ابزارها.
22 +4. Each actionable menu item opens one focused task surface. Shared data may reuse the same underlying engine, but unrelated cards are hidden.
23 +5. No fake menu items: an item is exposed only when the corresponding working lifecycle/view exists.
24 +6. Cross-module masters have one canonical home; secondary routes may deep-link to them but must not duplicate data.
25 +7. Global search indexes task-level commands, not just modules.
26 +8. Desktop follows the approved two-tier shell; responsive mode may collapse the contextual panel but preserves hierarchy.
27 +
28 +## Primary module rail
29 +1. داشبورد
30 +2. حسابداری
31 +3. بازرگانی
32 +4. خزانه‌داری
33 +5. پروژه و قرارداد
34 +6. انبار
35 +7. دارایی ثابت
36 +8. گزارش‌ها
37 +9. تنظیمات
38 +
39 +The old `کالا` and generic `ERP` rail entries are removed. کالا/خدمات belongs to بازرگانی master data; inventory and fixed assets are first-class operational modules. Currency, cost centers, import/backup and integrations are routed to accounting/settings where users expect them.
40 +
41 +## Contextual menu contract
42 +
43 +### داشبورد
44 +- نمای مدیریتی: داشبورد
45 +
46 +### حسابداری
47 +**اطلاعات پایه**
48 +- کدینگ حساب‌ها
49 +- تفصیلی‌های شناور
50 +- قواعد حساب و تفصیلی
51 +- سال‌های مالی
52 +- شعب
53 +- ارز و نرخ تبدیل
54 +- مراکز هزینه
55 +
56 +**عملیات**
57 +- ثبت سند حسابداری
58 +- فهرست اسناد حسابداری
59 +
60 +**دفاتر و گزارش‌ها**
61 +- تراز آزمایشی
62 +- دفتر کل / معین / تفصیلی
63 +- صورت سود و زیان و وضعیت مالی
64 +- جریان وجوه نقد
65 +- سن مطالبات و بدهی‌ها
66 +
67 +### بازرگانی
68 +**اطلاعات پایه**
69 +- اشخاص
70 +- کالا و خدمات
71 +**فروش**
72 +- فاکتور فروش
73 +**خرید**
74 +- فاکتور خرید
75 +**کنترل**
76 +- هزینه و درآمد
77 +
78 +### خزانه‌داری
79 +**عملیات**
80 +- دریافت و پرداخت
81 +- چک‌ها و صیاد
82 +No bank-account master is exposed until its full lifecycle exists.
83 +
84 +### پروژه و قرارداد
85 +**اطلاعات پایه**
86 +- پروژه‌ها
87 +**عملیات پیمان**
88 +- قراردادها، الحاقیه‌ها، کسورات، تضمین‌ها و صورت‌وضعیت‌ها (existing contracting workspace)
89 +**گزارش**
90 +- گزارش پروژه و پیمان
91 +
92 +### انبار
93 +- تعریف انبار
94 +- گردش انبار
95 +- انبارگردانی
96 +- موجودی و بهای میانگین
97 +These are task-focused projections of the existing inventory engine.
98 +
99 +### دارایی ثابت
100 +- ثبت دارایی
101 +- دفتر دارایی‌ها
102 +- استهلاک و سوابق
103 +
104 +### گزارش‌ها
105 +- گزارش‌های مدیریتی/عملیاتی
106 +- تراز آزمایشی
107 +- دفاتر حسابداری
108 +- صورت‌های مالی
109 +- جریان نقد
110 +- سن مطالبات/بدهی
111 +- پروژه/پیمان
112 +
113 +### تنظیمات
114 +- شرکت‌ها و تنظیمات عمومی
115 +- تنظیمات عملیاتی
116 +- ورود/خروج داده و پشتیبان
117 +- اتصالات و API
118 +- کاربران و لایسنس (admin only)
119 +
120 +## Explicitly not exposed as operational
121 +Budgeting, payroll, tax-authority live submission and any other future module are not placed in the active rail until their data lifecycle, permissions, accounting integration and tests exist.
122 +
123 +## Acceptance criteria
124 +- No primary rail label `خانه`, `کالا` or generic `ERP`.
125 +- Accounting contextual panel contains at least the grouped base/operations/books-report hierarchy above.
126 +- Clicking task-level accounting entries focuses only the relevant card/report, not the entire accounting-foundation/journal/report dump.
127 +- Commerce owns sales, purchases, contacts and products.
128 +- Global command search can navigate task-level entries.
129 +- Existing data and accounting engines are reused; no duplicate masters.
130 +- Real-DOM smoke verifies the rail labels, accounting groups and at least account-chart, journal-entry, journal-register and trial-balance task focusing.