package com.lesingle.edu.common.mapper;

import com.lesingle.edu.dto.response.TaskCompletionResponse;
import com.lesingle.edu.entity.TaskCompletion;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * TaskCompletion Entity Mapper
 */
@Mapper(componentModel = "spring")
public interface TaskCompletionMapper {

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

    /**
     * Entity 转 Response
     */
    TaskCompletionResponse toVO(TaskCompletion entity);

    /**
     * Entity 列表转 Response 列表
     */
    List<TaskCompletionResponse> toVO(List<TaskCompletion> entities);

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