package shop.alien.entity.store;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * 用户行为奖励规则配置表
 * 
 * @author system
 * @since 2025-01-XX
 */
@Data
@JsonInclude
@TableName("user_action_reward_rule")
@ApiModel(value = "UserActionRewardRule", description = "用户行为奖励规则配置表（3级树形结构）")
public class UserActionRewardRule {

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

    @ApiModelProperty(value = "父节点ID，0表示根节点（第一级：角色）")
    @TableField("parent_id")
    private Integer parentId;

    @ApiModelProperty(value = "层级：1-角色，2-行为，3-奖励")
    @TableField("level")
    private Integer level;

    @ApiModelProperty(value = "名称：根据level区分，1-角色名，2-行为名，3-奖励名")
    @TableField("name")
    private String name;

    @ApiModelProperty(value = "奖励数量：如1优惠券、2红包（仅第三级使用）")
    @TableField("reward_amount")
    private Integer rewardAmount;

    @ApiModelProperty(value = "状态：0-禁用，1-启用")
    @TableField("status")
    private Integer status;

    @ApiModelProperty(value = "排序：数值越大越靠前")
    @TableField("sort_order")
    private Integer sortOrder;

    @ApiModelProperty(value = "备注")
    @TableField("remark")
    private String remark;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createdTime;

    @ApiModelProperty(value = "创建人ID")
    @TableField("created_user_id")
    private Integer createdUserId;

    @ApiModelProperty(value = "修改时间")
    @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updatedTime;

    @ApiModelProperty(value = "修改人ID")
    @TableField("updated_user_id")
    private Integer updatedUserId;

    @ApiModelProperty(value = "删除标记, 0:未删除, 1:已删除")
    @TableField("delete_flag")
    @TableLogic
    private Integer deleteFlag;
}

