package com.gxwebsoft.cms.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 客资数据统计实体
 *
 * @author 科技小王子
 * @since 2026-04-14
 */
@Data
@TableName("lead_statistics")
@Schema(name = "LeadStatistics", description = "客资数据统计")
public class LeadStatistics implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "统计ID")
    @TableId(type = IdType.AUTO)
    private Integer statId;

    @Schema(description = "统计日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDateTime statDate;

    @Schema(description = "用户ID")
    private Integer userId;

    @Schema(description = "角色类型")
    private String roleType;

    @Schema(description = "总客资数")
    private Integer totalLeads;

    @Schema(description = "新增客资数")
    private Integer newLeads;

    @Schema(description = "已分配客资数")
    private Integer assignedLeads;

    @Schema(description = "已跟进客资数")
    private Integer followedLeads;

    @Schema(description = "已成交客资数")
    private Integer dealedLeads;

    @Schema(description = "成交总金额")
    private BigDecimal dealAmount;

    @Schema(description = "推荐成功数")
    private Integer referralCount;

    @Schema(description = "推荐费总额")
    private BigDecimal referralFee;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    // ========== 关联信息（非数据库字段）==========
    @Schema(description = "用户昵称")
    private String userName;
}
