Avoid country validation for customers created via Zuora callouts
Problem
Provisioning errors for unsupported countries was a frequent problem. If a subscription was provisioned from one of these countries, the callout would fail at the step the Customer was created for the sold to contact because of this country validation in the Customer model.
As mentioned here, a while back we updated this country validation on Customer to be conditional. If the customer was had a billing account membership, the validation would be skipped, allowing the provisioning process to continue. We had guardrails on the purchase process to prevent invalid countries from purchasing. However, if the purchase was made (e.g. sales assisted) and the order processed callout was received, CDot would provision the subscription (except for a handful of known trade restricted countries).
We found out recently there were still some provisions failing due to unsupported country as reported here that were unexpected. As explained in https://gitlab.com/gitlab-org/customers-gitlab-com/-/issues/4966#note_1716042535, we discovered the country validation was still blocking provisioning if the sold to contact email was not already a Customer in CDot, requiring a new Customer to be created. This would fail because of the country validation.
Proposal
Let's look at skipping the country validation for Customers created via the Zuora Callouts. We know because the callout originates from Zuora that the contact is part of a Zuora Account, and thus the CDot Customer will be a member of a billing account (just not at the point it's created here in the FindOrCreateCustomerService). We could instead pass an attribute to this service from ZuoraCallout::BaseWorker to indicate the country validation should be skipped for this Customer.
Result
Less failures during provisioning of subscriptions from countries that aren't truly trade restricted.