package com.ruoyi.web.modules.diagnosis;

import java.util.Calendar;
import java.util.Date;
import com.ruoyi.web.modules.diagnosis.domain.BizMedicalResource;
import com.ruoyi.web.modules.diagnosis.domain.BizServiceAppointment;
import com.ruoyi.web.modules.diagnosis.support.MedicalResourceRules;
import com.ruoyi.web.modules.diagnosis.support.ServiceAppointmentRules;

/**
 * 我的预约（兽医）测试样本。
 */
public final class VetMyAppointmentTestSamples
{
    public static final Long VET_PROVIDER_ID = 101L;

    public static final Long SYS_USER_ID = 1L;

    public static final Long OTHER_PROVIDER_ID = 202L;

    private VetMyAppointmentTestSamples()
    {
    }

    public static BizMedicalResource boundVetResource()
    {
        BizMedicalResource row = MedicalResourceTestSamples.sampleVetDraft();
        row.setId(VET_PROVIDER_ID);
        row.setSysUserId(SYS_USER_ID);
        row.setAccountAssigned(MedicalResourceRules.ACCOUNT_ASSIGNED_YES);
        return row;
    }

    public static BizServiceAppointment pendingAppointment()
    {
        BizServiceAppointment row = baseAppointment();
        row.setId(1000L);
        row.setStatus(ServiceAppointmentRules.STATUS_PENDING);
        return row;
    }

    public static BizServiceAppointment confirmedAppointment()
    {
        BizServiceAppointment row = baseAppointment();
        row.setId(1001L);
        row.setStatus(ServiceAppointmentRules.STATUS_CONFIRMED);
        return row;
    }

    public static BizServiceAppointment cancelledAppointment()
    {
        BizServiceAppointment row = baseAppointment();
        row.setId(1002L);
        row.setStatus(ServiceAppointmentRules.STATUS_CANCELLED);
        return row;
    }

    public static BizServiceAppointment rejectedAppointment()
    {
        BizServiceAppointment row = baseAppointment();
        row.setId(1003L);
        row.setStatus(ServiceAppointmentRules.STATUS_REJECTED);
        row.setRejectReason("时段冲突");
        return row;
    }

    private static BizServiceAppointment baseAppointment()
    {
        BizServiceAppointment row = new BizServiceAppointment();
        row.setProviderType(ServiceAppointmentRules.PROVIDER_TYPE_VET);
        row.setProviderId(VET_PROVIDER_ID);
        row.setAppointeeName("扎西");
        row.setAppointDate(today());
        row.setTimeStart("09:00");
        row.setTimeEnd("10:00");
        row.setContactPhone("13800138001");
        row.setServiceAddress("巴青县某某乡");
        row.setServiceRequirement("上门诊疗");
        return row;
    }

    private static Date today()
    {
        Calendar cal = Calendar.getInstance();
        cal.set(Calendar.HOUR_OF_DAY, 0);
        cal.set(Calendar.MINUTE, 0);
        cal.set(Calendar.SECOND, 0);
        cal.set(Calendar.MILLISECOND, 0);
        return cal.getTime();
    }
}
