-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
eligibility: Improve eligibility diagnosis data consistancy
- Loading branch information
Showing
11 changed files
with
123 additions
and
19 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
itou/eligibility/migrations/0010_add_eligibilitydiagnosis_author_kind_coherence.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Generated by Django 5.1.5 on 2025-01-28 09:51 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("companies", "0014_company_fields_history_and_more"), | ||
("eligibility", "0009_fix_selectedadministrativecriteria_certification_period"), | ||
("prescribers", "0007_prescriberorganization_automatic_geocoding_update"), | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
] | ||
|
||
operations = [ | ||
migrations.AddConstraint( | ||
model_name="eligibilitydiagnosis", | ||
constraint=models.CheckConstraint( | ||
condition=models.Q( | ||
models.Q( | ||
("author_kind", "employer"), | ||
("author_prescriber_organization__isnull", True), | ||
("author_siae__isnull", False), | ||
), | ||
models.Q( | ||
("author_kind", "prescriber"), | ||
("author_prescriber_organization__isnull", False), | ||
("author_siae__isnull", True), | ||
), | ||
_connector="OR", | ||
), | ||
name="eligibility_iae_diagnosis_author_kind_coherence", | ||
violation_error_message="La structure de l'auteur ne correspond pas à son type", | ||
), | ||
), | ||
] |
40 changes: 40 additions & 0 deletions
40
itou/eligibility/migrations/0011_update_geiqeligibilitydiagnosis_author_kind_coherence.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Generated by Django 5.1.5 on 2025-01-28 09:52 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("companies", "0014_company_fields_history_and_more"), | ||
("eligibility", "0010_add_eligibilitydiagnosis_author_kind_coherence"), | ||
("prescribers", "0007_prescriberorganization_automatic_geocoding_update"), | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveConstraint( | ||
model_name="geiqeligibilitydiagnosis", | ||
name="author_kind_coherence", | ||
), | ||
migrations.AddConstraint( | ||
model_name="geiqeligibilitydiagnosis", | ||
constraint=models.CheckConstraint( | ||
condition=models.Q( | ||
models.Q( | ||
("author_geiq__isnull", False), | ||
("author_kind", "geiq"), | ||
("author_prescriber_organization__isnull", True), | ||
), | ||
models.Q( | ||
("author_geiq__isnull", True), | ||
("author_kind", "prescriber"), | ||
("author_prescriber_organization__isnull", False), | ||
), | ||
_connector="OR", | ||
), | ||
name="author_kind_coherence", | ||
violation_error_message="La structure de l'auteur ne correspond pas à son type", | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters