package cn.reghao.tnb.user.app.model.po;

import cn.reghao.jutil.jdk.db.BaseObject;
import cn.reghao.tnb.common.auth.UserContext;
import cn.reghao.tnb.user.api.dto.ChargeReq;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * @author reghao
 * @date 2024-07-06 11:25:29
 */
@AllArgsConstructor
@NoArgsConstructor
@Getter
public class WalletCharge extends BaseObject<Integer> {
    private Long chargeId;
    private Double quantity;
    private Long owner;
    private Integer status;

    public WalletCharge(long chargeId, ChargeReq chargeReq) {
        this.chargeId = chargeId;
        this.quantity = chargeReq.getQuantity();
        this.owner = UserContext.getUser();
        this.status = 1;
    }
}
