Refactor user settings management to remove IsGmxEnabled and DefaultExchange from updatable fields, introducing GmxSlippage instead. Update UserController, UserService, and related DTOs to reflect these changes, ensuring proper handling of user settings. Adjust database schema and migrations to accommodate the new GmxSlippage property, enhancing user customization options for trading configurations.

This commit is contained in:
2025-12-30 07:19:08 +07:00
parent aa3b06bbe4
commit 21d87efeee
23 changed files with 1908 additions and 32 deletions

View File

@@ -157,6 +157,7 @@ public class UserController : BaseController
{
var user = await GetUser();
// Map API request to DTO
// Note: IsGmxEnabled and DefaultExchange are not updatable via settings endpoint
var settingsDto = new Managing.Application.Abstractions.Models.UserSettingsDto
{
LowEthAmountAlert = settings.LowEthAmountAlert,
@@ -164,12 +165,11 @@ public class UserController : BaseController
AutoswapAmount = settings.AutoswapAmount,
MaxWaitingTimeForPositionToGetFilledSeconds = settings.MaxWaitingTimeForPositionToGetFilledSeconds,
MaxTxnGasFeePerPosition = settings.MaxTxnGasFeePerPosition,
IsGmxEnabled = settings.IsGmxEnabled,
GmxSlippage = settings.GmxSlippage,
MinimumConfidence = settings.MinimumConfidence,
TrendStrongAgreementThreshold = settings.TrendStrongAgreementThreshold,
SignalAgreementThreshold = settings.SignalAgreementThreshold,
AllowSignalTrendOverride = settings.AllowSignalTrendOverride,
DefaultExchange = settings.DefaultExchange
AllowSignalTrendOverride = settings.AllowSignalTrendOverride
};
var updatedUser = await _userService.UpdateUserSettings(user, settingsDto);
return Ok(updatedUser);