👔 Skip level check when redeem gift
This commit is contained in:
@@ -716,14 +716,7 @@ public class SubscriptionService(
|
|||||||
if (existingSubscription is not null)
|
if (existingSubscription is not null)
|
||||||
throw new InvalidOperationException("You already have an active subscription of this type.");
|
throw new InvalidOperationException("You already have an active subscription of this type.");
|
||||||
|
|
||||||
// Check account level requirement
|
// We do not check account level requirement, since it is a gift
|
||||||
if (subscriptionInfo.RequiredLevel > 0)
|
|
||||||
{
|
|
||||||
var profile = await db.AccountProfiles.FirstOrDefaultAsync(p => p.AccountId == redeemer.Id);
|
|
||||||
if (profile is null || profile.Level < subscriptionInfo.RequiredLevel)
|
|
||||||
throw new InvalidOperationException(
|
|
||||||
$"Account level must be at least {subscriptionInfo.RequiredLevel} to redeem this gift.");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create the subscription from the gift
|
// Create the subscription from the gift
|
||||||
var cycleDuration = Duration.FromDays(30); // Standard 30-day subscription
|
var cycleDuration = Duration.FromDays(30); // Standard 30-day subscription
|
||||||
|
Reference in New Issue
Block a user