class InterviewAllocationServiceImpl implements InterviewAllocationService {

    @Override
    public ServiceResult<InterviewApplicationPageResource> getAllocatedApplications(long competitionId, long assessorUserId, Pageable pageable) {
        Page<InterviewApplicationResource> pagedResult = interviewRepository.findApplicationsAssignedToAssessor(
                competitionId,
                assessorUserId, pageable);

        long unallocatedApplications = interviewRepository.countUnallocatedApplications(competitionId, assessorUserId);
        long allocatedApplications = interviewRepository.countAllocatedApplications(competitionId, assessorUserId);

        return serviceSuccess(new InterviewApplicationPageResource(
                pagedResult.getTotalElements(),
                pagedResult.getTotalPages(),
                pagedResult.getContent(),
                pagedResult.getNumber(),
                pagedResult.getSize(),
                unallocatedApplications,
                allocatedApplications
        ));
    }

}