- Introduced a new `DiscountTierDto` to represent volume discount tiers, allowing roles with a config quota at or above specified thresholds to receive discounts on pricing. - Updated the `PricingSettingsDto` to include a list of discount tiers, enhancing the pricing model to support more flexible pricing strategies. - Modified the `GetPricingSettingsQueryHandler` and `UpdatePricingSettingsCommandHandler` to handle discount tiers, ensuring they are correctly retrieved and updated in the database. - Enhanced validation in `UpdatePricingSettingsCommandValidator` to enforce uniqueness and progressive discount tiers, preventing invalid configurations. - Updated frontend components to support the new discount tier functionality, including forms for adding and managing discount tiers in the admin interface. - Revised API documentation to reflect the new discount tier features and their usage in pricing settings.
63 lines
1.7 KiB
C#
63 lines
1.7 KiB
C#
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using PnvPanel.Domain.Activation;
|
|
using PnvPanel.Domain.Apps;
|
|
using PnvPanel.Domain.Audit;
|
|
using PnvPanel.Domain.Billing;
|
|
using PnvPanel.Domain.Configs;
|
|
using PnvPanel.Domain.Inbounds;
|
|
using PnvPanel.Domain.Instructions;
|
|
using PnvPanel.Domain.News;
|
|
using PnvPanel.Domain.Nodes;
|
|
using PnvPanel.Domain.Pricing;
|
|
using PnvPanel.Domain.Support;
|
|
using PnvPanel.Domain.Telegram;
|
|
|
|
namespace PnvPanel.Application.Common.Interfaces;
|
|
|
|
public interface IAppDbContext
|
|
{
|
|
DbSet<ActivationRequest> ActivationRequests { get; }
|
|
|
|
DbSet<AuditLog> AuditLogs { get; }
|
|
|
|
DbSet<TelegramLinkToken> TelegramLinkTokens { get; }
|
|
|
|
DbSet<TelegramLoginRequest> TelegramLoginRequests { get; }
|
|
|
|
DbSet<Node> Nodes { get; }
|
|
|
|
DbSet<Inbound> Inbounds { get; }
|
|
|
|
DbSet<VpnConfig> VpnConfigs { get; }
|
|
|
|
DbSet<TrafficSample> TrafficSamples { get; }
|
|
|
|
DbSet<ClientApp> ClientApps { get; }
|
|
|
|
DbSet<NewsPost> NewsPosts { get; }
|
|
|
|
DbSet<SupportTicket> SupportTickets { get; }
|
|
|
|
DbSet<TicketComment> TicketComments { get; }
|
|
|
|
DbSet<TicketAttachment> TicketAttachments { get; }
|
|
|
|
DbSet<InstructionIntro> InstructionIntros { get; }
|
|
|
|
DbSet<InstructionTab> InstructionTabs { get; }
|
|
|
|
DbSet<PricingSettings> PricingSettings { get; }
|
|
|
|
DbSet<PricingDiscountTier> PricingDiscountTiers { get; }
|
|
|
|
DbSet<BillingSettings> BillingSettings { get; }
|
|
|
|
DbSet<PaymentRequest> PaymentRequests { get; }
|
|
|
|
/// <summary>Нужен для advisory-lock при проверке квоты конфигов (см. CreateVpnConfigCommandHandler).</summary>
|
|
DatabaseFacade Database { get; }
|
|
|
|
Task<int> SaveChangesAsync(CancellationToken cancellationToken);
|
|
}
|