package com.gxwebsoft.shop.entity;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 用户优惠券
 *
 * @author 科技小王子
 * @since 2025-08-11 23:51:41
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Schema(name = "ShopUserCoupon对象", description = "用户优惠券")
public class ShopUserCoupon implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(description = "id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "优惠券模板ID")
    private Integer couponId;

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

    @Schema(description = "优惠券名称")
    private String name;

    @Schema(description = "优惠券描述")
    private String description;

    @Schema(description = "优惠券类型(10满减券 20折扣券 30免费劵)")
    private Integer type;

    @Schema(description = "满减券-减免金额")
    private BigDecimal reducePrice;

    @Schema(description = "折扣券-折扣率(0-100)")
    private Integer discount;

    @Schema(description = "最低消费金额")
    private BigDecimal minPrice;

    @Schema(description = "适用范围(10全部商品 20指定商品 30指定分类)")
    private Integer applyRange;

    @Schema(description = "到期类型(10领取后生效 20固定时间)")
    private Integer expireType;

    @Schema(description = "领取后生效-有效天数")
    private Integer expireDay;

    @Schema(description = "适用范围配置(json格式)")
    private String applyRangeConfig;

    @Schema(description = "是否过期(0未过期 1已过期)")
    private Integer isExpire;

    @Schema(description = "有效期开始时间")
    private LocalDateTime startTime;

    @Schema(description = "有效期结束时间")
    private LocalDateTime endTime;

    @Schema(description = "使用状态(0未使用 1已使用 2已过期)")
    private Integer status;

    @Schema(description = "使用时间")
    private LocalDateTime useTime;

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

    @Schema(description = "是否已使用")
    private Integer isUse;

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

    @Schema(description = "获取方式(10主动领取 20系统发放 30活动赠送)")
    private Integer obtainType;

    @Schema(description = "获取来源描述")
    private String obtainSource;

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

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

    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    @Schema(description = "修改时间")
    private LocalDateTime updateTime;

    @TableField(exist = false)
    private ShopCoupon couponItem;

}
