package com.xinelu.applet.dto.appletlogin;

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 org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalTime;
import java.util.List;

/**
 * @Description 预约输入参数实体类
 * @Author 纪寒
 * @Date 2022-09-06 13:26:20
 * @Version 1.0
 */
@Data
public class AppointmentInfoDTO implements Serializable {
    private static final long serialVersionUID = 6099437044812889671L;

    /**
     * 被护理人id
     */
    @NotNull(message = "用户信息不能为空！", groups = {Insert.class, Update.class})
    private Long patientId;

    /**
     * 护理站id
     */
    @NotNull(message = "护理站信息不能为空！", groups = {Insert.class, Update.class})
    private Long stationId;

    /**
     * 护理项目id
     */
    @NotNull(message = "套餐信息不能为空！", groups = {Insert.class, Update.class})
    private Long stationItemId;

    /**
     * 护理项目价格id
     */
    private Long stationItemPriceId;

    /**
     * 服务地址
     */
    @NotBlank(message = "服务地址不能为空", groups = {Insert.class, Update.class})
    @Length(max = 200, message = "服务地址不能超过200个字符", groups = {Insert.class, Update.class})
    private String serviceAddress;

    /**
     * 服务日期
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @NotNull(message = "服务日期不能为空", groups = {Insert.class, Update.class})
    private LocalDate serviceDate;

    /**
     * 服务开始时间
     */
    @DateTimeFormat(pattern = "HH:mm")
    @JsonFormat(pattern = "HH:mm")
    @NotNull(message = "服务开始时间不能为空", groups = {Insert.class, Update.class})
    private LocalTime serviceStartTime;

    /**
     * 服务结束时间
     */
    @DateTimeFormat(pattern = "HH:mm")
    @JsonFormat(pattern = "HH:mm")
    private LocalTime serviceEndTime;

    /**
     * 护理项目名称
     */
    @NotBlank(message = "套餐名称不能为空", groups = {Insert.class, Update.class})
    @Length(max = 50, message = "套餐名称不能超过50个字符", groups = {Insert.class, Update.class})
    private String nurseItemName;

    /**
     * 护理项目价格
     */
    private BigDecimal nurseItemPrice;

    /**
     * 护理项目服务时长和单位
     */
    @Length(max = 50, message = "套餐服务时长不能超过50个字符", groups = {Insert.class, Update.class})
    private String serveDurationUnit;

    /**
     * 耗材总价格
     */
    private BigDecimal consumableTotalPrice;

    /**
     * 订单应付总价格
     */
    private BigDecimal totalPrice;

    /**
     * 备注信息
     */
    private String remark;

    /**
     * 订单数量
     */
    private Long orderCount;

    /**
     * 耗材包信息集合
     */
    private List<AppointmentConsumableDTO> orderConsumableList;

    /**
     * 下单方式，手机App：MOBILE_APP，微信小程序：WECHAT_APPLET，支付宝小程序：ALI_PAY_APPLET
     */
    @NotBlank(message = "下单方式不能为空！", groups = {Insert.class, Update.class})
    private String orderChannel;

    /**
     * 预约时间点间隔
     */
    private String appointmentTimeInterval;

    /**
     * 提前预约时长
     */
    private String advanceAppointDuration;

    /**
     * 预约时间点数量上限
     */
    private Integer appointmentLimitCount;

    /**
     * 营业时间上午开始时间
     */
    @DateTimeFormat(pattern = "HH:mm")
    @JsonFormat(pattern = "HH:mm")
    @NotNull(message = "上午营业开始时间不能为空！", groups = {Insert.class, Update.class})
    private LocalTime morningOpenStartTime;

    /**
     * 营业时间上午结束时间
     */
    @DateTimeFormat(pattern = "HH:mm")
    @JsonFormat(pattern = "HH:mm")
    @NotNull(message = "上午营业结束时间不能为空！", groups = {Insert.class, Update.class})
    private LocalTime morningOpenEndTime;

    /**
     * 营业时间下午开始时间
     */
    @DateTimeFormat(pattern = "HH:mm")
    @JsonFormat(pattern = "HH:mm")
    @NotNull(message = "下午营业开始时间不能为空！", groups = {Insert.class, Update.class})
    private LocalTime afternoonOpenStartTime;

    /**
     * 营业时间下午结束时间
     */
    @DateTimeFormat(pattern = "HH:mm")
    @JsonFormat(pattern = "HH:mm")
    @NotNull(message = "下午营业结束时间不能为空！", groups = {Insert.class, Update.class})
    private LocalTime afternoonOpenEndTime;

    /**
     * 失能情况，NOT_DISABLED：未失能，DISABLED：已失能
     */
    @NotBlank(message = "失能情况不能为空！", groups = {Insert.class, Update.class})
    private String disablingCondition;

    /**
     * 失能原因
     */
    private String disablingReason;

    /**
     * 订单佣金金额
     */
    private BigDecimal orderCommissionAmount;
}
