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
+20 -12
View File
@@ -63,7 +63,7 @@ Redirect کاربر → صفحه پرداخت ZarinPal
### ۳.۱ معماری
```
Hangfire Recurring Job (هر ۱۵ دقیقه)
Hangfire Recurring Job (هر ۲۰ دقیقه — cron: */20 * * * *)
DayaLoanProcessorJob.Execute()
@@ -73,10 +73,10 @@ DayaLoanProcessorJob.Execute()
برای هر درخواست:
├─→ ارسال به DayaLoan API (با Polly retry ×3)
├─→ در صورت تأیید: شارژ ۳ کیف‌پول (هرکدام ۵۶M)
├─→ ارسال به DayaLoan API ([AutomaticRetry(Attempts=3)])
├─→ در صورت تأیید: Balance += 56M, DiscountBalance += 112M (2×)
├─→ ثبت Transaction + Log
└─→ در صورت رد: بروزرسانی Status=Rejected + ارسال SMS
└─→ در صورت رد: Status=Rejected + ارسال SMS
```
### ۳.۲ Mock Mode
@@ -95,9 +95,11 @@ DayaLoanProcessorJob.Execute()
| آیتم | مقدار |
|------|-------|
| مبلغ وام | ۵۶,۰۰۰,۰۰۰ تومان |
| شارژ هر کیف‌پول | ۵۶,۰۰۰,۰۰۰ تومان |
| مجموع شارژ | ۱۶۸,۰۰۰,۰۰۰ تومان |
| مبلغ وام (DayaLoanAmount) | ۵۶,۰۰۰,۰۰۰ ریال |
| شارژ Balance | ۵۶,۰۰۰,۰۰۰ ریال |
| شارژ DiscountBalance | ۱۱۲,۰۰۰,۰۰۰ ریال (دو برابر — DayaLoanAmount × 2) |
| مجموع شارژ | ۱۶۸,۰۰۰,۰۰۰ ریال |
| NetworkBalance | شارژ نمی‌شود |
| بازپرداخت | طبق شرایط دایا |
---
@@ -134,13 +136,15 @@ DayaLoanProcessorJob.Execute()
### ۵.۱ فرمول
```
قیمت محصول = 1,000,000 تومان
تخفیف باشگاه = 30%
قیمت محصول = 1,000,000 ریال
MaxDiscountPercent محصول = 40% (هر محصول درصد تخفیف مخصوص خود را دارد)
پرداخت از DiscountBalance = 1,000,000 × 0.30 = 300,000
پرداخت نقدی (IPG) = 1,000,000 × 0.70 = 700,000
سهم تخفیف = MIN(1,000,000 × 40%, DiscountBalanceکاربر) = 400,000
پرداخت نقدی (IPG) = 1,000,000 - 400,000 = 600,000
─────────
مجموع = 1,000,000
ℹ️ تخفیف ثابت ۳۰% نیست — فیلد Product.MaxDiscountPercent (0-100) تعیین‌کننده است.
```
### ۵.۲ فلوی خرید فروشگاه تخفیفی
@@ -204,7 +208,11 @@ service PaymentService {
## ۷. مالیات و VAT
```
VAT = 10% (configurable via SystemConstants)
دو نرخ VAT در کد:
SystemConstants.ShopVAT = 0.1 (10%) — تنظیم سیستمی
VAT_RATE = 0.09 (9%) — در فروشگاه تخفیفی (DiscountShop PlaceOrder)
قیمت نمایشی = قیمت پایه × (1 + VAT)
در صورتحساب: قیمت پایه + مالیات جداگانه نمایش داده می‌شود
```