سامانه صدور فاکتور و حسابداری
Mirrored from https://github.com/davoodmehraban89/Factor-easy.git
Synced Dec 3, 22:00 UTC
Record modular ERP and office automation expansion request
davoodmehraban89 committed
Sep 30, 2026 at 06:23 UTC
0b622439fb03b64b029cbc7b0c7987c55160ad0c
1 file changed
+13
-8
PROJECT_STATE.md
+13
-8
@@ -21,15 +21,15 @@ Owner explicitly granted standing authority on 2026-09-30 for in-scope GitHub an
21
## Current change ledger
22
| Date | Request / decision | Status | Evidence / next action |
23
|---|---|---|---|
24
+| 2026-09-30 | Expand Finora from accounting-centric ERP into a modular organization-wide platform. Add professional office automation (incoming/outgoing/internal correspondence, secretariat registration/numbering, scanned attachments/OCR-ready metadata, archive/search, inbox/referral/follow-up, letter drafting/templates), configurable requests/workflows (vehicle, stationery/procurement and arbitrary admin-defined request types/fields), role-scoped module administration and read/write/approve/secretariat permissions, transport/operations roadmap, and a module-selection entry experience. Commercial licenses must entitle explicit modules (accounting, office automation, payroll, etc.) or a full suite rather than automatically unlocking the entire ERP. Research mature Iranian office-automation patterns including Barid/ParGar, Chargoon/Didgah and Faragostar and synthesize rather than copy. | **IN PROGRESS — new platform slice** | Live pre-change head `ba6d7d44`; its Quality/Security/Pages are PASS. Supabase `hcsixhqbyuhpshfwqpjx` is `ACTIVE_HEALTHY`, 21 applied migrations through `20260929221754`, RLS on all public business tables, performance advisor clean. Research evidence found ParGar's unified organizational desk + OCR/search, Faragostar's correspondence/secretariat/inbox/forms/workflow/document patterns, and mature secretariat patterns such as multiple registries, numbering, attachments, referrals, SLA/follow-up and controlled search. Immediate architecture rule: license entitlement and user authorization are separate layers; no client-only permission security. First vertical slice will establish server-enforced module entitlements + module catalog/launcher + office-automation/request data contracts and tests without weakening existing accounting invariants. Full multi-user organizational delegation requires a tenant/membership model and will not be falsely claimed until server-side sharing/RLS is implemented. |
25
| 2026-09-30 | `@GitHub @Supabase`: perform required remaining work without routine permission prompts and finish executable remaining work. | **COMPLETED for the current hardening checkpoint** | Authority/reconciliation `38beab7f`; Real-DOM natural/legal ordering repair `23ed19b2`; browser enterprise-v2 routing repair `b0278172ba2110dcaf9cd0d2edb784417a0fdff5`. Quality `36661446705` **PASS** including syntax, application invariants, Phase 2–6, enterprise payroll/service-period behavior, Golden Accounting Journey and all 3 Real-DOM/PDF tests. Security `36661446688` **PASS**. Pages `36661445458` **PASS**. Production Supabase remains `ACTIVE_HEALTHY`, 21 migrations through `20260929221754`, RLS enabled on `profiles/licenses/records`, performance advisor clean. No DB mutation was required in this checkpoint. |
26
| 2026-09-30 | Iran-first high-assurance enterprise ERP: current Iranian accounting/tax/VAT/Taxpayer-System/commerce/labor/social-security controls; standards-aware chart/statements; HR/payroll/benefits/leave; treasury/petty cash; inventory/costing/ABC/performance budgets; intercompany/group controls; compliance traceability. Keep natural/legal identity, activity and group structure separate. | **IN PROGRESS — broader roadmap** | Baseline `docs/IRAN_COMPLIANCE_MATRIX_V1.md`; implemented foundations include chart roles, entity cleanup, employees/contracts/leave/cashboxes/petty cash/compliance, accounting-connected payroll, benefit accruals, posted petty-cash lifecycle, budgets, ABC and intercompany/group management controls. Applied+archived migrations: `20260929220543`, `20260929220613`, `20260929221252`, `20260929221754`. Do not claim statutory consolidation, full tax submission, full HR/CRM or every Iranian rule complete until lifecycle/accounting/permissions/tests exist. |
27
| 2026-09-30 | Accountant-first daily ERP: `پروژه`→`پیمانها`, first-login display/professional role, commercial company capacity, multi-company vs true holding separation, improved Chart of Accounts. | IMPLEMENTED / VERIFIED AT CURRENT PRODUCT CHECKPOINT | License capacity is live with server enforcement; professional role is separate from system `user/admin`; Chart of Accounts search/filter/hierarchy/safe edit/deactivate exists; roadmap `docs/FINORA_ERP_EXPANSION_ROADMAP_V4.md`. |
28
| 2026-09-30 | Approved two-tier shell, persistent contextual handle, task-focused navigation, isolated printing, separate company legal/activity/group metadata. | IMPLEMENTED / VERIFIED IN BROWSER | UX evidence `docs/FINORA_UX_ACCOUNTING_BENCHMARK_V3.md`; Chromium A4/A5 isolated-PDF tests PASS in `36661446705`. Physical-printer validation remains `NOT VERIFIED`. |
29
30
## Current verified live state — 2026-09-30
30
-- Verified product head: `b0278172ba2110dcaf9cd0d2edb784417a0fdff5`.
31
-- Quality `36661446705`: PASS, including Real-DOM and accounting/domain gates.
32
-- Security `36661446688`: PASS. Pages `36661445458`: PASS.
31
+- Live pre-platform-expansion head: `ba6d7d44402d97e007c2490b0a77d7e343a1642b`; current request-recording commit follows it.
32
+- Quality/Security/Pages on `ba6d7d44`: PASS.
33
- Supabase `hcsixhqbyuhpshfwqpjx`: `ACTIVE_HEALTHY`, PostgreSQL `17.6.1.166`, 21 migrations through `20260929221754 iran_enterprise_financial_controls`.
34
- Public data: `profiles` 4 rows, `licenses` 4, `records` 97; RLS enabled on all three; `licenses.max_companies default 1` exists.
35
- Performance advisor: no findings.
@@ -37,7 +37,7 @@ Owner explicitly granted standing authority on 2026-09-30 for in-scope GitHub an
37
- Supabase Sep-2026 changelog review: PostgreSQL 17.11 is available while project is 17.6.1; available connector actions do not expose platform database upgrade or Auth leaked-password-policy configuration, so neither was changed.
38
39
## Master roadmap status
40
-Phases 1–6 remain accepted and completed: UX shell; master data/accounting foundation; double-entry accounting; projects/contracts; inventory/costing/assets/multi-currency/import/integrations; professional reports/reconciliation/release. Current work is post-release hardening + Iran-first enterprise expansion, not a reset.
40
+Phases 1–6 remain accepted and completed: UX shell; master data/accounting foundation; double-entry accounting; projects/contracts; inventory/costing/assets/multi-currency/import/integrations; professional reports/reconciliation/release. Current work is post-release hardening + Iran-first enterprise/platform expansion, not a reset.
41
42
## Accounting/data invariants
43
- Posted journal lines are accounting truth; source documents remain traceable.
@@ -47,6 +47,7 @@ Phases 1–6 remain accepted and completed: UX shell; master data/accounting fou
47
- Counterparties/projects/branches/contracts are global masters/analytics, not one ledger account per entity; analytic dimensions stay normalized/generic and group/non-leaf nodes are non-postable where leaf-only rules apply.
48
- Tenant isolation is mandatory at RLS/data boundary; authorization never relies on user-editable metadata.
49
- Restore/sync preserves immutable financial history and resolves server uniqueness/immutability conflicts authoritatively.
50
+- **New platform invariant:** commercial module entitlement (what the customer bought) and member authorization (what a person may read/write/approve/administer) are independent checks; effective access is the intersection of both. UI hiding is never a security boundary.
51
52
## Required evidence
53
`docs/PHASE_1_REDESIGN_VERIFICATION.md` · `docs/PHASE_2_REDESIGN_VERIFICATION.md` · `docs/PHASE_3_REDESIGN_VERIFICATION.md` · `docs/PHASE_4_REDESIGN_VERIFICATION.md` · `docs/PHASE_5_VERIFICATION.md` · `docs/PHASE_6_VERIFICATION.md` · `docs/ACCOUNTING_CORE_ROADMAP_V1.md` · `docs/RD_IRAN_ACCOUNTING_ERP_2026-09-28.md` · `docs/IRAN_COMPLIANCE_MATRIX_V1.md` · `docs/FINORA_ERP_EXPANSION_ROADMAP_V4.md` · `docs/FINORA_UX_ACCOUNTING_BENCHMARK_V3.md` · `docs/PRODUCTION_RUNBOOK.md` · `supabase/migrations/`.
@@ -55,11 +56,15 @@ Phases 1–6 remain accepted and completed: UX shell; master data/accounting fou
56
- Authenticated production-user browser E2E: NOT VERIFIED; no production user credential/session is available here.
57
- Physical-printer behavior: NOT VERIFIED.
58
- Live third-party webhook delivery: NOT VERIFIED; no target endpoint/credential supplied.
59
+- OCR engine quality on real Persian scans: NOT VERIFIED; the new office-automation design must be OCR-ready but may not claim OCR accuracy before a real engine/pilot is connected.
60
+- Multi-user organization sharing/delegation: NOT YET IMPLEMENTED; existing `records.owner_id = auth.uid()` model is user-owned and must not be represented as secure organizational RBAC.
61
- Supabase leaked-password-protection enablement: NOT VERIFIED/current advisor says disabled; connector exposes no Auth password-policy mutation.
62
- PostgreSQL 17.11 platform upgrade/reindex: NOT PERFORMED; connector exposes no database-upgrade action.
63
64
## Exact next executable work
62
-1. Treat the current hardening checkpoint as verified; do not redo it without a regression.
63
-2. Continue the broader Iran-first enterprise roadmap as complete vertical slices, prioritizing statutory financial-statement/consolidation controls and submission-grade tax/HR workflows only when their full accounting, permission and test contracts can be implemented.
64
-3. Recheck Supabase migrations/RLS/advisors before any database slice and archive every applied migration exactly.
65
-4. Keep external/manual boundaries explicitly `NOT VERIFIED` until the necessary credentials/hardware/platform action exists.
65
+1. Write the researched office-automation + modular ERP architecture/IA and explicit module catalog, licensing/RBAC model and phased roadmap.
66
+2. Implement a server-enforced module-entitlement migration/RPC while preserving existing customers via an explicit backward-compatible entitlement policy; archive the exact applied migration.
67
+3. Implement the client module catalog/launcher and admin license module selection; gate modules from the server-derived license, not only CSS/UI.
68
+4. Add office-automation/request collections and a working first slice: secretariat registries + incoming/outgoing/internal correspondence metadata + attachment metadata + request-type/form schema foundations, with tests.
69
+5. Design then implement organization tenant/membership/RBAC as a separate high-risk slice before claiming module managers, secretariat operators or shared inboxes across multiple login accounts.
70
+6. Run full Quality/Security/Pages + Supabase advisors and update this file with exact evidence.