package cn.axzo.workflow.core.service.converter;

import cn.axzo.workflow.common.model.response.category.CategoryItemVO;
import cn.axzo.workflow.core.repository.entity.ExtAxDict;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.util.Arrays;

import static org.mapstruct.NullValueCheckStrategy.ALWAYS;

/**
 * 分类的 MapStruts 转换器
 */
@Mapper(
        componentModel = "spring",
        nullValueCheckStrategy = ALWAYS,
        imports = Arrays.class
)
public interface CategoryConverter extends EntityConverter<CategoryItemVO, ExtAxDict> {

    @Mapping(target = "id", source = "id")
    @Mapping(target = "type", source = "type")
    @Mapping(target = "label", source = "label")
    @Mapping(target = "value", source = "value")
    @Mapping(target = "remark", source = "remark")
    @Mapping(target = "status", source = "status")
    @Mapping(target = "operatorName", source = "operatorName")
    @Mapping(target = "workspaceTypeCode", source = "workspaceTypeCode")
    @Mapping(target = "updateAt", source = "updateAt")
    CategoryItemVO toVo(ExtAxDict category);
}
