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

docs(pilot): record exact correction feature QA/release and remaining coverage

davoodmehraban89 committed Oct 14, 2026 at 08:39 UTC 93e5f2b1b8e2bea4fc54615bbee00d6cd08083e9
1 file changed +8
PROJECT_STATE.md
+8
@@ -183,6 +183,14 @@ The latest user message is the sole source of new instructions. Read AGENTS.md t
183 - **Explicit coverage caveat:** this **is not an 'all financial documents' implementation yet**: purchase source, receipts, payment settlements, expenses, tax-submitted/legal documents, closed fiscal periods, and historical records without valid source-voucher linkage are intentionally not converted automatically. Individual record deletion of a posted voucher is never performed; the visible 'delete/cancel' action records reversal, which is legally and technically distinct. Draft sale deletion is allowed only if not linked to journal/tax doc/payments. No automatic bulk unposting of previously posted records.
184 - **Risk and follow-up:** `jeReverse` stages multiple saves on the existing debounced sync path; invoice correction requires a server acknowledgment before showing success, whereas manual journal correction relies on existing sync badge. Validate server-side immutable triggers and race/partial write scenarios in independent controlled tests before accepting production correction. If these safeguards fail CI, do not merge. No schema, RLS, Auth, user roles, SMS or live financial documents touched in this branch. Rollback by reverting exact scoped code PR; actual user reversals after future rollout remain immutable historical business events and cannot be erased by code rollback.
185
186 +### 2026-10-14 Pilot posted-document correction — PR #124 MERGED / EXACT-SHA QA, SECURITY, PAGES SUCCESS / OWNER ACCEPTANCE OPEN
187 +- Owner request: in pilot show «برگشت سند قطعی به موقت», edit/re-finalize and delete/cancel. This first release handles **manual journal vouchers** and **formal/nonformal sales invoices** through a linked compensating posted reversal and a NEW editable draft. Old posted vouchers and source history remain immutable.
188 +- Delivery: PR [#124](https://github.com/davoodmehraban89/Factor-easy/pull/124) squash merged as protected main **e66cbfe4e2a59519af0095f0187a4d1e7aab16d7**. Updated js/journal-engine.js, js/journal-ui.js, js/invoices.js, js/document-management.js, scripts/accounting-document-workflow.spec.js. Added manual journal draft edit/return/cancel; sales invoice correction with unique replacement ID/number and correctsInvoiceId lineage, server-acknowledged correction sync and guarded draft deletion. Confirmations, reason capture, company/identity/fiscal safeguards; electronic-tax/recognized payment-linked sources held for separate workflow.
189 +- Final PR test head **ddaeac6bcb86d1a96024c70d953a3d773b62e5af**: Quality **38514364453 SUCCESS**; Chromium **110/110 actual Playwright PASS**, Golden accounting PASS, three disposable PostgreSQL jobs PASS. Security **38514364423 SUCCESS** (CodeQL and release-safety; dependency review SKIPPED). Previously tested interim head 109/109 superseded.
190 +- Exact protected-main **e66cbfe4e2a59519af0095f0187a4d1e7aab16d7**: Quality **38514715350 SUCCESS**, Security **38514715371 SUCCESS**, Release Gate **38514995868 SUCCESS**, gated Pages **38515017469 SUCCESS**. Duplicate release **38514854574 CANCELLED** and Pages **38515005679 SKIPPED**, explicitly not counted. Gated Pages is not a live owner authenticated document acceptance claim.
191 +- **Explicitly not implemented / not accepted:** purchase invoices, receipts/payments, expenses/income, electronic submitted tax documents, legacy records without valid source-voucher linkage, locked fiscal years, adversarial second-user/tenant tests, real production owner corrective edit/repost. Source-specific inventory/settlement contracts require separate verified slices. No automatic unposting or physical deletion of posted records. Rollback of software cannot delete future legitimate compensating financial entries.
192 +- Boundary: no Supabase DDL/DML/permissions/Auth/RLS/roles, paid resource, SMS, real financial-history rewrite or live posted user record mutation occurred in this engineering delivery. Owner pilot acceptance and F0-01 slowness remain OPEN. Next: separately controlled purchase-correction workflow and authorized non-financial/synthetic owner smoke.
193 +
194 ## Current change ledger
195 | 2026-10-07 | Owner requested accounting/product usability refinement from live screenshots: automatic non-user-entered floating-detail codes, contextual in-product guides (especially accounting/chart/dimensions), remove duplicate product internal tax ID and use product code as internal item ID, strengthen in-control product/person search, introduce hierarchical product group/subgroup coding with deterministic 6-digit product codes, and keep sale/purchase commercial-document workspace layout stable while only semantic fields change. | **IMPLEMENTED / LOCAL VERIFICATION PASSED / CI PENDING** | Baseline main = `7e58c75f7d754f378d94ca3f356c1ae580aa7ee3`. Automatic dimension type/value codes, contextual guides, product-code-as-internal-ID, normalized multi-token search, and additive six-digit product coding implemented. Existing historical codes preserved. Commercial sale/purchase workspaces now share a stable `صدور سند تجاری` header/actions layout; duplicate purchase sidebar injection removed; the public selector is the single document-type selector and the legacy internal invoice-kind control is hidden. Local syntax/static/commerce/UX/accounting phases 2–6/Golden checks passed; protected-branch CI remains pending. |
196