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 lombok.Data;
import lombok.EqualsAndHashCode;

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

/**
 * 租户订阅订单
 *
 * @author WebSoft
 * @since 2025-12-12
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Schema(name = "TenantSubscriptionOrder对象", description = "租户订阅订单")
@TableName("sys_tenant_subscription_order")
public class TenantSubscriptionOrder implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(description = "订单ID")
    @TableId(value = "order_id", type = IdType.AUTO)
    private Long orderId;

    @Schema(description = "订单编号")
    private String orderNo;

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

    @Schema(description = "套餐ID")
    private Integer packageId;

    @Schema(description = "套餐名称")
    private String packageName;

    @Schema(description = "版本号")
    private Integer version;

    @Schema(description = "支付周期 1月付 3季付 12年付")
    private Integer payType;

    @Schema(description = "原价")
    private BigDecimal originalPrice;

    @Schema(description = "优惠金额")
    private BigDecimal discountPrice;

    @Schema(description = "实付金额")
    private BigDecimal actualPrice;

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

    @Schema(description = "到期时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date endTime;

    @Schema(description = "是否试用 0否 1是")
    private Integer isTrial;

    @Schema(description = "是否续费 0首购 1续费")
    private Integer isRenewal;

    @Schema(description = "是否升级 0否 1是")
    private Integer isUpgrade;

    @Schema(description = "升级前版本")
    private Integer oldVersion;

    @Schema(description = "支付方式 wxpay/alipay/balance")
    private String paymentMethod;

    @Schema(description = "支付流水号")
    private String paymentId;

    @Schema(description = "支付时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date paymentTime;

    @Schema(description = "订单状态 0待支付 1已支付 2已激活 3已取消 4已退款")
    private Integer orderStatus;

    @Schema(description = "取消原因")
    private String cancelReason;

    @Schema(description = "操作用户ID")
    private Integer userId;

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

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