package com.xunhong.erp.turbo.rbac.app.assembler;

import com.xunhong.erp.turbo.api.rbac.dto.vo.UserRoleVO;
import com.xunhong.erp.turbo.rbac.domain.entity.UserRole;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.NullValueCheckStrategy;

@Mapper(componentModel = "spring", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface UserRoleAssembler {
	@Mapping(target = "platformId", source = "userRole.role.platformId")
	@Mapping(target = "slug", source = "userRole.role.slug")
	@Mapping(target = "name", source = "userRole.role.name")
	@Mapping(target = "description", source = "userRole.role.description")
	UserRoleVO toUserRoleVO(UserRole userRole);
}
