package com.hz.pm.api.meeting.builder;

import com.hz.pm.api.meeting.entity.domain.MeetingOuterProject;
import com.hz.pm.api.meeting.entity.dto.MeetingReviewProjectDTO;
import com.hz.pm.api.meeting.entity.vo.MeetingReviewProjectVO;
import com.hz.pm.api.projectlib.model.entity.Project;

/**
 * <p>
 * MeetingReviewResultBuilder
 * </p>
 *
 * @author WendyYang
 * @since 19:29 2023/12/21
 */
public class MeetingReviewProjectBuilder {

    private MeetingReviewProjectBuilder() {
    }

    public static MeetingReviewProjectDTO convert(Project project){
        MeetingReviewProjectDTO mrp = new MeetingReviewProjectDTO();
        mrp.setProjectId(project.getId());
        mrp.setBuildOrg(project.getBuildOrgName());
        mrp.setProjectName(project.getProjectName());
        mrp.setProjectType(project.getProjectType());
        mrp.setProjectYear(project.getProjectYear());
        mrp.setDeclareAmount(project.getDeclareAmount());
        mrp.setProjectCode(project.getProjectCode());
        return mrp;
    }

    public static MeetingReviewProjectDTO convert(MeetingOuterProject mop) {
        MeetingReviewProjectDTO mrp = new MeetingReviewProjectDTO();
        mrp.setBuildOrg(mop.getBuildOrg());
        mrp.setProjectName(mop.getProjectName());
        mrp.setProjectType(mop.getProjectType());
        mrp.setProjectYear(mop.getProjectYear());
        mrp.setDeclareAmount(mop.getDeclareAmount());
        mrp.setMeetingProjectId(mop.getId());
        return mrp;
    }

    public static MeetingReviewProjectVO to(Project project) {
        return MeetingReviewProjectVO
                .builder()
                .id(project.getId())
                .projectCode(project.getProjectCode())
                .projectName(project.getProjectName())
                .declaredAmount(project.getDeclareAmount())
                .projectType(project.getProjectType())
                .projectYear(project.getProjectYear())
                .buildOrg(project.getBuildOrgName())
                .createOn(project.getCreateOn())
                .build();
    }

    public static MeetingReviewProjectVO to(MeetingOuterProject mop) {
        return MeetingReviewProjectVO
                .builder()
                .meetingProjectId(mop.getId())
                .projectName(mop.getProjectName())
                .declaredAmount(mop.getDeclareAmount())
                .projectType(mop.getProjectType())
                .projectYear(mop.getProjectYear())
                .buildOrg(mop.getBuildOrg())
                .createOn(mop.getCreateOn())
                .build();
    }


}
