feat: improve package retrieval logic in AcceptClubMembershipContract and ActivateClubMembership handlers
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 9m0s
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 9m0s
This commit is contained in:
+3
-2
@@ -235,8 +235,9 @@ public class ActivateClubMembershipCommandHandler : IRequestHandler<ActivateClub
|
||||
var hasCurrentCycle = await _context.ClubMembershipCycles
|
||||
.AnyAsync(c => c.UserId == user.Id && c.IsCurrentCycle, cancellationToken);
|
||||
|
||||
// اگر چرخه فعال دارد — یعنی Activate قبلاً برای این خرید اجرا شده؛ جلوگیری از ثبت Cycle تکراری
|
||||
if (hasCurrentCycle)
|
||||
// اگر چرخه فعال دارد و درخواست Force نیست — احتمال اجرای تکراری همان خرید
|
||||
// در حالت ForceActivation (مثل پرداخت دستی)، باید چرخه جدید ساخته شود تا پکیج جدید ثبت شود.
|
||||
if (hasCurrentCycle && !request.ForceActivation)
|
||||
{
|
||||
_logger.LogInformation(
|
||||
"User {UserId} already has a running cycle — skipping duplicate activation",
|
||||
|
||||
Reference in New Issue
Block a user