package com.crm.rely.backend.core.entity.agent.hidden;

import lombok.Data;

import java.util.HashMap;
import java.util.Map;

@Data
public class AgentHiddenPointEntity {
    /**
     * 代理ID
     */
    private Long agentId;
    /**
     * 上级代理ID
     */
    private Long pId;
    /**
     * 层级返结构
     */
    private AgentHiddenPointEntity superEntity;
    /**
     * 自身的返点
     */
    private Map<Integer,Float> selfPoint;
    /**
     * 计算的返点
     */
    private Map<Integer,Float> calcPoint;
    /**
     * 累计的返点
     */
    private Map<Integer,Float> cumulativePoint;

    public static AgentHiddenPointEntity getInstance() {
        AgentHiddenPointEntity agentHiddenPointEntity = new AgentHiddenPointEntity();
        agentHiddenPointEntity.setSelfPoint(new HashMap<>());
        agentHiddenPointEntity.setCalcPoint(new HashMap<>());
        agentHiddenPointEntity.setCumulativePoint(new HashMap<>());
        return agentHiddenPointEntity;
    }

    public static AgentHiddenPointEntity copyOf(AgentHiddenPointEntity agentHiddenPointEntity) {
        AgentHiddenPointEntity agentHiddenPointEntityCopy = new AgentHiddenPointEntity();
        agentHiddenPointEntityCopy.setSelfPoint(agentHiddenPointEntity.getSelfPoint());
        agentHiddenPointEntityCopy.setAgentId(agentHiddenPointEntity.getAgentId());
        agentHiddenPointEntityCopy.setPId(agentHiddenPointEntity.getPId());
        return agentHiddenPointEntityCopy;
    }
}
