package com.lesingle.edu.common.mapper;

import com.lesingle.edu.dto.response.ParentResponse;
import com.lesingle.edu.entity.Parent;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * Parent Entity Mapper
 */
@Mapper(componentModel = "spring")
public interface ParentMapper {

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

    /**
     * Entity 转 Response
     */
    ParentResponse toVO(Parent entity);

    /**
     * Entity 列表转 Response 列表
     */
    List<ParentResponse> toVO(List<Parent> entities);

    /**
     * Response 转 Entity（用于创建/更新时）
     */
    Parent toEntity(ParentResponse vo);
}
