Skip to content

Commit

Permalink
users: Remove deprecated and unused ATA allocation field
Browse files Browse the repository at this point in the history
This field is not displayed nor filled since a7fb1cb.
  • Loading branch information
rsebille committed Jan 6, 2025
1 parent 846b35b commit b47fe4a
Show file tree
Hide file tree
Showing 21 changed files with 47 additions and 93 deletions.
9 changes: 3 additions & 6 deletions itou/api/employee_record_api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,9 @@ class _API_SituationSerializer(serializers.Serializer):
source="job_application.job_seeker.jobseeker_profile.aah_allocation_since", allow_blank=True
)

salarieBenefATA = serializers.BooleanField(
source="job_application.job_seeker.jobseeker_profile.has_ata_allocation"
)
salarieBenefATADepuis = NullIfEmptyCharField(
source="job_application.job_seeker.jobseeker_profile.ata_allocation_since", allow_blank=True
)
# ATA fields are outdated and have not been displayed or filled since a7fb1cb36bb942d660bf082ac22ed2367320a1f9
salarieBenefATA = serializers.CharField(read_only=True, default=False)
salarieBenefATADepuis = serializers.CharField(read_only=True, default=None)

# There is a clear lack of knowledge of ASP business rules on this point.
# Without any satisfactory answer, it has been decided to obfuscate / mock these fields.
Expand Down
10 changes: 3 additions & 7 deletions itou/employee_record/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,9 @@ class _SituationSerializer(serializers.Serializer):
source="job_application.job_seeker.jobseeker_profile.aah_allocation_since",
) # Required if he has AAH allocation

salarieBenefATA = serializers.BooleanField(
source="job_application.job_seeker.jobseeker_profile.has_ata_allocation"
) # Required
salarieBenefATADepuis = NullIfEmptyChoiceField(
choices=AllocationDuration.choices,
source="job_application.job_seeker.jobseeker_profile.ata_allocation_since",
) # Required if he has ATA allocation
# ATA fields are outdated and have not been displayed or filled since a7fb1cb36bb942d660bf082ac22ed2367320a1f9
salarieBenefATA = serializers.ReadOnlyField(default=False) # Required
salarieBenefATADepuis = serializers.ReadOnlyField(default=None) # Required if he has ATA allocation

salarieBenefARE = NullField() # Required for EITI, "null" for others
salarieBenefAREDepuis = NullField() # Required for EITI, "null" for others
Expand Down
10 changes: 0 additions & 10 deletions itou/fixtures/django/07_jobseeker_profile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"aah_allocation_since": "",
"asp_uid": "57d76450cd919cc770d1fe9d2ca0f7",
"ass_allocation_since": "",
"ata_allocation_since": "",
"birth_country": null,
"birth_place": null,
"birthdate": "1990-03-13",
Expand Down Expand Up @@ -39,7 +38,6 @@
"aah_allocation_since": "",
"asp_uid": "856d991a30f7cd2b3a806402c7ccbe",
"ass_allocation_since": "",
"ata_allocation_since": "",
"birth_country": null,
"birth_place": null,
"birthdate": "1978-07-14",
Expand Down Expand Up @@ -74,7 +72,6 @@
"aah_allocation_since": "",
"asp_uid": "4aec9d160ccce21ffc478b38f039f9",
"ass_allocation_since": "",
"ata_allocation_since": "",
"birth_country": null,
"birth_place": null,
"birthdate": "2000-01-01",
Expand Down Expand Up @@ -109,7 +106,6 @@
"aah_allocation_since": "",
"asp_uid": "60ef9778140e58f018c4c794188f3a",
"ass_allocation_since": "",
"ata_allocation_since": "",
"birth_country": null,
"birth_place": null,
"birthdate": "1970-01-01",
Expand Down Expand Up @@ -144,7 +140,6 @@
"aah_allocation_since": "",
"asp_uid": "fa62c893761535ba8ca1a0241de8fe",
"ass_allocation_since": "",
"ata_allocation_since": "",
"birth_country": 269,
"birth_place": null,
"birthdate": "1950-01-01",
Expand Down Expand Up @@ -179,7 +174,6 @@
"aah_allocation_since": "",
"asp_uid": "d6596040b3862c8fc4902f4803fcbc",
"ass_allocation_since": "",
"ata_allocation_since": "",
"birth_country": 269,
"birth_place": null,
"birthdate": "1970-01-01",
Expand Down Expand Up @@ -214,7 +208,6 @@
"aah_allocation_since": "",
"asp_uid": "6017a46241a93b64411b6aed1f983a",
"ass_allocation_since": "",
"ata_allocation_since": "",
"birth_country": 269,
"birth_place": null,
"birthdate": "1970-01-01",
Expand Down Expand Up @@ -249,7 +242,6 @@
"aah_allocation_since": "04",
"asp_uid": "6e3785d7dd4d4d00613a470627b4d9",
"ass_allocation_since": "",
"ata_allocation_since": "",
"birth_country": 269,
"birth_place": null,
"birthdate": "1970-01-01",
Expand Down Expand Up @@ -284,7 +276,6 @@
"aah_allocation_since": "",
"asp_uid": "bac167be04db543199138a07f15d36",
"ass_allocation_since": "",
"ata_allocation_since": "",
"birth_country": null,
"birth_place": null,
"birthdate": null,
Expand Down Expand Up @@ -319,7 +310,6 @@
"aah_allocation_since": "",
"asp_uid": "f403018e1423501927500c8bdf79bb",
"ass_allocation_since": "",
"ata_allocation_since": "",
"birth_country": 91,
"birth_place": 26973,
"birthdate": "2005-05-03",
Expand Down
1 change: 0 additions & 1 deletion itou/users/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,6 @@ class Media:
"rsa_allocation_since",
"ass_allocation_since",
"aah_allocation_since",
"ata_allocation_since",
)
},
),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("users", "0017_add_hijack_permission"),
]

operations = [
migrations.SeparateDatabaseAndState(
database_operations=[
migrations.AlterField(
model_name="jobseekerprofile",
name="ata_allocation_since",
field=models.CharField(
blank=True,
choices=[
("01", "Moins de 6 mois"),
("02", "De 6 à 11 mois"),
("03", "De 12 à 23 mois"),
("04", "24 mois et plus"),
],
max_length=2,
verbose_name="allocataire de l'ATA depuis",
null=True, # Make it nullable
),
)
],
state_operations=[
migrations.RemoveField(
model_name="jobseekerprofile",
name="ata_allocation_since",
)
],
),
]
18 changes: 1 addition & 17 deletions itou/users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -931,13 +931,6 @@ class JobSeekerProfile(models.Model):
choices=AllocationDuration.choices,
)

ata_allocation_since = models.CharField(
max_length=2,
verbose_name="allocataire de l'ATA depuis",
blank=True,
choices=AllocationDuration.choices,
)

# Fields specifics to the EITI
are_allocation_since = models.CharField(
max_length=2,
Expand Down Expand Up @@ -1282,10 +1275,6 @@ def has_ass_allocation(self):
def has_aah_allocation(self):
return bool(self.aah_allocation_since)

@property
def has_ata_allocation(self):
return bool(self.ata_allocation_since)

@property
def has_are_allocation(self):
return bool(self.are_allocation_since)
Expand All @@ -1296,12 +1285,7 @@ def has_activity_bonus(self):

@property
def has_social_allowance(self):
return bool(
self.has_rsa_allocation != RSAAllocation.NO
or self.has_ass_allocation
or self.has_aah_allocation
or self.has_ata_allocation
)
return bool(self.has_rsa_allocation != RSAAllocation.NO or self.has_ass_allocation or self.has_aah_allocation)

@property
def hexa_address_filled(self):
Expand Down
3 changes: 0 additions & 3 deletions itou/www/itou_staff_views/export_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,6 @@ def export_row(spec, obj):
"job_seeker_aah_allocation_since": (
lambda job_app: job_app.job_seeker.jobseeker_profile.get_aah_allocation_since_display()
),
"job_seeker_ata_allocation_since": (
lambda job_app: job_app.job_seeker.jobseeker_profile.get_ata_allocation_since_display()
),
"application_eligibility_diagnosis_author_kind": lambda job_app: _getattrs(
job_app, "eligibility_diagnosis", "author_kind"
),
Expand Down
2 changes: 0 additions & 2 deletions tests/api/__snapshots__/test_geiq.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@
"users_jobseekerprofile"."rsa_allocation_since",
"users_jobseekerprofile"."ass_allocation_since",
"users_jobseekerprofile"."aah_allocation_since",
"users_jobseekerprofile"."ata_allocation_since",
"users_jobseekerprofile"."are_allocation_since",
"users_jobseekerprofile"."activity_bonus_since",
"users_jobseekerprofile"."cape_freelance",
Expand Down Expand Up @@ -541,7 +540,6 @@
"users_jobseekerprofile"."rsa_allocation_since",
"users_jobseekerprofile"."ass_allocation_since",
"users_jobseekerprofile"."aah_allocation_since",
"users_jobseekerprofile"."ata_allocation_since",
"users_jobseekerprofile"."are_allocation_since",
"users_jobseekerprofile"."activity_bonus_since",
"users_jobseekerprofile"."cape_freelance",
Expand Down
1 change: 0 additions & 1 deletion tests/api/employee_record_api/__snapshots__/tests.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,6 @@
"users_jobseekerprofile"."rsa_allocation_since",
"users_jobseekerprofile"."ass_allocation_since",
"users_jobseekerprofile"."aah_allocation_since",
"users_jobseekerprofile"."ata_allocation_since",
"users_jobseekerprofile"."are_allocation_since",
"users_jobseekerprofile"."activity_bonus_since",
"users_jobseekerprofile"."cape_freelance",
Expand Down
1 change: 0 additions & 1 deletion tests/users/__snapshots__/test_admin_views.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@
"users_jobseekerprofile"."rsa_allocation_since",
"users_jobseekerprofile"."ass_allocation_since",
"users_jobseekerprofile"."aah_allocation_since",
"users_jobseekerprofile"."ata_allocation_since",
"users_jobseekerprofile"."are_allocation_since",
"users_jobseekerprofile"."activity_bonus_since",
"users_jobseekerprofile"."cape_freelance",
Expand Down
1 change: 0 additions & 1 deletion tests/www/apply/__snapshots__/test_list_for_siae.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,6 @@
"users_jobseekerprofile"."rsa_allocation_since",
"users_jobseekerprofile"."ass_allocation_since",
"users_jobseekerprofile"."aah_allocation_since",
"users_jobseekerprofile"."ata_allocation_since",
"users_jobseekerprofile"."are_allocation_since",
"users_jobseekerprofile"."activity_bonus_since",
"users_jobseekerprofile"."cape_freelance",
Expand Down
2 changes: 0 additions & 2 deletions tests/www/apply/__snapshots__/test_list_prescriptions.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,6 @@
"users_jobseekerprofile"."rsa_allocation_since",
"users_jobseekerprofile"."ass_allocation_since",
"users_jobseekerprofile"."aah_allocation_since",
"users_jobseekerprofile"."ata_allocation_since",
"users_jobseekerprofile"."are_allocation_since",
"users_jobseekerprofile"."activity_bonus_since",
"users_jobseekerprofile"."cape_freelance",
Expand Down Expand Up @@ -1425,7 +1424,6 @@
"users_jobseekerprofile"."rsa_allocation_since",
"users_jobseekerprofile"."ass_allocation_since",
"users_jobseekerprofile"."aah_allocation_since",
"users_jobseekerprofile"."ata_allocation_since",
"users_jobseekerprofile"."are_allocation_since",
"users_jobseekerprofile"."activity_bonus_since",
"users_jobseekerprofile"."cape_freelance",
Expand Down
7 changes: 0 additions & 7 deletions tests/www/apply/__snapshots__/test_process.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@
"users_jobseekerprofile"."rsa_allocation_since",
"users_jobseekerprofile"."ass_allocation_since",
"users_jobseekerprofile"."aah_allocation_since",
"users_jobseekerprofile"."ata_allocation_since",
"users_jobseekerprofile"."are_allocation_since",
"users_jobseekerprofile"."activity_bonus_since",
"users_jobseekerprofile"."cape_freelance",
Expand Down Expand Up @@ -1259,7 +1258,6 @@
"users_jobseekerprofile"."rsa_allocation_since",
"users_jobseekerprofile"."ass_allocation_since",
"users_jobseekerprofile"."aah_allocation_since",
"users_jobseekerprofile"."ata_allocation_since",
"users_jobseekerprofile"."are_allocation_since",
"users_jobseekerprofile"."activity_bonus_since",
"users_jobseekerprofile"."cape_freelance",
Expand Down Expand Up @@ -1400,7 +1398,6 @@
T12."rsa_allocation_since",
T12."ass_allocation_since",
T12."aah_allocation_since",
T12."ata_allocation_since",
T12."are_allocation_since",
T12."activity_bonus_since",
T12."cape_freelance",
Expand Down Expand Up @@ -2395,7 +2392,6 @@
"users_jobseekerprofile"."rsa_allocation_since",
"users_jobseekerprofile"."ass_allocation_since",
"users_jobseekerprofile"."aah_allocation_since",
"users_jobseekerprofile"."ata_allocation_since",
"users_jobseekerprofile"."are_allocation_since",
"users_jobseekerprofile"."activity_bonus_since",
"users_jobseekerprofile"."cape_freelance",
Expand Down Expand Up @@ -2536,7 +2532,6 @@
T12."rsa_allocation_since",
T12."ass_allocation_since",
T12."aah_allocation_since",
T12."ata_allocation_since",
T12."are_allocation_since",
T12."activity_bonus_since",
T12."cape_freelance",
Expand Down Expand Up @@ -3475,7 +3470,6 @@
"users_jobseekerprofile"."rsa_allocation_since",
"users_jobseekerprofile"."ass_allocation_since",
"users_jobseekerprofile"."aah_allocation_since",
"users_jobseekerprofile"."ata_allocation_since",
"users_jobseekerprofile"."are_allocation_since",
"users_jobseekerprofile"."activity_bonus_since",
"users_jobseekerprofile"."cape_freelance",
Expand Down Expand Up @@ -3616,7 +3610,6 @@
T12."rsa_allocation_since",
T12."ass_allocation_since",
T12."aah_allocation_since",
T12."ata_allocation_since",
T12."are_allocation_since",
T12."activity_bonus_since",
T12."cape_freelance",
Expand Down
Loading

0 comments on commit b47fe4a

Please sign in to comment.