22 Commits

Author SHA1 Message Date
masoodafar-web e3850f9dd8 docs: فاز ۱۱ — فیکس‌های پرداخت ZarinPal + تصحیح تومان/ریال + امنیت Callback URL
- CHANGELOG: Phase 11 (11a-11f) — ZarinPal verify fix, تومان/ریال مدل, صفحه موفقیت, حذف ×۱۰ دوبار, callback URL امنیت
- BUSINESS-02: تصحیح مدل ارزی (DB=تومان نه ریال), ZarinPal verify fix, جدول callback URL امنیت
- TECH-01: اضافه CmsBaseUrl/FrontOfficeBaseUrl به appsettings, توضیح امنیت Open Redirect
- TECH-02: اضافه PaymentCallback.razor, وضعیت‌های جدید
- ROADMAP: بروزرسانی Payment 97→99%, اضافه فاز ۱۱ به DONE list
2026-02-27 22:33:35 +03:30
masoodafar-web 39590d2cbe docs: Phase 10 — DataMigration + EF Staging + PackagePurchaseDialog + UI Fixes
Updated 8 docs:
- CHANGELOG: Phase 10a-d (DataMigration tool, EF staging migrations, PackagePurchaseDialog, 4 UI fixes)
- PAYMENT-FINANCE: Rial→Toman conversion chain documented, PackagePurchaseDialog status
- TECH-02: Added PackagePurchaseDialog to folder structure + status table
- TECH-04: DataMigration tool features (smart retry, FK handling, fallback tables), EF staging
- PACKAGE-TASKS: Phase 10 graph, NuGet v0.0.189, T4.1+T4.2 marked 
- BIZ-PACKAGE: v6→v7, commits updated, T4.1+T4.2 marked 
- INDEX: Updated last-update + R3 description
- ROADMAP: Progress bars updated, DONE section + NOW section refreshed
2026-02-27 20:56:00 +03:30
masoodafar-web e9f1fb9911 docs: Phase 9 — Q24-Q30 + History Interceptor + Rename + Migration
- CHANGELOG: add Phase 9 (9a-9d) with all new commits (CMS:a1024a3→fdbb91d→10d2ca2, FO:474d364, BO:6939780)
- CHANGELOG: update summary table (279 items, 99%)
- TASKS: add Phase 9 section with detailed descriptions + update commit list (30 total)
- BIZ: update header to 'code complete — Phase 0-9 ' + add Phase 9 commits
- TECH-01: add SP Worker (Q26), History Tracking System (Q27), IHasHistory, Interceptor docs
- TECH-01: add UserWalletHistoryService (renamed from ChangeLog)
- INDEX: update R3/R6 descriptions, update timestamp
2026-02-27 06:35:09 +03:30
masoodafar-web 085583c274 docs(biz): v6 fix — carryover is per-DOWNLINE-package (not per-user-package), user's own package change has NO effect on carryover 2026-02-27 04:01:25 +03:30
masoodafar-web f8908d8e2b docs(biz): v6 — Q24-Q30: balance threshold, SP worker, history tables, UI guidance, DayaLoans+EXIT+carryover confirmations 2026-02-27 03:42:47 +03:30
masoodafar-web 37330a3e45 docs: update all documentation for Package-Based Transformation Phase 0-4
- OVERVIEW-03-CHANGELOG: Add complete Package-Based section (Phase 0-4) with
  commit references, add summary table row, update timeline
- OVERVIEW-05-ROADMAP: Add Package-Based progress bar (83%), update DONE/NOW
  sections with Phase 0-4 complete and Phase 5-6 pending
- OVERVIEW-02-INDEX: Add 4 new roadmap files to index, update file counts
- BIZ-PACKAGE-BASED-SYSTEM: Status → 'در حال پیاده‌سازی — فاز 0-4 تکمیل'
  with all 7 commit hashes
- PACKAGE-TRANSFORMATION-TASKS: Mark Phase 0/1/2 as complete with commit refs,
  update overview diagram with completion markers
2026-02-26 00:32:33 +03:30
masoodafar-web 977ef69e26 docs(biz): v5 — قرارداد یک‌بار (Q19) + فیچر DIFF (Q20) + First/Last Activation (Q21-Q22) + carryover تغییر پکیج (Q23)
تغییرات بنیادی v5:
- Q19: قرارداد باشگاه فقط یک بار امضا — حذف re-contract از G5, A10, T2.7
- Q20: فیچرها DIFF/تفاضل — FeatureDiffService جدید (مقایسه + اعمال اختلاف)
- Q21: ClubMembership: ActivatedAt → FirstActivationDate + LastActivationDate + FirstPackageId + LastPackageId
- Q22: تشخیص فعال‌شدگان هفته از LastActivationDate
- Q23: carryover strictly per-package — تغییر پکیج = carryover قبلی شمرده نمی‌شود

بخش‌های جدید:
- 5.4: قرارداد یک‌بار + فلوچارت خرید مجدد بدون قرارداد
- 5.5: الگوریتم DIFF فیچرها + مثال عملی + کد پیشنهادی
- 5.6: تشخیص فعال‌شدگان هفته (SQL)
- ClubMembership entity v5 با ۴ فیلد جدید

اصلاحات:
- EXIT Magic Mode: حذف membership.IsActive=false
- State diagram: re-purchase بدون قرارداد
- Migration: ActivatedAt → First/LastActivationDate
- Impact Analysis: 95+ تغییر (51 اصلی + 44 سایدافکت)
- Timeline: ~28 روز مجموع، ~24 روز critical path
2026-02-25 21:50:02 +03:30
masoodafar-web 1885fcbd3b docs: BIZ-PACKAGE-BASED-SYSTEM v4 — comprehensive side-effect discovery
44 NEW side effects discovered across 6 layers (total: 92 changes):

Side Effects — CMS Domain (3):

Side Effects — CMS Application (10):
- ChargeMagicWalletCommandHandler: global MagicWalletMaxDeposit (1B)
- VerifyMagicWalletChargeCommandHandler: global multiplier ×2.5
- UserOrderService EXIT/ENTRY: global caps → user trapped/ejected wrong
- 3 FluentValidation validators: hardcoded 1B ceiling
- GetAllFeatureIds(): ALL features granted regardless of package
- JWT: no PackageId/CanRepurchase, just boolean HasPurchased
- WalletGrpcService.GetMagicWalletStatus: global caps to frontend
- 4 Notifications: no PackageId in interface

Side Effects — Background (3):
- ClubMembershipCycleSeedService: seeds with hardcoded amounts
- DayaLoanStatusCheckWorker: global DayaLoanAmount
- ChatikaAccountActivationWorker: no package filter

Side Effects — FrontOffice (9):
- Contract text '56M toman' = LEGAL LIABILITY
- Magic wallet ×2.5 and deposit cap hardcoded (6 places + C# code)
- 'پکیج طلایی' hardcoded (5+ places) — wrong name
- PackageId=1 hardcoded in activation flow

Side Effects — BackOffice (8):
- ManualActivationDialog: 56M hardcoded + disabled + no package selector
- SystemConfigurationPage: global settings need per-package
- CSV exports (3 places): no package column

Impact: 48 core changes + 44 side effects = 92 total
Timeline: v3 17 days → v4 22 days critical path (+5 days)
2026-02-25 00:27:14 +03:30
masoodafar-web 33d5ae9305 docs: BIZ-PACKAGE-BASED-SYSTEM v3 — per-package commission deep analysis
Major v3 changes:
- Q12-Q18: MaxWeeklyBalancesPerLeg, MaxNetworkLevel, MagicWalletMaxDeposit,
  MagicWalletMaxCredit all become per-package (not global SystemConstants)
- NetworkWeeklyBalance gets PackageId + Unique(UserId,WeekId,PackageId)
- SP changes: @MaxBalancesPerLeg and @MaxNetworkLevel as dynamic params
  (removing hardcoded 300/15)
- SpCommissionCalculationStrategy: pass package settings to SPs
- Carryover per-package: week-shifting only for same PackageId records
- commission.proto: package_id+package_title in 4 message types,
  new CustomerCommissionPackageSummary message, package filter in requests
- FrontOffice: commission dashboard with per-package summary cards
- BackOffice: package filter dropdown in all commission reports + CSV
- Package Create/Edit: Quick Access checkboxes for features inline
- Seed data: silver MaxBalancesPerLeg=30, MagicWalletMax=100M/250M
- Migration: NetworkWeeklyBalances existing records get base PackageId
- Impact Analysis: 39 -> 48+ changes across 6 layers
- Timeline: 14 -> 17 days critical path (+3 days for per-package work)

Updated docs:
- business/BIZ-PACKAGE-BASED-SYSTEM.md (v2 -> v3)
- roadmap/PACKAGE-TRANSFORMATION-TASKS.md (synced with v3)
2026-02-24 23:48:09 +03:30
masoodafar-web dd5a2617cf docs: BIZ-PACKAGE-BASED-SYSTEM v2 — deep analysis + approved decisions
- 6 bugs found (DiscountBalance, UserPackagePurchase, re-purchase blocked)
- 15 hardcodes identified for removal
- 7 guards blocking re-purchase analyzed
- 5 payment path inconsistencies documented
- 39 changes across 6 layers planned
- 5 phases: bugfix → infra → logic → commission → UI → test
- v1 draft preserved as BIZ-PACKAGE-BASED-SYSTEM-v1-draft.md
2026-02-24 21:34:59 +03:30
masoodafar-web c78850f86e docs: update BUSINESS-02, BUSINESS-03, TECH-03
BUSINESS-02:
- فرمول هایبرید: حذف MIN، اضافه validation کیف‌پول اعتباری
- فلوی خرید: اضافه مرحله بررسی موجودی + UserWalletChangeLog
- نام‌گذاری جدید کیف‌پول‌ها: اصلی، اعتباری، پاداش تیمی
- جدول وضعیت: اضافه WalletChangeLog + Validation

BUSINESS-03:
- بخش ۹ جدید: ExpirePendingOrdersService (۱۵ دقیقه)
- دیاگرام Mermaid فلوی انقضا

TECH-03:
- فیکس URL پروداکشن (kbs1→kbs2) + هشدار
- ۴ کامیت جدید در بخش ۹.۲
- بخش ۹.۳ فیکس URL پروداکشن
- بخش ۹.۴ نام‌گذاری کیف‌پول‌ها
2026-02-24 00:29:03 +03:30
masoodafar-web f5173a4def docs: فعال‌سازی درگاه ZarinPal + مرج پروداکشن + بهبود UI ادمین
- CHANGELOG: اضافه Phase 18 BackOffice + فعال‌سازی درگاه FO + تنظیمات محیطی CMS + مرج پروداکشن
- PAYMENT-FINANCE: MerchantId واقعی + تنظیمات محیطی Staging/Production + Magic فاز 6 کامل
- ROADMAP: بروزرسانی درصدها + Magic 100% + Payment 97% + DONE section
- TECH-02: ساختار فولدر + UserAutoComplete + WalletManagement + دکمه‌های درگاه
- BUSINESS-01: Magic Wallet فاز 1-6 کامل
- TECH-04: Migration پروداکشن ExpandDiscountProductFullInformation + حذف u21 تکراری
- TECH-03: جزئیات مرج پروداکشن + تنظیمات appsettings.Production.json
- MAGIC-WALLET-PLAN: وضعیت کامل
- INDEX: بروزرسانی تاریخ
2026-02-22 23:26:36 +03:30
masoodafar-web 6b6173e2be docs: rename 'تخفیفی' to 'اعتباری' across all documentation
- 9 files updated: BUSINESS-01/02/03/04, TECH-02, OVERVIEW-01/03/04, MAGIC-WALLET-SPEC
- فروشگاه تخفیفی → فروشگاه اعتباری
- کیف‌پول تخفیفی → کیف‌پول اعتباری
- Consistent naming with FrontOffice UI
2026-02-22 20:57:05 +03:30
masoodafar-web 421a651975 docs: Magic Wallet + VAT 10% documentation update
- All 14 totalDoc files updated with Magic Wallet additions
- MAGIC-WALLET-PLAN.md: Phase 1-6 checklist fully marked complete
- Business docs: Magic Wallet section, commission filter, new entities
- Payment docs: VAT 9%→10%, TransactionType 14+15, ZarinPal 4th usage
- Technical docs: UserWallet fields, ClubMembershipCycle, gRPC RPCs
- Overview docs: Magic flowchart, ER diagram, changelog, glossary, roadmap
2026-02-22 20:09:01 +03:30
masoodafar-web b861b66cda docs: fix Regular Store payment — wallet-only, no IPG/ZarinPal
- Regular Store: Balance deduction only (SubmitShopBuyOrderCommandHandler)
  NO ZarinPal redirect, NO payment gateway
- Discount Store: DiscountBalance + ZarinPal IPG for remainder
  Added gatewayAmount=0 edge case (discount covers 100%)
- VAT: Both stores use 9% (ShopVAT=0.1 is stale/unused constant)
- Added ZarinPal usage scope note (only: Discount Store, Wallet Top-up, Package Purchase)
- Fixed BUSINESS-02: sections 2, 5.2, 5.3, 7
- Fixed BUSINESS-03: store comparison chart
- Fixed OVERVIEW-01: user journey + both store flowcharts
- Fixed OVERVIEW-03: timeline entry
2026-02-18 23:52:35 +03:30
masoodafar-web 1b04ba5326 docs: convert all ASCII charts to Mermaid diagrams
Converted 40+ ASCII art diagrams across 12 files to Mermaid:
- flowchart TD/LR for process flows and architecture
- erDiagram for entity relationships
- graph TD for tree structures (binary tree, categories)
- gantt for roadmap sprints

Files: BUSINESS-01 to 05, TECH-01/03/04/05, OVERVIEW-01/02/05
Directory tree structures kept as plain code blocks (Mermaid N/A)
2026-02-18 23:36:39 +03:30
masoodafar-web aef6861e21 docs: fix IPG DiscountBalance 56M → 112M (2× BasePackageAmount)
Matches code fix — IPG now charges DiscountBalance = BasePackageAmount × 2
Same as DayaLoan and ManualPayment. Total for all methods: 56M + 112M = 168M
2026-02-18 23:12:24 +03:30
masoodafar-web 3c729304db docs: fix all discrepancies based on comprehensive code audit
Corrections verified against actual CMS/BackOffice/FrontOffice source code:

- ClubActivationFee: 25,200,000 (not 25,000,000)
- Tree depth: no limit (15 is commission calculation depth only)
- IPG wallet charge: Balance=56M + Discount=56M
- DayaLoan wallet charge: Balance=56M + Discount=112M (2×)
- Discount: per-product MaxDiscountPercent (not fixed 30%)
- VAT: 10% (ShopVAT) vs 9% (discount store PlaceOrder)
- Kavenegar template: 'Afrino' only (not verify-foursat)
- SMS sender: 1000001110100
- DayaLoan job: every 20min (not 15min)
- Commission job: Sunday 00:05 (not Saturday)
- Network tree: on User entity (not separate NetworkNode table)
- UserWallets entity (not UserWalletBalances)
- OTP: 6 digits, 5 attempts, 2min TTL, 60s cooldown
- Removed non-existent constants (ClubJoiningPercentage, ClubActivationThreshold)
- Fixed Hangfire Chatika interval: every 5min
- Removed InventorySync from recurring jobs list
2026-02-18 22:58:40 +03:30
masoodafar-web efff5e9cd5 docs: consolidate 53 files into 15 structured files in 3 folders
- business/ (5): club-commission, payment, ecommerce, membership, content
- technical/ (5): cms-arch, ui, deployment, migration, api
- overview/ (5): flowcharts, index, changelog, glossary, roadmap
- Removed all old folders: backoffice, cms, deployment, docs, frontoffice, migration, ui-modernization, business (old)
- Updated internal links with relative folder paths
2026-02-18 22:29:37 +03:30
masoodafar-web 4ef4bfbeef docs: بروزرسانی کامل مستندات — باگ‌ها، فیکس‌ها، دیپلوی Production، CI/CD cross-deploy
- payment-gateway.md: سکشن ۸-۱۳ (ZarinPal callback, تخفیف ۱۰۰٪, VAT, ExpirePendingOrders, DeliveryStatus mapping, Production deploy)
- CICD-PIPELINE-GUIDE.md: باگ cross-deploy, قالب workflow Production, جدول مقایسه دو محیط
- INFRASTRUCTURE-GUIDE.md: سرور Production (45.149.79.127), DB KBS, Proto v0.0.179
- DISCOUNT-STORE-STATUS.md: وضعیت Production Deploy, فلوی پرداخت جدید
- SERVER-MIRRORS-CONFIG.md: registries.yaml سرور Production
- INDEX.md: تاریخ, توضیحات بروز, لینک‌های سریع جدید
2026-02-17 01:44:05 +03:30
masoodafar-web ad31c8be97 Refactor code structure for improved readability and maintainability 2026-02-16 00:59:16 +03:30
masoodafar-web 5149b9a89c Refactor code structure for improved readability and maintainability 2026-02-10 22:06:46 +03:30