Skip to content

Commit

Permalink
Merge pull request #575 from mit-27/fix-critical-bugs
Browse files Browse the repository at this point in the history
Fix critical bugs
  • Loading branch information
naelob authored Jul 30, 2024
2 parents 07e9a1e + d07f8bb commit 0bbede6
Show file tree
Hide file tree
Showing 62 changed files with 445 additions and 349 deletions.
10 changes: 5 additions & 5 deletions packages/api/src/ats/activity/services/registry.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ export class ServiceRegistry {

getService(integrationId: string): IActivityService {
const service = this.serviceMap.get(integrationId);
if (!service) {
throw new ReferenceError(
`Service not found for integration ID: ${integrationId}`,
);
}
// if (!service) {
// throw new ReferenceError(
// `Service not found for integration ID: ${integrationId}`,
// );
// }
return service;
}
}
19 changes: 11 additions & 8 deletions packages/api/src/ats/activity/sync/sync.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ export class SyncService implements OnModuleInit, IBaseSync {
this.logger.log(`Syncing activities....`);
const users = user_id
? [
await this.prisma.users.findUnique({
where: {
id_user: user_id,
},
}),
]
await this.prisma.users.findUnique({
where: {
id_user: user_id,
},
}),
]
: await this.prisma.users.findMany();
if (users && users.length > 0) {
for (const user of users) {
Expand Down Expand Up @@ -92,7 +92,7 @@ export class SyncService implements OnModuleInit, IBaseSync {
const candidates =
await this.prisma.ats_candidates.findMany({
where: {
id_connection: connection.id_connection,
id_connection: connection?.id_connection,
},
});
for (const candidate of candidates) {
Expand Down Expand Up @@ -124,7 +124,10 @@ export class SyncService implements OnModuleInit, IBaseSync {
const { integrationId, linkedUserId, id_candidate } = data;
const service: IActivityService =
this.serviceRegistry.getService(integrationId);
if (!service) return;
if (!service) {
this.logger.log(`No service found in {vertical:ats, commonObject: activity} for integration ID: ${integrationId}`);
return;
}

await this.ingestService.syncForLinkedUser<
UnifiedAtsActivityOutput,
Expand Down
10 changes: 5 additions & 5 deletions packages/api/src/ats/application/services/registry.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ export class ServiceRegistry {

getService(integrationId: string): IApplicationService {
const service = this.serviceMap.get(integrationId);
if (!service) {
throw new ReferenceError(
`Service not found for integration ID: ${integrationId}`,
);
}
// if (!service) {
// throw new ReferenceError(
// `Service not found for integration ID: ${integrationId}`,
// );
// }
return service;
}
}
17 changes: 10 additions & 7 deletions packages/api/src/ats/application/sync/sync.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ export class SyncService implements OnModuleInit, IBaseSync {
this.logger.log('Syncing applications...');
const users = user_id
? [
await this.prisma.users.findUnique({
where: {
id_user: user_id,
},
}),
]
await this.prisma.users.findUnique({
where: {
id_user: user_id,
},
}),
]
: await this.prisma.users.findMany();
if (users && users.length > 0) {
for (const user of users) {
Expand Down Expand Up @@ -104,7 +104,10 @@ export class SyncService implements OnModuleInit, IBaseSync {
const { integrationId, linkedUserId } = param;
const service: IApplicationService =
this.serviceRegistry.getService(integrationId);
if (!service) return;
if (!service) {
this.logger.log(`No service found in {vertical:ats, commonObject: application} for integration ID: ${integrationId}`);
return;
}

await this.ingestService.syncForLinkedUser<
UnifiedAtsApplicationOutput,
Expand Down
10 changes: 5 additions & 5 deletions packages/api/src/ats/attachment/services/registry.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ export class ServiceRegistry {

getService(integrationId: string): IAttachmentService {
const service = this.serviceMap.get(integrationId);
if (!service) {
throw new ReferenceError(
`Service not found for integration ID: ${integrationId}`,
);
}
// if (!service) {
// throw new ReferenceError(
// `Service not found for integration ID: ${integrationId}`,
// );
// }
return service;
}
}
10 changes: 5 additions & 5 deletions packages/api/src/ats/candidate/services/registry.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ export class ServiceRegistry {

getService(integrationId: string): ICandidateService {
const service = this.serviceMap.get(integrationId);
if (!service) {
throw new ReferenceError(
`Service not found for integration ID: ${integrationId}`,
);
}
// if (!service) {
// throw new ReferenceError(
// `Service not found for integration ID: ${integrationId}`,
// );
// }
return service;
}
}
17 changes: 10 additions & 7 deletions packages/api/src/ats/candidate/sync/sync.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ export class SyncService implements OnModuleInit, IBaseSync {
this.logger.log('Syncing candidates...');
const users = user_id
? [
await this.prisma.users.findUnique({
where: {
id_user: user_id,
},
}),
]
await this.prisma.users.findUnique({
where: {
id_user: user_id,
},
}),
]
: await this.prisma.users.findMany();
if (users && users.length > 0) {
for (const user of users) {
Expand Down Expand Up @@ -108,7 +108,10 @@ export class SyncService implements OnModuleInit, IBaseSync {
const { integrationId, linkedUserId } = param;
const service: ICandidateService =
this.serviceRegistry.getService(integrationId);
if (!service) return;
if (!service) {
this.logger.log(`No service found in {vertical:ats, commonObject: candidate} for integration ID: ${integrationId}`);
return;
}

await this.ingestService.syncForLinkedUser<
UnifiedAtsCandidateOutput,
Expand Down
10 changes: 5 additions & 5 deletions packages/api/src/ats/department/services/registry.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ export class ServiceRegistry {

getService(integrationId: string): IDepartmentService {
const service = this.serviceMap.get(integrationId);
if (!service) {
throw new ReferenceError(
`Service not found for integration ID: ${integrationId}`,
);
}
// if (!service) {
// throw new ReferenceError(
// `Service not found for integration ID: ${integrationId}`,
// );
// }
return service;
}
}
17 changes: 10 additions & 7 deletions packages/api/src/ats/department/sync/sync.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ export class SyncService implements OnModuleInit, IBaseSync {
this.logger.log('Syncing departments...');
const users = user_id
? [
await this.prisma.users.findUnique({
where: {
id_user: user_id,
},
}),
]
await this.prisma.users.findUnique({
where: {
id_user: user_id,
},
}),
]
: await this.prisma.users.findMany();
if (users && users.length > 0) {
for (const user of users) {
Expand Down Expand Up @@ -104,7 +104,10 @@ export class SyncService implements OnModuleInit, IBaseSync {
const { integrationId, linkedUserId } = param;
const service: IDepartmentService =
this.serviceRegistry.getService(integrationId);
if (!service) return;
if (!service) {
this.logger.log(`No service found in {vertical:ats, commonObject: department} for integration ID: ${integrationId}`);
return;
}

await this.ingestService.syncForLinkedUser<
UnifiedAtsDepartmentOutput,
Expand Down
10 changes: 5 additions & 5 deletions packages/api/src/ats/eeocs/services/registry.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ export class ServiceRegistry {

getService(integrationId: string): IEeocsService {
const service = this.serviceMap.get(integrationId);
if (!service) {
throw new ReferenceError(
`Service not found for integration ID: ${integrationId}`,
);
}
// if (!service) {
// throw new ReferenceError(
// `Service not found for integration ID: ${integrationId}`,
// );
// }
return service;
}
}
17 changes: 10 additions & 7 deletions packages/api/src/ats/eeocs/sync/sync.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ export class SyncService implements OnModuleInit, IBaseSync {
this.logger.log('Syncing EEOCs...');
const users = user_id
? [
await this.prisma.users.findUnique({
where: {
id_user: user_id,
},
}),
]
await this.prisma.users.findUnique({
where: {
id_user: user_id,
},
}),
]
: await this.prisma.users.findMany();
if (users && users.length > 0) {
for (const user of users) {
Expand Down Expand Up @@ -101,7 +101,10 @@ export class SyncService implements OnModuleInit, IBaseSync {
const { integrationId, linkedUserId } = param;
const service: IEeocsService =
this.serviceRegistry.getService(integrationId);
if (!service) return;
if (!service) {
this.logger.log(`No service found in {vertical:ats, commonObject: eeocs} for integration ID: ${integrationId}`);
return;
}

await this.ingestService.syncForLinkedUser<
UnifiedAtsEeocsOutput,
Expand Down
10 changes: 5 additions & 5 deletions packages/api/src/ats/interview/services/registry.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ export class ServiceRegistry {

getService(integrationId: string): IInterviewService {
const service = this.serviceMap.get(integrationId);
if (!service) {
throw new ReferenceError(
`Service not found for integration ID: ${integrationId}`,
);
}
// if (!service) {
// throw new ReferenceError(
// `Service not found for integration ID: ${integrationId}`,
// );
// }
return service;
}
}
17 changes: 10 additions & 7 deletions packages/api/src/ats/interview/sync/sync.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ export class SyncService implements OnModuleInit, IBaseSync {
this.logger.log('Syncing interviews...');
const users = user_id
? [
await this.prisma.users.findUnique({
where: {
id_user: user_id,
},
}),
]
await this.prisma.users.findUnique({
where: {
id_user: user_id,
},
}),
]
: await this.prisma.users.findMany();
if (users && users.length > 0) {
for (const user of users) {
Expand Down Expand Up @@ -103,7 +103,10 @@ export class SyncService implements OnModuleInit, IBaseSync {
const { integrationId, linkedUserId } = param;
const service: IInterviewService =
this.serviceRegistry.getService(integrationId);
if (!service) return;
if (!service) {
this.logger.log(`No service found in {vertical:ats, commonObject: interview} for integration ID: ${integrationId}`);
return;
}

await this.ingestService.syncForLinkedUser<
UnifiedAtsInterviewOutput,
Expand Down
10 changes: 5 additions & 5 deletions packages/api/src/ats/job/services/registry.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ export class ServiceRegistry {

getService(integrationId: string): IJobService {
const service = this.serviceMap.get(integrationId);
if (!service) {
throw new ReferenceError(
`Service not found for integration ID: ${integrationId}`,
);
}
// if (!service) {
// throw new ReferenceError(
// `Service not found for integration ID: ${integrationId}`,
// );
// }
return service;
}
}
17 changes: 10 additions & 7 deletions packages/api/src/ats/job/sync/sync.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ export class SyncService implements OnModuleInit, IBaseSync {
this.logger.log('Syncing jobs...');
const users = user_id
? [
await this.prisma.users.findUnique({
where: {
id_user: user_id,
},
}),
]
await this.prisma.users.findUnique({
where: {
id_user: user_id,
},
}),
]
: await this.prisma.users.findMany();
if (users && users.length > 0) {
for (const user of users) {
Expand Down Expand Up @@ -101,7 +101,10 @@ export class SyncService implements OnModuleInit, IBaseSync {
const { integrationId, linkedUserId } = param;
const service: IJobService =
this.serviceRegistry.getService(integrationId);
if (!service) return;
if (!service) {
this.logger.log(`No service found in {vertical:ats, commonObject: job} for integration ID: ${integrationId}`);
return;
}

await this.ingestService.syncForLinkedUser<
UnifiedAtsJobOutput,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ export class ServiceRegistry {

getService(integrationId: string): IJobInterviewStageService {
const service = this.serviceMap.get(integrationId);
if (!service) {
throw new ReferenceError(
`Service not found for integration ID: ${integrationId}`,
);
}
// if (!service) {
// throw new ReferenceError(
// `Service not found for integration ID: ${integrationId}`,
// );
// }
return service;
}
}
Loading

0 comments on commit 0bbede6

Please sign in to comment.