Refactoring TradingBotBase.cs + clean architecture (#38)

* Refactoring TradingBotBase.cs + clean architecture

* Fix basic tests

* Fix tests

* Fix workers

* Fix open positions

* Fix closing position stucking the grain

* Fix comments

* Refactor candle handling to use IReadOnlyList for chronological order preservation across various components
This commit is contained in:
Oda
2025-12-01 19:32:06 +07:00
committed by GitHub
parent ab26260f6d
commit 9d536ea49e
74 changed files with 4525 additions and 2350 deletions

View File

@@ -372,6 +372,8 @@ namespace Managing.Infrastructure.Databases.Migrations
b.HasIndex("Identifier")
.IsUnique();
b.HasIndex("MasterBotUserId");
b.HasIndex("Status");
b.HasIndex("UserId");
@@ -929,6 +931,9 @@ namespace Managing.Infrastructure.Databases.Migrations
.IsRequired()
.HasColumnType("text");
b.Property<int>("TradingType")
.HasColumnType("integer");
b.Property<decimal>("UiFees")
.HasColumnType("decimal(18,8)");
@@ -1571,12 +1576,19 @@ namespace Managing.Infrastructure.Databases.Migrations
modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.BotEntity", b =>
{
b.HasOne("Managing.Infrastructure.Databases.PostgreSql.Entities.UserEntity", "MasterBotUser")
.WithMany()
.HasForeignKey("MasterBotUserId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Managing.Infrastructure.Databases.PostgreSql.Entities.UserEntity", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.SetNull)
.IsRequired();
b.Navigation("MasterBotUser");
b.Navigation("User");
});