Mutation to add new product
Problem
We use the subscription#update
API to add new products such as CI minutes, additional storage for an existing subscription. In this issue, we create a GraphQL mutation to perform this operation.
Proposal
- Create a mutation namespace
subscriptions
inapp/graphql/mutations
if it does not already exist - Create a mutation class
AddNewProduct
in the namespace
Step 1: Define the following arguments:
Argument | Type | Required? |
---|---|---|
subscription_number |
GraphQL::Types::String |
Yes |
new_product_id |
GraphQL::Types::String |
Yes |
quantity |
GraphQL::Types::Int |
Yes |
payment_method_id |
GraphQL::Types::String |
Yes |
gl_namespace_name |
GraphQL::Types::String |
Yes |
gl_namespace_id |
GraphQL::Types::String |
Yes |
preview |
GraphQL::Types::Boolean |
No (defaults to false ) |
resolve
method:
Step 2: Define -
Invoke
OrderManagerService
:Zuora::Orders::OrderManagerService.new(customer: customer, order_action_types: action_types, params: params, subscription: subscription)
-
action_types
=add_new_product
-
params
should containid
(subscription number),quantity
,payment_method_id
,new_product_id
,gl_namespace_name
,gl_namespace_id
. May containpreview
-
Result
The mutation should add the new product specified to the subscription.
Next steps (if any)
How will we measure success?
Edited by Aishwarya Subramanian