Add condition to household export queries to exclude accompanying periods that are in draft.

This commit is contained in:
2023-12-20 10:46:29 +00:00
parent 0da12cdc2e
commit 4d72933edb
4 changed files with 17 additions and 5 deletions

View File

@@ -50,7 +50,7 @@ final class RelationshipApiControllerTest extends WebTestCase
->join('p.centerCurrent', 'center_current')
->join('center_current.center', 'c')
->where('c.name LIKE :name')
->andWhere('EXISTS (SELECT 1 FROM ' . Relationship::class . ' r WHERE r.fromPerson = p OR r.toPerson = p)')
->andWhere('EXISTS (SELECT 1 FROM '.Relationship::class.' r WHERE r.fromPerson = p OR r.toPerson = p)')
->setParameter('name', 'Center A')
->getQuery()
->setMaxResults(1)
@@ -62,7 +62,7 @@ final class RelationshipApiControllerTest extends WebTestCase
->join('p.centerCurrent', 'center_current')
->join('center_current.center', 'c')
->where('c.name LIKE :name')
->andWhere('NOT EXISTS (SELECT 1 FROM ' . Relationship::class . ' r WHERE r.fromPerson = p OR r.toPerson = p)')
->andWhere('NOT EXISTS (SELECT 1 FROM '.Relationship::class.' r WHERE r.fromPerson = p OR r.toPerson = p)')
->setParameter('name', 'Center A')
->getQuery()
->setMaxResults(1)
@@ -85,7 +85,7 @@ final class RelationshipApiControllerTest extends WebTestCase
->join('p.centerCurrent', 'center_current')
->join('center_current.center', 'c')
->where('c.name LIKE :name')
->andWhere('NOT EXISTS (SELECT 1 FROM ' . Relationship::class . ' r WHERE r.fromPerson = p OR r.toPerson = p)')
->andWhere('NOT EXISTS (SELECT 1 FROM '.Relationship::class.' r WHERE r.fromPerson = p OR r.toPerson = p)')
->setParameter('name', 'Center A')
->getQuery()
->setMaxResults(2)