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

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

import java.util.Arrays;

import static org.mapstruct.NullValueCheckStrategy.ALWAYS;

/**
 * 业务分类黑白名单配置转换器
 *
 * @author wangli
 * @since 2023/12/26 11:24
 */
@Mapper(
        componentModel = "spring",
        nullValueCheckStrategy = ALWAYS,
        imports = Arrays.class
)
public interface CategoryConfigConverter extends EntityConverter<CategoryConfigItemVO, ExtAxDictConf> {

    @Mapping(target = "id", source = "id")
    @Mapping(target = "dictId", source = "dictId")
    @Mapping(target = "configType", source = "configType")
    @Mapping(target = "workspaceId", source = "workspaceId")
    @Mapping(target = "operationName", source = "operationName")
    @Mapping(target = "createAt", source = "updateAt")
    CategoryConfigItemVO toVo(ExtAxDictConf config);
}
