Skip to content

Commit

Permalink
Merge pull request #37 from softwareone-platform/bugfix/MPT-3586/fix-…
Browse files Browse the repository at this point in the history
…items-api-changes

MPT-3586 Do not pass commitment period for one-time items
  • Loading branch information
d3rky authored Oct 10, 2024
2 parents c0f3c6a + ed425ef commit c247be4
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions swo/mpt/cli/core/products/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,16 +333,24 @@ def _to_item_json(
constants.ITEMS_QUANTITY_APPLICABLE, values
)[2]
== "True",
"terms": {
"commitment": find_value_for(constants.ITEMS_COMMITMENT_TERM, values)[2],
"period": find_value_for(constants.ITEMS_BILLING_FREQUENCY, values)[2],
},
"unit": {
"id": find_value_for(constants.ITEMS_UNIT_ID, values)[2],
},
"parameters": parameters,
}

period = find_value_for(constants.ITEMS_BILLING_FREQUENCY, values)[2]

if period == "one-time":
item_json["terms"] = {
"period": period,
}
else:
item_json["terms"] = {
"commitment": find_value_for(constants.ITEMS_COMMITMENT_TERM, values)[2],
"period": period,
}

if is_operations:
item_json["externalIds"] = {
"operations": find_value_for(constants.ITEMS_ERP_ITEM_ID, values)[2]
Expand Down

0 comments on commit c247be4

Please sign in to comment.