package com.unicorn.hgzero.meeting.infra.mapper;

import com.unicorn.hgzero.meeting.biz.domain.Dashboard;
import com.unicorn.hgzero.meeting.biz.dto.DashboardDTO;
import com.unicorn.hgzero.meeting.infra.dto.response.DashboardResponse;
import org.springframework.stereotype.Component;

/**
 * Dashboard 도메인 객체를 Response DTO로 변환하는 매퍼
 */
@Component
public class DashboardResponseMapper {

    /**
     * Dashboard 도메인 객체를 DashboardResponse로 변환
     */
    public DashboardResponse toResponse(Dashboard dashboard) {
        if (dashboard == null) {
            return null;
        }

        // Dashboard 도메인을 DashboardDTO로 변환한 후 DashboardResponse로 변환
        DashboardDTO dashboardDTO = DashboardDTO.from(dashboard);
        return DashboardResponse.from(dashboardDTO);
    }
}