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 OrgMyAppointmentTestSamples
{
    public static final Long ORG_PROVIDER_ID = 301L;

    public static final Long SYS_USER_ID = 2L;

    public static final Long OTHER_PROVIDER_ID = 302L;

    private OrgMyAppointmentTestSamples()
    {
    }

    public static BizMedicalResource boundOrgResource()
    {
        BizMedicalResource row = new BizMedicalResource();
        row.setId(ORG_PROVIDER_ID);
        row.setResourceType(MedicalResourceRules.RESOURCE_TYPE_ORG);
        row.setResourceName("测试诊疗机构");
        row.setSysUserId(SYS_USER_ID);
        row.setAccountAssigned(MedicalResourceRules.ACCOUNT_ASSIGNED_YES);
        row.setDelFlag(MedicalResourceRules.DEL_FLAG_NORMAL);
        return row;
    }

    public static BizServiceAppointment bookedAppointment()
    {
        BizServiceAppointment row = baseAppointment();
        row.setId(2000L);
        row.setStatus(ServiceAppointmentRules.STATUS_BOOKED);
        return row;
    }

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

    public static BizServiceAppointment completedAppointment()
    {
        BizServiceAppointment row = baseAppointment();
        row.setId(2002L);
        row.setStatus(ServiceAppointmentRules.STATUS_COMPLETED);
        return row;
    }

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

    private static BizServiceAppointment baseAppointment()
    {
        BizServiceAppointment row = new BizServiceAppointment();
        row.setProviderType(ServiceAppointmentRules.PROVIDER_TYPE_ORG);
        row.setProviderId(ORG_PROVIDER_ID);
        row.setAppointeeName("才让");
        row.setAppointDate(today());
        row.setTimeStart("14:00");
        row.setTimeEnd("15:00");
        row.setContactPhone("13900139001");
        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();
    }
}
