Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
adding opening to ats links and improving ag insertion
Browse files Browse the repository at this point in the history
  • Loading branch information
pellicceama committed Oct 16, 2024
1 parent d182d0b commit c41b582
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions connectors/connector-postgres/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ const agTableMappings = [
{from: 'integration_ats_candidate', to: 'IntegrationATSCandidate'},
{from: 'integration_ats_job_opening', to: 'IntegrationATSJobOpening'},
{from: 'integration_ats_offer', to: 'IntegrationATSOffer'},
{from: 'integration_connection', to: 'IntegrationConnection'}
{from: 'integration_connection', to: 'IntegrationConnection'},
{from: 'integration_ats_opening', to: 'IntegrationATSOpening'},
]

async function setupTable({
Expand Down Expand Up @@ -245,7 +246,7 @@ export const postgresServer = {
isOpenInt: true,
}

const isAgInsert =
const isAgInsert =
endUser?.orgId === 'org_2lcCCimyICKI8cpPNQt195h5zrP' ||
endUser?.orgId === 'org_2ms9FdeczlbrDIHJLcwGdpv3dTx'

Expand All @@ -258,11 +259,8 @@ export const postgresServer = {
rowToInsert['opening_external_id'] = data.entity?.raw?.id || '';
rowToInsert['candidate_name'] = data.entity?.raw?.name + ' ' + data.entity?.raw?.last_name || '';
} else if (tableName === 'IntegrationAtsJobOpening') {
rowToInsert['opening_external_id'] = data.entity?.raw?.id || '';
// NOTE Job openings are nested within Jobs and that o bject does not contain an id of the parent (job id)
// Depends on the implementation we may have to change this, leaving empty for now
// https://developers.greenhouse.io/harvest.html#the-job-object
rowToInsert['job_id'] = '';
rowToInsert['opening_external_id'] = data.entity?.raw?.opening_id || '';
rowToInsert['job_id'] = data.entity?.raw?.job_id || '';
} else if (tableName === 'IntegrationAtsOffer') {
// Note: These fields seemed duplicated from the nested objects
rowToInsert['opening_external_id'] = data.entity?.raw?.opening?.id || '';
Expand Down
2 changes: 1 addition & 1 deletion kits/cdk/base-links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export function agColumnRenameLink(_ctx: {
const entityMappings = {
job: 'IntegrationAtsJob',
candidate: 'IntegrationAtsCandidate',
job_opening: 'IntegrationAtsJobOpening',
opening: 'IntegrationAtsJobOpening',
offer: 'IntegrationAtsOffer',
}

Expand Down

0 comments on commit c41b582

Please sign in to comment.