Skip to content

Commit 6debc97

Browse files
committed
fix: member identity
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
1 parent 5f1703e commit 6debc97

1 file changed

Lines changed: 2 additions & 39 deletions

File tree

  • services/apps/snowflake_connectors/src/integrations/committees/committees

services/apps/snowflake_connectors/src/integrations/committees/committees/transformer.ts

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ import { COMMITTEES_GRID, CommitteesActivityType } from '@crowd/integrations'
22
import { getServiceChildLogger } from '@crowd/logging'
33
import {
44
IActivityData,
5-
IMemberData,
65
IOrganizationIdentity,
7-
MemberIdentityType,
86
OrganizationIdentityType,
97
OrganizationSource,
108
PlatformType,
@@ -43,43 +41,8 @@ export class CommitteesCommitteesTransformer extends TransformerBase {
4341
? CommitteesActivityType.REMOVED_FROM_COMMITTEE
4442
: CommitteesActivityType.ADDED_TO_COMMITTEE
4543

46-
const identities: IMemberData['identities'] = []
47-
48-
if (lfUsername) {
49-
identities.push(
50-
{
51-
platform: PlatformType.COMMITTEES,
52-
value: email,
53-
type: MemberIdentityType.EMAIL,
54-
verified: true,
55-
verifiedBy: PlatformType.COMMITTEES,
56-
},
57-
{
58-
platform: PlatformType.COMMITTEES,
59-
value: lfUsername,
60-
type: MemberIdentityType.USERNAME,
61-
verified: true,
62-
verifiedBy: PlatformType.COMMITTEES,
63-
},
64-
{
65-
platform: PlatformType.LFID,
66-
value: lfUsername,
67-
type: MemberIdentityType.USERNAME,
68-
verified: true,
69-
verifiedBy: PlatformType.COMMITTEES,
70-
},
71-
)
72-
}
73-
74-
if (!lfUsername) {
75-
identities.push({
76-
platform: PlatformType.COMMITTEES,
77-
value: email,
78-
type: MemberIdentityType.USERNAME,
79-
verified: true,
80-
verifiedBy: PlatformType.COMMITTEES,
81-
})
82-
}
44+
const sourceId = (row.PRIMARY_SOURCE_USER_ID as string | null)?.trim() || undefined
45+
const identities = this.buildMemberIdentities({ email, sourceId, lfUsername })
8346

8447
const activityTimestamp =
8548
type === CommitteesActivityType.ADDED_TO_COMMITTEE

0 commit comments

Comments
 (0)