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
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# ⚙️ معماری CMS و زیرساخت فنی
|
||||
|
||||
> **منابع ادغامشده:** `CMS-README.md`, `ICURRENTUSERSERVICE-IMPLEMENTATION.md`, `FILE-MANAGEMENT-ARCHITECTURE.md`, `FRONTOFFICE-CMS-API-COMPATIBILITY.md`, `BFF-REMOVAL-PLAN.md`, `system-constants.md`
|
||||
> **آخرین بروزرسانی:** اسفند ۱۴۰۴ (بروزرسانی: Magic Wallet entities + gRPC)
|
||||
> **آخرین بروزرسانی:** اسفند ۱۴۰۴ (بروزرسانی: History Interceptor + SP Worker + Rename UserWalletHistory)
|
||||
|
||||
---
|
||||
|
||||
@@ -140,6 +140,7 @@ public class CreateProductCommandHandler
|
||||
| `CategoryService` | category.proto | GetCategories, Create, Update |
|
||||
| `SystemConfigService` | config.proto | GetConfig, UpdateConfig |
|
||||
| `UserWalletService` | userwallet.proto | GetCustomerWallet, InitiateMagicCharge, GetMagicWalletStatus |
|
||||
| `UserWalletHistoryService` | userwallethistory.proto | *(renamed from UserWalletChangeLogService)* |
|
||||
|
||||
### ۴.۲ PaginationState (مشترک)
|
||||
|
||||
@@ -195,6 +196,45 @@ Engine: MSSQL 2022-CU16, Collation=Arabic_CI_AS
|
||||
| `sp_CalculateWeeklyBalances` | محاسبه بالانس هفتگی هر عضو |
|
||||
| `sp_CalculateWeeklyCommissionPool` | توزیع Pool هفتگی |
|
||||
|
||||
### ۵.۴ SP Auto-Deploy Worker (Q26)
|
||||
|
||||
```csharp
|
||||
// StoredProcedureDeploymentService : IHostedService
|
||||
// در startup:
|
||||
// 1. خواندن فایلهای .sql از embedded resource
|
||||
// 2. مقایسه checksum با جدول __SPChecksums
|
||||
// 3. فقط SPهای تغییریافته re-deploy میشوند
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## ۵.۵ History Tracking System (Q27)
|
||||
|
||||
### IHasHistory<T> Interface
|
||||
|
||||
```csharp
|
||||
public interface IHasHistory<THistory> where THistory : BaseAuditableEntity, new()
|
||||
{
|
||||
THistory CreateHistorySnapshot(string action, string? performedBy);
|
||||
}
|
||||
```
|
||||
|
||||
### HistoryTrackingSaveChangesInterceptor
|
||||
|
||||
- **مکان:** `Infrastructure/Persistence/Interceptors/HistoryTrackingSaveChangesInterceptor.cs`
|
||||
- **مکانیسم:** `SaveChangesInterceptor` — قبل از `SaveChanges` اجرا میشود
|
||||
- **شناسایی:** از `ChangeTracker` entityهایی که `IHasHistory<>` پیادهسازی کردن (Modified/Added)
|
||||
- **Auto-fill:** فیلدهای `Old*` از `entry.OriginalValues` با naming convention (مثلاً `OldPrice` ← `OriginalValues["Price"]`)
|
||||
- **Entityهای فعال:** `Package` → `PackageHistory`
|
||||
|
||||
### History Tables
|
||||
|
||||
| جدول | Entity مرتبط | فیلدهای Old/New |
|
||||
|------|-------------|----------------|
|
||||
| `PackageHistories` | Package | Price, ActivationFee, MagicMultiplier, MagicMaxDeposit, MaxBalancesPerLeg, IsActive |
|
||||
| `ClubMembershipCycleHistories` | ClubMembershipCycle | IsCurrentCycle, MagicStartedAt, MagicCompletedAt |
|
||||
| `UserWalletHistories` | UserWallet | *(renamed from UserWalletChangeLogs — RenameTable migration)* |
|
||||
|
||||
---
|
||||
|
||||
## ۶. حذف BFF / Gateway
|
||||
|
||||
Reference in New Issue
Block a user