package com.xinelu.applet.vo.healthconsultation;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinelu.common.custominterface.Insert;
import com.xinelu.common.custominterface.Update;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * @author ljh
 * @version 1.0
 * Create by 2023/3/8 13:59
 */
@Data
public class HealthConsultationOrderDTO implements Serializable {
    private static final long serialVersionUID = 8664995394794180987L;

    /**
     * 主键id
     */
    private Long id;

	/**
	 * 会诊信息表id
	 */
	private Long consultationInfoId;

    /**
     * 商品订单表id
     */
    private Long goodsOrderId;

    /**
     * 订单编号
     */
    private String orderNo;

    /**
     * 0：否，1：是
     */
    private Integer delFlag;

    /**
     * 会员id
     */
    @NotNull(message = "咨询人员信息不能为空！", groups = {Insert.class, Update.class})
    private Long patientId;

    /**
     * 订单状态，待付款：WAIT_PAY，已付款：PAY，已取消：CANCEL，待收货：WAIT_RECEIVED，已收货：RECEIVED，待退款：WAIT_REFUND，已退款：REFUNDED，待退货：WAIT_RETURNED，已退货：RETURNED
     */
    private String orderStatus;

    /**
     * 订单总金额
     */
    @NotNull(message = "金额不能为空", groups = {Insert.class, Update.class})
    private BigDecimal totalPrice;

    /**
     * 收货人
     */
    @NotBlank(message = "姓名不能为空", groups = {Insert.class, Update.class})
    @Length(max = 20, message = "姓名不能超过20位", groups = {Insert.class, Update.class})
    private String receiver;

    /**
     * 联系电话
     */
    @NotBlank(message = "联系电话不能为空", groups = {Insert.class, Update.class})
    @Length(max = 11, message = "联系电话不能超过11位", groups = {Insert.class, Update.class})
    private String phone;

    /**
     * 下单时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime orderTime;
    /**
     * 下单方式，手机App：MOBILE_APP，微信小程序：WECHAT_APPLET，支付宝小程序：ALI_PAY_APPLET
     */
    @NotNull(message = "下单方式不能为空", groups = {Insert.class, Update.class})
    private String orderChannel;

    /**
     * 护理站：NURSE_STATION，商城：SHOPPING_MALL，健康咨询：HEALTH_CONSULTATION
     */
    private String buySource;

    /**
     * 订单类型，积分兑换：INTEGRAL_EXCHANGE，直接购买：DIRECT_BUY，健康咨询：HEALTH_CONSULTATION
     */
    private String orderType;

    /**
     * 健康咨询人员表id，记录咨询订单中选择的医生，健康咨询订单使用
     */
    @NotNull(message = "请选择咨询的专家！", groups = {Insert.class, Update.class})
    private Long hospitalPersonId;

    /**
     * 商品原始金额，即：商品数量 * 商品单价
     */
    private BigDecimal originalTotalPrice;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    /**
     * 健康咨询预约时间，健康咨询订单使用
     **/
    @JsonFormat(pattern = "yyyy-MM-dd")
    @NotNull(message = "服务日期不能为空", groups = {Insert.class, Update.class})
    private Date healthAppointDate;

    /**
     * 健康咨询内容，健康咨询类型的订单使用
     */
    private String healthConsultationContent;

    /**
     * 健康咨询专家，记录咨询订单中选择的医生姓名，健康咨询订单使用
     */
    @NotBlank(message = "请选择咨询的专家！", groups = {Insert.class, Update.class})
    private String hospitalPersonName;
}
