diff --git a/services/apps/merge_suggestions_worker/src/activities/getAllTenants.ts b/services/apps/merge_suggestions_worker/src/activities/getAllTenants.ts index 870635f384..15db9e697e 100644 --- a/services/apps/merge_suggestions_worker/src/activities/getAllTenants.ts +++ b/services/apps/merge_suggestions_worker/src/activities/getAllTenants.ts @@ -1,10 +1,10 @@ -import { ITenantId } from 'types' +import { ITenant } from 'types' import { svc } from '../main' import TenantRepository from 'repo/tenant.repo' import { isFeatureEnabled } from '@crowd/feature-flags' import { FeatureFlag } from '@crowd/types' -export async function getAllTenants(): Promise { +export async function getAllTenants(): Promise { const tenantRepository = new TenantRepository(svc.postgres.writer.connection(), svc.log) const tenants = await tenantRepository.getAllTenants() @@ -15,6 +15,7 @@ export async function getAllTenants(): Promise { async () => { return { tenantId: tenant.tenantId, + plan: tenant.plan, } }, svc.unleash, diff --git a/services/apps/merge_suggestions_worker/src/repo/tenant.repo.ts b/services/apps/merge_suggestions_worker/src/repo/tenant.repo.ts index 0105b4a678..8407daed98 100644 --- a/services/apps/merge_suggestions_worker/src/repo/tenant.repo.ts +++ b/services/apps/merge_suggestions_worker/src/repo/tenant.repo.ts @@ -1,6 +1,6 @@ import { DbConnection, DbTransaction } from '@crowd/database' import { Logger } from '@crowd/logging' -import { ITenantId } from 'types' +import { ITenant } from 'types' class TenantRepository { constructor( @@ -8,11 +8,11 @@ class TenantRepository { private readonly log: Logger, ) {} - async getAllTenants(): Promise { - let rows: ITenantId[] = [] + async getAllTenants(): Promise { + let rows: ITenant[] = [] try { rows = await this.connection.query(` - SELECT id as "tenantId" + SELECT id as "tenantId", plan FROM tenants WHERE "deletedAt" IS NULL; `) } catch (err) { diff --git a/services/apps/merge_suggestions_worker/src/types.ts b/services/apps/merge_suggestions_worker/src/types.ts index 443dc000c5..3b8a1fba71 100644 --- a/services/apps/merge_suggestions_worker/src/types.ts +++ b/services/apps/merge_suggestions_worker/src/types.ts @@ -1,5 +1,6 @@ -export interface ITenantId { +export interface ITenant { tenantId: string + plan: string } interface ITermFilter {