class CheckFundsGtZeroHandler {

    @EventListener
    public void handleRefund(final RefundProcessedEvent refundProcessedEvent) {
        final Long requestId = refundProcessedEvent.getRefund().getRequestId();

        if (!hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, FUNDED)) {
            requestService.update(new UpdateRequestStatusCommand(requestId, OPEN));
        }
    }

    public  CheckFundsGtZeroHandler(final FundService fundService, final RequestService requestService);

}