package com.czg.account.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.Data;
import lombok.NoArgsConstructor;

/**
 * 活动商品赠送记录表 实体类。
 *
 * @author ww
 * @since 2025-02-20
 */
@Data

@NoArgsConstructor
@AllArgsConstructor
@Table("tb_shop_activate_coupon_record")
public class ShopActivateCouponRecord implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

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

    /**
     * 用户id shopUserId
     */
    private Long shopUserId;

    /**
     * 卷Id (校验是否可用)
     */
    private Long couponId;

    /**
     * 卷描述 满10减2/商品卷
     */
    private String name;

    /**
     * 1-满减  2-商品
     */
    private Integer type;

    /**
     * 商品id
     */
    private Long proId;

    /**
     * 满多少金额
     */
    private BigDecimal fullAmount;

    /**
     * 减多少金额
     */
    private BigDecimal discountAmount;

    /**
     * 店铺id
     */
    private Long shopId;
    @Column(ignore = true)
    private String shopName;

    /**
     * 来源活动id
     */
    private Long sourceActId;

    private Long sourceFlowId;

    /**
     * 可用开始时间
     */
    private LocalDateTime useStartTime;

    /**
     * 可用结束时间
     */
    private LocalDateTime useEndTime;

    @Column(onInsertValue = "now()")
    private LocalDateTime createTime;

    @Column(onInsertValue = "now()", onUpdateValue = "now()")
    private LocalDateTime updateTime;

    private String couponJson;

    /**
     * invited 邀请
     * activate 活动
     */
    private String source;

    /**
     * 未使用 0
     * 已使用 1
     * 已过期 2
     */
    private Integer status;
    private Long targetId;

}
