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;

/**
 * 店铺当前平台会员卡状态（每店一行）
 */
@Data
@JsonInclude
@TableName("platform_shop_membership")
@ApiModel(value = "PlatformShopMembership", description = "店铺平台会员卡状态")
public class PlatformShopMembership {

    @TableId(type = IdType.AUTO)
    private Integer id;

    @TableField("store_id")
    @ApiModelProperty("门店ID")
    private Integer storeId;

    @TableField("first_open_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty("首次开通时间")
    private Date firstOpenTime;

    @TableField("current_period_start")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty("当前会员周期开始")
    private Date currentPeriodStart;

    @TableField("expiry_date")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty("当前到期时间")
    private Date expiryDate;

    @TableField("current_plan_id")
    @ApiModelProperty("当前有效会员对应的方案ID（支付成功写入，与 platform_shop_membership_plan.id 对应）")
    private Integer currentPlanId;

    @TableField("weekly_promotion_remaining")
    @ApiModelProperty("每周推广剩余次数")
    private Integer weeklyPromotionRemaining;

    @TableField("monthly_computing_power_remaining")
    @ApiModelProperty("每月算力剩余")
    private Integer monthlyComputingPowerRemaining;

    @TableLogic
    @TableField("delete_flag")
    private Integer deleteFlag;

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

    @TableField("created_user_id")
    private Integer createdUserId;

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

    @TableField("updated_user_id")
    private Integer updatedUserId;
}
