package com.tzy.common.dto.act;

import com.tzy.common.annotation.Sensitive;
import com.tzy.common.constant.Constants;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Date;

/**
 * @Classname ActCountParam
 * @Description 活动限流参数
 * @Date 2024/3/5 15:52
 * @Created by Administrator
 */
@Data
@Accessors(chain = true)
public class ShareRecordDTO implements Serializable {
    /**活动id*/
    private Integer actId;
    private BigDecimal actAmount;
    private Integer shareUserId;
    @Sensitive
    private String shareName;
    private String shareAvatar;
    private String pointType;
    private String pointTypeMsg;
    private String name;
    private Date createTime;
    /**是否是分享*/
    private boolean shareAble;
    /**分享用户等级*/
    private Integer shareMemberLevel;

    public BigDecimal getActAmount() {
        if (actAmount == null) {
            actAmount = BigDecimal.ZERO;
        }
        return actAmount.divide(Constants.HUNDRED, 2, RoundingMode.HALF_UP);
    }
}
