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:
File diff suppressed because it is too large
Load Diff
@@ -173,6 +173,16 @@ export type RoleDto = {
|
||||
maxConfigs: number
|
||||
maxIpLimit: number
|
||||
isSystem: boolean
|
||||
pricePerConfigPerQuarter: number | null
|
||||
pricePerConfigPerYear: number | null
|
||||
}
|
||||
|
||||
/** Роль для выбора в заявке на роль (GET /support/roles) — без цены, она видна только админу. */
|
||||
export type SelectableRoleDto = {
|
||||
id: string
|
||||
name: string
|
||||
maxConfigs: number
|
||||
maxIpLimit: number
|
||||
}
|
||||
|
||||
export type ActivationRequestAdminDto = {
|
||||
|
||||
@@ -253,6 +253,14 @@ const resources = {
|
||||
maxConfigsHint: '−1 = без лимита.',
|
||||
maxIpLimit: 'Лимит IP на конфиг',
|
||||
maxIpLimitHint: '−1 = без лимита. Применяется только к новым конфигам.',
|
||||
pricePerConfigPerQuarter: 'Цена за конфиг / 3 мес',
|
||||
pricePerConfigPerQuarterHint: 'Справочно, видно только админу. Минимальный период оплаты.',
|
||||
pricePerConfigPerYear: 'Цена за конфиг / год',
|
||||
pricePerConfigPerYearHint: 'Справочно, видно только админу. Задаётся отдельно от квартальной цены.',
|
||||
totalPerQuarter: 'Итого / 3 мес',
|
||||
totalPerYear: 'Итого / год',
|
||||
totalValue: 'Итого для роли: {{total}} ₽.',
|
||||
noPrice: '—',
|
||||
system: 'системная',
|
||||
edit: 'Изменить',
|
||||
save: 'Сохранить',
|
||||
@@ -671,6 +679,14 @@ const resources = {
|
||||
maxConfigsHint: '−1 = unlimited.',
|
||||
maxIpLimit: 'IP limit per config',
|
||||
maxIpLimitHint: '−1 = unlimited. Applies to new configs only.',
|
||||
pricePerConfigPerQuarter: 'Price per config / 3 months',
|
||||
pricePerConfigPerQuarterHint: 'Reference only, visible to admin only. Minimum billing period.',
|
||||
pricePerConfigPerYear: 'Price per config / year',
|
||||
pricePerConfigPerYearHint: 'Reference only, visible to admin only. Set independently from the quarterly price.',
|
||||
totalPerQuarter: 'Total / 3 months',
|
||||
totalPerYear: 'Total / year',
|
||||
totalValue: 'Total for role: {{total}} ₽.',
|
||||
noPrice: '—',
|
||||
system: 'system',
|
||||
edit: 'Edit',
|
||||
save: 'Save',
|
||||
|
||||
Reference in New Issue
Block a user