package com.kym.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * 专属充值优惠活动
 *
 * @author skyline
 * @since 2026-06-03
 */
@Getter
@Setter
@TableName("t_recharge_promotion")
@Accessors(chain = true)
public class RechargePromotion extends BaseEntity {

    public static final int TARGET_ALL = 1;
    public static final int TARGET_SPECIFIC = 2;

    public static final int STATUS_DISABLED = 0;
    public static final int STATUS_ENABLED = 1;

    /**
     * 活动标题
     */
    private String title;

    /**
     * 充值金额（分）
     */
    private Integer rechargeAmount;

    /**
     * 赠送金额（分）
     */
    private Integer grantsAmount;

    /**
     * 目标用户ID列表（JSON数组），TARGET_ALL时可为null
     */
    private String targetUserIds;

    /**
     * 目标模式: 1=所有人, 2=指定用户
     */
    private Integer targetMode;

    /**
     * 活动开始时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime startTime;

    /**
     * 活动结束时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime endTime;

    /**
     * 状态: 0=禁用, 1=启用
     */
    private Integer status;

    /**
     * 二维码场景值（唯一标识）
     */
    private String token;

    /**
     * 二维码图片URL
     */
    private String qrCodeUrl;
}
