Skip to content

Commit c2e29f5

Browse files
authored
chore: remove team only (#3249)
1 parent 6ffb784 commit c2e29f5

4 files changed

Lines changed: 6 additions & 47 deletions

File tree

__tests__/workers/notifications/candidateOpportunityMatchNotification.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { DataSource } from 'typeorm';
22
import { candidateOpportunityMatchNotification as worker } from '../../../src/workers/notifications/candidateOpportunityMatchNotification';
33
import createOrGetConnection from '../../../src/db';
4-
import { Feature, FeatureType, User } from '../../../src/entity';
4+
import { User } from '../../../src/entity';
55
import { usersFixture } from '../../fixture';
66
import { workers } from '../../../src/workers';
77
import { invokeTypedNotificationWorker, saveFixtures } from '../../helpers';
@@ -19,11 +19,6 @@ describe('candidateOpportunityMatchNotification worker', () => {
1919
beforeEach(async () => {
2020
jest.resetAllMocks();
2121
await saveFixtures(con, User, usersFixture);
22-
await con.getRepository(Feature).insert({
23-
userId: '1',
24-
feature: FeatureType.Team,
25-
value: 1,
26-
});
2722
});
2823

2924
it('should be registered', () => {

__tests__/workers/opportunity/storeCandidateOpportunityMatch.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,7 @@ import { storeCandidateOpportunityMatch as worker } from '../../../src/workers/o
33
import { DataSource } from 'typeorm';
44
import createOrGetConnection from '../../../src/db';
55
import { OpportunityMatch } from '../../../src/entity/OpportunityMatch';
6-
import {
7-
User,
8-
Organization,
9-
Alerts,
10-
Feature,
11-
FeatureType,
12-
} from '../../../src/entity';
6+
import { User, Organization, Alerts } from '../../../src/entity';
137
import { Opportunity } from '../../../src/entity/opportunities/Opportunity';
148
import { usersFixture } from '../../fixture';
159
import {
@@ -30,12 +24,6 @@ describe('storeCandidateOpportunityMatch worker', () => {
3024
await saveFixtures(con, Organization, organizationsFixture);
3125
await saveFixtures(con, User, usersFixture);
3226
await saveFixtures(con, Opportunity, opportunitiesFixture);
33-
34-
await con.getRepository(Feature).insert({
35-
userId: '1',
36-
feature: FeatureType.Team,
37-
value: 1,
38-
});
3927
});
4028

4129
it('should handle the correct schema format', async () => {

src/workers/notifications/candidateOpportunityMatchNotification.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { NotificationType } from '../../notifications/common';
22
import { TypedNotificationWorker } from '../worker';
33
import { TypeORMQueryFailedError } from '../../errors';
44
import { MatchedCandidate } from '@dailydotdev/schema';
5-
import { Feature, FeatureType } from '../../entity';
65

76
const candidateOpportunityMatchNotification: TypedNotificationWorker<'gondul.v1.candidate-opportunity-match'> =
87
{
@@ -18,18 +17,6 @@ const candidateOpportunityMatchNotification: TypedNotificationWorker<'gondul.v1.
1817
return;
1918
}
2019

21-
// TODO: Temporary until we happy to launch
22-
const isTeamMember = await con.getRepository(Feature).exists({
23-
where: {
24-
userId,
25-
feature: FeatureType.Team,
26-
value: 1,
27-
},
28-
});
29-
if (!isTeamMember) {
30-
return;
31-
}
32-
3320
return [
3421
{
3522
type: NotificationType.NewOpportunityMatch,

src/workers/opportunity/storeCandidateOpportunityMatch.ts

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { TypedWorker } from '../worker';
22
import { MatchedCandidate } from '@dailydotdev/schema';
33
import { OpportunityMatch } from '../../entity/OpportunityMatch';
44
import { opportunityMatchDescriptionSchema } from '../../common/schema/opportunities';
5-
import { Alerts, Feature, FeatureType } from '../../entity';
5+
import { Alerts } from '../../entity';
66
import { IsNull } from 'typeorm';
77

88
export const storeCandidateOpportunityMatch: TypedWorker<'gondul.v1.candidate-opportunity-match'> =
@@ -35,20 +35,9 @@ export const storeCandidateOpportunityMatch: TypedWorker<'gondul.v1.candidate-op
3535
skipUpdateIfNoValuesChanged: true,
3636
},
3737
);
38-
39-
// TODO: Temporary until we happy to launch
40-
const isTeamMember = await con.getRepository(Feature).exists({
41-
where: {
42-
userId,
43-
feature: FeatureType.Team,
44-
value: 1,
45-
},
46-
});
47-
if (isTeamMember) {
48-
await manager
49-
.getRepository(Alerts)
50-
.update({ userId, opportunityId: IsNull() }, { opportunityId });
51-
}
38+
await manager
39+
.getRepository(Alerts)
40+
.update({ userId, opportunityId: IsNull() }, { opportunityId });
5241
});
5342
},
5443
parseMessage: (message) => {

0 commit comments

Comments
 (0)