package com.miraclegarden.smsmessage.mmp;

/**
 * 单个红包领取人。
 */
public class MmpClaim {
    public String nickname;
    /** TNG receiverId，重名时用来区分 */
    public String userId;
    /** activityPoolId（单次领取池条目） */
    public String poolId;
    public String amountText;
    public double amount;
    public String claimTime;
    public int rank;

    public MmpClaim() {
    }

    public MmpClaim(String nickname, double amount, String claimTime) {
        this.nickname = nickname;
        this.amount = amount;
        this.amountText = String.format(java.util.Locale.US, "%.2f", amount);
        this.claimTime = claimTime != null ? claimTime : "";
    }

    public String shortUserId() {
        if (userId == null || userId.isEmpty()) {
            return "";
        }
        return userId.length() <= 10 ? userId : userId.substring(0, 8) + "…";
    }
}
