feat: Enhance club membership activation and commission pool validation
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 8m9s
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:
+8
-2
@@ -118,7 +118,10 @@ public class GetNetworkTreeQueryHandler : IRequestHandler<GetNetworkTreeQuery, N
|
||||
ActivationWeekDefinitionId = reader.IsDBNull(reader.GetOrdinal("ActivationWeekDefinitionId")) ? null : reader.GetInt64(reader.GetOrdinal("ActivationWeekDefinitionId")),
|
||||
ActivationWeekDisplayName = reader.IsDBNull(reader.GetOrdinal("ActivationWeekDisplayName")) ? null : reader.GetString(reader.GetOrdinal("ActivationWeekDisplayName")),
|
||||
IsActivatedInTargetWeek = Convert.ToBoolean(reader.GetValue(reader.GetOrdinal("IsActivatedInTargetWeek"))),
|
||||
UserCreated = new DateTimeOffset(reader.GetDateTime(reader.GetOrdinal("UserCreated")))
|
||||
UserCreated = new DateTimeOffset(reader.GetDateTime(reader.GetOrdinal("UserCreated"))),
|
||||
IsNewActivation = reader.IsDBNull(reader.GetOrdinal("IsNewActivation")) ? null : (bool?)(reader.GetInt32(reader.GetOrdinal("IsNewActivation")) == 1),
|
||||
PackageName = reader.IsDBNull(reader.GetOrdinal("PackageName")) ? null : reader.GetString(reader.GetOrdinal("PackageName")),
|
||||
PackageId = reader.IsDBNull(reader.GetOrdinal("PackageId")) ? null : reader.GetInt64(reader.GetOrdinal("PackageId"))
|
||||
};
|
||||
|
||||
results.Add(node);
|
||||
@@ -160,7 +163,10 @@ public class GetNetworkTreeQueryHandler : IRequestHandler<GetNetworkTreeQuery, N
|
||||
ActivationWeekDefinitionId = flatNode.ActivationWeekDefinitionId,
|
||||
ActivationWeekDisplayName = flatNode.ActivationWeekDisplayName,
|
||||
IsActivatedInTargetWeek = flatNode.IsActivatedInTargetWeek,
|
||||
UserCreated = flatNode.UserCreated
|
||||
UserCreated = flatNode.UserCreated,
|
||||
IsNewActivation = flatNode.IsNewActivation,
|
||||
PackageName = flatNode.PackageName,
|
||||
PackageId = flatNode.PackageId
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+13
-1
@@ -47,7 +47,19 @@ public class NetworkTreeDto
|
||||
/// تاریخ ایجاد کاربر
|
||||
/// </summary>
|
||||
public DateTimeOffset UserCreated { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// آیا فعالسازی در هفته هدف اولین بار بوده؟ null = بدون Cycle
|
||||
/// </summary>
|
||||
public bool? IsNewActivation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام پکیج موثر (هفته هدف یا پکیج فعلی)
|
||||
/// </summary>
|
||||
public string? PackageName { get; set; }
|
||||
|
||||
public long? PackageId { get; set; }
|
||||
|
||||
public NetworkTreeDto? LeftChild { get; set; }
|
||||
public NetworkTreeDto? RightChild { get; set; }
|
||||
}
|
||||
|
||||
+13
@@ -20,6 +20,19 @@ public class NetworkTreeNodeDto
|
||||
public string? ActivationWeekDisplayName { get; set; }
|
||||
public bool IsActivatedInTargetWeek { get; set; }
|
||||
public DateTimeOffset UserCreated { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا فعالسازی در هفته هدف اولین بار بوده (true) یا خرید مجدد (false)؟
|
||||
/// null یعنی Cycleای ندارد
|
||||
/// </summary>
|
||||
public bool? IsNewActivation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام پکیج موثر (هفته هدف یا پکیج فعلی)
|
||||
/// </summary>
|
||||
public string? PackageName { get; set; }
|
||||
|
||||
public long? PackageId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام کامل کاربر
|
||||
|
||||
Reference in New Issue
Block a user