class CreateGithubCommentOnFundHandler {

    @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT)
    public void createGithubCommentOnRequestFunded(final RequestFundedEvent event) {
        if (addComment) {
            final IssueInformationDto issueInformation = requestService.findRequest(event.getRequestId()).getIssueInformation();
            if (issueInformation.getPlatform() == Platform.GITHUB
                && !isCommentAlreadyPresent(issueInformation.getNumber(), issueInformation.getOwner(), issueInformation.getRepo())) {
                placeComment(event.getRequestId(), issueInformation.getNumber(), issueInformation.getOwner(), issueInformation.getRepo());
            }
        }
    }

    public  CreateGithubCommentOnFundHandler(final GithubGateway githubGateway,
                                            final GithubCommentFactory githubCommentFactory,
                                            final RequestService requestService,
                                            @Value("${github.add-comments:false}") final Boolean addComment,
                                            @Value("${feign.client.github.username:fundrequest-notifier}") final String githubUser);

}