Create Account model

Problem

CustomersDot needs a model that represents a Zuora Customer Account.

Proposal

Create migration and model for Account that maps 1:1 with a Zuora Customer Account.

Attributes to consider for model:

  • id
  • name (e.g. Customer.company_name)
  • zuora_account_id
  • salesforce_account_id

Other attributes to consider:

  • company_size
    • This may not need to be persisted on Account as it is currently only used when creating the Salesforce Account when creating a subscription via SubscriptionManagerService. I don't think it is needed for future purchases and therefore probably does not need to be synced.
  • vat_code
    • This may not need to be persisted on Account as it is currently only used in SubscribeService or Zuora::Orders::Entities::NewAccount before a new account is created. I don't think it is needed for future purchases and therefore probably does not need to be synced.
  • billable
    • This attribute probably makes more sense at the Customer or AccountMembership level, but may not make sense as currently implemented. It's used only to determine which customers should receive a welcome email. This may require a follow-up issue, perhaps not part of this epic.
  • login_activated
    • This attribute probably makes more sense at the Customer or AccountMembership level, but may not make sense as currently implemented. When enabled, this attribute prevents access to CustomersDot. It is set when a Zuora Callout is processed and a subscription is determined to be managed by a reseller. This may require a follow-up issue, perhaps not part of this epic.

It might be a good idea to review the latest schema.rb to make sure all appropriate Customer attributes have been considered for the Account model.

We are leaning towards very light duplication of data that exists in Zuora, and rely on fetching from Zuora when needed. We will revisit caching in later iterations, but it probably makes sense to store Account name and salesforce_account_id locally on this table given they will be used frequently. This means we will need to keep this model in sync with Zuora, which will be implemented in a later issue.

Edited Sep 12, 2022 by Tyler Amos
Assignee Loading
Time tracking Loading