package shop.alien.entity.store;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDate;
import java.util.Date;

/**
 * <p>
 * 优惠券商户发放好友优惠券关系表
 * </p>
 *
 * @author ssk
 * @since 2025-02-19
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "LifeDiscountCouponStoreFriend对象", description = "优惠券商户发放好友优惠券关系表	")
@TableName("life_discount_coupon_store_friend")
public class LifeDiscountCouponStoreFriend extends Model<LifeDiscountCouponStoreFriend> {

    private static final long serialVersionUID = 1L;

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

    @ApiModelProperty(value = "【兼容旧列】接收方店铺，与 receiver_store_id 一致，对应库字段 store_user_id（命名易误导）")
    @TableField("store_user_id")
    private Integer storeUserId;

    @ApiModelProperty(value = "券id，优惠券时使用（life_discount_coupon.id）")
    @TableField("coupon_id")
    private Integer couponId;

    @ApiModelProperty(value = "代金券id，代金券时使用（life_coupon.id）")
    @TableField("voucher_id")
    private String voucherId;

    @ApiModelProperty(value = "【兼容旧列】赠送方商户用户(store_user.id)，与 sender_user_id 一致")
    @TableField("friend_store_user_id")
    private Integer friendStoreUserId;

    @ApiModelProperty(value = "接收方店铺(store_info.id)")
    @TableField("receiver_store_id")
    private Integer receiverStoreId;

    @ApiModelProperty(value = "接收方商户用户(store_user.id)，可为空")
    @TableField("receiver_user_id")
    private Integer receiverUserId;

    @ApiModelProperty(value = "赠送方店铺(store_info.id)")
    @TableField("sender_store_id")
    private Integer senderStoreId;

    @ApiModelProperty(value = "赠送方商户用户(store_user.id)")
    @TableField("sender_user_id")
    private Integer senderUserId;

    @ApiModelProperty(value = "有效期（天）")
    @TableField("expiration_date")
    private Integer expirationDate;

    @ApiModelProperty(value = "领取后是否长期有效：0-否，1-是（赠券时自优惠券模板快照）")
    @TableField("long_term_valid")
    private Integer longTermValid;

    @ApiModelProperty(value = "开始日期")
    @TableField("start_date")
    private LocalDate startDate;

    @ApiModelProperty(value = "结束日期")
    @TableField("end_date")
    private LocalDate endDate;

    @ApiModelProperty(value = "库存（优惠券数量）")
    @TableField("single_qty")
    private Integer singleQty;

    @ApiModelProperty(value = "删除状态")
    @TableField("delete_flag")
    @TableLogic
    private Integer deleteFlag;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    private Date createdTime;

    @ApiModelProperty(value = "更新时间")
    @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
    private Date updatedTime;

    @ApiModelProperty(value = "创建人ID")
    @TableField(value = "created_user_id", fill = FieldFill.INSERT)
    private Integer createdUserId;

    @ApiModelProperty(value = "修改人ID")
    @TableField(value = "updated_user_id", fill = FieldFill.INSERT_UPDATE)
    private Integer updatedUserId;

    @ApiModelProperty(value = "发布状态：0 未发布，1发布")
    @TableField("release_type")
    private Integer releaseType;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
