feat: extend teamer dashboard
This commit is contained in:
1 parent
8ff59b3068
commit
b5781df8d9
16 files changed
+286
-30
No files matched your search
@@ -55,6 +55,15 @@ class ApplicationRepository extends ServiceEntityRepository
|
||||
;
|
||||
}
|
||||
|
||||
public function getPendingForTeamer(Teamer $teamer, int $limit = 5): array
|
||||
{
|
||||
return $this
|
||||
->getPendingForTeamerQuery($teamer)
|
||||
->setMaxResults($limit)
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
|
||||
public function getCurrentByAssignment(Assignment $assignment): array
|
||||
{
|
||||
$qb = $this->createQueryBuilder('application');
|
||||
|
||||
@@ -221,10 +221,12 @@ class AssignmentRepository extends ServiceEntityRepository
|
||||
->select('assignment', 'destination', 'job_profile')
|
||||
->innerJoin('assignment.destination', 'destination')
|
||||
->innerJoin('assignment.jobProfile', 'job_profile')
|
||||
->leftJoin('assignment.applications', 'application', Join::WITH, $qb->expr()->neq('application.teamer', ':teamer'))
|
||||
->leftJoin('assignment.applications', 'application', Join::WITH, $qb->expr()->eq('application.teamer', ':teamer'))
|
||||
->leftJoin('assignment.dispositions', 'disposition', Join::WITH, $qb->expr()->eq('disposition.teamer', ':teamer'))
|
||||
->where($qb->expr()->andX(
|
||||
$qb->expr()->in('assignment.jobProfile', ':jobProfiles'),
|
||||
$qb->expr()->isNull('application')
|
||||
$qb->expr()->isNull('application'),
|
||||
$qb->expr()->isNull('disposition')
|
||||
))
|
||||
->setParameter('jobProfiles', $teamer->getJobProfiles())
|
||||
->setParameter('teamer', $teamer)
|
||||
|
||||
@@ -29,8 +29,9 @@ class DispositionRepository extends ServiceEntityRepository
|
||||
$qb = $this->createQueryBuilder('disposition');
|
||||
|
||||
return $qb
|
||||
->select('disposition', 'assignment', 'job_profile', 'destination')
|
||||
->select('disposition', 'assignment', 'job_profile', 'destination', 'documents')
|
||||
->innerJoin('disposition.assignment', 'assignment')
|
||||
->leftJoin('assignment.documents', 'documents')
|
||||
->innerJoin('assignment.jobProfile', 'job_profile')
|
||||
->innerJoin('assignment.destination', 'destination')
|
||||
->where($qb->expr()->andX(
|
||||
@@ -52,6 +53,15 @@ class DispositionRepository extends ServiceEntityRepository
|
||||
;
|
||||
}
|
||||
|
||||
public function getUpcomingDispositionsByTeamer(Teamer $teamer, int $limit = 5): array
|
||||
{
|
||||
return $this
|
||||
->getUpcomingDispositionsByTeamerQuery($teamer)
|
||||
->setMaxResults($limit)
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
|
||||
public function getRecentDispositionsByTeamerQuery(Teamer $teamer): Query
|
||||
{
|
||||
$qb = $this->createQueryBuilder('disposition');
|
||||
@@ -123,10 +133,12 @@ class DispositionRepository extends ServiceEntityRepository
|
||||
->innerJoin('assignment.destination', 'destination')
|
||||
->where($qb->expr()->andX(
|
||||
$qb->expr()->in('destination.hotelBusProId', ':hotelBusProIds'),
|
||||
$qb->expr()->lt('destination.dateTo', ':dateTo')
|
||||
$qb->expr()->lt('destination.dateTo', ':dateTo'),
|
||||
$qb->expr()->eq('disposition.status', ':status')
|
||||
))
|
||||
->setParameter('hotelBusProIds', $hotelBusProIds)
|
||||
->setParameter('dateTo', new \DateTimeImmutable())
|
||||
->setParameter('status', Disposition::STATUS_NEW)
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Feedback;
|
||||
use App\Entity\Teamer;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
@@ -28,6 +29,8 @@ class FeedbackRepository extends ServiceEntityRepository
|
||||
return $qb
|
||||
->select('feedback', 'teamer')
|
||||
->innerJoin('feedback.teamer', 'teamer')
|
||||
->where($qb->expr()->eq('feedback.status', ':status'))
|
||||
->setParameter('status', Feedback::STATUS_NEW)
|
||||
->orderBy('feedback.createdAt', 'DESC')
|
||||
->setMaxResults($limit)
|
||||
->getQuery()
|
||||
@@ -47,4 +50,22 @@ class FeedbackRepository extends ServiceEntityRepository
|
||||
->getSingleScalarResult()
|
||||
;
|
||||
}
|
||||
|
||||
public function getRecentForTeamer(Teamer $teamer, int $limit = 5): array
|
||||
{
|
||||
$qb = $this->createQueryBuilder('feedback');
|
||||
|
||||
return $qb
|
||||
->where($qb->expr()->andX(
|
||||
$qb->expr()->eq('feedback.teamer', ':teamer'),
|
||||
$qb->expr()->eq('feedback.status', ':status')
|
||||
))
|
||||
->setParameter('teamer', $teamer)
|
||||
->setParameter('status', Feedback::STATUS_PUBLISHED)
|
||||
->orderBy('feedback.createdAt', 'DESC')
|
||||
->setMaxResults($limit)
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user