package com.sonic.lion.lib.output;

import lombok.*;

/**
 * 账号余额
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AccountBuffOutput {

    /**
     * 用户id
     */
    private Long uid;

    /**
     * 可消费金额
     */
    private Long balance;

    /**
     * 可提现收入
     */
    private Long withdrawableIncome;

    /**
     * 待入账收入
     */
    private Long awaitingIncome;

    /**
     * 冻结收入
     */
    private Long frozenIncome;

    /**
     * 冻结余额
     */
    private Long frozenBalance;

    /**
     * 总充值
     */
    private long rechargeTotal;

    /**
     * 在途的 提现金额
     */
    private Long withdrawOnGoing;

    /**
     * 状态
     */
    private Status status;

    @Getter
    public enum Status {

        ENABLE(0, "ENABLE"),

        DISABLE(1, "DISABLE"),
        ;

        private final int value;

        private final String desc;

        Status(int value, String desc) {
            this.value = value;
            this.desc = desc;
        }
    }

    /**
     * 获取总金额
     *
     * @return
     */
    public long getTotalAmount() {
        return this.getBalance() + this.getWithdrawableIncome() + this.getAwaitingIncome() + this.getFrozenIncome();
    }
}