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
This commit is contained in:
masoodafar-web
2026-02-18 22:58:40 +03:30
parent efff5e9cd5
commit 3c729304db
10 changed files with 130 additions and 107 deletions
+24 -15
View File
@@ -35,7 +35,7 @@
│ ├──────────┬──────────┬──────────┬─────────────┤ │
│ │ فروشگاه │ درخت شبکه │ کمیسیون │ Chatika AI │ │
│ │ تخفیفی │ باینری │ هفتگی │ │ │
│ │ (30%↓) │ │ │ │ │
│ │ (per-product) │ │ │ │ │
│ └──────────┴──────────┴──────────┴─────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────┘
@@ -56,15 +56,17 @@
│ [Daya Loan] ──→ ├──→ [PYMS Service] ──→ [DB Transaction] │
│ [Manual Pay] ──→ ┘ │ │
│ ▼ │
│ ═══════════ توزیع به ۳ کیف‌پول ═══════════ │
│ ═══════════ توزیع به کیف‌پول‌ها ═══════════ │
│ │
│ ┌────────────────┐ ┌─────────────────┐ ┌──────────────────┐ │
│ │ 💰 Balance │ │ 🌐 NetworkBal │ │ 🏷️ DiscountBal │ │
│ │ (نقدی) │ │ (شبکه‌ای) │ │ (تخفیفی) │ │
│ │ 💰 Balance │ │ 🌟 NetworkBal │ │ 🏷️ DiscountBal │ │
│ │ (نقدی) │ │ (طلایی/کمیسیون)│ │ (تخفیفی) │ │
│ │ │ │ │ │ │ │
│ │ • خرید فروشگاه │ │ • محاسبه │ │ • فروشگاه تخفیفی │ │
│ │ • هزینه فعالسازی │ │ کمیسیون │ │ • سهم 30% از │ │
│ │ (25M) │ │ • سقف 300/هفته │ │ قیمت محصول │ │
│ │ • IPG: +56M │ │ • شارژ نمی‌شود │ │ • IPG: +56M │ │
│ │ • Daya: +56M │ │ • فقط برای │ │ • Daya: +112M │ │
│ │ • فعالسازی │ │ محاسبه │ │ (دو برابر) │ │
│ │ -25.2M │ │ کمیسیون │ │ • per-product │ │
│ │ • خرید فروشگاه │ │ • سقف 300/هفته │ │ MaxDiscount% │ │
│ └───────┬────────┘ └────────┬────────┘ └────────┬─────────┘ │
│ │ │ │ │
│ ▼ ▼ ▼ │
@@ -163,7 +165,8 @@ Legend:
R = Right leg sales this week
Active = فعال (contract signed)
Pend. = در انتظار فعالسازی
Max depth = 15 levels
شبکه روی entity User مدل شده (NetworkParentId, LegPosition)
محاسبه کمیسیون تا عمق 15 سطح — درخت بدون محدودیت عمق
```
---
@@ -188,8 +191,8 @@ Legend:
│ │ │ [بررسی DiscountBalance] │
│ ▼ │ │ │
│ [Checkout] │ ▼ │
│ │ │ [محاسبه سهم تخفیف (30%)]
│ ▼ │ [محاسبه سهم نقدی (70%)]
│ │ │ [محاسبه سهم تخفیف (MaxDiscount%)]
│ ▼ │ [محاسبه سهم نقدی (باقیمانده)]
│ [ZarinPal IPG] │ │ │
│ [100% نقدی] │ ▼ │
│ │ │ [کسر از DiscountBalance] │
@@ -242,17 +245,23 @@ Legend:
## ۷. Entity Relationship (ساده‌شده)
```
┌──────────┐ ┌──────────────┐ ┌──────────────┐
│ User │────→│ ClubMembership│────→│ NetworkNode │
│ │ │ │ (BinaryTree)│
└────┬─────┘ └──────────────┘ └──────────────┘
┌──────────┐ ┌──────────────┐
│ User │────→│ ClubMembership│
+Network │ │ │
│ ParentId│ └──────────────┘
│ +LegPos │
└────┬─────┘
├────→ ┌──────────┐ ┌──────────┐
│ │ Order │────→│ OrderItem│────→ [Product]
│ └──────────┘ └──────────┘
├────→ ┌──────────────┐
│ │ Transaction │────→ [Wallet (×3)]
│ │ Transaction │
│ └──────────────┘
├────→ ┌──────────────┐
│ │ UserWallet │────→ Balance + NetworkBalance + DiscountBalance
│ └──────────────┘
├────→ ┌──────────────┐
+4 -4
View File
@@ -23,7 +23,7 @@
| Pool هفتگی | Weekly Commission Pool | مخزن کمیسیون قابل‌توزیع |
| هزینه فعالسازی | Activation Fee | ۲۵M تومان از Balance |
| واریز هدیه | Gift Value | ۲۵.۲M واریز به Pool |
| فروشگاه تخفیفی | Discount Store | فروشگاه ۳۰% تخفیف برای اعضا |
| فروشگاه تخفیفی | Discount Store | فروشگاه با تخفیف per-product برای اعضا |
| پرداخت ترکیبی | Hybrid Payment | DiscountBalance + IPG |
| وام دایا | Daya Loan | وام آنلاین برای خرید پکیج |
| کد معرف | Referral Code | کد یکتا هر عضو برای دعوت |
@@ -39,9 +39,9 @@
| درگاه پرداخت | Payment Gateway (IPG) | ZarinPal |
| سرویس پرداخت | PYMS | Payment Management Service |
| کیف‌پول نقدی | Balance Wallet | موجودی قابل‌خرج |
| کیف‌پول شبکه‌ای | Network Balance | برای محاسبه کمیسیون |
| کیف‌پول تخفیفی | Discount Balance | برای فروشگاه تخفیفی |
| بارگذاری تنبل | Lazy Loading | لود محصولات ۱۲تایی |
| کیف‌پول طلایی | Network Balance | برای محاسبه کمیسیون (شارژ نمی‌شود) |
| کیف‌پول تخفیفی | Discount Balance | برای فروشگاه تخفیفی (Daya: 112M, IPG: 56M) |
| بارگذاری تنبل | Lazy Loading | لود محصولات 12تایی (FO) / 10تایی (CMS default) |
| صفحات سایت | Site Pages | صفحات قابل‌ویرایش (Shopify-style) |
| ثوابت سیستمی | System Constants | تنظیمات key-value |
| پردازش پس‌زمینه | Background Job | Hangfire recurring/fire-and-forget |