♻️ Splitted wallet service
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
using DysonNetwork.Pass.Wallet;
|
||||
using DysonNetwork.Shared.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace DysonNetwork.Pass.Leveling;
|
||||
|
||||
public class ExperienceService(AppDatabase db, SubscriptionService subscriptions)
|
||||
public class ExperienceService(AppDatabase db)
|
||||
{
|
||||
public async Task<SnExperienceRecord> AddRecord(string reasonType, string reason, long delta, Guid accountId)
|
||||
{
|
||||
@@ -16,20 +15,6 @@ public class ExperienceService(AppDatabase db, SubscriptionService subscriptions
|
||||
AccountId = accountId,
|
||||
};
|
||||
|
||||
var perkSubscription = await subscriptions.GetPerkSubscriptionAsync(accountId);
|
||||
if (perkSubscription is not null)
|
||||
{
|
||||
record.BonusMultiplier = perkSubscription.Identifier switch
|
||||
{
|
||||
SubscriptionType.Stellar => 1.5,
|
||||
SubscriptionType.Nova => 2,
|
||||
SubscriptionType.Supernova => 2.5,
|
||||
_ => 1
|
||||
};
|
||||
if (record.Delta >= 0)
|
||||
record.Delta = (long)Math.Floor(record.Delta * record.BonusMultiplier);
|
||||
}
|
||||
|
||||
db.ExperienceRecords.Add(record);
|
||||
await db.SaveChangesAsync();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user