Replace Customer references to zuora_account_id in Rails Admin and Reconciliation services

Problem

There are many places in the application where zuora_account_id is referenced from Customer (to be renamed User). Here are a few examples:

  • Setting zuora_account_id on an Order
  • FindOrCreateCustomerService
  • InvoicesFinder

Note: This is not an exhaustive list. As we start working on this issue, we could promote this to a sub-epic and create issues for smaller pieces.

Proposal

Let's review the application code to find all the places where zuora_account_id is referenced from a Customer. When the feature flag (introduced in #4794 (closed)) is enabled, the Customer's BillingAccountMembership should be used instead. In many instances, the logged in Customer would have selected the BillingAccount they wish to administer, so this scope should be set and used instead of using the zuora_account_id directly on Customer.

The legacy code will be removed in a later issue once the feature flag has been vetted and promoted in production.

2022-12-16 UPDATE: We've broken this issue into an epic with many issues. I moved this issue into the newly created epic and I've narrowed the focus of this issue to just those items that have been delivered to this point (admin changes and updates to the reconciliation services).

Edited Dec 16, 2022 by Tyler Amos
Assignee Loading
Time tracking Loading