package com.smppw.common.pojo;

import java.util.stream.Stream;

/**
 * @author mozuwen
 * @date 2023/07/26 10:00
 * @description 公募二级策略完整名称
 */

public enum PublicSubStrategyFullName implements IStrategy{
    Other(-10000, "其他型","IN00000008"),
    Initiative(10101, "主动股票型","IN00000008"),
    Passive(10102, "被动股票型","IN00000008"),
    IndexEnhancement(10103, "指增股票型","IN00000008"),
    PartialStock(10201, "偏股混合型","IN00000008"),
    Balance(10202, "平衡混合型","IN000002F1"),
    PartialDebt(10203, "偏债混合型","IN0000028F"),
    OrdinaryDebt(10301, "普通债型","IN0000028F"),
    ConvertibleBond(10302, "可转债型","IN0000028F"),
    Exponential(10303, "指数债券型","IN0000028F"),
    Monetary(10401, "货币型","IN0000007G"),
    FinancialManagement(10402, "理财型","IN0000007G"),
    Commodity(10501, "商品型","IN0000008S"),
    MarketNeutral(10601, "市场中性型","IN00000008"),
    FofPartialStock(10701, "偏股FOF型","IN00000008"),
    FofBalance(10702, "平衡FOF型","IN000002F1"),
    FofPartialDebt(10703, "偏债FOF型","IN0000028F"),
    OverseeInitiative(10801, "海外主动型","IN00000008"),
    OverseePassive(10802, "海外被动型","IN00000008"),
    OverseeIndexEnhancement(10803, "海外指增型","IN00000008");

    private final Integer id;
    private final String nameDesc;
    private final String benchmarkId;

    public Integer getId() {
        return id;
    }

    public String getNameDesc() {
        return nameDesc;
    }

    PublicSubStrategyFullName(Integer id, String nameDesc,String benchmarkId) {
        this.id = id;
        this.nameDesc = nameDesc;
        this.benchmarkId = benchmarkId;
    }

    public static NewPublicSubStrategy getPublicSubStrategy(int id) {
        return Stream.of(NewPublicSubStrategy.values()).filter(e -> e.getId() == id).findFirst().orElse(null);
    }
    public static PublicSubStrategyFullName getPublicSubStrategyFullName(int id) {
        return Stream.of(PublicSubStrategyFullName.values()).filter(e -> e.getId() == id).findFirst().orElse(null);
    }

    @Override
    public Integer getStrategyId() {
        return this.getId();
    }

    @Override
    public String getStrategyOriginName() {
        return this.name();
    }

    @Override
    public String getStrategyNameDesc() {
        return this.getNameDesc();
    }

    @Override
    public String getBenchmark() {
        return this.benchmarkId;
    }
}
