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:
@@ -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);
|
||||
|
||||
@@ -11,13 +11,14 @@ public class UpdateUserSettingsRequest
|
||||
public decimal? AutoswapAmount { get; set; }
|
||||
public int? MaxWaitingTimeForPositionToGetFilledSeconds { get; set; }
|
||||
public decimal? MaxTxnGasFeePerPosition { get; set; }
|
||||
public bool? IsGmxEnabled { get; set; }
|
||||
// Note: IsGmxEnabled is not updatable via settings endpoint
|
||||
public decimal? GmxSlippage { get; set; }
|
||||
|
||||
// Indicator Combo Configuration
|
||||
public Confidence? MinimumConfidence { get; set; }
|
||||
public decimal? TrendStrongAgreementThreshold { get; set; }
|
||||
public decimal? SignalAgreementThreshold { get; set; }
|
||||
public bool? AllowSignalTrendOverride { get; set; }
|
||||
public TradingExchanges? DefaultExchange { get; set; }
|
||||
// Note: DefaultExchange is not updatable via settings endpoint
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user