Skip to content

Commit

Permalink
🚧 Wip
Browse files Browse the repository at this point in the history
  • Loading branch information
naelob committed Jan 9, 2024
1 parent 331837a commit 8e1362a
Show file tree
Hide file tree
Showing 45 changed files with 2,412 additions and 2,095 deletions.
28 changes: 2 additions & 26 deletions packages/api/src/@core/utils/types/original/original.crm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import {
ZohoCompanyOutput,
FreshsalesEngagementInput,
FreshsalesEngagementOutput,
FreshsalesLeadInput,
FreshsalesLeadOutput,
FreshsalesNoteInput,
FreshsalesNoteOutput,
FreshsalesStageInput,
Expand All @@ -27,32 +25,24 @@ import {
HubspotDealOutput,
HubspotEngagementInput,
HubspotEngagementOutput,
HubspotLeadInput,
HubspotLeadOutput,
HubspotStageInput,
HubspotStageOutput,
HubspotTaskInput,
HubspotTaskOutput,
PipedriveEngagementInput,
PipedriveEngagementOutput,
PipedriveLeadInput,
PipedriveLeadOutput,
PipedriveStageInput,
PipedriveStageOutput,
PipedriveTaskInput,
PipedriveTaskOutput,
ZendeskEngagementInput,
ZendeskEngagementOutput,
ZendeskLeadInput,
ZendeskLeadOutput,
ZendeskStageInput,
ZendeskStageOutput,
ZendeskTaskInput,
ZendeskTaskOutput,
ZohoEngagementInput,
ZohoEngagementOutput,
ZohoLeadInput,
ZohoLeadOutput,
ZohoNoteInput,
ZohoNoteOutput,
ZohoStageInput,
Expand Down Expand Up @@ -145,13 +135,7 @@ export type OriginalStageInput =
| ZendeskStageInput
| PipedriveStageInput;

/* lead */
export type OriginalLeadInput =
| FreshsalesLeadInput
| HubspotLeadInput
| ZohoLeadInput
| ZendeskLeadInput
| PipedriveLeadInput;
/* engagementType */

/* user */
export type OriginalUserInput =
Expand All @@ -169,7 +153,6 @@ export type CrmObjectInput =
| OriginalNoteInput
| OriginalTaskInput
| OriginalStageInput
| OriginalLeadInput
| OriginalUserInput;

/* OUTPUT */
Expand Down Expand Up @@ -229,13 +212,7 @@ export type OriginalStageOutput =
| ZendeskStageOutput
| PipedriveStageOutput;

/* lead */
export type OriginalLeadOutput =
| FreshsalesLeadOutput
| HubspotLeadOutput
| ZohoLeadOutput
| ZendeskLeadOutput
| PipedriveLeadOutput;
/* engagementType */

/* user */
export type OriginalUserOutput =
Expand All @@ -253,5 +230,4 @@ export type CrmObjectOutput =
| OriginalNoteOutput
| OriginalTaskOutput
| OriginalStageOutput
| OriginalLeadOutput
| OriginalUserOutput;
2 changes: 1 addition & 1 deletion packages/api/src/@core/utils/unification/unify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import { unifyCrm } from '@crm/@utils/@unification';
import { TicketingObject } from '@ticketing/@utils/@types';
import { unifyTicketing } from '@ticketing/@utils/@unification';
import { UnifySourceType } from '../types/unfify.output';
import { UnifySourceType } from '../types/unify.output';

/* to fetch data
Expand Down
25 changes: 6 additions & 19 deletions packages/api/src/crm/@utils/@types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,7 @@ import {
UnifiedEngagementInput,
UnifiedEngagementOutput,
} from '@crm/engagement/types/model.unified';
import { ILeadService } from '@crm/lead/types';
import { leadUnificationMapping } from '@crm/lead/types/mappingsTypes';
import {
UnifiedLeadInput,
UnifiedLeadOutput,
} from '@crm/lead/types/model.unified';

import { INoteService } from '@crm/note/types';
import { noteUnificationMapping } from '@crm/note/types/mappingsTypes';
import {
Expand Down Expand Up @@ -62,6 +57,7 @@ export enum CrmObject {
note = 'note',
task = 'task',
engagement = 'engagement',
engagementType = 'engagementType',
stage = 'stage',
user = 'user',
}
Expand All @@ -75,8 +71,6 @@ export type UnifiedCrm =
| UnifiedDealOutput
| UnifiedEngagementInput
| UnifiedEngagementOutput
| UnifiedLeadInput
| UnifiedLeadOutput
| UnifiedNoteInput
| UnifiedNoteOutput
| UnifiedStageInput
Expand All @@ -91,7 +85,6 @@ export const unificationMapping = {
[CrmObject.deal]: dealUnificationMapping,
[CrmObject.company]: companyUnificationMapping,
[CrmObject.engagement]: engagementUnificationMapping,
[CrmObject.lead]: leadUnificationMapping,
[CrmObject.note]: noteUnificationMapping,
[CrmObject.stage]: stageUnificationMapping,
[CrmObject.task]: taskUnificationMapping,
Expand All @@ -104,7 +97,6 @@ export type ICrmService =
| IEngagementService
| INoteService
| IDealService
| ILeadService
| ITaskService
| IStageService
| ICompanyService;
Expand Down Expand Up @@ -144,13 +136,6 @@ export * from '../../deal/services/hubspot/types';
export * from '../../deal/services/zoho/types';
export * from '../../deal/services/pipedrive/types';

/* lead */
export * from '../../lead/services/freshsales/types';
export * from '../../lead/services/zendesk/types';
export * from '../../lead/services/hubspot/types';
export * from '../../lead/services/zoho/types';
export * from '../../lead/services/pipedrive/types';

/* task */
export * from '../../task/services/freshsales/types';
export * from '../../task/services/zendesk/types';
Expand All @@ -172,6 +157,8 @@ export * from '../../company/services/hubspot/types';
export * from '../../company/services/zoho/types';
export * from '../../company/services/pipedrive/types';

/* engagementType */

export class Email {
@ApiProperty({
description: 'The email address',
Expand Down Expand Up @@ -237,12 +224,12 @@ export class Address {
@ApiProperty({
description: 'The address type',
})
address_type: string;
address_type?: string;

@ApiProperty({
description: 'The owner type of the address',
})
owner_type: string;
owner_type?: string;
}

export type NormalizedContactInfo = {
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/crm/@utils/@unification/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CrmObject, unificationMapping } from '@crm/@utils/@types';
import { Unified, UnifyReturnType } from '@@core/utils/types';
import { UnifySourceType } from '@@core/utils/types/unfify.output';
import { UnifySourceType } from '@@core/utils/types/unify.output';
import { CrmObjectInput } from '@@core/utils/types/original/original.crm';

export async function desunifyCrm<T extends Unified>({
Expand Down
Loading

0 comments on commit 8e1362a

Please sign in to comment.