package com.jeesharp.business.modules.member.convert;

import com.jeesharp.business.modules.member.dto.MemberPointsRuleLevelSaveItemDTO;
import com.jeesharp.business.modules.member.entity.MemberPointsRuleLevel;
import com.jeesharp.business.modules.member.vo.MemberPointsRuleLevelItemVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * 积分规则等级明细 MapStruct 转换器。
 *
 * @author jeesharp
 * @since 2026-06-23
 */
@Mapper
public interface MemberPointsRuleLevelConvert {

    MemberPointsRuleLevelConvert INSTANCE = Mappers.getMapper(MemberPointsRuleLevelConvert.class);

    @Mapping(target = "levelName", ignore = true)
    MemberPointsRuleLevelItemVO toItemVO(MemberPointsRuleLevel entity);

    List<MemberPointsRuleLevelItemVO> toItemVOList(List<MemberPointsRuleLevel> list);

    @Mapping(target = "id", ignore = true)
    @Mapping(target = "ruleId", ignore = true)
    MemberPointsRuleLevel fromSaveItem(MemberPointsRuleLevelSaveItemDTO dto);

    List<MemberPointsRuleLevel> fromSaveItemList(List<MemberPointsRuleLevelSaveItemDTO> list);
}
