package com.ruoyi.info.order.domain.bo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.validate.EditGroup;
import com.ruoyi.info.order.enums.OrderStatus;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 订单业务对象 tb_order
 *
 * @author ruoyi
 * @date 2025-09-20
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel("订单业务对象")
public class OrderBo extends BaseEntity {

    /**
     * ID
     */
    @ApiModelProperty(value = "ID", required = true)
    private Long id;

    /**
     * 订单号
     */
    @ApiModelProperty(value = "订单号", required = true)
    private String orderNo;

    /**
     * C端用户ID
     */
    @ApiModelProperty(value = "C端用户ID", required = true)
    private Long userId;
    @ApiModelProperty(value = "C端用户手机号")
    private String userMobile;

    /**
     * 状态
     */
    @ApiModelProperty(value = "状态", required = true)
    private OrderStatus status;

    /**
     * 医院ID
     */
    @ApiModelProperty(value = "医院ID", required = true)
    @NotNull(message = "医院ID不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long hospitalId;

    /**
     * 医院科室ID
     */
    @ApiModelProperty(value = "医院科室ID", required = true)
    @NotNull(message = "医院科室ID不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long hospitalDepartmentId;
    private List<Long> hospitalDepartmentIds;

    /**
     * 房床号
     */
    @ApiModelProperty(value = "房床号", required = true)
    private String roomNumber;

    /**
     * 订单备注
     */
    @ApiModelProperty(value = "订单备注", required = true)
    private String remarks;

    /**
     * 就诊人ID
     */
    @ApiModelProperty(value = "就诊人ID", required = true)
    @NotNull(message = "就诊人ID不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long patientId;

    /**
     * 服务ID
     */
    @ApiModelProperty(value = "服务ID", required = true)
    @NotNull(message = "服务ID不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long serviceId;
    @ApiModelProperty("服务名称")
    private String serviceName;
    /**
     * 期望时间
     */
    @ApiModelProperty(value = "期望时间", required = true)
    private Date expectedTime;

    /**
     * 下单数量
     */
    @ApiModelProperty(value = "下单数量", required = true)
    @NotNull(message = "下单数量不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer orderNum;

    /**
     * 销售价
     */
    @ApiModelProperty(value = "销售价", required = true)
    private BigDecimal sellingPrice;

    /**
     * 应付价格
     */
    @ApiModelProperty(value = "应付价格", required = true)
    private BigDecimal totalPrice;
    /**
     * 护工ID
     */
    @ApiModelProperty(value = "护工ID", required = true)
    private Long workerId;

    /**
     * 开始日期(查询用)
     */
    @ApiModelProperty(value = "开始日期(查询用)", required = true)
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date startTime;

    /**
     * 结束日期(查询用)
     */
    @ApiModelProperty(value = "结束日期(查询用)", required = true)
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endTime;

    @ApiModelProperty(value = "是否评价过")
    private Boolean isReviewed;
}
