Enhance role management by adding pricing fields and updating related logic
- Updated `CreateRoleCommand` and `UpdateRoleCommand` to include optional pricing fields: `PricePerConfigPerQuarter` and `PricePerConfigPerYear`. - Modified `RoleEndpoints` to handle the new pricing parameters during role creation and updates. - Enhanced validation logic in `CreateRoleCommandValidator` and `UpdateRoleCommandValidator` to ensure pricing fields are non-negative when provided. - Updated `RoleDto` and `SelectableRoleDto` to include pricing information, ensuring proper data handling in API responses. - Adjusted frontend components to support new pricing fields in role forms and display total costs based on configurations. - Updated API documentation to reflect changes in role management endpoints and pricing structure.
This commit is contained in:
@@ -2,7 +2,15 @@ using PnvPanel.Application.Common.Models;
|
||||
|
||||
namespace PnvPanel.Application.Common.Interfaces;
|
||||
|
||||
public sealed record RoleDto(Guid Id, string Name, int MaxConfigs, int MaxIpLimit, bool IsSystem);
|
||||
public sealed record RoleDto(
|
||||
Guid Id,
|
||||
string Name,
|
||||
int MaxConfigs,
|
||||
int MaxIpLimit,
|
||||
bool IsSystem,
|
||||
int? PricePerConfigPerQuarter = null,
|
||||
int? PricePerConfigPerYear = null
|
||||
);
|
||||
|
||||
public interface IRoleService
|
||||
{
|
||||
@@ -10,6 +18,8 @@ public interface IRoleService
|
||||
string name,
|
||||
int maxConfigs,
|
||||
int maxIpLimit,
|
||||
int? pricePerConfigPerQuarter,
|
||||
int? pricePerConfigPerYear,
|
||||
CancellationToken cancellationToken
|
||||
);
|
||||
|
||||
@@ -17,6 +27,8 @@ public interface IRoleService
|
||||
Guid roleId,
|
||||
int maxConfigs,
|
||||
int maxIpLimit,
|
||||
int? pricePerConfigPerQuarter,
|
||||
int? pricePerConfigPerYear,
|
||||
CancellationToken cancellationToken
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user