n8n-nodes-aivencerealtycrm 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -32,74 +32,39 @@ class AivenceRealty {
|
|
|
32
32
|
type: 'options',
|
|
33
33
|
noDataExpression: true,
|
|
34
34
|
options: [
|
|
35
|
-
{
|
|
36
|
-
name: 'Property',
|
|
37
|
-
value: 'property',
|
|
38
|
-
},
|
|
39
35
|
{
|
|
40
36
|
name: 'Lead',
|
|
41
37
|
value: 'lead',
|
|
42
38
|
},
|
|
43
39
|
{
|
|
44
|
-
name: '
|
|
45
|
-
value: '
|
|
40
|
+
name: 'Property',
|
|
41
|
+
value: 'property',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'Email',
|
|
45
|
+
value: 'email',
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
|
-
name: 'Maintenance
|
|
49
|
-
value: '
|
|
48
|
+
name: 'Maintenance Request',
|
|
49
|
+
value: 'maintenanceRequest',
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
name: 'Contractor',
|
|
53
53
|
value: 'contractor',
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
|
-
name: '
|
|
57
|
-
value: '
|
|
56
|
+
name: 'Maintenance Cost',
|
|
57
|
+
value: 'maintenanceCost',
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
|
-
name: '
|
|
61
|
-
value: '
|
|
60
|
+
name: 'Appointment',
|
|
61
|
+
value: 'appointment',
|
|
62
62
|
},
|
|
63
63
|
],
|
|
64
|
-
default: '
|
|
64
|
+
default: 'lead',
|
|
65
65
|
description: 'Recurso del CRM a operar',
|
|
66
66
|
},
|
|
67
67
|
// ============================================
|
|
68
|
-
// PROPERTY OPERATIONS
|
|
69
|
-
// ============================================
|
|
70
|
-
{
|
|
71
|
-
displayName: 'Operación',
|
|
72
|
-
name: 'operation',
|
|
73
|
-
type: 'options',
|
|
74
|
-
noDataExpression: true,
|
|
75
|
-
displayOptions: {
|
|
76
|
-
show: {
|
|
77
|
-
resource: ['property'],
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
options: [
|
|
81
|
-
{
|
|
82
|
-
name: 'List',
|
|
83
|
-
value: 'list',
|
|
84
|
-
description: 'Listar todas las propiedades',
|
|
85
|
-
action: 'Listar propiedades',
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
name: 'Get Similar',
|
|
89
|
-
value: 'getSimilar',
|
|
90
|
-
description: 'Obtener propiedades similares',
|
|
91
|
-
action: 'Obtener propiedades similares',
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
name: 'Get Statistics',
|
|
95
|
-
value: 'getStatistics',
|
|
96
|
-
description: 'Obtener estadísticas de propiedades',
|
|
97
|
-
action: 'Obtener estadísticas',
|
|
98
|
-
},
|
|
99
|
-
],
|
|
100
|
-
default: 'list',
|
|
101
|
-
},
|
|
102
|
-
// ============================================
|
|
103
68
|
// LEAD OPERATIONS
|
|
104
69
|
// ============================================
|
|
105
70
|
{
|
|
@@ -116,66 +81,61 @@ class AivenceRealty {
|
|
|
116
81
|
{
|
|
117
82
|
name: 'List',
|
|
118
83
|
value: 'list',
|
|
119
|
-
description: 'Listar
|
|
84
|
+
description: 'Listar leads',
|
|
120
85
|
action: 'Listar leads',
|
|
121
86
|
},
|
|
122
87
|
{
|
|
123
88
|
name: 'Create',
|
|
124
89
|
value: 'create',
|
|
125
|
-
description: 'Crear
|
|
90
|
+
description: 'Crear nuevo lead',
|
|
126
91
|
action: 'Crear lead',
|
|
127
92
|
},
|
|
93
|
+
{
|
|
94
|
+
name: 'Update',
|
|
95
|
+
value: 'update',
|
|
96
|
+
description: 'Actualizar lead',
|
|
97
|
+
action: 'Actualizar lead',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: 'Get',
|
|
101
|
+
value: 'get',
|
|
102
|
+
description: 'Obtener lead por ID',
|
|
103
|
+
action: 'Obtener lead',
|
|
104
|
+
},
|
|
128
105
|
],
|
|
129
106
|
default: 'list',
|
|
130
107
|
},
|
|
131
|
-
// Lead
|
|
108
|
+
// Lead ID (para Update y Get)
|
|
132
109
|
{
|
|
133
|
-
displayName: '
|
|
134
|
-
name: '
|
|
110
|
+
displayName: 'Lead ID',
|
|
111
|
+
name: 'leadId',
|
|
135
112
|
type: 'string',
|
|
136
113
|
required: true,
|
|
137
114
|
displayOptions: {
|
|
138
115
|
show: {
|
|
139
116
|
resource: ['lead'],
|
|
140
|
-
operation: ['
|
|
117
|
+
operation: ['update', 'get'],
|
|
141
118
|
},
|
|
142
119
|
},
|
|
143
120
|
default: '',
|
|
144
|
-
description: '
|
|
121
|
+
description: 'ID del lead',
|
|
145
122
|
},
|
|
123
|
+
// Lead Create/Update: JSON from previous node
|
|
146
124
|
{
|
|
147
|
-
displayName: '
|
|
148
|
-
name: '
|
|
149
|
-
type: '
|
|
150
|
-
required: true,
|
|
125
|
+
displayName: 'Usar datos del nodo anterior',
|
|
126
|
+
name: 'useJsonInput',
|
|
127
|
+
type: 'boolean',
|
|
151
128
|
displayOptions: {
|
|
152
129
|
show: {
|
|
153
130
|
resource: ['lead'],
|
|
154
|
-
operation: ['create'],
|
|
131
|
+
operation: ['create', 'update'],
|
|
155
132
|
},
|
|
156
133
|
},
|
|
157
|
-
default:
|
|
158
|
-
description: '
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
displayName: 'Mensaje',
|
|
162
|
-
name: 'mensaje',
|
|
163
|
-
type: 'string',
|
|
164
|
-
typeOptions: {
|
|
165
|
-
rows: 4,
|
|
166
|
-
},
|
|
167
|
-
required: true,
|
|
168
|
-
displayOptions: {
|
|
169
|
-
show: {
|
|
170
|
-
resource: ['lead'],
|
|
171
|
-
operation: ['create'],
|
|
172
|
-
},
|
|
173
|
-
},
|
|
174
|
-
default: '',
|
|
175
|
-
description: 'Mensaje o consulta del lead',
|
|
134
|
+
default: true,
|
|
135
|
+
description: 'Si está activado, usará el JSON completo del nodo anterior',
|
|
176
136
|
},
|
|
177
137
|
// ============================================
|
|
178
|
-
//
|
|
138
|
+
// PROPERTY OPERATIONS
|
|
179
139
|
// ============================================
|
|
180
140
|
{
|
|
181
141
|
displayName: 'Operación',
|
|
@@ -184,202 +144,156 @@ class AivenceRealty {
|
|
|
184
144
|
noDataExpression: true,
|
|
185
145
|
displayOptions: {
|
|
186
146
|
show: {
|
|
187
|
-
resource: ['
|
|
147
|
+
resource: ['property'],
|
|
188
148
|
},
|
|
189
149
|
},
|
|
190
150
|
options: [
|
|
191
151
|
{
|
|
192
152
|
name: 'List',
|
|
193
153
|
value: 'list',
|
|
194
|
-
description: 'Listar
|
|
195
|
-
action: 'Listar
|
|
196
|
-
},
|
|
197
|
-
],
|
|
198
|
-
default: 'list',
|
|
199
|
-
},
|
|
200
|
-
// ============================================
|
|
201
|
-
// MAINTENANCE ORDER OPERATIONS
|
|
202
|
-
// ============================================
|
|
203
|
-
{
|
|
204
|
-
displayName: 'Operación',
|
|
205
|
-
name: 'operation',
|
|
206
|
-
type: 'options',
|
|
207
|
-
noDataExpression: true,
|
|
208
|
-
displayOptions: {
|
|
209
|
-
show: {
|
|
210
|
-
resource: ['maintenanceOrder'],
|
|
211
|
-
},
|
|
212
|
-
},
|
|
213
|
-
options: [
|
|
214
|
-
{
|
|
215
|
-
name: 'Check Duplicate',
|
|
216
|
-
value: 'checkDuplicate',
|
|
217
|
-
description: 'Verificar si existe orden duplicada',
|
|
218
|
-
action: 'Verificar duplicado',
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
name: 'Create',
|
|
222
|
-
value: 'create',
|
|
223
|
-
description: 'Crear nueva orden de trabajo',
|
|
224
|
-
action: 'Crear orden',
|
|
154
|
+
description: 'Listar propiedades',
|
|
155
|
+
action: 'Listar propiedades',
|
|
225
156
|
},
|
|
226
157
|
{
|
|
227
158
|
name: 'Get',
|
|
228
159
|
value: 'get',
|
|
229
|
-
description: 'Obtener
|
|
230
|
-
action: 'Obtener
|
|
160
|
+
description: 'Obtener propiedad por ID',
|
|
161
|
+
action: 'Obtener propiedad',
|
|
231
162
|
},
|
|
232
163
|
{
|
|
233
|
-
name: '
|
|
234
|
-
value: '
|
|
235
|
-
description: '
|
|
236
|
-
action: '
|
|
237
|
-
},
|
|
238
|
-
{
|
|
239
|
-
name: 'List',
|
|
240
|
-
value: 'list',
|
|
241
|
-
description: 'Listar órdenes de trabajo',
|
|
242
|
-
action: 'Listar órdenes',
|
|
164
|
+
name: 'Get Agent View',
|
|
165
|
+
value: 'getAgentView',
|
|
166
|
+
description: 'Vista de agente (búsqueda avanzada)',
|
|
167
|
+
action: 'Vista de agente',
|
|
243
168
|
},
|
|
244
169
|
],
|
|
245
170
|
default: 'list',
|
|
246
171
|
},
|
|
247
|
-
//
|
|
172
|
+
// Property ID
|
|
248
173
|
{
|
|
249
174
|
displayName: 'Property ID',
|
|
250
|
-
name: '
|
|
251
|
-
type: '
|
|
175
|
+
name: 'propertyId',
|
|
176
|
+
type: 'string',
|
|
252
177
|
required: true,
|
|
253
178
|
displayOptions: {
|
|
254
179
|
show: {
|
|
255
|
-
resource: ['
|
|
256
|
-
operation: ['
|
|
180
|
+
resource: ['property'],
|
|
181
|
+
operation: ['get', 'getAgentView'],
|
|
257
182
|
},
|
|
258
183
|
},
|
|
259
|
-
default:
|
|
184
|
+
default: '',
|
|
260
185
|
description: 'ID de la propiedad',
|
|
261
186
|
},
|
|
262
|
-
//
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
name: 'orderId',
|
|
266
|
-
type: 'number',
|
|
267
|
-
required: true,
|
|
268
|
-
displayOptions: {
|
|
269
|
-
show: {
|
|
270
|
-
resource: ['maintenanceOrder'],
|
|
271
|
-
operation: ['get', 'update'],
|
|
272
|
-
},
|
|
273
|
-
},
|
|
274
|
-
default: 0,
|
|
275
|
-
description: 'ID de la orden de trabajo',
|
|
276
|
-
},
|
|
277
|
-
// Maintenance Order - Create Fields
|
|
187
|
+
// ============================================
|
|
188
|
+
// EMAIL OPERATIONS
|
|
189
|
+
// ============================================
|
|
278
190
|
{
|
|
279
|
-
displayName: '
|
|
280
|
-
name: '
|
|
281
|
-
type: '
|
|
282
|
-
|
|
191
|
+
displayName: 'Operación',
|
|
192
|
+
name: 'operation',
|
|
193
|
+
type: 'options',
|
|
194
|
+
noDataExpression: true,
|
|
283
195
|
displayOptions: {
|
|
284
196
|
show: {
|
|
285
|
-
resource: ['
|
|
286
|
-
operation: ['create'],
|
|
197
|
+
resource: ['email'],
|
|
287
198
|
},
|
|
288
199
|
},
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
required: true,
|
|
296
|
-
displayOptions: {
|
|
297
|
-
show: {
|
|
298
|
-
resource: ['maintenanceOrder'],
|
|
299
|
-
operation: ['create'],
|
|
200
|
+
options: [
|
|
201
|
+
{
|
|
202
|
+
name: 'Ingest',
|
|
203
|
+
value: 'ingest',
|
|
204
|
+
description: 'Ingestar email al CRM',
|
|
205
|
+
action: 'Ingestar email',
|
|
300
206
|
},
|
|
301
|
-
|
|
302
|
-
default:
|
|
207
|
+
],
|
|
208
|
+
default: 'ingest',
|
|
303
209
|
},
|
|
304
210
|
{
|
|
305
|
-
displayName: '
|
|
306
|
-
name: '
|
|
307
|
-
type: '
|
|
308
|
-
required: true,
|
|
211
|
+
displayName: 'Usar datos del nodo anterior',
|
|
212
|
+
name: 'useJsonInput',
|
|
213
|
+
type: 'boolean',
|
|
309
214
|
displayOptions: {
|
|
310
215
|
show: {
|
|
311
|
-
resource: ['
|
|
312
|
-
operation: ['
|
|
216
|
+
resource: ['email'],
|
|
217
|
+
operation: ['ingest'],
|
|
313
218
|
},
|
|
314
219
|
},
|
|
315
|
-
default:
|
|
220
|
+
default: true,
|
|
221
|
+
description: 'Si está activado, usará el JSON completo del nodo anterior',
|
|
316
222
|
},
|
|
223
|
+
// ============================================
|
|
224
|
+
// MAINTENANCE REQUEST OPERATIONS
|
|
225
|
+
// ============================================
|
|
317
226
|
{
|
|
318
|
-
displayName: '
|
|
319
|
-
name: '
|
|
227
|
+
displayName: 'Operación',
|
|
228
|
+
name: 'operation',
|
|
320
229
|
type: 'options',
|
|
321
|
-
|
|
230
|
+
noDataExpression: true,
|
|
322
231
|
displayOptions: {
|
|
323
232
|
show: {
|
|
324
|
-
resource: ['
|
|
325
|
-
operation: ['create'],
|
|
233
|
+
resource: ['maintenanceRequest'],
|
|
326
234
|
},
|
|
327
235
|
},
|
|
328
236
|
options: [
|
|
329
|
-
{
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
{
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
237
|
+
{
|
|
238
|
+
name: 'List',
|
|
239
|
+
value: 'list',
|
|
240
|
+
description: 'Listar solicitudes',
|
|
241
|
+
action: 'Listar solicitudes',
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: 'Get',
|
|
245
|
+
value: 'get',
|
|
246
|
+
description: 'Obtener solicitud por ID',
|
|
247
|
+
action: 'Obtener solicitud',
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
name: 'Create',
|
|
251
|
+
value: 'create',
|
|
252
|
+
description: 'Crear solicitud',
|
|
253
|
+
action: 'Crear solicitud',
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
name: 'Update',
|
|
257
|
+
value: 'update',
|
|
258
|
+
description: 'Actualizar solicitud',
|
|
259
|
+
action: 'Actualizar solicitud',
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
name: 'Add Message',
|
|
263
|
+
value: 'addMessage',
|
|
264
|
+
description: 'Agregar mensaje a solicitud',
|
|
265
|
+
action: 'Agregar mensaje',
|
|
348
266
|
},
|
|
349
|
-
},
|
|
350
|
-
options: [
|
|
351
|
-
{ name: 'Baja', value: 'baja' },
|
|
352
|
-
{ name: 'Media', value: 'media' },
|
|
353
|
-
{ name: 'Alta', value: 'alta' },
|
|
354
267
|
],
|
|
355
|
-
default: '
|
|
268
|
+
default: 'list',
|
|
356
269
|
},
|
|
270
|
+
// Maintenance Request ID
|
|
357
271
|
{
|
|
358
|
-
displayName: '
|
|
359
|
-
name: '
|
|
272
|
+
displayName: 'Request ID',
|
|
273
|
+
name: 'requestId',
|
|
360
274
|
type: 'string',
|
|
361
275
|
required: true,
|
|
362
276
|
displayOptions: {
|
|
363
277
|
show: {
|
|
364
|
-
resource: ['
|
|
365
|
-
operation: ['
|
|
278
|
+
resource: ['maintenanceRequest'],
|
|
279
|
+
operation: ['get', 'update', 'addMessage'],
|
|
366
280
|
},
|
|
367
281
|
},
|
|
368
282
|
default: '',
|
|
283
|
+
description: 'ID de la solicitud',
|
|
369
284
|
},
|
|
370
285
|
{
|
|
371
|
-
displayName: '
|
|
372
|
-
name: '
|
|
373
|
-
type: '
|
|
374
|
-
typeOptions: { rows: 4 },
|
|
375
|
-
required: true,
|
|
286
|
+
displayName: 'Usar datos del nodo anterior',
|
|
287
|
+
name: 'useJsonInput',
|
|
288
|
+
type: 'boolean',
|
|
376
289
|
displayOptions: {
|
|
377
290
|
show: {
|
|
378
|
-
resource: ['
|
|
379
|
-
operation: ['create'],
|
|
291
|
+
resource: ['maintenanceRequest'],
|
|
292
|
+
operation: ['create', 'update', 'addMessage'],
|
|
380
293
|
},
|
|
381
294
|
},
|
|
382
|
-
default:
|
|
295
|
+
default: true,
|
|
296
|
+
description: 'Si está activado, usará el JSON completo del nodo anterior',
|
|
383
297
|
},
|
|
384
298
|
// ============================================
|
|
385
299
|
// CONTRACTOR OPERATIONS
|
|
@@ -396,44 +310,22 @@ class AivenceRealty {
|
|
|
396
310
|
},
|
|
397
311
|
options: [
|
|
398
312
|
{
|
|
399
|
-
name: '
|
|
400
|
-
value: '
|
|
401
|
-
description: '
|
|
402
|
-
action: '
|
|
313
|
+
name: 'List',
|
|
314
|
+
value: 'list',
|
|
315
|
+
description: 'Listar contractors',
|
|
316
|
+
action: 'Listar contractors',
|
|
403
317
|
},
|
|
404
318
|
{
|
|
405
|
-
name: '
|
|
406
|
-
value: '
|
|
407
|
-
description: '
|
|
408
|
-
action: '
|
|
319
|
+
name: 'Get Next Available',
|
|
320
|
+
value: 'getNextAvailable',
|
|
321
|
+
description: 'Obtener siguiente disponible',
|
|
322
|
+
action: 'Obtener siguiente disponible',
|
|
409
323
|
},
|
|
410
324
|
],
|
|
411
|
-
default: '
|
|
412
|
-
},
|
|
413
|
-
// Contractor - Find By Category
|
|
414
|
-
{
|
|
415
|
-
displayName: 'Categoría',
|
|
416
|
-
name: 'categoria',
|
|
417
|
-
type: 'options',
|
|
418
|
-
required: true,
|
|
419
|
-
displayOptions: {
|
|
420
|
-
show: {
|
|
421
|
-
resource: ['contractor'],
|
|
422
|
-
operation: ['findByCategory'],
|
|
423
|
-
},
|
|
424
|
-
},
|
|
425
|
-
options: [
|
|
426
|
-
{ name: 'Fontanería', value: 'fontanería' },
|
|
427
|
-
{ name: 'Electricidad', value: 'electricidad' },
|
|
428
|
-
{ name: 'Pintura', value: 'pintura' },
|
|
429
|
-
{ name: 'Cerrajería', value: 'cerrajería' },
|
|
430
|
-
{ name: 'Carpintería', value: 'carpintería' },
|
|
431
|
-
{ name: 'Aires Acondicionados', value: 'aires_acondicionados' },
|
|
432
|
-
],
|
|
433
|
-
default: 'fontanería',
|
|
325
|
+
default: 'list',
|
|
434
326
|
},
|
|
435
327
|
// ============================================
|
|
436
|
-
//
|
|
328
|
+
// MAINTENANCE COST OPERATIONS
|
|
437
329
|
// ============================================
|
|
438
330
|
{
|
|
439
331
|
displayName: 'Operación',
|
|
@@ -442,75 +334,34 @@ class AivenceRealty {
|
|
|
442
334
|
noDataExpression: true,
|
|
443
335
|
displayOptions: {
|
|
444
336
|
show: {
|
|
445
|
-
resource: ['
|
|
337
|
+
resource: ['maintenanceCost'],
|
|
446
338
|
},
|
|
447
339
|
},
|
|
448
340
|
options: [
|
|
449
341
|
{
|
|
450
|
-
name: '
|
|
451
|
-
value: '
|
|
452
|
-
description: '
|
|
453
|
-
action: '
|
|
342
|
+
name: 'Create',
|
|
343
|
+
value: 'create',
|
|
344
|
+
description: 'Crear costo de mantenimiento',
|
|
345
|
+
action: 'Crear costo',
|
|
454
346
|
},
|
|
455
347
|
],
|
|
456
|
-
default: '
|
|
348
|
+
default: 'create',
|
|
457
349
|
},
|
|
458
|
-
// Monthly Cost - Track Fields
|
|
459
350
|
{
|
|
460
|
-
displayName: '
|
|
461
|
-
name: '
|
|
462
|
-
type: '
|
|
463
|
-
required: true,
|
|
351
|
+
displayName: 'Usar datos del nodo anterior',
|
|
352
|
+
name: 'useJsonInput',
|
|
353
|
+
type: 'boolean',
|
|
464
354
|
displayOptions: {
|
|
465
355
|
show: {
|
|
466
|
-
resource: ['
|
|
467
|
-
operation: ['
|
|
468
|
-
},
|
|
469
|
-
},
|
|
470
|
-
default: new Date().getMonth() + 1,
|
|
471
|
-
description: 'Mes (1-12)',
|
|
472
|
-
},
|
|
473
|
-
{
|
|
474
|
-
displayName: 'Año',
|
|
475
|
-
name: 'anio',
|
|
476
|
-
type: 'number',
|
|
477
|
-
required: true,
|
|
478
|
-
displayOptions: {
|
|
479
|
-
show: {
|
|
480
|
-
resource: ['monthlyCost'],
|
|
481
|
-
operation: ['track'],
|
|
482
|
-
},
|
|
483
|
-
},
|
|
484
|
-
default: new Date().getFullYear(),
|
|
485
|
-
},
|
|
486
|
-
{
|
|
487
|
-
displayName: 'Categoría',
|
|
488
|
-
name: 'categoria',
|
|
489
|
-
type: 'string',
|
|
490
|
-
required: true,
|
|
491
|
-
displayOptions: {
|
|
492
|
-
show: {
|
|
493
|
-
resource: ['monthlyCost'],
|
|
494
|
-
operation: ['track'],
|
|
495
|
-
},
|
|
496
|
-
},
|
|
497
|
-
default: '',
|
|
498
|
-
},
|
|
499
|
-
{
|
|
500
|
-
displayName: 'Total Gastado',
|
|
501
|
-
name: 'totalGastado',
|
|
502
|
-
type: 'number',
|
|
503
|
-
required: true,
|
|
504
|
-
displayOptions: {
|
|
505
|
-
show: {
|
|
506
|
-
resource: ['monthlyCost'],
|
|
507
|
-
operation: ['track'],
|
|
356
|
+
resource: ['maintenanceCost'],
|
|
357
|
+
operation: ['create'],
|
|
508
358
|
},
|
|
509
359
|
},
|
|
510
|
-
default:
|
|
360
|
+
default: true,
|
|
361
|
+
description: 'Si está activado, usará el JSON completo del nodo anterior',
|
|
511
362
|
},
|
|
512
363
|
// ============================================
|
|
513
|
-
//
|
|
364
|
+
// APPOINTMENT OPERATIONS
|
|
514
365
|
// ============================================
|
|
515
366
|
{
|
|
516
367
|
displayName: 'Operación',
|
|
@@ -519,48 +370,31 @@ class AivenceRealty {
|
|
|
519
370
|
noDataExpression: true,
|
|
520
371
|
displayOptions: {
|
|
521
372
|
show: {
|
|
522
|
-
resource: ['
|
|
373
|
+
resource: ['appointment'],
|
|
523
374
|
},
|
|
524
375
|
},
|
|
525
376
|
options: [
|
|
526
377
|
{
|
|
527
|
-
name: '
|
|
528
|
-
value: '
|
|
529
|
-
description: '
|
|
530
|
-
action: '
|
|
378
|
+
name: 'Create',
|
|
379
|
+
value: 'create',
|
|
380
|
+
description: 'Crear cita',
|
|
381
|
+
action: 'Crear cita',
|
|
531
382
|
},
|
|
532
383
|
],
|
|
533
|
-
default: '
|
|
384
|
+
default: 'create',
|
|
534
385
|
},
|
|
535
|
-
// WhatsApp - Send Message Fields
|
|
536
386
|
{
|
|
537
|
-
displayName: '
|
|
538
|
-
name: '
|
|
539
|
-
type: '
|
|
540
|
-
required: true,
|
|
387
|
+
displayName: 'Usar datos del nodo anterior',
|
|
388
|
+
name: 'useJsonInput',
|
|
389
|
+
type: 'boolean',
|
|
541
390
|
displayOptions: {
|
|
542
391
|
show: {
|
|
543
|
-
resource: ['
|
|
544
|
-
operation: ['
|
|
545
|
-
},
|
|
546
|
-
},
|
|
547
|
-
default: '',
|
|
548
|
-
placeholder: '5491112345678',
|
|
549
|
-
description: 'Número de WhatsApp (con código de país)',
|
|
550
|
-
},
|
|
551
|
-
{
|
|
552
|
-
displayName: 'Mensaje',
|
|
553
|
-
name: 'mensaje',
|
|
554
|
-
type: 'string',
|
|
555
|
-
typeOptions: { rows: 4 },
|
|
556
|
-
required: true,
|
|
557
|
-
displayOptions: {
|
|
558
|
-
show: {
|
|
559
|
-
resource: ['whatsapp'],
|
|
560
|
-
operation: ['sendMessage'],
|
|
392
|
+
resource: ['appointment'],
|
|
393
|
+
operation: ['create'],
|
|
561
394
|
},
|
|
562
395
|
},
|
|
563
|
-
default:
|
|
396
|
+
default: true,
|
|
397
|
+
description: 'Si está activado, usará el JSON completo del nodo anterior',
|
|
564
398
|
},
|
|
565
399
|
],
|
|
566
400
|
};
|
|
@@ -576,124 +410,137 @@ class AivenceRealty {
|
|
|
576
410
|
const operation = this.getNodeParameter('operation', i);
|
|
577
411
|
let responseData;
|
|
578
412
|
// ============================================
|
|
579
|
-
//
|
|
413
|
+
// LEAD RESOURCE
|
|
580
414
|
// ============================================
|
|
581
|
-
if (resource === '
|
|
415
|
+
if (resource === 'lead') {
|
|
582
416
|
if (operation === 'list') {
|
|
583
417
|
responseData = await this.helpers.httpRequest({
|
|
584
418
|
method: 'GET',
|
|
585
|
-
url: `${baseUrl}/api/v1/
|
|
419
|
+
url: `${baseUrl}/api/v1/leads`,
|
|
586
420
|
json: true,
|
|
587
421
|
});
|
|
588
422
|
}
|
|
589
|
-
else if (operation === '
|
|
423
|
+
else if (operation === 'create') {
|
|
424
|
+
const useJsonInput = this.getNodeParameter('useJsonInput', i, true);
|
|
425
|
+
const body = useJsonInput ? items[i].json : {};
|
|
590
426
|
responseData = await this.helpers.httpRequest({
|
|
591
|
-
method: '
|
|
592
|
-
url: `${baseUrl}/api/v1/
|
|
427
|
+
method: 'POST',
|
|
428
|
+
url: `${baseUrl}/api/v1/leads`,
|
|
429
|
+
body,
|
|
430
|
+
json: true,
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
else if (operation === 'update') {
|
|
434
|
+
const leadId = this.getNodeParameter('leadId', i);
|
|
435
|
+
const useJsonInput = this.getNodeParameter('useJsonInput', i, true);
|
|
436
|
+
const body = useJsonInput ? items[i].json : {};
|
|
437
|
+
responseData = await this.helpers.httpRequest({
|
|
438
|
+
method: 'PATCH',
|
|
439
|
+
url: `${baseUrl}/api/v1/leads/${leadId}`,
|
|
440
|
+
body,
|
|
593
441
|
json: true,
|
|
594
442
|
});
|
|
595
443
|
}
|
|
596
|
-
else if (operation === '
|
|
444
|
+
else if (operation === 'get') {
|
|
445
|
+
const leadId = this.getNodeParameter('leadId', i);
|
|
597
446
|
responseData = await this.helpers.httpRequest({
|
|
598
447
|
method: 'GET',
|
|
599
|
-
url: `${baseUrl}/api/v1/
|
|
448
|
+
url: `${baseUrl}/api/v1/leads/${leadId}`,
|
|
600
449
|
json: true,
|
|
601
450
|
});
|
|
602
451
|
}
|
|
603
452
|
}
|
|
604
453
|
// ============================================
|
|
605
|
-
//
|
|
454
|
+
// PROPERTY RESOURCE
|
|
606
455
|
// ============================================
|
|
607
|
-
else if (resource === '
|
|
456
|
+
else if (resource === 'property') {
|
|
608
457
|
if (operation === 'list') {
|
|
609
458
|
responseData = await this.helpers.httpRequest({
|
|
610
459
|
method: 'GET',
|
|
611
|
-
url: `${baseUrl}/api/v1/
|
|
460
|
+
url: `${baseUrl}/api/v1/properties`,
|
|
612
461
|
json: true,
|
|
613
462
|
});
|
|
614
463
|
}
|
|
615
|
-
else if (operation === '
|
|
616
|
-
const
|
|
617
|
-
nombre: this.getNodeParameter('nombre', i),
|
|
618
|
-
telefono: this.getNodeParameter('telefono', i),
|
|
619
|
-
mensaje: this.getNodeParameter('mensaje', i),
|
|
620
|
-
};
|
|
464
|
+
else if (operation === 'get') {
|
|
465
|
+
const propertyId = this.getNodeParameter('propertyId', i);
|
|
621
466
|
responseData = await this.helpers.httpRequest({
|
|
622
|
-
method: '
|
|
623
|
-
url: `${baseUrl}/api/v1/
|
|
624
|
-
body,
|
|
467
|
+
method: 'GET',
|
|
468
|
+
url: `${baseUrl}/api/v1/properties/${propertyId}`,
|
|
625
469
|
json: true,
|
|
626
470
|
});
|
|
627
471
|
}
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
// TENANT RESOURCE
|
|
631
|
-
// ============================================
|
|
632
|
-
else if (resource === 'tenant') {
|
|
633
|
-
if (operation === 'list') {
|
|
472
|
+
else if (operation === 'getAgentView') {
|
|
473
|
+
const propertyId = this.getNodeParameter('propertyId', i);
|
|
634
474
|
responseData = await this.helpers.httpRequest({
|
|
635
475
|
method: 'GET',
|
|
636
|
-
url: `${baseUrl}/api/v1/
|
|
476
|
+
url: `${baseUrl}/api/v1/propiedades/agent/${propertyId}`,
|
|
637
477
|
json: true,
|
|
638
478
|
});
|
|
639
479
|
}
|
|
640
480
|
}
|
|
641
481
|
// ============================================
|
|
642
|
-
//
|
|
482
|
+
// EMAIL RESOURCE
|
|
643
483
|
// ============================================
|
|
644
|
-
else if (resource === '
|
|
645
|
-
if (operation === '
|
|
646
|
-
const
|
|
647
|
-
|
|
648
|
-
estado: 'abierto',
|
|
649
|
-
};
|
|
484
|
+
else if (resource === 'email') {
|
|
485
|
+
if (operation === 'ingest') {
|
|
486
|
+
const useJsonInput = this.getNodeParameter('useJsonInput', i, true);
|
|
487
|
+
const body = useJsonInput ? items[i].json : {};
|
|
650
488
|
responseData = await this.helpers.httpRequest({
|
|
651
489
|
method: 'POST',
|
|
652
|
-
url: `${baseUrl}/api/
|
|
490
|
+
url: `${baseUrl}/api/v1/emails/ingest`,
|
|
653
491
|
body,
|
|
654
492
|
json: true,
|
|
655
493
|
});
|
|
656
494
|
}
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
urgencia: this.getNodeParameter('urgencia', i),
|
|
664
|
-
descripcion_corta: this.getNodeParameter('descripcionCorta', i),
|
|
665
|
-
descripcion_detallada: this.getNodeParameter('descripcionDetallada', i),
|
|
666
|
-
estado: 'pendiente_aceptacion',
|
|
667
|
-
};
|
|
495
|
+
}
|
|
496
|
+
// ============================================
|
|
497
|
+
// MAINTENANCE REQUEST RESOURCE
|
|
498
|
+
// ============================================
|
|
499
|
+
else if (resource === 'maintenanceRequest') {
|
|
500
|
+
if (operation === 'list') {
|
|
668
501
|
responseData = await this.helpers.httpRequest({
|
|
669
|
-
method: '
|
|
670
|
-
url: `${baseUrl}/api/
|
|
671
|
-
body,
|
|
502
|
+
method: 'GET',
|
|
503
|
+
url: `${baseUrl}/api/maintenance-requests`,
|
|
672
504
|
json: true,
|
|
673
505
|
});
|
|
674
506
|
}
|
|
675
507
|
else if (operation === 'get') {
|
|
676
|
-
const
|
|
508
|
+
const requestId = this.getNodeParameter('requestId', i);
|
|
677
509
|
responseData = await this.helpers.httpRequest({
|
|
678
510
|
method: 'GET',
|
|
679
|
-
url: `${baseUrl}/api/
|
|
511
|
+
url: `${baseUrl}/api/maintenance-requests/${requestId}`,
|
|
512
|
+
json: true,
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
else if (operation === 'create') {
|
|
516
|
+
const useJsonInput = this.getNodeParameter('useJsonInput', i, true);
|
|
517
|
+
const body = useJsonInput ? items[i].json : {};
|
|
518
|
+
responseData = await this.helpers.httpRequest({
|
|
519
|
+
method: 'POST',
|
|
520
|
+
url: `${baseUrl}/api/maintenance-requests`,
|
|
521
|
+
body,
|
|
680
522
|
json: true,
|
|
681
523
|
});
|
|
682
524
|
}
|
|
683
525
|
else if (operation === 'update') {
|
|
684
|
-
const
|
|
685
|
-
|
|
526
|
+
const requestId = this.getNodeParameter('requestId', i);
|
|
527
|
+
const useJsonInput = this.getNodeParameter('useJsonInput', i, true);
|
|
528
|
+
const body = useJsonInput ? items[i].json : {};
|
|
686
529
|
responseData = await this.helpers.httpRequest({
|
|
687
530
|
method: 'PATCH',
|
|
688
|
-
url: `${baseUrl}/api/
|
|
689
|
-
body
|
|
531
|
+
url: `${baseUrl}/api/maintenance-requests/${requestId}`,
|
|
532
|
+
body,
|
|
690
533
|
json: true,
|
|
691
534
|
});
|
|
692
535
|
}
|
|
693
|
-
else if (operation === '
|
|
536
|
+
else if (operation === 'addMessage') {
|
|
537
|
+
const requestId = this.getNodeParameter('requestId', i);
|
|
538
|
+
const useJsonInput = this.getNodeParameter('useJsonInput', i, true);
|
|
539
|
+
const body = useJsonInput ? items[i].json : {};
|
|
694
540
|
responseData = await this.helpers.httpRequest({
|
|
695
|
-
method: '
|
|
696
|
-
url: `${baseUrl}/api/
|
|
541
|
+
method: 'PATCH',
|
|
542
|
+
url: `${baseUrl}/api/maintenance-requests/${requestId}/add-message`,
|
|
543
|
+
body,
|
|
697
544
|
json: true,
|
|
698
545
|
});
|
|
699
546
|
}
|
|
@@ -702,54 +549,46 @@ class AivenceRealty {
|
|
|
702
549
|
// CONTRACTOR RESOURCE
|
|
703
550
|
// ============================================
|
|
704
551
|
else if (resource === 'contractor') {
|
|
705
|
-
if (operation === '
|
|
706
|
-
const categoria = this.getNodeParameter('categoria', i);
|
|
552
|
+
if (operation === 'list') {
|
|
707
553
|
responseData = await this.helpers.httpRequest({
|
|
708
554
|
method: 'GET',
|
|
709
|
-
url: `${baseUrl}/api/
|
|
710
|
-
qs: { categoria },
|
|
555
|
+
url: `${baseUrl}/api/contractors`,
|
|
711
556
|
json: true,
|
|
712
557
|
});
|
|
713
558
|
}
|
|
714
|
-
else if (operation === '
|
|
559
|
+
else if (operation === 'getNextAvailable') {
|
|
715
560
|
responseData = await this.helpers.httpRequest({
|
|
716
561
|
method: 'GET',
|
|
717
|
-
url: `${baseUrl}/api/
|
|
562
|
+
url: `${baseUrl}/api/contractors/next-available`,
|
|
718
563
|
json: true,
|
|
719
564
|
});
|
|
720
565
|
}
|
|
721
566
|
}
|
|
722
567
|
// ============================================
|
|
723
|
-
//
|
|
568
|
+
// MAINTENANCE COST RESOURCE
|
|
724
569
|
// ============================================
|
|
725
|
-
else if (resource === '
|
|
726
|
-
if (operation === '
|
|
727
|
-
const
|
|
728
|
-
|
|
729
|
-
anio: this.getNodeParameter('anio', i),
|
|
730
|
-
categoria: this.getNodeParameter('categoria', i),
|
|
731
|
-
total_gastado: this.getNodeParameter('totalGastado', i),
|
|
732
|
-
};
|
|
570
|
+
else if (resource === 'maintenanceCost') {
|
|
571
|
+
if (operation === 'create') {
|
|
572
|
+
const useJsonInput = this.getNodeParameter('useJsonInput', i, true);
|
|
573
|
+
const body = useJsonInput ? items[i].json : {};
|
|
733
574
|
responseData = await this.helpers.httpRequest({
|
|
734
575
|
method: 'POST',
|
|
735
|
-
url: `${baseUrl}/api/
|
|
576
|
+
url: `${baseUrl}/api/maintenance-costs`,
|
|
736
577
|
body,
|
|
737
578
|
json: true,
|
|
738
579
|
});
|
|
739
580
|
}
|
|
740
581
|
}
|
|
741
582
|
// ============================================
|
|
742
|
-
//
|
|
583
|
+
// APPOINTMENT RESOURCE
|
|
743
584
|
// ============================================
|
|
744
|
-
else if (resource === '
|
|
745
|
-
if (operation === '
|
|
746
|
-
const
|
|
747
|
-
|
|
748
|
-
text: this.getNodeParameter('mensaje', i),
|
|
749
|
-
};
|
|
585
|
+
else if (resource === 'appointment') {
|
|
586
|
+
if (operation === 'create') {
|
|
587
|
+
const useJsonInput = this.getNodeParameter('useJsonInput', i, true);
|
|
588
|
+
const body = useJsonInput ? items[i].json : {};
|
|
750
589
|
responseData = await this.helpers.httpRequest({
|
|
751
590
|
method: 'POST',
|
|
752
|
-
url: `${baseUrl}/api/
|
|
591
|
+
url: `${baseUrl}/api/v1/appointments`,
|
|
753
592
|
body,
|
|
754
593
|
json: true,
|
|
755
594
|
});
|
|
Binary file
|