package com.simuwang.base.pojo.dto.report;

import com.simuwang.base.pojo.dos.report.ReportFundInfoDO;
import lombok.Getter;
import lombok.Setter;

import java.util.Objects;

/**
 * @author wangzaijun
 * @date 2024/9/26 16:47
 * @description 报告基金基本信息
 */
@Setter
@Getter
public class ReportFundInfoDTO extends BaseReportDTO<ReportFundInfoDO> {
    /**
     * 投资顾问
     */
    private String advisorName;
    /**
     * 基金托管人
     */
    private String custodianName;
    /**
     * 基金经理描述
     */
    private String fundManager;
    /**
     * 基金名称
     */
    private String fundName;
    /**
     * 投资策略
     */
    private String fundStrategyDescription;
    /**
     * 基金成立日期
     */
    private String inceptionDate;
    /**
     * 行业趋势
     */
    private String industryTrend;
    /**
     * 投资目标
     */
    private String investmentObjective;
    /**
     * 杠杆比例
     */
    private String leverage;
    /**
     * 杠杆比例描述
     */
    private String leverageNote;
    /**
     * 基金运作方式
     */
    private String operationType;
    /**
     * 备案编码
     */
    private String registerNumber;
    /**
     * 风险收益特征
     */
    private String riskReturnDesc;
    /**
     * 业绩比较基准
     */
    private String secondaryBenchmark;
    /**
     * 基金管理人
     */
    private String trustName;
    /**
     * 基金到期日期
     */
    private String dueDate;
    /**
     * 信息披露报告是否经托管机构复核
     */
    private String isReviewed;

    public ReportFundInfoDTO() {
        super();
    }

    public ReportFundInfoDTO(Integer fileId) {
        super(fileId);
    }

    @Override
    public ReportFundInfoDO toEntity() {
        ReportFundInfoDO entity = new ReportFundInfoDO();
        entity.setFileId(this.getFileId());
        entity.setAdvisorName(this.advisorName);
        entity.setCustodianName(this.custodianName);
        entity.setFundManager(this.fundManager);
        entity.setFundName(this.fundName);
        entity.setFundStrategyDescription(this.fundStrategyDescription);
        entity.setInceptionDate(this.toDate(this.inceptionDate));
        entity.setIndustryTrend(this.industryTrend);
        entity.setInvestmentObjective(this.investmentObjective);
        entity.setLeverage(this.toBigDecimal(this.leverage));
        entity.setLeverageNote(this.leverageNote);
        entity.setOperationType(this.operationType);
        entity.setRegisterNumber(this.registerNumber);
        entity.setRiskReturnDesc(this.riskReturnDesc);
        entity.setSecondaryBenchmark(this.secondaryBenchmark);
        entity.setTrustName(this.trustName);
        entity.setDueDate(this.toDate(this.dueDate));
        entity.setReviewed(Objects.equals("是", this.isReviewed) ? 1 : 0);
        return entity;
    }

    @Override
    public String toString() {
        return "{" +
                super.toString() +
                ", advisorName='" + advisorName + '\'' +
                ", fundName='" + fundName + '\'' +
                ", inceptionDate='" + inceptionDate + '\'' +
                ", registerNumber='" + registerNumber + '\'' +
                ", trustName='" + trustName + '\'' +
                ", dueDate='" + dueDate + '\'' +
                '}';
    }
}
