Follow-up from "Update Billing Account Resolver to accept Gitlab Customer ID"
The following discussion from !8819 should be addressed:
-
@aluthra2 started a discussion: Note to Reviewer: I have not added the
billing_account.present?
check here since we are expecting an empty BillingAccountPresenter in specs for such cases instead of an empty object.
Problem
Currently, the BillingAccountType
is returned when no billing account is actually present for the user. This means all the attributes in this type have to allow null
as a response, for the case where no account exists.
If we instead return null
instead of a BillingAccountType
, we can make the nullability of these attributes more accurate. For example - zuora_account_name
should always be available on the type.
Proposal
- Return
null
in theBillingAccountResolver
when the billing account does not exist - Update the
BillingAccountType
to have correctnull
fields for attributes that should not be null