All checks were successful
BCards Deployment Pipeline / Run Tests (push) Successful in 4s
BCards Deployment Pipeline / PR Validation (push) Has been skipped
BCards Deployment Pipeline / Build and Push Image (push) Successful in 15m22s
BCards Deployment Pipeline / Deploy to Production (ARM - OCI) (push) Successful in 1m54s
BCards Deployment Pipeline / Deploy to Test (x86 - Local) (push) Has been skipped
BCards Deployment Pipeline / Cleanup Old Resources (push) Has been skipped
BCards Deployment Pipeline / Deployment Summary (push) Successful in 0s
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
57 lines
1.8 KiB
C#
57 lines
1.8 KiB
C#
using BCards.Web.Models;
|
|
|
|
namespace BCards.Web.Services;
|
|
|
|
public interface IPlanConfigurationService
|
|
{
|
|
/// <summary>
|
|
/// Mapeia um PriceId do Stripe para o PlanType correspondente
|
|
/// </summary>
|
|
PlanType GetPlanTypeFromPriceId(string priceId);
|
|
|
|
/// <summary>
|
|
/// Mapeia um PriceId do Stripe para o nome string do plano
|
|
/// </summary>
|
|
string GetPlanNameFromPriceId(string priceId);
|
|
|
|
/// <summary>
|
|
/// Obtém as limitações de um plano baseado no PlanType
|
|
/// </summary>
|
|
PlanLimitations GetPlanLimitations(PlanType planType);
|
|
|
|
/// <summary>
|
|
/// Obtém o PriceId de um plano (mensal por padrão)
|
|
/// </summary>
|
|
string GetPriceId(PlanType planType, bool yearly = false);
|
|
|
|
/// <summary>
|
|
/// Obtém o preço de um plano
|
|
/// </summary>
|
|
decimal GetPlanPrice(PlanType planType, bool yearly = false);
|
|
|
|
/// <summary>
|
|
/// Verifica se um plano é anual baseado no PriceId
|
|
/// </summary>
|
|
bool IsYearlyPlan(string priceId);
|
|
|
|
/// <summary>
|
|
/// Obtém todas as configurações de um plano pelo nome da seção
|
|
/// </summary>
|
|
PlanConfiguration? GetPlanConfiguration(string planSectionName);
|
|
}
|
|
|
|
public class PlanConfiguration
|
|
{
|
|
public string Name { get; set; } = string.Empty;
|
|
public string PriceId { get; set; } = string.Empty;
|
|
public decimal Price { get; set; }
|
|
public int MaxPages { get; set; }
|
|
public int MaxLinks { get; set; }
|
|
public bool AllowPremiumThemes { get; set; }
|
|
public bool AllowProductLinks { get; set; }
|
|
public bool AllowAnalytics { get; set; }
|
|
public bool? SpecialModeration { get; set; }
|
|
public List<string> Features { get; set; } = new();
|
|
public string Interval { get; set; } = "month";
|
|
public PlanType BasePlanType { get; set; }
|
|
} |