Sync Zuora::Subscription when custom fields are updated in Zuora

Problem

In Phase 1: Build Zuora Cache Models (&11751 - closed), Zuora Subscription models (e.g. Zuora::Subscription, Zuora::RatePlan) were introduced to cache Zuora Subscription data locally in CDot. We need to make sure the data stored in this new model is kept in sync with the Single Source of Truth, Zuora Billing. A big piece to keeping this data in sync will be handled by Sync Zuora::Local::Subscription when processing... (#7728 - closed). However, custom fields for a Zuora Subscription can be updated outside of a Zuora Order. This means changes to these fields wouldn't trigger an Order Processed callout. CDot would need another trigger to keep the Subscription in sync.

Proposal

In this issue, we need to work with @gitlab-com/business-technology/enterprise-apps/zuora-architects to build the mechanism for ensuring changes, in particular relevant custom field changes, to Zuora Subscriptions are synced to CustomersDot.

We've engaged the Finsys team via https://gitlab.com/gitlab-com/business-technology/enterprise-apps/financeops/finance-systems/-/issues/1638+. In that issue, the Finsys team will create a Custom Event, triggered when relevant custom fields are updated on a Zuora Subscription, which will send a callout notification to CustomersDot. You can find the list of relevant custom fields in the Finsys change management issue.

In this issue, we will be responsible for creating a new API endpoint for enqueueing a worker to create/update a Zuora::Subscription record based on this callout notification. This can function similarly to the existing sync_account endpoint. This issue should also cover creating the worker responsible for creating or updating the Zuora::Subscription. Following the same pattern of the existing workers for Account and Contact, this worker would be named ZuoraCallout::SyncResource::SubscriptionWorker.

Checklist

  • Add new API endpoint to enqueue sync subscription background job
  • Add sync subscription worker to create/update a Zuora::Subscription record and its associated records
  • Update documentation in doc/zuora/zuora_callouts.md
  • Enable custom event and callout for CDot Dev in Zuora Central Sandbox 2 (Tenant ID: 10000719)
    • Test and monitor results in CDot Dev
  • Enable custom event and callout for CDot Stg in Zuora Central Sandbox (Tenant ID: 10000796)
    • Test and monitor results in CDot Stg
  • Enable custom event and callout for CDot Prod in Zuora Production (Tenant ID: 6165)
    • Test and monitor results in CDot Prod
Edited Sep 23, 2024 by Tyler Amos
Assignee Loading
Time tracking Loading