File tree 6 files changed +25
-19
lines changed
contact/services/leadsquared
engagement/services/leadsquared
task/services/leadsquared
6 files changed +25
-19
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ export class LeadSquaredContactMapper implements IContactMapper {
41
41
if ( primaryPhone && source . phone_numbers ?. [ 0 ] ?. phone_type == 'MOBILE' ) {
42
42
result . Mobile = primaryPhone ;
43
43
}
44
- if ( source . addresses && source . addresses [ 0 ] ) {
44
+ if ( source . addresses ?. [ 0 ] ) {
45
45
result . Account_Street1 = source . addresses [ 0 ] . street_1 ;
46
46
result . Account_City = source . addresses [ 0 ] . city ;
47
47
result . Account_State = source . addresses [ 0 ] . state ;
@@ -109,7 +109,7 @@ export class LeadSquaredContactMapper implements IContactMapper {
109
109
}
110
110
// Constructing email and phone details
111
111
const email_addresses =
112
- contact && contact . EmailAddress
112
+ contact ? .EmailAddress
113
113
? [
114
114
{
115
115
email_address : contact . EmailAddress ,
@@ -132,13 +132,13 @@ export class LeadSquaredContactMapper implements IContactMapper {
132
132
phone_type : 'MOBILE' ,
133
133
} ) ;
134
134
}
135
- if ( contact && contact . Account_Fax ) {
135
+ if ( contact ? .Account_Fax ) {
136
136
phone_numbers . push ( {
137
137
phone_number : contact . Account_Fax ,
138
138
phone_type : 'fax' ,
139
139
} ) ;
140
140
}
141
- if ( contact && contact . Phone ) {
141
+ if ( contact ? .Phone ) {
142
142
phone_numbers . push ( {
143
143
phone_number : contact . Phone ,
144
144
phone_type : 'home' ,
Original file line number Diff line number Diff line change @@ -87,13 +87,13 @@ type LeadSquaredContact = {
87
87
[ key : string ] : string | number | boolean | null ;
88
88
} ;
89
89
90
+ type LeadProperty = {
91
+ Attribute : string ;
92
+ Value : string ;
93
+ } ;
94
+
90
95
export type LeadSquaredContactResponse = {
91
- LeadPropertyList : [
92
- {
93
- Attribute : string ;
94
- Value : string ;
95
- } ,
96
- ] ;
96
+ LeadPropertyList : LeadProperty [ ] ;
97
97
} ;
98
98
99
99
export type LeadSquaredContactInput = Partial < LeadSquaredContact > ;
Original file line number Diff line number Diff line change @@ -197,9 +197,9 @@ export class LeadSquaredEngagementMapper implements IEngagementMapper {
197
197
Direction : source . direction === 'INBOUND' ? 'Inbound' : 'Outbound' ,
198
198
CallerSource : source . content || '' ,
199
199
LeadId : source . company_id || '' ,
200
- SourceNumber : '+91-8611795988' , // todo ,
201
- DisplayNumber : '+91-8611795989' , // todo
202
- DestinationNumber : '+91-9611795983' , // todo ,
200
+ SourceNumber : source . source_number || '' ,
201
+ DisplayNumber : source . display_number || '' ,
202
+ DestinationNumber : source . destination_number || '' ,
203
203
} ;
204
204
205
205
if ( source . start_at && source . end_time ) {
Original file line number Diff line number Diff line change 1
- interface KeyValuePair {
2
- [ key : string ] : unknown ;
3
- }
1
+ type KeyValuePair = Record < string , unknown > ;
4
2
5
3
export type LeadSquaredEngagementCall = {
6
4
SourceNumber : string ; //'+91-8611795988';
Original file line number Diff line number Diff line change @@ -71,6 +71,11 @@ export class LeadSquaredService implements ITaskService {
71
71
CrmObject . task ,
72
72
ActionType . POST ,
73
73
) ;
74
+ return {
75
+ data : null ,
76
+ message : 'Failed to create Leadsquared task' ,
77
+ statusCode : 500 ,
78
+ } ;
74
79
}
75
80
}
76
81
@@ -123,6 +128,11 @@ export class LeadSquaredService implements ITaskService {
123
128
CrmObject . task ,
124
129
ActionType . POST ,
125
130
) ;
131
+ return {
132
+ data : [ ] ,
133
+ message : 'Failed to retrieve Leadsquared tasks' ,
134
+ statusCode : 500 ,
135
+ } ;
126
136
}
127
137
}
128
138
}
Original file line number Diff line number Diff line change 1
- interface KeyValuePair {
2
- [ key : string ] : unknown ;
3
- }
1
+ type KeyValuePair = Record < string , unknown > ;
4
2
5
3
interface LeadSquaredTask {
6
4
UserTaskId : string ;
You can’t perform that action at this time.
0 commit comments