class ActivityLogServiceImpl implements ActivityLogService {

    @Override
    public void recordQueryActivityByProjectFinanceId(long projectFinanceId, ActivityType activityType, long threadId) {
        projectFinanceRepository.findById(projectFinanceId)
                .ifPresent(projectFinance -> {
                    queryRepository.findById(threadId).ifPresent(query -> {
                        ActivityLog log = new ActivityLog(projectFinance.getProject().getApplication(), activityType, query, projectFinance.getOrganisation());
                        activityLogRepository.save(log);
                    });
                });
    }

}