using Meezi.Core.Enums;
using Meezi.Core.Platform;
using Meezi.Infrastructure.Services.Platform;

namespace Meezi.API.Tests;

/// <summary>Test double: every feature enabled, unlimited limits. Keeps plan gating
/// out of the way for service-level tests.</summary>
internal sealed class NoOpPlatformCatalogService : IPlatformCatalogService
{
    public Task<IReadOnlyList<PlanDefinitionDto>> GetPlansAsync(CancellationToken ct = default) =>
        Task.FromResult<IReadOnlyList<PlanDefinitionDto>>([]);

    public Task<PlanDefinitionDto?> GetPlanAsync(PlanTier tier, CancellationToken ct = default) =>
        Task.FromResult<PlanDefinitionDto?>(null);

    public Task<PlanLimitsData> GetLimitsAsync(PlanTier tier, CancellationToken ct = default) =>
        Task.FromResult(new PlanLimitsData());

    public Task<decimal> GetMonthlyPriceTomanAsync(PlanTier tier, CancellationToken ct = default) =>
        Task.FromResult(0m);

    public Task<bool> IsBillableOnlineAsync(PlanTier tier, CancellationToken ct = default) =>
        Task.FromResult(false);

    public Task<IReadOnlyList<PlatformSettingDto>> GetSettingsAsync(CancellationToken ct = default) =>
        Task.FromResult<IReadOnlyList<PlatformSettingDto>>([]);

    public Task<string?> GetSettingAsync(string key, CancellationToken ct = default) =>
        Task.FromResult<string?>(null);

    public Task<IReadOnlyList<PlatformFeatureDto>> GetFeaturesAsync(CancellationToken ct = default) =>
        Task.FromResult<IReadOnlyList<PlatformFeatureDto>>([]);

    public Task<IReadOnlyDictionary<string, bool>> GetEffectiveFeaturesForCafeAsync(
        string cafeId, PlanTier planTier, CancellationToken ct = default) =>
        Task.FromResult<IReadOnlyDictionary<string, bool>>(new Dictionary<string, bool>());

    public Task<bool> IsFeatureEnabledForCafeAsync(
        string cafeId, PlanTier planTier, string featureKey, CancellationToken ct = default) =>
        Task.FromResult(true);

    public void InvalidateCache() { }
}
