Skip to content

Commit

Permalink
feat: Add delinquent to account details serializer (#706)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajay-sentry authored Jul 23, 2024
1 parent b3c6343 commit 8339939
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 4 additions & 3 deletions api/internal/owner/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,21 +261,22 @@ class Meta:
fields = read_only_fields + (
"activated_student_count",
"activated_user_count",
"apply_cancellation_discount",
"checkout_session_id",
"delinquent",
"email",
"inactive_user_count",
"name",
"nb_active_private_repos",
"plan",
"plan_auto_activate",
"plan_provider",
"uses_invoice",
"plan",
"repo_total_credits",
"root_organization",
"schedule_detail",
"student_count",
"subscription_detail",
"apply_cancellation_discount",
"uses_invoice",
)

def _get_billing(self):
Expand Down
5 changes: 5 additions & 0 deletions api/internal/tests/views/test_account_viewset.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ def test_retrieve_account_gets_account_fields(self):
"student_count": 0,
"schedule_detail": None,
"uses_invoice": False,
"delinquent": None,
}

@patch("services.billing.stripe.SubscriptionSchedule.retrieve")
Expand Down Expand Up @@ -264,6 +265,7 @@ def test_retrieve_account_gets_account_fields_when_there_are_scheduled_details(
},
},
"uses_invoice": False,
"delinquent": None,
}

@patch("services.billing.stripe.SubscriptionSchedule.retrieve")
Expand Down Expand Up @@ -366,6 +368,7 @@ def test_retrieve_account_returns_last_phase_when_more_than_one_scheduled_phases
},
},
"uses_invoice": False,
"delinquent": None,
}

@patch("services.billing.stripe.Subscription.retrieve")
Expand Down Expand Up @@ -432,6 +435,7 @@ def test_retrieve_account_gets_none_for_schedule_details_when_schedule_is_nonexi
"student_count": 0,
"schedule_detail": None,
"uses_invoice": False,
"delinquent": None,
}

def test_retrieve_account_gets_account_students(self):
Expand Down Expand Up @@ -465,6 +469,7 @@ def test_retrieve_account_gets_account_students(self):
"student_count": 3,
"schedule_detail": None,
"uses_invoice": False,
"delinquent": None,
}

def test_account_with_free_user_plan(self):
Expand Down

0 comments on commit 8339939

Please sign in to comment.