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
-2
@@ -244,8 +244,8 @@ reject/approve владением тикета не ограничены. Еди
|
||||
| POST | `/api/admin/activation-requests/{id}/approve` | admin | — | `204 No Content` |
|
||||
| POST | `/api/admin/activation-requests/{id}/reject` | admin | `{ reason? }` | `204 No Content` |
|
||||
| GET | `/api/admin/roles` | admin | — | `RoleDto[]` |
|
||||
| POST | `/api/admin/roles` | admin | `{ name, maxConfigs, maxIpLimit }` | `RoleDto` |
|
||||
| PUT | `/api/admin/roles/{id}` | admin | `{ maxConfigs, maxIpLimit }` | `RoleDto` |
|
||||
| POST | `/api/admin/roles` | admin | `{ name, maxConfigs, maxIpLimit, pricePerConfigPerQuarter?, pricePerConfigPerYear? }` | `RoleDto` |
|
||||
| PUT | `/api/admin/roles/{id}` | admin | `{ maxConfigs, maxIpLimit, pricePerConfigPerQuarter?, pricePerConfigPerYear? }` | `RoleDto` (для `admin` цена игнорируется, остаётся `null`) |
|
||||
| DELETE | `/api/admin/roles/{id}` | admin | — | `204 No Content` (системные `admin`/`user` удалить нельзя) |
|
||||
| PATCH | `/api/admin/users/{id}/role` | admin | `{ roleId }` | `204 No Content` (`409 Roles.CannotRemoveLastAdmin`, если у цели сейчас `admin`, новая роль другая, и это единственный админ) |
|
||||
|
||||
|
||||
Reference in New Issue
Block a user