package com.ics.admin.domain.meeting;

import com.baomidou.mybatisplus.annotation.IEnum;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ics.common.core.domain.BaseEntity;
import lombok.Data;
import java.util.Date;
import java.util.List;

/**
 * 预约记录对象 tb_reservation
 * 
 * @author chen
 * @date 2024-02-25
 */
@Data
@TableName("tb_reservation")
public class Reservation extends BaseEntity<Reservation> {
    private static final long serialVersionUID = 1L;

    /** 会议主体id */
    private Long roomContentId;

    /** 用户id */
    private Long userId;

    @TableField(exist = false)
    private String userName;

    @TableField(exist = false)
    private String phone;

    /** 优惠卷id */
    private Long ticketId;

    private Integer personNum;

    @TableField(exist = false)
    private String ticketName;

    @TableField(exist = false)
    private String avatar;

    /** 企业id */
    private Long customerId;

    /** 主题（会议主题、展厅主题） */
    private String title;

    @TableField(exist = false)
    private String statusName;

    @TableField(exist = false)
    private Integer statusValue;

    @TableField(exist = false)
    private List<ReservationPerson> reservationPersonList;

    @TableField(exist = false)
    private List<ReservationServe> reservationServes;

    /** 预约状态   0待支付，1.已预约，2.进行中，3已结束，4.已取消 */
    private Status stauts;
    public enum Status implements IEnum<Integer> {
        TO_BE_PAID("待支付", 0),

        /**
         * 报名中
         */
        APPOINTMENT("待使用", 1),

        /**
         * 活动未开始
         */
        ONGOING("进行中", 2),


        /**
         * 已满额
         */
        ENDED("已结束", 3),

        /**
         * 已满额
         */
        CANCELED("已取消", 4);


        private String name;
        private int value;

        Status(String name, int value) {
            this.name = name;
            this.value = value;
        }

        @Override
        public Integer getValue() {
            return this.value;
        }

        public String getName() {
            return this.name;
        }

        public static Status parse(Integer value) {
            for (Status status : values()) {
                if (status.getValue().equals(value)) {
                    return status;
                }
            }
            return null;
        }
    }

    /** 是否申请售后0否1是 */
    private String isAfterSale;

    /** 订单号 */
    private String oderNumber;

    /** 订单价格 */
    private String orderMoney;

    private String prepayId;

    /** 订单取消时间 */
    private Date cancelTime;

    private Date orderTime;

    /** 订单取消原因 */
    private String cancelResaon;

    /** 参观目的：1领导视察，2参观学习，3合作调研，4同行交流 */
    private String visitType;

    /** 讲解需求：1需要，0不需要 */
    private String explainNeedType;

    /** 会议室需求：1需要，0不需要 */
    private String meetingNeedType;

    /** 会议室id */
//    private Long meetingId;

    /** 摄影需求：1需要，0不需要 */
    private String photographType;

    /** 预约-开始时间 */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;

    /** 预约-结束时间 */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endDate;

    /** 备注 */
    private String remake;


    private Long serveId;

    private String reservationNumber;

    @TableField(exist = false)
    private RoomContent roomContent;

    @TableField(exist = false)
    private Long equipmentId;

    @TableField(exist = false)
    private String customerName;

    @TableField(exist = false)
    private Long duration;

    @TableField(exist = false)
    private String isPay;

    @TableField(exist = false)
    private Long buildingId;

    @TableField(exist = false)
    private String parkName;

    @TableField(exist = false)
    private String TenantName;

    @TableField(exist = false)
    private String roomName;

    @TableField(exist = false)
    private String buildingName;

    @TableField(exist = false)
    private String buildName;

    private String createBy;


    private Date createTime;


}
