package com.zhongshu.card.client.model.wallet;

import com.zhongshu.card.client.model.base.SuperModel;
import com.zhongshu.card.client.model.org.UserCountModel;
import com.zhongshu.card.client.type.DataState;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

/**
 * @author TRX
 * @date 2024/6/28
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class WalletModel extends SuperModel {
    @Schema(description = "用户userId")
    private String userId;

    @Schema(description = "用户信息")
    private UserCountModel userAccount;

    @Schema(description = "可用金额")
    private BigDecimal amount = BigDecimal.ZERO;

    @Schema(description = "钱包状态：是否可用")
    private DataState dataState = DataState.Enable;

    private String dataStateStr;

    public String getDataStateStr() {
        if (dataState != null) {
            return dataState.getRemark();
        }
        return "";
    }
}
