package com.ningdatech.pmapi.meeting.builder;

import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo;
import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert;
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertInviteTypeEnum;

/**
 * <p>
 * ExpertInviteBuilder
 * </p>
 *
 * @author WendyYang
 * @since 21:30 2022/11/21
 */
public class ExpertInviteBuilder {

    private ExpertInviteBuilder() {
    }

    public static MeetingExpert getExpertByRandom(Long meetingId, ExpertUserFullInfo user, Long ruleId) {
        return getExpertBasic(meetingId, user, ruleId, ExpertInviteTypeEnum.RANDOM);
    }

    private static MeetingExpert getExpertBasic(Long meetingId, ExpertUserFullInfo user, Long ruleId, ExpertInviteTypeEnum type) {
        MeetingExpert expert = new MeetingExpert();
        expert.setMeetingId(meetingId);
        expert.setMobile(user.getPhoneNo());
        expert.setExpertId(user.getId());
        expert.setExpertName(user.getExpertName());
        expert.setRuleId(ruleId);
        expert.setInviteType(type.getCode());
        return expert;
    }

    public static MeetingExpert getExpertByAppoint(Long meetingId, ExpertUserFullInfo user, Long ruleId) {
        return getExpertBasic(meetingId, user, ruleId, ExpertInviteTypeEnum.APPOINT);
    }

}
