Implement pricing management functionality and update related components
CI / Backend (build + test) (push) Successful in 1m19s
CI / Frontend (lint + typecheck + build) (push) Successful in 32s

- Added new endpoints for managing global pricing settings, including retrieval and updates for `PricePerConfigPerQuarter` and `PricePerConfigPerYear`.
- Updated `RoleService` and related commands to remove pricing fields from role management, ensuring a clear separation between role configurations and global pricing.
- Enhanced the `FactoryResetCommandHandler` to include seeding of pricing settings during a factory reset.
- Modified frontend components to support new pricing settings, including forms for creating and updating pricing information.
- Updated API documentation to reflect changes in pricing management endpoints and their expected request/response formats.
- Adjusted tests to ensure proper coverage for new pricing functionalities and their integration with existing role management features.
This commit is contained in:
Leonid Pershin
2026-07-18 19:34:29 +03:00
parent 285d8180c8
commit ae379f8e0f
54 changed files with 2516 additions and 268 deletions
+18 -10
View File
@@ -191,6 +191,7 @@ const resources = {
users: 'Пользователи',
configs: 'Все конфиги',
roles: 'Роли',
pricing: 'Цены',
nodes: 'Ноды',
apps: 'Приложения',
instructions: 'Инструкции',
@@ -253,13 +254,8 @@ const resources = {
maxConfigsHint: '1 = без лимита.',
maxIpLimit: 'Лимит IP на конфиг',
maxIpLimitHint: '−1 = без лимита. Применяется только к новым конфигам.',
pricePerConfigPerQuarter: 'Цена за конфиг / 3 мес',
pricePerConfigPerQuarterHint: 'Справочно, видно только админу. Минимальный период оплаты.',
pricePerConfigPerYear: 'Цена за конфиг / год',
pricePerConfigPerYearHint: 'Справочно, видно только админу. Задаётся отдельно от квартальной цены.',
totalPerQuarter: 'Итого / 3 мес',
totalPerYear: 'Итого / год',
totalValue: 'Итого для роли: {{total}} ₽.',
noPrice: '—',
system: 'системная',
edit: 'Изменить',
@@ -270,6 +266,14 @@ const resources = {
updated: 'Квота обновлена.',
deleted: 'Роль удалена.',
},
pricing: {
title: 'Справочная цена конфига',
pricePerConfigPerQuarter: 'Цена за конфиг / 3 мес',
pricePerConfigPerQuarterHint: 'Минимальный период оплаты. Видно только админу.',
pricePerConfigPerYear: 'Цена за конфиг / год',
pricePerConfigPerYearHint: 'Задаётся независимо от квартальной цены (можно сделать скидку за год).',
updated: 'Цена обновлена.',
},
nodes: {
create: 'Добавить ноду',
name: 'Название',
@@ -617,6 +621,7 @@ const resources = {
users: 'Users',
configs: 'All configs',
roles: 'Roles',
pricing: 'Pricing',
nodes: 'Nodes',
apps: 'Apps',
instructions: 'Instructions',
@@ -679,13 +684,8 @@ 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',
@@ -696,6 +696,14 @@ const resources = {
updated: 'Quota updated.',
deleted: 'Role deleted.',
},
pricing: {
title: 'Reference config price',
pricePerConfigPerQuarter: 'Price per config / 3 months',
pricePerConfigPerQuarterHint: 'Minimum billing period. Visible to admin only.',
pricePerConfigPerYear: 'Price per config / year',
pricePerConfigPerYearHint: 'Set independently from the quarterly price (allows an annual discount).',
updated: 'Pricing updated.',
},
nodes: {
create: 'Add node',
name: 'Name',