[Spike] Replace Customer references to salesforce_account_id

Problem

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

  • Salesforce::CreateAccountWorker
  • Salesforce::FindAccountService
  • Api::CustomersController

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 salesforce_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 to fetch salesforce_account_id instead of using the salesforce_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.

Edited Oct 14, 2022 by Tyler Amos
Assignee Loading
Time tracking Loading