mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
Add user limit check for free plan
This commit is contained in:
@@ -16,7 +16,7 @@ import { IsBillingEnabled } from '../EnvironmentConfig';
|
||||
import { AccountsRoute } from 'Common/ServiceRoute';
|
||||
import DatabaseConfig from '../DatabaseConfig';
|
||||
import BillingService from './BillingService';
|
||||
import SubscriptionPlan from 'Common/Types/Billing/SubscriptionPlan';
|
||||
import SubscriptionPlan, { PlanSelect } from 'Common/Types/Billing/SubscriptionPlan';
|
||||
import Project from 'Model/Models/Project';
|
||||
import MailService from './MailService';
|
||||
import EmailTemplateType from 'Common/Types/Email/EmailTemplateType';
|
||||
@@ -62,6 +62,13 @@ export class TeamMemberService extends DatabaseService<TeamMember> {
|
||||
Errors.TeamMemberService.LIMIT_REACHED
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if(createBy.props.currentPlan === PlanSelect.Free && project && project.paymentProviderSubscriptionSeats && project.paymentProviderSubscriptionSeats >= 1){
|
||||
throw new BadDataException(
|
||||
Errors.TeamMemberService.LIMIT_REACHED_FOR_FREE_PLAN
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
createBy.data.hasAcceptedInvitation = false;
|
||||
|
||||
@@ -19,5 +19,6 @@ export default {
|
||||
'This team should have at least 1 member who has accepted the invitation.',
|
||||
LIMIT_REACHED:
|
||||
'You have reached the user limit. You cannot invite any more users to this project. Please contact billing@oneuptime.com to increase your user limit.',
|
||||
LIMIT_REACHED_FOR_FREE_PLAN: 'You have reached the user limit for the free plan. Please upgrade your plan to Growth to invite more users.',
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user