Implement Persian Date Conversion and Enhance User Network Information Service

- Added PersianDateTimeService for converting Gregorian dates to Persian format in the BackOffice frontend.
- Updated multiple frontend pages (Dashboard, UserPayouts, WorkerControl, UserNetworkInfo) to utilize the new Persian date service.
- Enhanced GetUserNetworkPositionDto with 28+ new fields for comprehensive user network data.
- Updated GetUserNetworkPositionQueryHandler to include new methods for calculating network statistics.
- Modified Protobuf messages to accommodate the new fields, increasing from 14 to 42.
- Refined week number calculation algorithm to ensure consistency across C# and SQL implementations.
- Created new CSV and Excel files for binary plan calculations.
- Ensured all changes are tested and validated for accuracy and performance.
This commit is contained in:
masoodafar-web
2025-12-20 06:15:59 +03:30
parent 13a3489765
commit 002e99f6bf
32 changed files with 10263 additions and 106 deletions
+49 -1
View File
@@ -21,7 +21,53 @@
---
## 🆕 Recent Updates (2024-12-04)
## 🆕 Recent Updates (2025-12-09)
### ✅ Club Membership Auto-Features Enhancement
**Date**: 2025-12-09
**Feature**: اختصاص خودکار ویژگی‌های باشگاه به اعضای جدید
**Changes**:
1. **`ActivateClubMembershipCommandHandler.cs`**:
- بعد از ایجاد `ClubMembership` و ثبت `ClubMembershipHistory`
- به‌طور خودکار 4 ویژگی باشگاه (`ClubFeatureId IN (1,2,3,4)`) در جدول `UserClubFeatures` ثبت می‌شود
- فقط برای عضویت‌های جدید (`isNewMembership = true`)
- با `Notes = "اعطا شده به‌طور خودکار هنگام فعالسازی"`
2. **Migration Script**:
- `MigrateUsersToClubMembership.sql`: اسکریپت مهاجرت کاربران با ≥56M شارژ به باشگاه
- شامل:
- ایجاد `ClubMembership` (با `ActivatedAt` = تاریخ اولین شارژ)
- ثبت `ClubMembershipHistory` (با `Action = 0` = Activated)
- ایجاد 4 رکورد `UserClubFeatures` برای هر کاربر
- نسخه Simple: بر اساس موجودی فعلی (`UserWallets.Balance`)
**Business Logic**:
```csharp
// بعد از SaveChanges برای History:
if (isNewMembership)
{
var clubFeatures = await _context.ClubFeatures
.Where(f => !f.IsDeleted && new long[] { 1, 2, 3, 4 }.Contains(f.Id))
.ToListAsync(cancellationToken);
var userClubFeatures = clubFeatures.Select(feature => new UserClubFeature
{
UserId = user.Id,
ClubMembershipId = entity.Id,
ClubFeatureId = feature.Id,
GrantedAt = activationDate,
Notes = "اعطا شده به‌طور خودکار هنگام فعالسازی"
}).ToList();
_context.UserClubFeatures.AddRange(userClubFeatures);
}
```
---
## 🆕 Previous Updates (2024-12-04)
### ✅ Phase 9: Club Discount Shop System Implementation (Complete)
@@ -642,6 +688,8 @@ if (vatEnabled) {
- ✅ `ActivateClubMembershipCommand` - Activate user's club membership
- Creates new or reactivates existing membership
- Records history with Activated action
- **اضافه شده 2025-12-09**: اختصاص خودکار 4 ویژگی باشگاه (`UserClubFeatures`) برای اعضای جدید
- `ClubFeatureId IN (1, 2, 3, 4)` به‌طور خودکار ثبت می‌شوند
- ✅ `DeactivateClubMembershipCommand` - Deactivate membership
- Sets IsActive = false, records history
- ✅ `UpdateClubMembershipCommand` - Update membership details