Consolidate 'invoice_datas' key to 'invoice_data' for for preview params
Problem
Currently we have two different, but similar object key when generating preview for invoices.
- When creating subscription we use:
{invoice_data: {}}
- When amending subscription we use:
{invoice_datas: {}}
The difference between invoice_data and invoice_datas is easy to miss which may lead to unknown bugs, or extra code to check for both key
Proposal
Consolidate both the keys into single key usage: invoice_data
- The amendment only happens from
CDot
subscription management, so we can scope our testing withinCDot
only. - Search and test for possible areas of code break in
CDot
with the API change. - Frontend already checks for both keys when parsing response
Result
Uniform invoice
data object structure when previewing invoice for create and amend.
Edited by Bishwa Hang Rai