Skip to content

Commit

Permalink
Add disregard_selection EligibilityCheck serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMillar-MOJ committed Nov 4, 2024
1 parent 61f80c5 commit f71a244
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions cla_backend/apps/call_centre/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class Meta(PersonalDetailsSerializerFull.Meta):
"safe_to_contact",
"vulnerable_user",
"has_diversity",
"announce_call"
"announce_call",
)


Expand Down Expand Up @@ -200,17 +200,18 @@ def validate_property_set(self, value):
property_item = super(EligibilityCheckSerializer, self).validate_property_set(value)
# Iterate through each item (property) in the property_set list
for property_item in value:
if property_item.get('value') is None:
if property_item.get("value") is None:
raise serializers.ValidationError("Property 'value' cannot be null.")
if property_item.get('mortgage_left') is None:
if property_item.get("mortgage_left") is None:
raise serializers.ValidationError("Property 'mortgage_left' cannot be null.")
if property_item.get('share') is None:
if property_item.get("share") is None:
raise serializers.ValidationError("Property 'share' cannot be null.")
if property_item.get('disputed') is None:
if property_item.get("disputed") is None:
raise serializers.ValidationError("Property 'disputed' cannot be null.")
if property_item.get('main') is None:
if property_item.get("main") is None:
raise serializers.ValidationError("Property 'main' cannot be null.")
return value

property_set = PropertySerializer(many=True, required=False)
you = PersonSerializer(required=False, allow_null=True)
partner = PartnerPersonSerializer(required=False, allow_null=True)
Expand All @@ -236,6 +237,7 @@ class Meta(EligibilityCheckSerializerBase.Meta):
"state",
"specific_benefits",
"disregards",
"disregard_selection",
"has_passported_proceedings_letter",
"under_18_passported",
"is_you_under_18",
Expand Down Expand Up @@ -360,7 +362,7 @@ class CreateCaseSerializer(CaseSerializer):
"""

def create(self, validated_data):
validated_data['gtm_anon_id'] = str(uuid.uuid4())
validated_data["gtm_anon_id"] = str(uuid.uuid4())
return super(CreateCaseSerializer, self).create(validated_data)

personal_details = UUIDSerializer(
Expand Down

0 comments on commit f71a244

Please sign in to comment.