Add user settings update functionality in UserController and UserService
Implement a new endpoint in UserController to allow users to update their settings. The UserService is updated to handle the logic for updating user settings, including partial updates for various fields. Additionally, the User entity and database schema are modified to accommodate new user settings properties, ensuring persistence and retrieval of user preferences.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Managing.Common;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using static Managing.Common.Enums;
|
||||
|
||||
namespace Managing.Infrastructure.Databases.PostgreSql.Entities;
|
||||
|
||||
@@ -17,6 +19,15 @@ public class UserEntity
|
||||
public DateTimeOffset? LastConnectionDate { get; set; }
|
||||
public bool IsAdmin { get; set; }
|
||||
|
||||
// User Settings
|
||||
[Column(TypeName = "decimal(18,8)")] public decimal? LowEthAmountAlert { get; set; }
|
||||
public bool EnableAutoswap { get; set; } = false;
|
||||
[Column(TypeName = "decimal(18,8)")] public decimal? AutoswapAmount { get; set; }
|
||||
public int? MaxWaitingTimeForPositionToGetFilledSeconds { get; set; }
|
||||
[Column(TypeName = "decimal(18,8)")] public decimal? MaxTxnGasFeePerPosition { get; set; }
|
||||
public bool IsGmxEnabled { get; set; } = false;
|
||||
public Confidence? MinimumConfidence { get; set; }
|
||||
|
||||
// Navigation properties
|
||||
public virtual ICollection<AccountEntity> Accounts { get; set; } = new List<AccountEntity>();
|
||||
}
|
||||
Reference in New Issue
Block a user