Refactor pricing endpoints and enhance support for pricing retrieval
- Added a new endpoint `/api/support/pricing` to allow users to retrieve pricing information, making it accessible for role request dialogs. - Introduced the `GetSupportPricing` method to handle pricing queries, ensuring that pricing data is available to non-admin users. - Updated frontend components to integrate the new pricing retrieval functionality, displaying estimated costs based on user-selected configurations. - Removed the `PricingSettingsDto` as it is no longer needed, streamlining the pricing data structure. - Enhanced API documentation to reflect the new endpoint and its usage in the support context.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
using PnvPanel.Domain.Pricing;
|
||||
|
||||
namespace PnvPanel.Application.Common.Interfaces;
|
||||
|
||||
/// <summary>Все поля — цена за конфиг В МЕСЯЦ при соответствующем тарифе оплаты; итог за период =
|
||||
/// ставка × число месяцев. Используется и Admin (редактирование), и Support (справка при заявке на
|
||||
/// роль) — см. PricingSettingsDto.FromDomain.</summary>
|
||||
public sealed record PricingSettingsDto(
|
||||
int? PricePerConfigPerQuarter,
|
||||
int? PricePerConfigPerHalfYear,
|
||||
int? PricePerConfigPerYear
|
||||
)
|
||||
{
|
||||
public static PricingSettingsDto FromDomain(PricingSettings settings) =>
|
||||
new(
|
||||
settings.PricePerConfigPerQuarter,
|
||||
settings.PricePerConfigPerHalfYear,
|
||||
settings.PricePerConfigPerYear
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user