Ability to add an Order Action type more than once in a transaction

Problem

ParamConstructor (Zuora::Orders::Actions::ParamConstructor) is a set of middleware services that sanitizes and formulates params required by an order action service (Zuora::Orders::Actions).

Currently, ParamConstructor returns a single object, assuming that a transaction can contain an Order action type only once. While this is true for most order actions in the existing business driven actions, there are a few exceptions such as:

  • UpdateProduct: a single transaction can update main product as well as options product

Proposal

  • Update params in Zuora::Orders::Actions::BaseService to be an Array of Objects instead of a single Object
  • Update .execute in Zuora::Orders::Actions::BaseService to loop through params
  • Individual Zuora::Orders::Actions::ParamConstructor returns an array instead of an object

Result

  • Ability to add more than one instance of an OrderAction type in a transaction
  • Signature of ParamConstructor is consistent for all order actions

Next steps (if any)

How will we measure success?

Edited Sep 13, 2022 by Aishwarya Subramanian
Assignee Loading
Time tracking Loading