Remove Customer dependency from Subscription model
Problem
In CustomersDot, a Subscription
model exists as a wrapper around a Zuora::Subscription
object. This wrapper is meant to contain business logic specific to CustomersDot. The Subscription
class has an initialization dependency on having a Customer
record (see code). This dependency does not seem to be necessary and only adds to the complexity in our system.
In most places, the Customer
record is used simply as a way to determine the zuora_account_id
for the subscription, but we should be getting this directly from the Zuora::Subscription
instead. In other places, it is used to determine who should receive provisioning emails, but this can also be determined from using Zuora (the Sold To contact of the Zuora Account).
Proposal
Identify and update all places where the customer
is referenced from the Subscription
object, and eventually remove the dependency altogether. We can start with the easy references where customer is used to get the zuora_account_id
.
Result
A much cleaner and understandable Subscription
class. This will also enable us to rely more on Zuora data and less on the customer data in CDot which helps towards the initiative in &8331.