package com.wzj.soopin.transaction.domain.bo;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.wzj.soopin.transaction.domain.po.Charge;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.dromara.common.core.domain.BaseBO;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 充值
 *
 * @author wzj
 * @date 2023-03-07
 */
@Schema(description="充值")
@Data
public class ChargeBO extends BaseBO<Charge> {

    /**
     * 主键
     */
    @Schema(description ="主键")
    private Long id;

    /**
     * 提现码
     */
    @Schema(description ="充值码")
    private String code;

    /**
     * 会员id
     */
    @Schema(description ="会员id")
    private Long memberId;



    /**
     * 金额
     */
    @Schema(description ="金额")
    private BigDecimal money;

    /**
     * 手续费
     */
    @Schema(description ="手续费")
    private BigDecimal fee;

    /**
     * 实际金额
     */
    @Schema(description ="实际金额")
    private BigDecimal actualMoney;


    /**
     * 状态
     */
    @Schema(description ="状态")
    private Integer status;
    /**
     * 类型
     */
    @Schema(description ="类型")
    private Integer type;
    /**
     * 审核人
     */
    @Schema(description ="审核人")
    private Long auditBy;

    /**
     * 审核时间
     */
    @Schema(description ="审核时间")
    private LocalDateTime auditTime;

    /**
     * 提现方式
     */
    @Schema(description ="提现方式")
    private Integer method;

    /**
     * 审核状态
     */
    @Schema(description ="审核状态")
    private Integer  auditStatus;

    @Override
    public LambdaQueryWrapper<Charge> toWrapper() {
        return super.toWrapper().eq(id!=null, Charge::getId, id)
            .eq(memberId!=null, Charge::getMemberId, memberId)
            .eq(money!=null, Charge::getMoney, money)
            .eq(fee!=null, Charge::getFee, fee)
            .eq(actualMoney!=null, Charge::getActualMoney, actualMoney)
            .eq(status!=null, Charge::getStatus, status)
            .eq(type!=null, Charge::getType, type);
    }
}
