-
Notifications
You must be signed in to change notification settings - Fork 741
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing premium data points for organizations (#1374)
Co-authored-by: Joana Maia <joana@crowd.dev> Co-authored-by: Joan Reyero <joan@crowd.dev>
- Loading branch information
1 parent
165662c
commit 30f1d63
Showing
70 changed files
with
1,635 additions
and
248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import commandLineArgs from 'command-line-args' | ||
import commandLineUsage from 'command-line-usage' | ||
import * as fs from 'fs' | ||
import path from 'path' | ||
import { getServiceLogger } from '@crowd/logging' | ||
import { BulkorganizationEnrichmentWorker } from '@/serverless/microservices/nodejs/bulk-enrichment/bulkOrganizationEnrichmentWorker' | ||
|
||
/* eslint-disable no-console */ | ||
|
||
const banner = fs.readFileSync(path.join(__dirname, 'banner.txt'), 'utf8') | ||
|
||
const log = getServiceLogger() | ||
|
||
const options = [ | ||
{ | ||
name: 'tenant', | ||
alias: 't', | ||
type: String, | ||
description: 'The unique ID of tenant that you would like to enrich.', | ||
}, | ||
{ | ||
name: 'help', | ||
alias: 'h', | ||
type: Boolean, | ||
description: 'Print this usage guide.', | ||
}, | ||
] | ||
const sections = [ | ||
{ | ||
content: banner, | ||
raw: true, | ||
}, | ||
{ | ||
header: 'Enrich members, organizations or both of the tenant', | ||
content: 'Enrich all enrichable members, organizations or both of the tenant', | ||
}, | ||
{ | ||
header: 'Options', | ||
optionList: options, | ||
}, | ||
] | ||
|
||
const usage = commandLineUsage(sections) | ||
const parameters = commandLineArgs(options) | ||
|
||
if (parameters.help || (!parameters.tenant && (!parameters.organization || !parameters.member))) { | ||
console.log(usage) | ||
} else { | ||
setImmediate(async () => { | ||
const tenantIds = parameters.tenant.split(',') | ||
const limit = 3 | ||
|
||
for (const tenantId of tenantIds) { | ||
await BulkorganizationEnrichmentWorker(tenantId, limit, true) | ||
log.info(`Done for tenant ${tenantId}`) | ||
} | ||
|
||
process.exit(0) | ||
}) | ||
} |
20 changes: 20 additions & 0 deletions
20
backend/src/database/migrations/U1692796226__addOrganizationPremiumDataPoints.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
ALTER TABLE public."organizations" DROP COLUMN "affiliatedProfiles"; | ||
ALTER TABLE public."organizations" DROP COLUMN "allSubsidiaries"; | ||
ALTER TABLE public."organizations" DROP COLUMN "alternativeDomains"; | ||
ALTER TABLE public."organizations" DROP COLUMN "alternativeNames"; | ||
ALTER TABLE public."organizations" DROP COLUMN "averageEmployeeTenure"; | ||
ALTER TABLE public."organizations" DROP COLUMN "averageTenureByLevel"; | ||
ALTER TABLE public."organizations" DROP COLUMN "averageTenureByRole"; | ||
ALTER TABLE public."organizations" DROP COLUMN "directSubsidiaries"; | ||
ALTER TABLE public."organizations" DROP COLUMN "employeeChurnRate"; | ||
ALTER TABLE public."organizations" DROP COLUMN "employeeCountByMonth"; | ||
ALTER TABLE public."organizations" DROP COLUMN "employeeGrowthRate"; | ||
ALTER TABLE public."organizations" DROP COLUMN "employeeCountByMonthByLevel"; | ||
ALTER TABLE public."organizations" DROP COLUMN "employeeCountByMonthByRole"; | ||
ALTER TABLE public."organizations" DROP COLUMN "gicsSector"; | ||
ALTER TABLE public."organizations" DROP COLUMN "grossAdditionsByMonth"; | ||
ALTER TABLE public."organizations" DROP COLUMN "grossDeparturesByMonth"; | ||
ALTER TABLE public."organizations" DROP COLUMN "ultimateParent"; | ||
ALTER TABLE public."organizations" DROP COLUMN "immediateParent"; | ||
ALTER TABLE public."organizations" ADD COLUMN "parentUrl" TEXT NULL; | ||
ALTER TABLE public."organizationCaches" ADD COLUMN "parentUrl" TEXT NULL; |
20 changes: 20 additions & 0 deletions
20
backend/src/database/migrations/V1692796226__addOrganizationPremiumDataPoints.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
ALTER TABLE public."organizations" ADD COLUMN "affiliatedProfiles" TEXT[]; | ||
ALTER TABLE public."organizations" ADD COLUMN "allSubsidiaries" TEXT[]; | ||
ALTER TABLE public."organizations" ADD COLUMN "alternativeDomains" TEXT[]; | ||
ALTER TABLE public."organizations" ADD COLUMN "alternativeNames" TEXT[]; | ||
ALTER TABLE public."organizations" ADD COLUMN "averageEmployeeTenure" FLOAT NULL; | ||
ALTER TABLE public."organizations" ADD COLUMN "averageTenureByLevel" JSONB NULL; | ||
ALTER TABLE public."organizations" ADD COLUMN "averageTenureByRole" JSONB NULL; | ||
ALTER TABLE public."organizations" ADD COLUMN "directSubsidiaries" TEXT[]; | ||
ALTER TABLE public."organizations" ADD COLUMN "employeeChurnRate" JSONB NULL; | ||
ALTER TABLE public."organizations" ADD COLUMN "employeeCountByMonth" JSONB NULL; | ||
ALTER TABLE public."organizations" ADD COLUMN "employeeGrowthRate" JSONB NULL; | ||
ALTER TABLE public."organizations" ADD COLUMN "employeeCountByMonthByLevel" JSONB NULL; | ||
ALTER TABLE public."organizations" ADD COLUMN "employeeCountByMonthByRole" JSONB NULL; | ||
ALTER TABLE public."organizations" ADD COLUMN "gicsSector" TEXT NULL; | ||
ALTER TABLE public."organizations" ADD COLUMN "grossAdditionsByMonth" JSONB NULL; | ||
ALTER TABLE public."organizations" ADD COLUMN "grossDeparturesByMonth" JSONB NULL; | ||
ALTER TABLE public."organizations" ADD COLUMN "ultimateParent" TEXT NULL; | ||
ALTER TABLE public."organizations" ADD COLUMN "immediateParent" TEXT NULL; | ||
ALTER TABLE public."organizations" DROP COLUMN "parentUrl"; | ||
ALTER TABLE public."organizationCaches" DROP COLUMN "parentUrl"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.