Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api-service): Nv 5304 update pricing and billing pages #7718

Open
wants to merge 3 commits into
base: next
Choose a base branch
from

Conversation

tatarco
Copy link
Contributor

@tatarco tatarco commented Feb 13, 2025

What changed? Why was the change needed?

Screenshots

Expand for optional sections

Related enterprise PR

Special notes for your reviewer

Copy link

linear bot commented Feb 13, 2025

Copy link

netlify bot commented Feb 13, 2025

Deploy Preview for dashboard-v2-novu-staging failed. Why did it fail? →

Name Link
🔨 Latest commit 9d4d26f
🔍 Latest deploy log https://app.netlify.com/sites/dashboard-v2-novu-staging/deploys/67ae10cc67910d0008c69941

Copy link

netlify bot commented Feb 13, 2025

Deploy Preview for dev-web-novu failed. Why did it fail? →

Name Link
🔨 Latest commit 9d4d26f
🔍 Latest deploy log https://app.netlify.com/sites/dev-web-novu/deploys/67ae10ccf2fc650008f25147

fix(dashboard): added FF to FE

fix(dashboard): added FF to FE

fix(dashboard): change default sorting

fix(api-service): compiles68457b4c79403ba223d4f360925eb0422e33dffb

fix(api-service): compiles68457b4c79403ba223d4f360925eb0422e33dffb

fix(api-service): compiles
@tatarco tatarco changed the title Nv 5304 update pricing and billing pages feat(api-service): Nv 5304 update pricing and billing pages Feb 13, 2025
Copy link
Contributor

@ChmaraX ChmaraX left a comment

Choose a reason for hiding this comment

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

Please fix the spellcheck errors as well.

Also, we need to change this dashboard part as well:
https://github.com/novuhq/novu/blob/bfb8b9517dd4d8342c0f9850974fb226882ec10c/apps/web/src/ee/billing/components/PlanActionButton.tsx

The action button to "Upgrade plan" has a hardcoded http call like this:

...
api.post(checkoutUrl, {
  billingInterval: selectedBillingInterval,
  apiServiceLevel: ApiServiceLevelEnum.BUSINESS,
}),
...

The apiServiceLevel on the button need to change dynamically based on selected plan.

@@ -158,7 +156,7 @@ describe('webhook event - checkout.session.completed #novu-v2', () => {
throw new Error('ee-billing does not exist');
}

const { CheckoutSessionCompletedHandler, VerifyCustomer, GetPrices } = eeBilling;
const { CheckoutSessionCompletedHandler, VerifyCustomer, GetStripePlanPriceUseCase } = eeBilling;
Copy link
Contributor

Choose a reason for hiding this comment

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

this usecase is not renamed in EE PR - please use GetPrices


describe('CreateSubscription #novu-v2', () => {
const eeBilling = require('@novu/ee-billing');
if (!eeBilling) {
throw new Error('ee-billing does not exist');
}

const { CreateSubscription, GetPrices, UpdateServiceLevel, CreateSubscriptionCommand } = eeBilling;
const { CreateSubscription, GetStripePlanPriceUseCase, UpdateServiceLevel, CreateSubscriptionCommand } = eeBilling;
Copy link
Contributor

Choose a reason for hiding this comment

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

this usecase is not renamed in EE PR - please use GetPrices

@@ -6,6 +6,7 @@ import { encryptApiKey } from '@novu/application-generic';
import { EnvironmentRepository, NotificationGroupRepository } from '@novu/dal';

import { EnvironmentEnum, PROTECTED_ENVIRONMENTS } from '@novu/shared';
import { undefined } from 'zod';
Copy link
Contributor

Choose a reason for hiding this comment

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

is this used?

import { TierExceededException } from './tier-exceeded.exception';

@Injectable()
export class ValidateTiersUseCase {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering if this should be placed in the create-environment module since tier limits are not specific to environments only.

Comment on lines +24 to +30
protected mapEntity<TData>(data: TData): TData extends null ? null : OrganizationEntity {
const mapEntity = super.mapEntity(data);

return mapEntity;
// return { ...mapEntity, apiServiceLevel: migrateServiceLevel(mapEntity?.apiServiceLevel) };
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove this since it does exactly the same thing as super.mapEntity

@ChmaraX ChmaraX assigned LetItRock and unassigned LetItRock Feb 13, 2025
@ChmaraX ChmaraX requested a review from LetItRock February 13, 2025 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants