package com.gxwebsoft.glt.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 我的水票
 *
 * @author 科技小王子
 * @since 2026-02-03 18:55:55
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Schema(name = "GltUserTicket对象", description = "我的水票")
@TableName("glt_user_ticket")
public class GltUserTicket implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @Schema(description = "模板ID")
    private Integer templateId;

    @Schema(description = "模板名称")
    @TableField(exist = false)
    private String templateName;

    @Schema(description = "商品ID")
    private Integer goodsId;

    @Schema(description = "购买价格")
    @TableField(exist = false)
    private BigDecimal payPrice;

    @Schema(description = "商品名称")
    @TableField(exist = false)
    private String goodsName;

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

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

    @Schema(description = "订单商品ID")
    private Integer orderGoodsId;

    @Schema(description = "订单商品数量")
    private Integer orderGoodsQty;

    @Schema(description = "总数量")
    private Integer totalQty;

    @Schema(description = "可用数量")
    private Integer availableQty;

    @Schema(description = "冻结数量")
    private Integer frozenQty;

    @Schema(description = "已使用数量")
    private Integer usedQty;

    @Schema(description = "已释放数量")
    private Integer releasedQty;

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

    @Schema(description = "用户昵称")
    @TableField(exist = false)
    private String nickname;

    @Schema(description = "用户头像")
    @TableField(exist = false)
    private String avatar;

    @Schema(description = "用户手机号")
    @TableField(exist = false)
    private String phone;

    @Schema(description = "订单状态")
    @TableField(exist = false)
    private Integer orderStatus;

    @Schema(description = "排序(数字越小越靠前)")
    private Integer sortNumber;

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

    @Schema(description = "状态, 0正常, 1冻结")
    private Integer status;

    @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 LocalDateTime createTime;

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

}
