feat: add resource quotas, PayPal subscriptions and paid disk allowances
Calculate and enforce configurable resource consumption, expose balances in PostIt and document the rule in CGU. Add confirmed monthly PayPal credits and disk quotas of twice the free default for Discovery and five times for Premium, with payment reconciliation, migrations and regression tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
0728d2a3f7
commit
650e5f5e30
69 changed files with 19111 additions and 203 deletions
|
|
@ -2,9 +2,7 @@ namespace Yavsc.Abstract.Resources;
|
|||
|
||||
/// <summary>
|
||||
/// Lightweight usage snapshot for PostIt / Yavsc resource accounting.
|
||||
/// The initial implementation is intentionally intentionally small and
|
||||
/// serialisable so it can be exposed through the API and consumed by the
|
||||
/// PostIt client without requiring a full database model yet.
|
||||
/// Counters are cumulative; consumption is expressed in points, not currency.
|
||||
/// </summary>
|
||||
public sealed class ResourceUsageSummary
|
||||
{
|
||||
|
|
@ -17,6 +15,17 @@ public sealed class ResourceUsageSummary
|
|||
public decimal BandwidthMb { get; set; }
|
||||
public decimal StorageMb { get; set; }
|
||||
|
||||
public decimal Consumption { get; set; }
|
||||
public decimal GrossConsumption { get; set; }
|
||||
public decimal CreditBalance { get; set; }
|
||||
public decimal AppliedCredits { get; set; }
|
||||
public decimal ConsumptionLimit { get; set; }
|
||||
public decimal RemainingConsumption { get; set; }
|
||||
public bool IsQuotaReached { get; set; }
|
||||
public long? DiskQuota { get; set; }
|
||||
public DateTimeOffset? PremiumDiskQuotaUntil { get; set; }
|
||||
public DateTimeOffset? DiscoveryDiskQuotaUntil { get; set; }
|
||||
|
||||
public decimal EstimatedCompensation { get; set; }
|
||||
public string Currency { get; set; } = Constants.ResourceUsageDefaultCurrency;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue