- Interfaces: IAccountRepository, IMarketRepository, IPositionRepository (IPositionRepository kapselt das Collection-per-Account-Muster). - Mongo-Implementierungen bilden die bisherige Shim-Semantik 1:1 mit direkten MongoDB.Driver-Aufrufen nach (kein App-Shim-Bezug im Core). - AddCorePersistence()-Erweiterung + Registrierung in Program.cs. - Noch keine Call-Sites umgestellt; Build 0 Fehler. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
28 lines
934 B
C#
28 lines
934 B
C#
using System.Collections.Generic;
|
|
using PolyTraderSharp.Models;
|
|
|
|
namespace PolyTrader.Core.Persistence
|
|
{
|
|
/// <summary>
|
|
/// Zugriff auf die offenen Positionen je Account. Kapselt das aktuelle
|
|
/// Collection-per-Account-Muster ("open_positions_{id}" / "demo_positions_{id}").
|
|
/// In der späteren MySQL-Migration wird daraus eine Tabelle mit account_id/is_demo.
|
|
/// </summary>
|
|
public interface IPositionRepository
|
|
{
|
|
List<Position> GetLive(int accountId);
|
|
List<Position> GetDemo(int accountId);
|
|
|
|
Position? FindLive(int accountId, string tokenId);
|
|
Position? FindDemo(int accountId, string tokenId);
|
|
|
|
void UpsertLive(int accountId, Position position);
|
|
void UpsertDemo(int accountId, Position position);
|
|
|
|
void DeleteLive(int accountId, string tokenId);
|
|
void DeleteDemo(int accountId, string tokenId);
|
|
|
|
void DropDemo(int accountId);
|
|
}
|
|
}
|