package com.czg.market.entity;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

import java.io.Serial;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * 积分商品设置 实体类。
 *
 * @author ww
 * @since 2025-12-08
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table("mk_points_goods")
@Accessors(chain = true)
public class MkPointsGoods implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @Id(keyType = KeyType.Auto)
    private Long id;

    /**
     * 店铺id
     */
    private Long shopId;
    /**
     * 商品类型 优惠劵 其它商品
     */
    private String goodsCategory;

    /**
     * 优惠券id
     */
    private Long couponId;
    /**
     * 商品名称
     */
    private String goodsName;

    /**
     * 商品图片URL
     */
    private String goodsImageUrl;

    /**
     * 所需积分
     */
    private Integer requiredPoints;

    /**
     * 额外价格
     */
    private BigDecimal extraPrice;

    /**
     * 数量
     */
    private Integer quantity;

    /**
     * 排序(权重)，数字越高，显示约靠前
     */
    private Integer sort;

    /**
     * 是否上架 1-是 0-否
     */
    private Integer status;

    /**
     * 领取方式 店内自取、系统发放
     */
    private String receiveType;

    /**
     * 限购数量
     */
    private Integer limitQuota;
    /**
     * 已购数量
     */
    @Column(ignore = true)
    private Integer boughtCount;

    /**
     * 商品详情
     */
    private String goodsDescription;

    /**
     * 累计兑换数量
     */
    private Integer totalExchangeCount;

    /**
     * 创建时间
     */
    @Column(onInsertValue = "now()")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @Column(onInsertValue = "now()", onUpdateValue = "now()")
    private LocalDateTime updateTime;

    /**
     * 逻辑删除标志 1-是 0-否
     */
    private Integer delFlag;
    /**
     * 优惠券信息
     */
    @Column(ignore = true)
    private ShopCoupon couponInfo;


}
