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

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

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

Synced Dec 4, 08:00 UTC

docs(finora): register canonical inventory-count and draft-to-posted JWT QA refinement

davoodmehraban89 committed Nov 23, 2026 at 19:38 UTC 2d66d79058c9dd961546cda8ac4422b42ddd6a07
1 file changed +7
PROJECT_STATE.md
+7
@@ -880,3 +880,10 @@ Next action: run and inspect Quality on the latest PR212 head. If any browser te
880 - **Root cause evidence and missing boundary:** `20260930031853_organization_membership_rbac_foundation.sql` `records_insert` checks collection-level `create`, not approval on `data.status=posted`, and `20260929172129_phase5_complementary_erp_collections.sql` existing Phase5 guard blocks UPDATE/DELETE of pre-existing posted rows, not initial INSERT posted. The test did not modify either SQL file. PR243's real-JWT organization/company read-only isolation and posted UPDATE/DELETE safeguards remain valid and distinct from this INSERT status authorization defect.
881 - **Action taken:** Opened [Issue245](https://github.com/davoodmehraban89/Factor-easy/issues/245) with exact acceptance for Codex-main to forbid unauthorized direct posted stock/count writes and implement independent server-side finalize audit, transactional source link, idempotency and fiscal lock. Test must become ordinary authorized denial PASS `FINORA_PHASE5_POSTED_INSERT_APPROVAL_PASS` after correction. Explicit positive authorized finalize independently needed. Existing browser PR240/242 issues and Issue229 remain uncorrected.
882 - **CI at tested SHA:** WP2 #45200147190 SUCCESS proving expected known product RED, Security [#45200146799](https://github.com/davoodmehraban89/Factor-easy/actions/runs/45200146799) SUCCESS (not a business authorization proof); Quality #45200146962, WP1 #45200147309 IN PROGRESS at recording. New docs-inclusive SHA must pass exact-head Quality/WP1/WP2/Security separately. Draft and Codex-main final review mandatory. No app JS, migrations, SQL/RLS/Auth/grants, customer posted history, Production, main merge/release/deploy changed. Six-phase product progress **A90/B50/C20/D55/E53/F10 unchanged**.
883 +
884 +
885 +### 2026-11-23 — FIN-QA-245-CANONICAL-COUNT-AND-UPDATE / decision before QA refinement
886 +- Follow-up user request: continue real Finora execution; keep linear A90/B50/C20/D55/E53/F10 after each completed checkpoint. Protected main still `dab1a45fcfc4f12e675cfe055e477138cd3e99fa`; PR244 QA exact previously tested final `e58c16c5fecc8c16ea018c8b6c95929a69a4d6ea` four gates SUCCESS after Quality same-SHA isolated rerun, with prior 271/272 intermittent contact snapshot failure preserved in PR conversation. PR244/243 Draft; Issue245 and Issue229 open; no Codex-main financial fix or merge.
887 +- **New audit finding, test fidelity correction**: real product `js/phase5-enterprise.js::p5SaveCount` persists `systemQty`, `physicalQty`, `difference`, while PR244's disposable direct posted `inventoryCounts` JSON used `expectedQty`, `actualQty`, `diff` (from prior test fixture). RLS status bypass and HTTP201 persistence are real regardless, but this is not canonical count payload fidelity. Tighten the QA count fixture to the actual client schema; preserve exact owner JWT readback and original direct create-only test.
888 +- **Distinct unverified follow-on hypothesis**: `records_update` in `20260930031853_organization_membership_rbac_foundation.sql` requires `inventory:edit` but no approval of JSON `status`, while `finora_guard_phase5_posted_records` only blocks mutation if OLD was `posted`; client can plausibly create a draft then PATCH to `posted` without `inventory:approve`. This must be verified through real Auth-issued JWT/PostgREST with a separate non-owner member possessing only `inventory:create,inventory:edit` company A1 scope (no approve). Distinct from the existing create-only JWT and read-only JWT in PR243. Grant a third fixture seat via **disposable A license `max_users=3`** while retaining real license trigger. For each `stockMovements` and `inventoryCounts`, create true `draft` first, verify owner readback, PATCH same row status to `posted`, independently readback with real owner JWT. Distinguish `FINORA_PHASE5_POSTED_UPDATE_WITHOUT_APPROVE_EXPECTED_RED` (both successful persisted) from proper denial `FINORA_PHASE5_POSTED_UPDATE_APPROVAL_PASS` (both denied and still draft); mixed or unknown outcomes fail closed. Keep the original direct INSERT expected-RED/approval-PASS markers intact. No weakening/x-failing legitimate assertions.
889 +- **Scope:** existing PR244 QA script, narrowly scoped existing WP2 workflow step already covers script (no new step), append-only canonical docs; do NOT change product JS, SQL, migrations, RLS/Auth/grants, history, Production, main, release, or Codex-main exclusive financial implementation. After implementation, run exact-head WP2/Quality/WP1/Security and independently verify log/SHAs; if fixture fails, fix only evidence-justified fixture. Notify Issue245 of actionable dual-path contract. Product progress remains A90/B50/C20/D55/E53/F10 despite added proof.