From 764a4e7c83acf33ae93afe4e5232f6b9d73a18a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Le=CC=81o=20S?= Date: Thu, 12 Sep 2024 10:46:13 +0200 Subject: [PATCH] =?UTF-8?q?feat(rdvi):=20add=20RDV-Solidarit=C3=A9s=20ID?= =?UTF-8?q?=20to=20company?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- itou/companies/admin.py | 2 +- .../0007_company_rdv_solidarites_id.py | 24 +++++++++++++++++++ itou/companies/models.py | 8 +++++++ .../www/apply/__snapshots__/test_process.ambr | 4 ++++ .../__snapshots__/test_detail.ambr | 21 ++++++++++++---- .../__snapshots__/test_details.ambr | 9 ++++--- 6 files changed, 59 insertions(+), 9 deletions(-) create mode 100644 itou/companies/migrations/0007_company_rdv_solidarites_id.py diff --git a/itou/companies/admin.py b/itou/companies/admin.py index 8ed70ccf7b..650d6a9dec 100644 --- a/itou/companies/admin.py +++ b/itou/companies/admin.py @@ -160,7 +160,7 @@ def export(self, request, queryset): "block_job_applications", "job_applications_blocked_at", "approvals_list", - "rdv_insertion_id", + "rdv_solidarites_id", ) }, ), diff --git a/itou/companies/migrations/0007_company_rdv_solidarites_id.py b/itou/companies/migrations/0007_company_rdv_solidarites_id.py new file mode 100644 index 0000000000..a4c9acac39 --- /dev/null +++ b/itou/companies/migrations/0007_company_rdv_solidarites_id.py @@ -0,0 +1,24 @@ +# Generated by Django 5.0.9 on 2024-09-12 08:37 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("companies", "0006_alter_company_created_by_alter_company_insee_city_and_more"), + ] + + operations = [ + migrations.AddField( + model_name="company", + name="rdv_solidarites_id", + field=models.IntegerField( + blank=True, + error_messages={"unique": "Une entreprise avec cet ID d'organisation RDV-S existe déjà."}, + help_text="Permet d'initier la prise de RDV via RDV-I lorsque renseigné.", + null=True, + unique=True, + verbose_name="identifiant d'organisation RDV-S", + ), + ), + ] diff --git a/itou/companies/models.py b/itou/companies/models.py index ad18617c82..0c5a7784c4 100644 --- a/itou/companies/models.py +++ b/itou/companies/models.py @@ -276,6 +276,14 @@ class Company(AddressMixin, OrganizationAbstract): help_text="Permet d'initier la prise de RDV via RDV-I lorsque renseigné.", error_messages={"unique": "Une entreprise avec cet ID d'organisation RDV-I existe déjà."}, ) + rdv_solidarites_id = models.IntegerField( + verbose_name="identifiant d'organisation RDV-S", + blank=True, + null=True, + unique=True, + help_text="Permet d'initier la prise de RDV via RDV-I lorsque renseigné.", + error_messages={"unique": "Une entreprise avec cet ID d'organisation RDV-S existe déjà."}, + ) # Use the generic relation to let NotificationSettings being collected on deletion notification_settings = GenericRelation( diff --git a/tests/www/apply/__snapshots__/test_process.ambr b/tests/www/apply/__snapshots__/test_process.ambr index 8e53fe001e..40f121a41d 100644 --- a/tests/www/apply/__snapshots__/test_process.ambr +++ b/tests/www/apply/__snapshots__/test_process.ambr @@ -118,6 +118,7 @@ "companies_company"."convention_id", "companies_company"."job_app_score", "companies_company"."rdv_insertion_id", + "companies_company"."rdv_solidarites_id", EXISTS (SELECT %s AS "a" FROM "companies_siaeconvention" U0 @@ -435,6 +436,7 @@ T12."convention_id", T12."job_app_score", T12."rdv_insertion_id", + T12."rdv_solidarites_id", "eligibility_geiqeligibilitydiagnosis"."id", "eligibility_geiqeligibilitydiagnosis"."author_id", "eligibility_geiqeligibilitydiagnosis"."author_kind", @@ -509,6 +511,7 @@ T15."convention_id", T15."job_app_score", T15."rdv_insertion_id", + T15."rdv_solidarites_id", T16."id", T16."address_line_1", T16."address_line_2", @@ -572,6 +575,7 @@ "companies_company"."convention_id", "companies_company"."job_app_score", "companies_company"."rdv_insertion_id", + "companies_company"."rdv_solidarites_id", T17."id", T17."password", T17."last_login", diff --git a/tests/www/employees_views/__snapshots__/test_detail.ambr b/tests/www/employees_views/__snapshots__/test_detail.ambr index 640cae863e..c9a6e0826c 100644 --- a/tests/www/employees_views/__snapshots__/test_detail.ambr +++ b/tests/www/employees_views/__snapshots__/test_detail.ambr @@ -118,6 +118,7 @@ "companies_company"."convention_id", "companies_company"."job_app_score", "companies_company"."rdv_insertion_id", + "companies_company"."rdv_solidarites_id", EXISTS (SELECT %s AS "a" FROM "companies_siaeconvention" U0 @@ -355,6 +356,7 @@ T8."convention_id", T8."job_app_score", T8."rdv_insertion_id", + T8."rdv_solidarites_id", T9."id", T9."address_line_1", T9."address_line_2", @@ -823,7 +825,8 @@ "companies_company"."job_applications_blocked_at", "companies_company"."convention_id", "companies_company"."job_app_score", - "companies_company"."rdv_insertion_id" + "companies_company"."rdv_insertion_id", + "companies_company"."rdv_solidarites_id" FROM "companies_company" WHERE "companies_company"."id" = %s LIMIT 21 @@ -1167,7 +1170,8 @@ "companies_company"."job_applications_blocked_at", "companies_company"."convention_id", "companies_company"."job_app_score", - "companies_company"."rdv_insertion_id" + "companies_company"."rdv_insertion_id", + "companies_company"."rdv_solidarites_id" FROM "job_applications_jobapplication" INNER JOIN "companies_company" ON ("job_applications_jobapplication"."to_company_id" = "companies_company"."id") LEFT OUTER JOIN "users_user" T4 ON ("job_applications_jobapplication"."sender_id" = T4."id") @@ -1651,6 +1655,7 @@ "companies_company"."convention_id", "companies_company"."job_app_score", "companies_company"."rdv_insertion_id", + "companies_company"."rdv_solidarites_id", EXISTS (SELECT %s AS "a" FROM "companies_siaeconvention" U0 @@ -1888,6 +1893,7 @@ T8."convention_id", T8."job_app_score", T8."rdv_insertion_id", + T8."rdv_solidarites_id", T9."id", T9."address_line_1", T9."address_line_2", @@ -2269,7 +2275,8 @@ "companies_company"."job_applications_blocked_at", "companies_company"."convention_id", "companies_company"."job_app_score", - "companies_company"."rdv_insertion_id" + "companies_company"."rdv_insertion_id", + "companies_company"."rdv_solidarites_id" FROM "companies_company" WHERE "companies_company"."id" = %s LIMIT 21 @@ -2626,7 +2633,8 @@ "companies_company"."job_applications_blocked_at", "companies_company"."convention_id", "companies_company"."job_app_score", - "companies_company"."rdv_insertion_id" + "companies_company"."rdv_insertion_id", + "companies_company"."rdv_solidarites_id" FROM "job_applications_jobapplication" INNER JOIN "companies_company" ON ("job_applications_jobapplication"."to_company_id" = "companies_company"."id") LEFT OUTER JOIN "users_user" T4 ON ("job_applications_jobapplication"."sender_id" = T4."id") @@ -3299,6 +3307,7 @@ "companies_company"."convention_id", "companies_company"."job_app_score", "companies_company"."rdv_insertion_id", + "companies_company"."rdv_solidarites_id", EXISTS (SELECT %s AS "a" FROM "companies_siaeconvention" U0 @@ -3536,6 +3545,7 @@ T8."convention_id", T8."job_app_score", T8."rdv_insertion_id", + T8."rdv_solidarites_id", T9."id", T9."address_line_1", T9."address_line_2", @@ -4089,7 +4099,8 @@ "companies_company"."job_applications_blocked_at", "companies_company"."convention_id", "companies_company"."job_app_score", - "companies_company"."rdv_insertion_id" + "companies_company"."rdv_insertion_id", + "companies_company"."rdv_solidarites_id" FROM "job_applications_jobapplication" INNER JOIN "companies_company" ON ("job_applications_jobapplication"."to_company_id" = "companies_company"."id") LEFT OUTER JOIN "users_user" T4 ON ("job_applications_jobapplication"."sender_id" = T4."id") diff --git a/tests/www/job_seekers_views/__snapshots__/test_details.ambr b/tests/www/job_seekers_views/__snapshots__/test_details.ambr index 9e4a23cb73..dc04278709 100644 --- a/tests/www/job_seekers_views/__snapshots__/test_details.ambr +++ b/tests/www/job_seekers_views/__snapshots__/test_details.ambr @@ -1251,7 +1251,8 @@ "companies_company"."job_applications_blocked_at", "companies_company"."convention_id", "companies_company"."job_app_score", - "companies_company"."rdv_insertion_id" + "companies_company"."rdv_insertion_id", + "companies_company"."rdv_solidarites_id" FROM "eligibility_geiqeligibilitydiagnosis" LEFT OUTER JOIN "companies_company" ON ("eligibility_geiqeligibilitydiagnosis"."author_geiq_id" = "companies_company"."id") LEFT OUTER JOIN "prescribers_prescriberorganization" ON ("eligibility_geiqeligibilitydiagnosis"."author_prescriber_organization_id" = "prescribers_prescriberorganization"."id") @@ -1479,7 +1480,8 @@ "companies_company"."job_applications_blocked_at", "companies_company"."convention_id", "companies_company"."job_app_score", - "companies_company"."rdv_insertion_id" + "companies_company"."rdv_insertion_id", + "companies_company"."rdv_solidarites_id" FROM "eligibility_eligibilitydiagnosis" INNER JOIN "users_user" T3 ON ("eligibility_eligibilitydiagnosis"."author_id" = T3."id") LEFT OUTER JOIN "prescribers_prescriberorganization" ON ("eligibility_eligibilitydiagnosis"."author_prescriber_organization_id" = "prescribers_prescriberorganization"."id") @@ -1661,7 +1663,8 @@ "companies_company"."job_applications_blocked_at", "companies_company"."convention_id", "companies_company"."job_app_score", - "companies_company"."rdv_insertion_id" + "companies_company"."rdv_insertion_id", + "companies_company"."rdv_solidarites_id" FROM "job_applications_jobapplication" LEFT OUTER JOIN "users_user" T3 ON ("job_applications_jobapplication"."sender_id" = T3."id") INNER JOIN "companies_company" ON ("job_applications_jobapplication"."to_company_id" = "companies_company"."id")