package com.friday.custody.convertor;

import com.friday.custody.entity.CdsProductInfoEntity;
import com.friday.operation.api.custody.vo.*;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

public class CdsProductInfoToOverviewOfPrivateFundConvertor {
    public static OverviewOfPrivateFundVO convert(CdsProductInfoEntity entity) {
        OverviewOfPrivateFundVO overviewOfPrivateFundVO = new OverviewOfPrivateFundVO();
        overviewOfPrivateFundVO.setFundCode(entity.getFundCode());
        overviewOfPrivateFundVO.setFundName(entity.getFundName());
        overviewOfPrivateFundVO.setFundStatus(entity.getFundStatus());
        overviewOfPrivateFundVO.setAdmin(entity.getAdmin());
        overviewOfPrivateFundVO.setAdminName(entity.getAdminName());
        overviewOfPrivateFundVO.setSunshineFund(entity.getSunshineFund());
        overviewOfPrivateFundVO.setLiquidation(entity.getLiquidation());
        overviewOfPrivateFundVO.setManageType(entity.getManageType());
        return overviewOfPrivateFundVO;
    }
    public static ArrayList<OverviewOfPrivateFundVO> convertList(List<CdsProductInfoEntity> cdsProductInfoEntityList) {
        return cdsProductInfoEntityList.stream()
                .map(CdsProductInfoToOverviewOfPrivateFundConvertor::convert)
                .collect(Collectors.toCollection(ArrayList::new));
    }
}
