Handle multiple charges product in a consistent approach

From the discussion https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/7748#note_1467816090

One product rate plan contains multiple product rate plan charges -- this scenario is really tricky.

It seems we have such scenario. For example GitLab EE Premium(2c92a0fd58c4fff70158d6989f6f2a3d) contains multiple product rate plan charges, among those charges we only treat the below charge as main_product:

GitLab EE Premium

199.00 USD / Seats / Annual
Id: 2c92a0ff58bdf4eb0158d699430653cd
(Last Updated: 10/01/2021 07:42:05 PDT)

The way we handle such GitLab EE Premium product rate plan, is to check the product rate plan charge id instead of product rate plan id in detect_main_product

But the GitLab EE Premium(2c92a0fd58c4fff70158d6989f6f2a3d) is not included in all_gitlab_plans. While GitLab Dedicated plans are included in all_gitlab_plans. 😄

Now I think this MR's approach works.

Beyond this MR, I feel we might consider to handle multiple charges product in a consistent approach in the future. Maybe we ONLY use product rate plan charge id in config/application.yml? 🤔

Edited Jul 13, 2023 by Qingyu Zhao
Assignee Loading
Time tracking Loading