Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
find_many_member_ids_by_identities,
find_many_organization_ids_by_identities,
get_repo_affiliation_registry,
insert_member_organizations,
insert_member_segment_affiliations,
save_service_execution,
upsert_repo_affiliation_registry,
)
Expand Down Expand Up @@ -807,9 +809,8 @@ async def apply_affiliations(
}
)

# TODO: Enable CDP writes after testing (import insert_member_* from crud)
# await insert_member_organizations(mo_inserts)
# await insert_member_segment_affiliations(msa_inserts)
await insert_member_organizations(mo_inserts)
await insert_member_segment_affiliations(msa_inserts)

async def process_affiliations(
self,
Expand Down
7 changes: 4 additions & 3 deletions services/libs/common/src/member.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,10 @@ export const calculateReach = (oldReach: any, newReach: any): { total: number }
*/
export function getMemberOrganizationSourceRank(source: string | null | undefined): number {
if (source === OrganizationSource.UI) return 0
if (source === OrganizationSource.EMAIL_DOMAIN) return 1
if (source?.startsWith('enrichment-')) return 2
return 3
if (source === OrganizationSource.PROJECT_REGISTRY) return 1
if (source === OrganizationSource.EMAIL_DOMAIN) return 2
if (source?.startsWith('enrichment-')) return 3
return 4
}

/**
Expand Down
1 change: 1 addition & 0 deletions services/libs/data-access-layer/src/members/segments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ export async function findMemberManualAffiliation(
AND (
("dateStart" <= $(timestamp) AND "dateEnd" >= $(timestamp))
OR ("dateStart" <= $(timestamp) AND "dateEnd" IS NULL)
OR ("dateStart" IS NULL AND "dateEnd" IS NULL)
)
ORDER BY "dateStart" DESC, id
Comment on lines +192 to 194
LIMIT 1
Expand Down
1 change: 1 addition & 0 deletions services/libs/types/src/enums/organizations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export enum OrganizationAttributeName {

export enum OrganizationSource {
EMAIL_DOMAIN = 'email-domain',
PROJECT_REGISTRY = 'project-registry',
ENRICHMENT_PROGAI = 'enrichment-progai',
ENRICHMENT_CLEARBIT = 'enrichment-clearbit',
ENRICHMENT_CRUSTDATA = 'enrichment-crustdata',
Expand Down
Loading