package com.haha.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

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

@Data
@TableName("t_invite_activity")
public class InviteActivity implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.ASSIGN_ID)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    private String activityName;

    private String activityDesc;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private LocalDateTime startTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private LocalDateTime endTime;

    /**
     * 状态：0-草稿 1-已发布 2-进行中 3-已暂停 4-已结束
     */
    private Integer status;

    /**
     * 邀请人奖励优惠券模板ID
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long couponTemplateId;

    /**
     * 被邀请人奖励优惠券模板ID（双向奖励时使用）
     */
    @TableField("invitee_coupon_template_id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long inviteeCouponTemplateId;

    /**
     * 每人每日最大邀请数
     */
    private Integer dailyLimit;

    /**
     * 每人活动期间最大邀请总数
     */
    private Integer totalLimit;

    /**
     * 是否要求完成首单：0-否 1-是
     */
    private Integer requireFirstOrder;

    /**
     * 首单最低金额要求
     */
    private BigDecimal minOrderAmount;

    /**
     * 邀请码前缀
     */
    private String inviteCodePrefix;

    /**
     * 适用范围：1-全平台 2-指定门店
     */
    private Integer applyScope;

    /**
     * 商品范围：1-全部商品 2-指定商品
     */
    private Integer productScope;

    /**
     * 总邀请次数
     */
    private Integer totalInviteCount;

    /**
     * 有效邀请数
     */
    private Integer validInviteCount;

    /**
     * 奖励发放总数
     */
    private Integer rewardCount;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long creatorId;

    private String creatorName;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private LocalDateTime createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private LocalDateTime updateTime;

    private Integer deleted;

    @TableField(exist = false)
    private String statusLabel;

    @TableField(exist = false)
    private String applyScopeLabel;

    @TableField(exist = false)
    private String productScopeLabel;
}
