namespace AssetManager.Models.DTOs;
///
/// 创建投资组合请求
///
public class CreatePortfolioRequest
{
public string? Name { get; set; }
public string? StrategyId { get; set; }
public string? Currency { get; set; }
public List? Stocks { get; set; }
}
///
/// 更新投资组合请求
///
public class UpdatePortfolioRequest
{
public string? Name { get; set; }
public string? StrategyId { get; set; }
public string? Status { get; set; }
}
///
/// 股票项
///
public class StockItem
{
public string? Name { get; set; }
public string? Code { get; set; }
public double Price { get; set; }
public int Amount { get; set; }
public string? Date { get; set; }
public string? Currency { get; set; }
public string AssetType { get; set; } = "Stock";
}
///
/// 创建投资组合响应
///
public class CreatePortfolioResponse
{
public string? Id { get; set; }
public double TotalValue { get; set; }
public double ReturnRate { get; set; }
public string? Currency { get; set; }
public string? CreatedAt { get; set; }
}
///
/// 投资组合详情响应
///
public class PortfolioDetailResponse
{
public string? Id { get; set; }
public string? Name { get; set; }
public string? Currency { get; set; }
public string? Status { get; set; }
public StrategyInfo? Strategy { get; set; }
public double PortfolioValue { get; set; }
public double TotalReturn { get; set; }
public double TodayProfit { get; set; }
public double HistoricalChange { get; set; }
public double DailyVolatility { get; set; }
public string? TodayProfitCurrency { get; set; }
public string? LogicModel { get; set; }
public string? LogicModelStatus { get; set; }
public string? LogicModelDescription { get; set; }
public int TotalItems { get; set; }
public double TotalRatio { get; set; }
public List? Positions { get; set; }
}
///
/// 策略信息
///
public class StrategyInfo
{
public string? Id { get; set; }
public string? Name { get; set; }
public string? Description { get; set; }
}
///
/// 持仓项
///
public class PositionItem
{
public string? Id { get; set; }
public string? StockCode { get; set; }
public string? StockName { get; set; }
public string? Symbol { get; set; }
public int Amount { get; set; }
public double AveragePrice { get; set; }
public double CurrentPrice { get; set; }
public double TotalValue { get; set; }
public double Profit { get; set; }
public double ProfitRate { get; set; }
public double ChangeAmount { get; set; }
public double Ratio { get; set; }
public double DeviationRatio { get; set; }
public string? Currency { get; set; }
}
///
/// 交易项
///
public class TransactionItem
{
public string? Id { get; set; }
public string? PortfolioId { get; set; }
public string? Date { get; set; }
public string? Time { get; set; }
public string? Type { get; set; }
public string? Title { get; set; }
public string? StockCode { get; set; }
public double Amount { get; set; }
public string? Currency { get; set; }
public string? Status { get; set; }
public string? Remark { get; set; }
}
///
/// 获取交易列表请求
///
public class GetTransactionsRequest
{
public string? PortfolioId { get; set; }
public int Limit { get; set; }
public int Offset { get; set; }
}
///
/// 获取交易列表响应
///
public class GetTransactionsResponse
{
public List? Items { get; set; }
public int Total { get; set; }
public int Page { get; set; }
public int PageSize { get; set; }
}
///
/// 创建交易请求
///
public class CreateTransactionRequest
{
public string? PortfolioId { get; set; }
public string? Type { get; set; }
public string? StockCode { get; set; }
public int Amount { get; set; }
public double Price { get; set; }
public string? Currency { get; set; }
public string? Remark { get; set; }
public string AssetType { get; set; } = "Stock";
public string? TransactionTime { get; set; }
public string? TransactionDate { get; set; }
}
///
/// 创建交易响应
///
public class CreateTransactionResponse
{
public string? Id { get; set; }
public double TotalAmount { get; set; }
public string? Status { get; set; }
public string? CreatedAt { get; set; }
}
///
/// 投资组合列表项
///
public class PortfolioListItem
{
public string? Id { get; set; }
public string? Name { get; set; }
public string? Tags { get; set; }
public string? Status { get; set; }
public string? StatusType { get; set; }
public string? IconChar { get; set; }
public string? IconBgClass { get; set; }
public string? IconTextClass { get; set; }
public double Value { get; set; }
public string? Currency { get; set; }
public double ReturnRate { get; set; }
public string? ReturnType { get; set; }
public double TodayProfit { get; set; }
public string? TodayProfitCurrency { get; set; }
}
///
/// 获取投资组合列表响应
///
public class GetPortfoliosResponse
{
public List? Items { get; set; }
}
///
/// 总资产响应
///
public class TotalAssetsResponse
{
public double TotalValue { get; set; }
public string? Currency { get; set; }
public double TodayProfit { get; set; }
public string? TodayProfitCurrency { get; set; }
public double TotalReturnRate { get; set; }
}
// ===== 净值历史相关 DTO =====
///
/// 净值历史请求
///
public class NavHistoryRequest
{
public DateTime? StartDate { get; set; }
public DateTime? EndDate { get; set; }
public string? Interval { get; set; } = "daily";
}
///
/// 净值历史响应
///
public class NavHistoryResponse
{
public string? PortfolioId { get; set; }
public string? Currency { get; set; }
public List? NavHistory { get; set; }
public NavStatistics? Statistics { get; set; }
}
///
/// 净值历史项
///
public class NavHistoryItem
{
public string? Date { get; set; }
public double Nav { get; set; }
public double TotalValue { get; set; }
public double TotalCost { get; set; }
public double DailyReturn { get; set; }
public double CumulativeReturn { get; set; }
}
///
/// 净值统计
///
public class NavStatistics
{
public double MaxReturn { get; set; }
public double MinReturn { get; set; }
public double MaxDrawdown { get; set; }
public double SharpeRatio { get; set; }
public double Volatility { get; set; }
public double TotalReturn { get; set; }
public int TradingDays { get; set; }
}
///
/// 回填净值请求
///
public class BackfillNavRequest
{
public string? PortfolioId { get; set; }
public bool Force { get; set; }
}
///
/// 回填净值响应
///
public class BackfillNavResponse
{
public string? PortfolioId { get; set; }
public int RecordsCreated { get; set; }
public DateTime? StartDate { get; set; }
public DateTime? EndDate { get; set; }
public string? Message { get; set; }
}