Skip to content

Commit

Permalink
feat(rdvi): add RDV-Solidarités ID to company
Browse files Browse the repository at this point in the history
  • Loading branch information
leo-naeka committed Sep 12, 2024
1 parent adaf51e commit 764a4e7
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 9 deletions.
2 changes: 1 addition & 1 deletion itou/companies/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def export(self, request, queryset):
"block_job_applications",
"job_applications_blocked_at",
"approvals_list",
"rdv_insertion_id",
"rdv_solidarites_id",
)
},
),
Expand Down
24 changes: 24 additions & 0 deletions itou/companies/migrations/0007_company_rdv_solidarites_id.py
Original file line number Diff line number Diff line change
@@ -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",
),
),
]
8 changes: 8 additions & 0 deletions itou/companies/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 4 additions & 0 deletions tests/www/apply/__snapshots__/test_process.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
21 changes: 16 additions & 5 deletions tests/www/employees_views/__snapshots__/test_detail.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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")
Expand Down
9 changes: 6 additions & 3 deletions tests/www/job_seekers_views/__snapshots__/test_details.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 764a4e7

Please sign in to comment.