def get_product_summary(self, plan_version, account, subscription):
        product_rate = plan_version.product_rate
        product_type = product_rate.product.product_type
        return {
            'name': product_type,
            'monthly_fee': _("USD %s /month") % product_rate.monthly_fee,
            'type': product_type,
            'subscription_credit': self._fmt_credit(self._credit_grand_total(
                CreditLine.get_credits_by_subscription_and_features(
                    subscription, product_type=SoftwareProductType.ANY
                ) if subscription else None
            )),
            'account_credit': self._fmt_credit(self._credit_grand_total(
                CreditLine.get_credits_for_account(
                    account, product_type=SoftwareProductType.ANY
                ) if account else None
            )),
        }
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/domain/views.py/DomainSubscriptionView.get_product_summary/original