Remove amendment from Product object

Background

When using the Amend API to make changes to a subscription, the Subscription Rate Plan ends up with a reference to the amendment_id responsible for the change. As part of the Orders Harmonization testing, we noticed when using Orders to make changes to a subscription, there is no amendment_id on the Subscription Rate Plan (interestingly there is an amendment_type).

CustomersDot uses this reference to the amendment_id in order to build a Product object (ref) for the subscription (think of this as an object representing the products attached to the subscription).

As far as we can tell, the amendment on the Product is used only to determine the created_at datetime of the Product. CustomersDot is using the created_date of the amendment as the Product's created_at date. It's not exactly clear why this is using the amendment, but was introduced in https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/333 over 2 years ago. Perhaps this information could be pulled from the Subscription Rate Plan, Charge or Tier, and eliminate this dependency on the amendment.

Purpose

Investigate if amendment can be removed from the Product model. It appears to only be used for the created_at method (but we should confirm that). If we use other object like the Subscription Rate Plan, Charge or Tier to get a "created" timestamp of the product, we would be able to remove amendment.

We also noticed that the amendment in the subscription object appears to be only used for product initialization. We should determine if it can be removed from Subscription as well.

Edited Oct 29, 2021 by Amparo Luna
Assignee Loading
Time tracking Loading