using SqlSugar;
namespace AssetManager.Data;
///
/// 投资组合表
///
[SugarTable("portfolios")]
public class Portfolio
{
///
/// 主键
///
[SugarColumn(IsPrimaryKey = true, IsIdentity = false)]
public string? Id { get; set; }
///
/// 所属用户ID
///
[SugarColumn(ColumnName = "user_id", IndexGroupNameList = new string[] { "idx_user_id" })]
public string? UserId { get; set; }
///
/// 所用策略ID
///
[SugarColumn(ColumnName = "strategy_id", IndexGroupNameList = new string[] { "idx_strategy_id" })]
public string? StrategyId { get; set; }
///
/// 组合名称
///
[SugarColumn(ColumnName = "name", Length = 200)]
public string? Name { get; set; }
///
/// 组合币种 (USD/CNY等)
///
[SugarColumn(ColumnName = "currency", Length = 10)]
public string? Currency { get; set; }
///
/// 当前总市值 (可冗余或实时计算)
///
[SugarColumn(ColumnName = "total_value", ColumnDataType = "decimal(18,4)")]
public decimal TotalValue { get; set; }
///
/// 累计收益率
///
[SugarColumn(ColumnName = "return_rate", ColumnDataType = "decimal(18,4)")]
public decimal ReturnRate { get; set; }
///
/// 运行状态 (运行中/监控中)
///
[SugarColumn(ColumnName = "status", Length = 50)]
public string? Status { get; set; }
///
/// 创建时间
///
[SugarColumn(ColumnName = "created_at")]
public DateTime CreatedAt { get; set; }
///
/// 更新时间
///
[SugarColumn(ColumnName = "updated_at")]
public DateTime UpdatedAt { get; set; }
}