Skip to content

[PB-6350]: feat/add monthly commitment plans logic#364

Merged
xabg2 merged 4 commits intomasterfrom
feature/monthly-plans-commitment
May 5, 2026
Merged

[PB-6350]: feat/add monthly commitment plans logic#364
xabg2 merged 4 commits intomasterfrom
feature/monthly-plans-commitment

Conversation

@xabg2
Copy link
Copy Markdown
Collaborator

@xabg2 xabg2 commented May 5, 2026

What

We are introducing monthly plans with a 12-month commitment. Users can already purchase monthly plans, but we now need to handle cancellations according to this commitment period.

How

To support this, we update the cancel_at property of the subscription to schedule cancellation based on the remaining months required to complete the 12-month commitment.
Additionally, a commitment object has been added to the subscription response. This includes:

  • Whether the commitment is active
  • The number of months remaining
  • The scheduled cancellation date

@xabg2 xabg2 self-assigned this May 5, 2026
@xabg2 xabg2 requested review from jzunigax2 and sg-gs as code owners May 5, 2026 07:21
@xabg2 xabg2 added the enhancement New feature or request label May 5, 2026
Comment thread tests/src/services/klaviyo.service.test.ts
Comment thread tests/src/services/payment.service.test.ts Outdated
Comment thread tests/src/services/payment.service.test.ts Outdated
Comment thread src/services/payment.service.ts Outdated
const cancelAtDate = createdAt.add(periodsElapsed + 1, 'year');
const cancelAt = cancelAtDate.unix();

const isFirstMonth = monthsElapsed === 0 && now.diff(createdAt, 'day') < 30;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<= I think, isn't? It's up to 30 days.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, changing it

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed! @sg-gs

Comment thread tests/src/services/payment.service.test.ts
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 5, 2026

@xabg2 xabg2 merged commit b1acec6 into master May 5, 2026
11 checks passed
@xabg2 xabg2 deleted the feature/monthly-plans-commitment branch May 5, 2026 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ready-for-preview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants