Use total_quantity when calculating quantity in Order.build_from_subscription
In Order.build_from_subscription, it calculates quantity as subscription.main_product.quantity
.
This is incorrect when the subscription contains multiple main products. For example, this subscription. After provision, the order.quantity is 26
, it should be 75
instead.
I think this code should use subscription.total_quantity
.
We had ever addressed similar issue in several old issues:
- https://gitlab.com/gitlab-org/customers-gitlab-com/-/issues/2050+
- https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/1038#note_299229470 (https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/1153+ --- however this was reverted by https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/1176+)
I think now we should apply https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/1153+ again.
Problem
Proposal
Result
Next steps (if any)
How will we measure success?
Edited by Qingyu Zhao