feat: teamer season disposition count in info modal
addresses #869dv94n4
This commit is contained in:
@@ -144,6 +144,37 @@ class DispositionRepository extends ServiceEntityRepository
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
* The effective start date of every non-called-off disposition of a teamer, one row
|
||||
* each, for the per-season tally in the info modal.
|
||||
*
|
||||
* Same teamer/called-off filtering as findRecentDispositionsByTeamer(), but unbounded
|
||||
* and stripped to the one date it needs: assignment.dateFrom falling back to the
|
||||
* destination's, the season convention shared with SeasonPeriodFilter.
|
||||
*
|
||||
* @return array<int, array{seasonDate: string}>
|
||||
*/
|
||||
public function findDispositionSeasonDatesByTeamer(Teamer $teamer): array
|
||||
{
|
||||
$qb = $this->createQueryBuilder('disposition');
|
||||
|
||||
return $qb
|
||||
->select('COALESCE(assignment.dateFrom, destination.dateFrom) AS seasonDate')
|
||||
->innerJoin('disposition.assignment', 'assignment')
|
||||
->innerJoin('assignment.destination', 'destination')
|
||||
->where($qb->expr()->andX(
|
||||
$qb->expr()->eq('disposition.teamer', ':teamer'),
|
||||
$qb->expr()->neq('assignment.status', ':assignmentStatus'),
|
||||
$qb->expr()->neq('disposition.status', ':dispositionStatus')
|
||||
))
|
||||
->setParameter('teamer', $teamer)
|
||||
->setParameter('assignmentStatus', Assignment::STATUS_CALLED_OFF)
|
||||
->setParameter('dispositionStatus', Disposition::STATUS_CALLED_OFF)
|
||||
->getQuery()
|
||||
->getScalarResult()
|
||||
;
|
||||
}
|
||||
|
||||
public function findCurrentDispositionsByTeamer(Teamer $teamer): array
|
||||
{
|
||||
$qb = $this->createQueryBuilder('disposition');
|
||||
|
||||
Reference in New Issue
Block a user