feat: Enhance club membership activation and commission pool validation
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 8m9s

- Updated AcceptClubMembershipContractCommandHandler to set PackagePurchasedAt to the contract-signing time, ensuring accurate pool charging.
- Modified ActivateClubMembershipCommand to allow specifying a PackageId for forced activation, defaulting to the base package if not provided.
- Improved ActivateClubMembershipCommandHandler to handle new and existing memberships differently regarding pool charging.
- Added validation logic in GetWeeklyCommissionPoolQueryHandler to compare TotalPoolAmount against actual activations.
- Introduced validation fields in WeeklyCommissionPoolDto for tracking discrepancies and expected amounts.
- Updated stored procedures to ensure accurate calculations based on package purchases and to handle empty pools.
- Enhanced protobuf definitions to include validation fields for commission pools and network tree nodes.
- Added mapping for new fields in CommissionProfile and NetworkMembershipProfile.
- Created DiscountProductProfile for mapping discount product requests and responses.
This commit is contained in:
masoodafar-web
2026-05-01 00:07:05 +03:30
parent 789aa0b870
commit 8518c7b3ec
18 changed files with 423 additions and 115 deletions
@@ -3,7 +3,7 @@
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>0.0.193</Version>
<Version>0.0.195</Version>
<DebugType>None</DebugType>
<DebugSymbols>False</DebugSymbols>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
@@ -212,6 +212,11 @@ message GetWeeklyCommissionPoolResponse
google.protobuf.Timestamp created = 9;
int64 package_id = 10;
string package_title = 11;
// Q29: اعتبارسنجی TotalPoolAmount
bool validation_is_valid = 12;
int64 validation_expected_amount = 13;
int64 validation_discrepancy = 14;
int32 validation_activation_count = 15;
}
// GetUserCommissionPayouts Query
@@ -205,6 +205,10 @@ message NetworkTreeNodeModel
string position = 16; // Root/Left/Right position indicator
NetworkTreeNodeModel left_child = 17; // Left child node
NetworkTreeNodeModel right_child = 18; // Right child node
// فیلدهای اطلاعات پکیج و نوع فعال‌سازی
google.protobuf.BoolValue is_new_activation = 22; // true=اولین فعال‌سازی، false=خرید مجدد، null=بدون Cycle
string package_name = 23; // نام پکیج موثر
google.protobuf.Int64Value package_id = 24; // شناسه پکیج
}
// GetHistory Query