Skip to content

Commit

Permalink
fix: remove expired license status and define EnrollmentDueDateSerial…
Browse files Browse the repository at this point in the history
…izer (#602)
  • Loading branch information
adamstankiewicz authored Nov 27, 2024
1 parent 1c2fc12 commit dadd558
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
4 changes: 0 additions & 4 deletions enterprise_access/apps/api/v1/tests/test_bff_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ def setUp(self):
'subscription_licenses_by_status': {
'activated': [],
'assigned': [],
'expired': [],
'revoked': [],
},
},
Expand Down Expand Up @@ -277,7 +276,6 @@ def test_dashboard_with_subscriptions(
'subscription_licenses_by_status': {
'activated': [self.expected_subscription_license],
'assigned': [],
'expired': [],
'revoked': [],
},
},
Expand Down Expand Up @@ -346,7 +344,6 @@ def test_dashboard_with_subscriptions_license_activation(
'subscription_licenses_by_status': {
'activated': [expected_activated_subscription_license],
'assigned': [],
'expired': [],
'revoked': [],
},
},
Expand Down Expand Up @@ -531,7 +528,6 @@ def test_dashboard_with_subscriptions_license_auto_apply(
'subscription_licenses_by_status': {
'activated': expected_licenses,
'assigned': [],
'expired': [],
'revoked': [],
},
},
Expand Down
13 changes: 11 additions & 2 deletions enterprise_access/apps/bffs/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ class SubscriptionLicenseStatusSerializer(BaseBffSerializer):

activated = SubscriptionLicenseSerializer(many=True, required=False, default=list)
assigned = SubscriptionLicenseSerializer(many=True, required=False, default=list)
expired = SubscriptionLicenseSerializer(many=True, required=False, default=list)
revoked = SubscriptionLicenseSerializer(many=True, required=False, default=list)


Expand Down Expand Up @@ -252,6 +251,16 @@ class BaseLearnerPortalResponseSerializer(BaseResponseSerializer):
enterprise_customer_user_subsidies = EnterpriseCustomerUserSubsidiesSerializer()


class EnrollmentDueDateSerializer(BaseBffSerializer):
"""
Serializer for enrollment due date.
"""

name = serializers.CharField()
date = serializers.CharField()
url = serializers.URLField()


class EnterpriseCourseEnrollmentSerializer(BaseBffSerializer):
"""
Serializer for enterprise course enrollment.
Expand All @@ -277,7 +286,7 @@ class EnterpriseCourseEnrollmentSerializer(BaseBffSerializer):
resume_course_run_url = serializers.URLField(allow_null=True)
is_revoked = serializers.BooleanField()
due_dates = serializers.ListField(
child=serializers.DictField(),
child=EnrollmentDueDateSerializer(),
allow_empty=True,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ def test_build(self, mock_handler_context, has_subscriptions_data):
"subscription_licenses_by_status": {
'activated': [],
'assigned': [],
'expired': [],
'revoked': [],
},
}
Expand Down

0 comments on commit dadd558

Please sign in to comment.