package com.datacenter.entity.stat;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 平台每日运营盈亏统计。
 * 每天凌晨 1:05 跑定时任务，写两行：includeInternal=0（排除内部账户）和 includeInternal=1（含）。
 */
@Data
@TableName("stat_platform_daily_pnl")
public class StatPlatformDailyPnl {

    @TableId(type = IdType.AUTO)
    private Long id;

    private LocalDate statDate;
    private Integer includeInternal;

    // ── 充值 / 提现 ────────────────────────────────────────────────────────────
    private BigDecimal depositAmount;
    private BigDecimal withdrawAmount;

    // ── 合约自主交易（follow_id IS NULL，含带单员自身交易）────────────────────────
    private Integer    selfOpenCount;
    private BigDecimal selfOpenAmount;
    private BigDecimal selfCloseProfit;
    private BigDecimal selfCloseLoss;
    private BigDecimal selfCloseDiff;
    private BigDecimal selfFee;
    private BigDecimal selfFundingFee;

    // ── 跟单交易（follow_id IS NOT NULL，仅跟单用户数据）────────────────────────
    private Integer    copyOpenCount;
    private BigDecimal copyOpenAmount;
    private BigDecimal copyCloseProfit;
    private BigDecimal copyCloseLoss;
    private BigDecimal copyCloseDiff;
    private BigDecimal copyFee;
    private BigDecimal copyFundingFee;

    private LocalDateTime updatedTime;
}
