Better profile caching.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using SQLite;
|
||||
|
||||
namespace Wino.Core.Domain.Entities.Shared;
|
||||
|
||||
public class WinoAccountAddOnCache
|
||||
{
|
||||
[PrimaryKey]
|
||||
public Guid AccountId { get; set; }
|
||||
|
||||
public bool HasAiPack { get; set; }
|
||||
|
||||
public int? AiUsageCount { get; set; }
|
||||
|
||||
public int? AiUsageLimit { get; set; }
|
||||
|
||||
public DateTime? AiBillingPeriodStartUtc { get; set; }
|
||||
|
||||
public DateTime? AiBillingPeriodEndUtc { get; set; }
|
||||
|
||||
public bool HasUnlimitedAccounts { get; set; }
|
||||
|
||||
public DateTime LastUpdatedUtc { get; set; }
|
||||
}
|
||||
@@ -22,6 +22,7 @@ public interface IWinoAccountProfileService
|
||||
Task<ApiEnvelope<EmailConfirmationResendResultDto>> ResendEmailConfirmationAsync(string endpoint, string ticket, CancellationToken cancellationToken = default);
|
||||
Task<ApiEnvelope<JsonElement>> ForgotPasswordAsync(string email, CancellationToken cancellationToken = default);
|
||||
Task<WinoAccount?> GetActiveAccountAsync();
|
||||
Task<WinoAccountAddOnSnapshot?> GetCachedAddOnSnapshotAsync();
|
||||
Task<WinoAccount?> GetAuthenticatedAccountAsync(CancellationToken cancellationToken = default);
|
||||
Task<bool> HasActiveAccountAsync();
|
||||
Task<bool> HasAddOnAsync(WinoAddOnProductType productId, CancellationToken cancellationToken = default);
|
||||
|
||||
@@ -8,5 +8,5 @@ namespace Wino.Core.Domain.Interfaces;
|
||||
|
||||
public interface IWinoAddOnService
|
||||
{
|
||||
Task<IReadOnlyList<WinoAddOnInfo>> GetAvailableAddOnsAsync(CancellationToken cancellationToken = default);
|
||||
Task<IReadOnlyList<WinoAddOnInfo>> GetAvailableAddOnsAsync(bool useCachedDataOnly = false, CancellationToken cancellationToken = default);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
|
||||
namespace Wino.Core.Domain.Models.Accounts;
|
||||
|
||||
public sealed record WinoAccountAddOnSnapshot(
|
||||
bool HasAiPack,
|
||||
int? UsageCount = null,
|
||||
int? UsageLimit = null,
|
||||
DateTimeOffset? BillingPeriodStartUtc = null,
|
||||
DateTimeOffset? BillingPeriodEndUtc = null,
|
||||
bool HasUnlimitedAccounts = false,
|
||||
DateTimeOffset? LastUpdatedUtc = null);
|
||||
Reference in New Issue
Block a user