Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove expired license status and define EnrollmentDueDateSerializer #602

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
14 changes: 12 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,17 @@ 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 +287,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
Loading