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

@@ -0,0 +1,37 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Managing.Infrastructure.Databases.Migrations
{
/// <inheritdoc />
public partial class AddGmxSlippageSetting : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
// Add column with default value
migrationBuilder.AddColumn<decimal>(
name: "GmxSlippage",
table: "Users",
type: "numeric(5,2)",
nullable: true,
defaultValue: 0.5m);
// Update existing NULL values to default
migrationBuilder.Sql(@"
UPDATE ""Users""
SET ""GmxSlippage"" = 0.5
WHERE ""GmxSlippage"" IS NULL;
");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "GmxSlippage",
table: "Users");
}
}
}