Skip to content

Commit

Permalink
fix: add missing batch.status and ahjo_case_id to serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
sirtawast committed Sep 11, 2024
1 parent 9a31f2e commit ff80631
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions backend/benefit/applications/api/v1/serializers/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -1890,6 +1890,8 @@ class Meta:
"alterations",
"archived",
"handled_by_ahjo_automation",
"ahjo_case_id",
"batch",
]

read_only_fields = [
Expand All @@ -1910,6 +1912,8 @@ class Meta:
"alterations",
"archived",
"handled_by_ahjo_automation",
"ahjo_case_id",
"batch",
]

archived = serializers.BooleanField()
Expand Down Expand Up @@ -1939,6 +1943,13 @@ class Meta:
),
)

batch = serializers.SerializerMethodField("get_batch_status")

def get_batch_status(self, obj):
print(obj.batch)
return {"status": getattr(obj.batch, "status", None)}

ahjo_case_id = serializers.CharField()
application_number = serializers.IntegerField()

status = serializers.ChoiceField(
Expand Down

0 comments on commit ff80631

Please sign in to comment.