diff --git a/__tests__/workers/notifications/candidateOpportunityMatchNotification.ts b/__tests__/workers/notifications/candidateOpportunityMatchNotification.ts index 3f1ee351a0..5d529dc528 100644 --- a/__tests__/workers/notifications/candidateOpportunityMatchNotification.ts +++ b/__tests__/workers/notifications/candidateOpportunityMatchNotification.ts @@ -1,7 +1,7 @@ import { DataSource } from 'typeorm'; import { candidateOpportunityMatchNotification as worker } from '../../../src/workers/notifications/candidateOpportunityMatchNotification'; import createOrGetConnection from '../../../src/db'; -import { Feature, FeatureType, User } from '../../../src/entity'; +import { User } from '../../../src/entity'; import { usersFixture } from '../../fixture'; import { workers } from '../../../src/workers'; import { invokeTypedNotificationWorker, saveFixtures } from '../../helpers'; @@ -19,11 +19,6 @@ describe('candidateOpportunityMatchNotification worker', () => { beforeEach(async () => { jest.resetAllMocks(); await saveFixtures(con, User, usersFixture); - await con.getRepository(Feature).insert({ - userId: '1', - feature: FeatureType.Team, - value: 1, - }); }); it('should be registered', () => { diff --git a/__tests__/workers/opportunity/storeCandidateOpportunityMatch.ts b/__tests__/workers/opportunity/storeCandidateOpportunityMatch.ts index b7a5855674..4e59b01010 100644 --- a/__tests__/workers/opportunity/storeCandidateOpportunityMatch.ts +++ b/__tests__/workers/opportunity/storeCandidateOpportunityMatch.ts @@ -3,13 +3,7 @@ import { storeCandidateOpportunityMatch as worker } from '../../../src/workers/o import { DataSource } from 'typeorm'; import createOrGetConnection from '../../../src/db'; import { OpportunityMatch } from '../../../src/entity/OpportunityMatch'; -import { - User, - Organization, - Alerts, - Feature, - FeatureType, -} from '../../../src/entity'; +import { User, Organization, Alerts } from '../../../src/entity'; import { Opportunity } from '../../../src/entity/opportunities/Opportunity'; import { usersFixture } from '../../fixture'; import { @@ -30,12 +24,6 @@ describe('storeCandidateOpportunityMatch worker', () => { await saveFixtures(con, Organization, organizationsFixture); await saveFixtures(con, User, usersFixture); await saveFixtures(con, Opportunity, opportunitiesFixture); - - await con.getRepository(Feature).insert({ - userId: '1', - feature: FeatureType.Team, - value: 1, - }); }); it('should handle the correct schema format', async () => { diff --git a/src/workers/notifications/candidateOpportunityMatchNotification.ts b/src/workers/notifications/candidateOpportunityMatchNotification.ts index 51b328e7c0..e5667d4493 100644 --- a/src/workers/notifications/candidateOpportunityMatchNotification.ts +++ b/src/workers/notifications/candidateOpportunityMatchNotification.ts @@ -2,7 +2,6 @@ import { NotificationType } from '../../notifications/common'; import { TypedNotificationWorker } from '../worker'; import { TypeORMQueryFailedError } from '../../errors'; import { MatchedCandidate } from '@dailydotdev/schema'; -import { Feature, FeatureType } from '../../entity'; const candidateOpportunityMatchNotification: TypedNotificationWorker<'gondul.v1.candidate-opportunity-match'> = { @@ -18,18 +17,6 @@ const candidateOpportunityMatchNotification: TypedNotificationWorker<'gondul.v1. return; } - // TODO: Temporary until we happy to launch - const isTeamMember = await con.getRepository(Feature).exists({ - where: { - userId, - feature: FeatureType.Team, - value: 1, - }, - }); - if (!isTeamMember) { - return; - } - return [ { type: NotificationType.NewOpportunityMatch, diff --git a/src/workers/opportunity/storeCandidateOpportunityMatch.ts b/src/workers/opportunity/storeCandidateOpportunityMatch.ts index 144a702dc9..72609fe3ec 100644 --- a/src/workers/opportunity/storeCandidateOpportunityMatch.ts +++ b/src/workers/opportunity/storeCandidateOpportunityMatch.ts @@ -2,7 +2,7 @@ import { TypedWorker } from '../worker'; import { MatchedCandidate } from '@dailydotdev/schema'; import { OpportunityMatch } from '../../entity/OpportunityMatch'; import { opportunityMatchDescriptionSchema } from '../../common/schema/opportunities'; -import { Alerts, Feature, FeatureType } from '../../entity'; +import { Alerts } from '../../entity'; import { IsNull } from 'typeorm'; export const storeCandidateOpportunityMatch: TypedWorker<'gondul.v1.candidate-opportunity-match'> = @@ -35,20 +35,9 @@ export const storeCandidateOpportunityMatch: TypedWorker<'gondul.v1.candidate-op skipUpdateIfNoValuesChanged: true, }, ); - - // TODO: Temporary until we happy to launch - const isTeamMember = await con.getRepository(Feature).exists({ - where: { - userId, - feature: FeatureType.Team, - value: 1, - }, - }); - if (isTeamMember) { - await manager - .getRepository(Alerts) - .update({ userId, opportunityId: IsNull() }, { opportunityId }); - } + await manager + .getRepository(Alerts) + .update({ userId, opportunityId: IsNull() }, { opportunityId }); }); }, parseMessage: (message) => {