-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
📝 Updated md files for contributions
- Loading branch information
Showing
11 changed files
with
160 additions
and
80 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
24 changes: 13 additions & 11 deletions
24
.../connections/crm/crm-connection.module.ts → .../connections/crm/crm.connection.module.ts
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
37 changes: 37 additions & 0 deletions
37
packages/api/src/@core/connections/crm/services/registry.service.ts
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,37 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
import { ICrmConnectionService } from '../types'; | ||
import { ZohoConnectionService } from './zoho/zoho.service'; | ||
import { ZendeskConnectionService } from './zendesk/zendesk.service'; | ||
import { PipedriveConnectionService } from './pipedrive/pipedrive.service'; | ||
import { HubspotConnectionService } from './hubspot/hubspot.service'; | ||
import { FreshsalesConnectionService } from './freshsales/freshsales.service'; | ||
|
||
@Injectable() | ||
export class ServiceConnectionRegistry { | ||
private serviceMap: Map<string, ICrmConnectionService>; | ||
|
||
constructor( | ||
freshsales: FreshsalesConnectionService, | ||
hubspot: HubspotConnectionService, | ||
zoho: ZohoConnectionService, | ||
zendesk: ZendeskConnectionService, | ||
pipedrive: PipedriveConnectionService, | ||
) { | ||
this.serviceMap = new Map<string, ICrmConnectionService>(); | ||
this.serviceMap.set('freshsales', freshsales); | ||
this.serviceMap.set('hubspot', hubspot); | ||
this.serviceMap.set('zoho', zoho); | ||
this.serviceMap.set('zendesk', zendesk); | ||
this.serviceMap.set('pipedrive', pipedrive); | ||
} | ||
|
||
getService(integrationId: string): ICrmConnectionService { | ||
const service = this.serviceMap.get(integrationId); | ||
if (!service) { | ||
throw new Error( | ||
`Connection Service not found for integration ID: ${integrationId}`, | ||
); | ||
} | ||
return service; | ||
} | ||
} |
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.