Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions backend/src/common/data-injection.tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,7 @@ export enum UseCaseType {
SAAS_LOGIN_USER_WITH_GOOGLE = 'SAAS_LOGIN_USER_WITH_GOOGLE',
SAAS_LOGIN_USER_WITH_GITHUB = 'SAAS_LOGIN_USER_WITH_GITHUB',
SAAS_SAAS_GET_USERS_INFOS_BY_EMAIL = 'SAAS_SAAS_GET_USERS_INFOS_BY_EMAIL',
SAAS_SUSPEND_USERS = 'SAAS_SUSPEND_USERS',
SAAS_SUSPEND_USERS_OVER_LIMIT = 'SAAS_SUSPEND_USERS_OVER_LIMIT',
SAAS_GET_COMPANY_INFO_BY_USER_ID = 'SAAS_GET_COMPANY_INFO_BY_USER_ID',
SAAS_GET_USERS_COUNT_IN_COMPANY = 'SAAS_GET_USERS_COUNT_IN_COMPANY',
FREEZE_CONNECTIONS_IN_COMPANY = 'FREEZE_CONNECTIONS_IN_COMPANY',
UNFREEZE_CONNECTIONS_IN_COMPANY = 'UNFREEZE_CONNECTIONS_IN_COMPANY',
SAAS_REGISTER_USER_WITH_SAML = 'SAAS_REGISTER_USER_WITH_SAML',
SAAS_CREATE_CONNECTION_FOR_HOSTED_DB = 'SAAS_CREATE_CONNECTION_FOR_HOSTED_DB',
SAAS_DELETE_CONNECTION_FOR_HOSTED_DB = 'SAAS_DELETE_CONNECTION_FOR_HOSTED_DB',
SAAS_UPDATE_HOSTED_CONNECTION_PASSWORD = 'SAAS_UPDATE_HOSTED_CONNECTION_PASSWORD',
Expand All @@ -150,16 +144,6 @@ export enum UseCaseType {
SUSPEND_USERS_IN_COMPANY = 'SUSPEND_USERS_IN_COMPANY',
UNSUSPEND_USERS_IN_COMPANY = 'UNSUSPEND_USERS_IN_COMPANY',
TOGGLE_TEST_CONNECTIONS_DISPLAY_MODE_IN_COMPANY = 'TOGGLE_TEST_CONNECTIONS_DISPLAY_MODE_IN_COMPANY',
UPLOAD_COMPANY_LOGO = 'UPLOAD_COMPANY_LOGO',
FIND_COMPANY_LOGO = 'FIND_COMPANY_LOGO',
DELETE_COMPANY_LOGO = 'DELETE_COMPANY_LOGO',
UPLOAD_COMPANY_FAVICON = 'UPLOAD_COMPANY_FAVICON',
FIND_COMPANY_FAVICON = 'FIND_COMPANY_FAVICON',
DELETE_COMPANY_FAVICON = 'DELETE_COMPANY_FAVICON',
ADD_COMPANY_TAB_TITLE = 'ADD_COMPANY_TAB_TITLE',
FIND_COMPANY_TAB_TITLE = 'FIND_COMPANY_TAB_TITLE',
DELETE_COMPANY_TAB_TITLE = 'DELETE_COMPANY_TAB_TITLE',
GET_COMPANY_WHITE_LABEL_PROPERTIES = 'GET_COMPANY_WHITE_LABEL_PROPERTIES',

CREATE_ACTION_RULES = 'CREATE_ACTION_RULES',
FIND_ACTION_RULES_FOR_TABLE = 'FIND_ACTION_RULES_FOR_TABLE',
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { ApiProperty } from '@nestjs/swagger';
import { FoundSimpleConnectionInfoDS } from '../../../connection/application/data-structures/found-connections.ds.js';
import { FoundCompanyImageInfo } from '../dto/found-company-logo.ro.js';
import { FoundInvitationInCompanyDs } from './found-invitation-in-company.ds.js';

export class FoundUserCompanyInfoDs {
Expand Down Expand Up @@ -34,17 +33,9 @@ export class FoundUserCompanyInfoDs {
@ApiProperty()
show_test_connections: boolean;

@ApiProperty({ required: false })
custom_domain: string | null;

@ApiProperty({ required: false, type: FoundCompanyImageInfo, nullable: true })
logo: FoundCompanyImageInfo | null;

@ApiProperty({ required: false, type: FoundCompanyImageInfo, nullable: true })
favicon: FoundCompanyImageInfo | null;

// Custom domains were retired with plan 46 (2026-09); always null, kept for API compatibility.
@ApiProperty({ required: false, nullable: true })
tab_title: string | null;
custom_domain: string | null;
}

export class FoundUserFullCompanyInfoDs extends FoundUserCompanyInfoDs {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
import { ApiProperty } from '@nestjs/swagger';
import { SubscriptionLevelEnum } from '../../../../enums/subscription-level.enum.js';
import { FoundCompanyImageInfo } from './found-company-logo.ro.js';

// TEMPORARY (plan 46, 2026-09-17): white label is retired, but the deployed Angular shell still calls
// GET /company/white-label-properties/:companyId on every load. This RO is the empty answer that keeps
// it on the default logo/favicon/title. Delete together with the route once the frontend no longer
// asks (rocketadmin/frontend `app.component.ts` → `CompanyService.getWhiteLabelProperties`).
export class FoundCompanyWhiteLabelPropertiesRO {
@ApiProperty({ type: FoundCompanyImageInfo, required: false, nullable: true })
logo: FoundCompanyImageInfo | null;
@ApiProperty({ type: 'object', nullable: true, properties: {} })
logo: null;

@ApiProperty({ type: FoundCompanyImageInfo, required: false, nullable: true })
favicon: FoundCompanyImageInfo | null;
@ApiProperty({ type: 'object', nullable: true, properties: {} })
favicon: null;

@ApiProperty({ type: String, required: false, nullable: true })
tab_title: string | null;
@ApiProperty({ type: String, nullable: true })
tab_title: null;

@ApiProperty({ enum: SubscriptionLevelEnum, nullable: true })
subscriptionLevel: SubscriptionLevelEnum | null;
@ApiProperty({ type: String, nullable: true })
subscriptionLevel: null;
}

export const EMPTY_WHITE_LABEL_PROPERTIES: FoundCompanyWhiteLabelPropertiesRO = {
logo: null,
favicon: null,
tab_title: null,
subscriptionLevel: null,
};
37 changes: 7 additions & 30 deletions backend/src/entities/company-info/company-info-helper.service.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,12 @@
import { Inject, Injectable } from '@nestjs/common';
import { IGlobalDatabaseContext } from '../../common/application/global-database-context.interface.js';
import { BaseType } from '../../common/data-injection.tokens.js';
import { SubscriptionLevelEnum } from '../../enums/subscription-level.enum.js';
import { isSaaS } from '../../helpers/app/is-saas.js';
import { isTest } from '../../helpers/app/is-test.js';
import { Constants } from '../../helpers/constants/constants.js';
import { SaasCompanyGatewayService } from '../../microservices/gateways/saas-gateway.ts/saas-company-gateway.service.js';
import { Injectable } from '@nestjs/common';

@Injectable()
export class CompanyInfoHelperService {
constructor(
@Inject(BaseType.GLOBAL_DB_CONTEXT)
protected _dbContext: IGlobalDatabaseContext,
private readonly saasCompanyGatewayService: SaasCompanyGatewayService,
) {}

public async canInviteMoreUsers(companyId: string): Promise<boolean> {
if (!isSaaS() || isTest()) {
return true;
}

const companyInformationFromSaaS = await this.saasCompanyGatewayService.getCompanyInfo(companyId);

const [countUsersInCompany, countInvitationsInCompany] = await Promise.all([
this._dbContext.userRepository.countUsersInCompany(companyId),
this._dbContext.invitationInCompanyRepository.countNonExpiredInvitationsInCompany(companyId),
]);

if (companyInformationFromSaaS?.subscriptionLevel === SubscriptionLevelEnum.FREE_PLAN) {
return countUsersInCompany + countInvitationsInCompany < Constants.FREE_PLAN_USERS_COUNT;
}
return true;
// Plan 46 (2026-09-17): RocketAdmin is a free product with unlimited members — the 3-seat cap on
// FREE_PLAN companies (users + pending invitations, checked against the saas subscription level)
// is gone. The method stays as the single seam the invite flow consults, so a future member cap
// has one place to land; it makes no saas round trip and needs no database.
public canInviteMoreUsers(_companyId: string): Promise<boolean> {
return Promise.resolve(true);
}
}
Loading
Loading