Mechanism to keep BillingAccount data in sync with Zuora
Problem
With BillingAccount records being created and stored locally in CustomersDot, it will be important to make sure the data stored locally is kept in sync with the Single Source of Truth, Zuora. The main concern at this point might be the BillingAccount name as we may not be caching much else locally. We can reference the issue where the BillingAccount model was introduced for more information, #4792 (closed).
Proposal
In this issue, we need to work with @gitlab-com/business-technology/enterprise-apps/zuora-architects to build the mechanism for ensuring changes to Zuora Account (mainly name and salesforce_account_id) are synced to CustomersDot.
We've engaged the Finsys team via https://gitlab.com/gitlab-com/business-technology/enterprise-apps/financeops/finance-systems/-/issues/886. In that issue, the Finsys team will create a Custom Event for Zuora Account which will send a callout notification to CustomersDot.
In this issue, we will be responsible for creating the API endpoint for updating the BillingAccount record based on this callout notification.
Checklist
-
Add new API endpoint to enqueue sync account background job -
Add sync account worker to update BillingAccount with Zuora Account data -
Update documentation in doc/zuora/zuora_callouts.md
Availability & Testing
When we arrive at a solution, we should add tests to ensure that this mechanism indeed passes and receives correct data with Zuora. This will likely take the form of integration tests, but contract tests would also work.