mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-17 12:14:58 +00:00
Compare commits
7 Commits
async-uplo
...
2.15.1
Author | SHA1 | Date | |
---|---|---|---|
60ede58af0 | |||
afb79141f0 | |||
4d72933edb | |||
0da12cdc2e | |||
d1ce99e6d3 | |||
|
0ad27328c9 | ||
f02873c6e0
|
5
.changes/v2.15.1.md
Normal file
5
.changes/v2.15.1.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
## v2.15.1 - 2023-12-20
|
||||||
|
### Fixed
|
||||||
|
* Fix the household export query to exclude accompanying periods that are in draft state.
|
||||||
|
### DX
|
||||||
|
* ([#167](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/167)) Fixed readthedocs compilation by updating readthedocs config file and requirements for Sphinx
|
@@ -1,10 +1,14 @@
|
|||||||
---
|
---
|
||||||
version: 2
|
version: 2
|
||||||
|
|
||||||
|
build:
|
||||||
|
os: ubuntu-22.04
|
||||||
|
tools:
|
||||||
|
python: "3.7"
|
||||||
|
|
||||||
sphinx:
|
sphinx:
|
||||||
configuration: docs/source/conf.py
|
configuration: docs/source/conf.py
|
||||||
|
|
||||||
python:
|
python:
|
||||||
version: 3.7
|
|
||||||
install:
|
install:
|
||||||
- requirements: docs/requirements.txt
|
- requirements: docs/requirements.txt
|
@@ -6,6 +6,12 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
|
|||||||
and is generated by [Changie](https://github.com/miniscruff/changie).
|
and is generated by [Changie](https://github.com/miniscruff/changie).
|
||||||
|
|
||||||
|
|
||||||
|
## v2.15.1 - 2023-12-20
|
||||||
|
### Fixed
|
||||||
|
* Fix the household export query to exclude accompanying periods that are in draft state.
|
||||||
|
### DX
|
||||||
|
* ([#167](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/167)) Fixed readthedocs compilation by updating readthedocs config file and requirements for Sphinx
|
||||||
|
|
||||||
## v2.15.0 - 2023-12-11
|
## v2.15.0 - 2023-12-11
|
||||||
### Feature
|
### Feature
|
||||||
* ([#191](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/191)) Add export "number of household associate with an exchange"
|
* ([#191](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/191)) Add export "number of household associate with an exchange"
|
||||||
|
@@ -27,7 +27,7 @@ To compile this documentation :
|
|||||||
Contribute
|
Contribute
|
||||||
===========
|
===========
|
||||||
|
|
||||||
Issue tracker : https://git.framasoft.org/groups/Chill-project/issues
|
Issue tracker : https://gitlab.com/Chill-Projet/chill-bundles/-/issues
|
||||||
|
|
||||||
Licence
|
Licence
|
||||||
=======
|
=======
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
docutils==0.13.1
|
docutils==0.13.1
|
||||||
Pygments==2.2.0
|
Pygments==2.2.0
|
||||||
sphinx==1.8.5
|
sphinx==1.8.5
|
||||||
|
Jinja2<3.1
|
||||||
git+https://github.com/fabpot/sphinx-php.git@v2.0.2#egg_name=sphinx-php
|
git+https://github.com/fabpot/sphinx-php.git@v2.0.2#egg_name=sphinx-php
|
||||||
jsx-lexer===0.0.8
|
jsx-lexer===0.0.8
|
||||||
sphinx_rtd_theme==0.5.0
|
sphinx_rtd_theme==0.5.0
|
||||||
|
@@ -49,7 +49,7 @@ Clone or download the chill-skeleton project and `cd` into the main directory.
|
|||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
git clone https://gitlab.com/Chill-Projet/chill-skeleton-basic.git
|
git clone https://gitlab.com/Chill-Projet/chill-skeleton-basic.git
|
||||||
cd chill-app
|
cd chill-skeleton-basic
|
||||||
|
|
||||||
|
|
||||||
As a developer, the code will stay on your computer and will be executed in docker container. To avoid permission problem, the code should be run with the same uid/gid from your current user. This is why we get your current user id with the command ``id -u`` in each following scripts.
|
As a developer, the code will stay on your computer and will be executed in docker container. To avoid permission problem, the code should be run with the same uid/gid from your current user. This is why we get your current user id with the command ``id -u`` in each following scripts.
|
||||||
|
@@ -17,6 +17,7 @@ use Chill\MainBundle\Export\GroupedExportInterface;
|
|||||||
use Chill\MainBundle\Form\Type\PickRollingDateType;
|
use Chill\MainBundle\Form\Type\PickRollingDateType;
|
||||||
use Chill\MainBundle\Service\RollingDate\RollingDate;
|
use Chill\MainBundle\Service\RollingDate\RollingDate;
|
||||||
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
|
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
|
||||||
|
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||||
use Chill\PersonBundle\Entity\Household\Household;
|
use Chill\PersonBundle\Entity\Household\Household;
|
||||||
use Chill\PersonBundle\Entity\Person\PersonCenterHistory;
|
use Chill\PersonBundle\Entity\Person\PersonCenterHistory;
|
||||||
use Chill\PersonBundle\Export\Declarations;
|
use Chill\PersonBundle\Export\Declarations;
|
||||||
@@ -121,7 +122,9 @@ class CountHouseholdInPeriod implements ExportInterface, GroupedExportInterface
|
|||||||
->join('acppart.accompanyingPeriod', 'acp')
|
->join('acppart.accompanyingPeriod', 'acp')
|
||||||
->andWhere('acppart.startDate != acppart.endDate OR acppart.endDate IS NULL')
|
->andWhere('acppart.startDate != acppart.endDate OR acppart.endDate IS NULL')
|
||||||
->andWhere('hmember.startDate <= :count_household_at_date AND (hmember.endDate IS NULL OR hmember.endDate > :count_household_at_date)')
|
->andWhere('hmember.startDate <= :count_household_at_date AND (hmember.endDate IS NULL OR hmember.endDate > :count_household_at_date)')
|
||||||
->setParameter('count_household_at_date', $this->rollingDateConverter->convert($data['calc_date']));
|
->andWhere('acp.step != :count_acp_step')
|
||||||
|
->setParameter('count_household_at_date', $this->rollingDateConverter->convert($data['calc_date']))
|
||||||
|
->setParameter('count_acp_step', AccompanyingPeriod::STEP_DRAFT);
|
||||||
|
|
||||||
$qb
|
$qb
|
||||||
->select('COUNT(DISTINCT household.id) AS household_export_result')
|
->select('COUNT(DISTINCT household.id) AS household_export_result')
|
||||||
|
@@ -20,6 +20,7 @@ use Chill\MainBundle\Export\ListInterface;
|
|||||||
use Chill\MainBundle\Form\Type\PickRollingDateType;
|
use Chill\MainBundle\Form\Type\PickRollingDateType;
|
||||||
use Chill\MainBundle\Service\RollingDate\RollingDate;
|
use Chill\MainBundle\Service\RollingDate\RollingDate;
|
||||||
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
|
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
|
||||||
|
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||||
use Chill\PersonBundle\Entity\Household\Household;
|
use Chill\PersonBundle\Entity\Household\Household;
|
||||||
use Chill\PersonBundle\Entity\Household\HouseholdComposition;
|
use Chill\PersonBundle\Entity\Household\HouseholdComposition;
|
||||||
use Chill\PersonBundle\Entity\Household\HouseholdMember;
|
use Chill\PersonBundle\Entity\Household\HouseholdMember;
|
||||||
@@ -144,7 +145,9 @@ class ListHouseholdInPeriod implements ListInterface, GroupedExportInterface
|
|||||||
->join('acppart.accompanyingPeriod', 'acp')
|
->join('acppart.accompanyingPeriod', 'acp')
|
||||||
->andWhere('acppart.startDate != acppart.endDate OR acppart.endDate IS NULL')
|
->andWhere('acppart.startDate != acppart.endDate OR acppart.endDate IS NULL')
|
||||||
->andWhere('hmember.startDate <= :count_household_at_date AND (hmember.endDate IS NULL OR hmember.endDate > :count_household_at_date)')
|
->andWhere('hmember.startDate <= :count_household_at_date AND (hmember.endDate IS NULL OR hmember.endDate > :count_household_at_date)')
|
||||||
->setParameter('count_household_at_date', $this->rollingDateConverter->convert($data['calc_date']));
|
->andWhere('acp.step != :list_acp_step')
|
||||||
|
->setParameter('count_household_at_date', $this->rollingDateConverter->convert($data['calc_date']))
|
||||||
|
->setParameter('list_acp_step', AccompanyingPeriod::STEP_DRAFT);
|
||||||
|
|
||||||
if ($this->filterStatsByCenters) {
|
if ($this->filterStatsByCenters) {
|
||||||
$qb
|
$qb
|
||||||
|
@@ -14,6 +14,7 @@ namespace Chill\PersonBundle\Tests\Controller;
|
|||||||
use Chill\MainBundle\Test\PrepareClientTrait;
|
use Chill\MainBundle\Test\PrepareClientTrait;
|
||||||
use Chill\PersonBundle\Entity\Person;
|
use Chill\PersonBundle\Entity\Person;
|
||||||
use Chill\PersonBundle\Entity\Relationships\Relation;
|
use Chill\PersonBundle\Entity\Relationships\Relation;
|
||||||
|
use Chill\PersonBundle\Entity\Relationships\Relationship;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
@@ -43,31 +44,34 @@ final class RelationshipApiControllerTest extends WebTestCase
|
|||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
$countPersons = $em->createQueryBuilder()
|
$personIdHavingRelation = $em->createQueryBuilder()
|
||||||
->select('count(p)')
|
->select('p.id')
|
||||||
->from(Person::class, 'p')
|
|
||||||
->join('p.centerCurrent', 'center_current')
|
|
||||||
->join('center_current.center', 'c')
|
|
||||||
->where('c.name LIKE :name')
|
|
||||||
->setParameter('name', 'Center A')
|
|
||||||
->getQuery()
|
|
||||||
->getSingleScalarResult();
|
|
||||||
$person = $em->createQueryBuilder()
|
|
||||||
->select('p')
|
|
||||||
->from(Person::class, 'p')
|
->from(Person::class, 'p')
|
||||||
->join('p.centerCurrent', 'center_current')
|
->join('p.centerCurrent', 'center_current')
|
||||||
->join('center_current.center', 'c')
|
->join('center_current.center', 'c')
|
||||||
->where('c.name LIKE :name')
|
->where('c.name LIKE :name')
|
||||||
|
->andWhere('EXISTS (SELECT 1 FROM '.Relationship::class.' r WHERE r.fromPerson = p OR r.toPerson = p)')
|
||||||
->setParameter('name', 'Center A')
|
->setParameter('name', 'Center A')
|
||||||
->getQuery()
|
->getQuery()
|
||||||
->setMaxResults(1)
|
->setMaxResults(1)
|
||||||
->setFirstResult(\random_int(0, $countPersons - 1))
|
->getSingleScalarResult();
|
||||||
->getSingleResult();
|
|
||||||
|
$personIdWithoutRelation = $em->createQueryBuilder()
|
||||||
|
->select('p.id')
|
||||||
|
->from(Person::class, 'p')
|
||||||
|
->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)')
|
||||||
|
->setParameter('name', 'Center A')
|
||||||
|
->getQuery()
|
||||||
|
->setMaxResults(1)
|
||||||
|
->getSingleScalarResult();
|
||||||
|
|
||||||
self::ensureKernelShutdown();
|
self::ensureKernelShutdown();
|
||||||
|
|
||||||
return [
|
return [
|
||||||
[$person->getId()],
|
[$personIdHavingRelation, $personIdWithoutRelation],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,39 +79,29 @@ final class RelationshipApiControllerTest extends WebTestCase
|
|||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
$countPersons = $em->createQueryBuilder()
|
$personIdWithoutRelations = $em->createQueryBuilder()
|
||||||
->select('count(DISTINCT p)')
|
->select('p.id')
|
||||||
->from(Person::class, 'p')
|
|
||||||
->join('p.centerCurrent', 'center_current')
|
|
||||||
->join('center_current.center', 'c')
|
|
||||||
->where('c.name LIKE :name')
|
|
||||||
->setParameter('name', 'Center A')
|
|
||||||
->getQuery()
|
|
||||||
->getSingleScalarResult();
|
|
||||||
|
|
||||||
$persons = $em->createQueryBuilder()
|
|
||||||
->select('p')
|
|
||||||
->from(Person::class, 'p')
|
->from(Person::class, 'p')
|
||||||
->join('p.centerCurrent', 'center_current')
|
->join('p.centerCurrent', 'center_current')
|
||||||
->join('center_current.center', 'c')
|
->join('center_current.center', 'c')
|
||||||
->where('c.name LIKE :name')
|
->where('c.name LIKE :name')
|
||||||
|
->andWhere('NOT EXISTS (SELECT 1 FROM '.Relationship::class.' r WHERE r.fromPerson = p OR r.toPerson = p)')
|
||||||
->setParameter('name', 'Center A')
|
->setParameter('name', 'Center A')
|
||||||
->getQuery()
|
->getQuery()
|
||||||
->setMaxResults(2)
|
->setMaxResults(2)
|
||||||
->setFirstResult(\random_int(0, $countPersons - 1))
|
|
||||||
->getResult();
|
->getResult();
|
||||||
|
|
||||||
self::ensureKernelShutdown();
|
self::ensureKernelShutdown();
|
||||||
|
|
||||||
return [
|
return [
|
||||||
[$persons[0]->getId(), $persons[1]->getId(), $this->getRandomRelation($em)->getId(), true],
|
[$personIdWithoutRelations[0]['id'], $personIdWithoutRelations[1]['id'], $this->getRandomRelation($em)->getId(), true],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider personProvider
|
* @dataProvider personProvider
|
||||||
*/
|
*/
|
||||||
public function testGetRelationshipByPerson(mixed $personId)
|
public function testGetRelationshipByPerson(int $personId)
|
||||||
{
|
{
|
||||||
self::ensureKernelShutdown();
|
self::ensureKernelShutdown();
|
||||||
$client = $this->getClientAuthenticated();
|
$client = $this->getClientAuthenticated();
|
||||||
|
Reference in New Issue
Block a user