package com.gxwebsoft.common.system.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 订单商品
 *
 * @author 科技小王子
 * @since 2024-10-26 12:18:05
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Schema(name = "OrderGoods对象", description = "订单商品")
@TableName("sys_order_goods")
public class OrderGoods implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(description = "订单号")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @Schema(description = "订单类型，0商城 1应用插件")
    private Integer type;

    @Schema(description = "订单号")
    private Integer orderId;

    @Schema(description = "项目ID")
    private Integer itemId;

    @Schema(description = "插件ID")
    private Integer menuId;

    @Schema(description = "实际付款")
    private BigDecimal payPrice;

    @Schema(description = "购买时长")
    private Integer month;

    @Schema(description = "购买数量")
    private Integer totalNum;

    @Schema(description = "0未付款，1已付款")
    private Boolean payStatus;

    @Schema(description = "0未完成，1已完成，2已取消，3取消中，4退款申请中，5退款被拒绝，6退款成功，7客户端申请退款")
    private Integer orderStatus;

    @Schema(description = "预约详情开始时间数组")
    private String startTime;

    @Schema(description = "是否已开具发票：0未开发票，1已开发票，2不能开具发票")
    private Boolean isInvoice;

    @Schema(description = "发票流水号")
    private String invoiceNo;

    @Schema(description = "支付时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date payTime;

    @Schema(description = "过期时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date expirationTime;

    @Schema(description = "用户id")
    private Integer userId;

    @Schema(description = "应用名称")
    private String appName;

    @Schema(description = "产品控制台")
    private String adminUrl;

    @Schema(description = "备注")
    private String comments;

    @Schema(description = "排序号")
    private Integer sortNumber;

    @Schema(description = "是否删除, 0否, 1是")
    @TableLogic
    private Integer deleted;

    @Schema(description = "租户id")
    private Integer tenantId;

    @Schema(description = "修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @Schema(description = "应用名称")
    @TableField(exist = false)
    private String tenantName;

    @Schema(description = "应用图标")
    @TableField(exist = false)
    private String logo;
}
