سامانه صدور فاکتور و حسابداری
Mirrored from https://github.com/davoodmehraban89/Factor-easy.git
Synced Dec 3, 20:45 UTC
docs(state): record offline OTP QA evidence, provider approval and no-activation gate
davoodmehraban89 committed
Oct 12, 2026 at 22:49 UTC
29e194e66bea214a3efcaf9b6ce5f999af426c3c
1 file changed
+6
PROJECT_STATE.md
+6
@@ -69,6 +69,12 @@ The latest user message is the sole source of new instructions. Read AGENTS.md t
69
- **Verified baseline:** main `833b795b7b0320260b91dcbe621bbce04b23f0c3`; live Supabase `hcsixhqbyuhpshfwqpjx` HEALTHY; `public.profiles.phone` and unique partial index existing, live `phone_identity_profile` migration recorded; no Kavenegar sender Edge Function deployed; historical PR #58 remains open, must not blindly merge/duplicate migration. Windows Desktop Commander `DESKTOP-71SJ63M` ONLINE. Its working copy `C:\Temp\Factor-easy` was observed on stale `main` SHA `b1a35fdc...`, with **0 tracked modifications / 2189 untracked files**, and is read-only for this operation; GitHub branch is canonical source.
70
- **Acceptance:** offline contract tests cover signed hook body/gate, phone formatting, token/template injection protection, provider status/errors/timeouts and no sensitive logging; source/docs checked on feature-head CI. Activation requires independently verified **approved provider template**, securely configured API/hook secrets, admin owner confirmation before Auth provider setting changes and actual SMS send/test costs, safe linking/verification for existing user phone identities, staged user test without creating duplicate accounts, owner affected-network sign-in acceptance. RLS/tenant isolation and ledger remain unchanged. **Phase 0 F0-01 still OPEN.**
71
72
+### 2026-10-12 Kavenegar OTP server-only preparation — PR #110 OFFLINE QA PASS / NOT ACTIVATED
73
+- **Owner clarification upheld:** `FinoraLogin` template **NOT verified approved by Kavenegar**, only owner-approved infrastructure preparation. Provider SDK API documented; **no provider key received**, no live outbound SMS or Auth hook configuration. Keep existing email/password/Google functioning unchanged. Historical phone PR #58 remains pending and was not merged.
74
+- **PR [#110](https://github.com/davoodmehraban89/Factor-easy/pull/110):** isolated `supabase/functions/finora-kavenegar-send-sms/{handler.mjs,index.ts}` stage, `scripts/kavenegar-otp-preflight-test.mjs`, Quality workflow step and detailed `docs/FINORA_KAVENEGAR_OTP_PREPARATION_2026-10-12.md`. Feature disabled unless explicit `FINORA_KAVENEGAR_OTP_ENABLED=true` plus Edge-only `KAVENEGAR_API_KEY` and `SEND_SMS_HOOK_SECRET`. Checks Standard Webhooks HMAC and 5-minute timestamp before parsing, validates `+989...` and 6–10-digit token, uses provider's fixed template `FinoraLogin` and 3.5s timeout. Responds non-200 on disabled/invalid/provider failure; synthetic tests never contact Kavenegar. No account management, DB migrations, RLS, Auth configuration, website login UI, edge deployment, secret creation or cost.
75
+- **Observed Quality head `b6e72973a45bd48f3b2ad28f31a4da54c8094633`:** GitHub [Quality run `38296251394`](https://github.com/davoodmehraban89/Factor-easy/actions/runs/38296251394), **attempt 2 SUCCESS**, 96/96 Chromium PASS, Golden accounting PASS, OTP synthetic signed-hook/provider regression PASS, three isolated PostgreSQL suites PASS; [Security `38296251305`](https://github.com/davoodmehraban89/Factor-easy/actions/runs/38296251305) SUCCESS. First attempt had 95/96 Chromium with old F0-06 light-theme luminance assertion failing (reported 0.456 < 0.5), but no OTP regression; reran exact code job without weakening or changing the visual assertion and passed 96/96. This *documentation follow-up* commit still requires a new exact-head validation before merge.
76
+- **Acceptance still OPEN:** Kavenegar template approval/real delivery/cost, staging Edge deploy with signature verification and `verify_jwt=false`, protected server secrets, Supabase Auth phone provider & SMS hook configuration and real-account mobile binding must receive separate explicit owner approval and testing. NO automatic signup or newly created unrelated Auth user is allowed during legacy identity migration. Phase 0 F0-01 owner-real-ISP sign-in and Phase 0 as a whole remain OPEN.
77
+
78
## Current change ledger
79
| 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. |
80