package com.izouma.nineth.dto.wallet;

import com.izouma.nineth.domain.RechargeOrder;
import org.springframework.beans.BeanUtils;

public class RechargeOrderDTO extends RechargeOrder {

    public RechargeOrderDTO(RechargeOrder source){
        BeanUtils.copyProperties(source,this);
    }

    @Override
    public String getBankNo(){
        if(super.getBankNo() != null){
            String bankNo = super.getBankNo().replaceAll("^\\w+(\\d{4})$", "***************$1");
            return bankNo;
        }

        return null;
    }

}
