n8n-nodes-aivencerealtycrm 1.5.0 → 1.7.0
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.
|
@@ -1198,6 +1198,184 @@ class AivenceRealty {
|
|
|
1198
1198
|
default: false,
|
|
1199
1199
|
description: 'Usar JSON del nodo anterior (true) o campos individuales (false). Por defecto muestra campos individuales para mayor claridad.',
|
|
1200
1200
|
},
|
|
1201
|
+
// Property ID
|
|
1202
|
+
{
|
|
1203
|
+
displayName: 'Property ID',
|
|
1204
|
+
name: 'property_id',
|
|
1205
|
+
type: 'number',
|
|
1206
|
+
required: true,
|
|
1207
|
+
displayOptions: {
|
|
1208
|
+
show: {
|
|
1209
|
+
resource: ['appointment'],
|
|
1210
|
+
operation: ['create'],
|
|
1211
|
+
useJsonInput: [false],
|
|
1212
|
+
},
|
|
1213
|
+
},
|
|
1214
|
+
default: 0,
|
|
1215
|
+
description: 'ID de la propiedad para la cita',
|
|
1216
|
+
},
|
|
1217
|
+
// Date
|
|
1218
|
+
{
|
|
1219
|
+
displayName: 'Date',
|
|
1220
|
+
name: 'date',
|
|
1221
|
+
type: 'dateTime',
|
|
1222
|
+
required: true,
|
|
1223
|
+
displayOptions: {
|
|
1224
|
+
show: {
|
|
1225
|
+
resource: ['appointment'],
|
|
1226
|
+
operation: ['create'],
|
|
1227
|
+
useJsonInput: [false],
|
|
1228
|
+
},
|
|
1229
|
+
},
|
|
1230
|
+
default: '',
|
|
1231
|
+
description: 'Fecha de la cita (formato: YYYY-MM-DD)',
|
|
1232
|
+
},
|
|
1233
|
+
// Time
|
|
1234
|
+
{
|
|
1235
|
+
displayName: 'Time',
|
|
1236
|
+
name: 'time',
|
|
1237
|
+
type: 'string',
|
|
1238
|
+
required: true,
|
|
1239
|
+
displayOptions: {
|
|
1240
|
+
show: {
|
|
1241
|
+
resource: ['appointment'],
|
|
1242
|
+
operation: ['create'],
|
|
1243
|
+
useJsonInput: [false],
|
|
1244
|
+
},
|
|
1245
|
+
},
|
|
1246
|
+
default: '',
|
|
1247
|
+
placeholder: '14:30',
|
|
1248
|
+
description: 'Hora de la cita (formato: HH:mm, ejemplo: 14:30)',
|
|
1249
|
+
},
|
|
1250
|
+
// Client Name
|
|
1251
|
+
{
|
|
1252
|
+
displayName: 'Client Name',
|
|
1253
|
+
name: 'client_name',
|
|
1254
|
+
type: 'string',
|
|
1255
|
+
required: true,
|
|
1256
|
+
displayOptions: {
|
|
1257
|
+
show: {
|
|
1258
|
+
resource: ['appointment'],
|
|
1259
|
+
operation: ['create'],
|
|
1260
|
+
useJsonInput: [false],
|
|
1261
|
+
},
|
|
1262
|
+
},
|
|
1263
|
+
default: '',
|
|
1264
|
+
description: 'Nombre completo del cliente',
|
|
1265
|
+
},
|
|
1266
|
+
// Client Phone
|
|
1267
|
+
{
|
|
1268
|
+
displayName: 'Client Phone',
|
|
1269
|
+
name: 'client_phone',
|
|
1270
|
+
type: 'string',
|
|
1271
|
+
required: true,
|
|
1272
|
+
displayOptions: {
|
|
1273
|
+
show: {
|
|
1274
|
+
resource: ['appointment'],
|
|
1275
|
+
operation: ['create'],
|
|
1276
|
+
useJsonInput: [false],
|
|
1277
|
+
},
|
|
1278
|
+
},
|
|
1279
|
+
default: '',
|
|
1280
|
+
description: 'Teléfono del cliente (mínimo 8 caracteres)',
|
|
1281
|
+
},
|
|
1282
|
+
// Client Email
|
|
1283
|
+
{
|
|
1284
|
+
displayName: 'Client Email',
|
|
1285
|
+
name: 'client_email',
|
|
1286
|
+
type: 'string',
|
|
1287
|
+
required: true,
|
|
1288
|
+
displayOptions: {
|
|
1289
|
+
show: {
|
|
1290
|
+
resource: ['appointment'],
|
|
1291
|
+
operation: ['create'],
|
|
1292
|
+
useJsonInput: [false],
|
|
1293
|
+
},
|
|
1294
|
+
},
|
|
1295
|
+
default: '',
|
|
1296
|
+
description: 'Email del cliente',
|
|
1297
|
+
},
|
|
1298
|
+
// Visit Type
|
|
1299
|
+
{
|
|
1300
|
+
displayName: 'Visit Type',
|
|
1301
|
+
name: 'visit_type',
|
|
1302
|
+
type: 'options',
|
|
1303
|
+
displayOptions: {
|
|
1304
|
+
show: {
|
|
1305
|
+
resource: ['appointment'],
|
|
1306
|
+
operation: ['create'],
|
|
1307
|
+
useJsonInput: [false],
|
|
1308
|
+
},
|
|
1309
|
+
},
|
|
1310
|
+
options: [
|
|
1311
|
+
{
|
|
1312
|
+
name: 'Property Visit',
|
|
1313
|
+
value: 'property_visit',
|
|
1314
|
+
},
|
|
1315
|
+
{
|
|
1316
|
+
name: 'Valuation',
|
|
1317
|
+
value: 'valuation',
|
|
1318
|
+
},
|
|
1319
|
+
{
|
|
1320
|
+
name: 'Consultation',
|
|
1321
|
+
value: 'consultation',
|
|
1322
|
+
},
|
|
1323
|
+
{
|
|
1324
|
+
name: 'Contract Signing',
|
|
1325
|
+
value: 'contract_signing',
|
|
1326
|
+
},
|
|
1327
|
+
],
|
|
1328
|
+
default: 'property_visit',
|
|
1329
|
+
description: 'Tipo de visita',
|
|
1330
|
+
},
|
|
1331
|
+
// Notes
|
|
1332
|
+
{
|
|
1333
|
+
displayName: 'Notes',
|
|
1334
|
+
name: 'notes',
|
|
1335
|
+
type: 'string',
|
|
1336
|
+
typeOptions: {
|
|
1337
|
+
rows: 4,
|
|
1338
|
+
},
|
|
1339
|
+
displayOptions: {
|
|
1340
|
+
show: {
|
|
1341
|
+
resource: ['appointment'],
|
|
1342
|
+
operation: ['create'],
|
|
1343
|
+
useJsonInput: [false],
|
|
1344
|
+
},
|
|
1345
|
+
},
|
|
1346
|
+
default: '',
|
|
1347
|
+
description: 'Notas adicionales sobre la cita (máximo 1000 caracteres)',
|
|
1348
|
+
},
|
|
1349
|
+
// Staff ID
|
|
1350
|
+
{
|
|
1351
|
+
displayName: 'Staff ID',
|
|
1352
|
+
name: 'staff_id',
|
|
1353
|
+
type: 'number',
|
|
1354
|
+
displayOptions: {
|
|
1355
|
+
show: {
|
|
1356
|
+
resource: ['appointment'],
|
|
1357
|
+
operation: ['create'],
|
|
1358
|
+
useJsonInput: [false],
|
|
1359
|
+
},
|
|
1360
|
+
},
|
|
1361
|
+
default: 0,
|
|
1362
|
+
description: 'ID del staff asignado (opcional, se asigna automáticamente si no se especifica)',
|
|
1363
|
+
},
|
|
1364
|
+
// Source
|
|
1365
|
+
{
|
|
1366
|
+
displayName: 'Source',
|
|
1367
|
+
name: 'source',
|
|
1368
|
+
type: 'string',
|
|
1369
|
+
displayOptions: {
|
|
1370
|
+
show: {
|
|
1371
|
+
resource: ['appointment'],
|
|
1372
|
+
operation: ['create'],
|
|
1373
|
+
useJsonInput: [false],
|
|
1374
|
+
},
|
|
1375
|
+
},
|
|
1376
|
+
default: '',
|
|
1377
|
+
description: 'Origen de la cita (máximo 50 caracteres)',
|
|
1378
|
+
},
|
|
1201
1379
|
// Appointment ID para get, updateStatus y delete
|
|
1202
1380
|
{
|
|
1203
1381
|
displayName: 'Appointment ID',
|
|
@@ -1722,8 +1900,41 @@ class AivenceRealty {
|
|
|
1722
1900
|
});
|
|
1723
1901
|
}
|
|
1724
1902
|
else if (operation === 'create') {
|
|
1725
|
-
const useJsonInput = this.getNodeParameter('useJsonInput', i,
|
|
1726
|
-
|
|
1903
|
+
const useJsonInput = this.getNodeParameter('useJsonInput', i, false);
|
|
1904
|
+
let body = {};
|
|
1905
|
+
if (useJsonInput) {
|
|
1906
|
+
// Usar JSON del nodo anterior
|
|
1907
|
+
body = items[i].json;
|
|
1908
|
+
}
|
|
1909
|
+
else {
|
|
1910
|
+
// Construir body con campos estructurados
|
|
1911
|
+
const dateValue = this.getNodeParameter('date', i);
|
|
1912
|
+
const timeValue = this.getNodeParameter('time', i);
|
|
1913
|
+
// Formatear fecha (de ISO a Y-m-d)
|
|
1914
|
+
let formattedDate = dateValue;
|
|
1915
|
+
if (dateValue.includes('T')) {
|
|
1916
|
+
formattedDate = dateValue.split('T')[0];
|
|
1917
|
+
}
|
|
1918
|
+
body = {
|
|
1919
|
+
property_id: this.getNodeParameter('property_id', i),
|
|
1920
|
+
date: formattedDate,
|
|
1921
|
+
time: timeValue,
|
|
1922
|
+
client_name: this.getNodeParameter('client_name', i),
|
|
1923
|
+
client_phone: this.getNodeParameter('client_phone', i),
|
|
1924
|
+
client_email: this.getNodeParameter('client_email', i),
|
|
1925
|
+
visit_type: this.getNodeParameter('visit_type', i, 'property_visit'),
|
|
1926
|
+
notes: this.getNodeParameter('notes', i, ''),
|
|
1927
|
+
staff_id: this.getNodeParameter('staff_id', i, 0),
|
|
1928
|
+
source: this.getNodeParameter('source', i, ''),
|
|
1929
|
+
};
|
|
1930
|
+
// Remover campos vacíos opcionales
|
|
1931
|
+
if (!body.notes)
|
|
1932
|
+
delete body.notes;
|
|
1933
|
+
if (body.staff_id === 0)
|
|
1934
|
+
delete body.staff_id;
|
|
1935
|
+
if (!body.source)
|
|
1936
|
+
delete body.source;
|
|
1937
|
+
}
|
|
1727
1938
|
responseData = await this.helpers.httpRequest({
|
|
1728
1939
|
method: 'POST',
|
|
1729
1940
|
url: `${baseUrl}/api/v1/reservas`,
|
|
@@ -66,6 +66,11 @@ class AivenceRealtyTrigger {
|
|
|
66
66
|
value: 'maintenance.created',
|
|
67
67
|
description: 'Se dispara cuando se crea una solicitud de mantenimiento',
|
|
68
68
|
},
|
|
69
|
+
{
|
|
70
|
+
name: 'Contractor Response',
|
|
71
|
+
value: 'maintenance.contractor_response',
|
|
72
|
+
description: 'Se dispara cuando un contratista responde a una solicitud',
|
|
73
|
+
},
|
|
69
74
|
{
|
|
70
75
|
name: 'Appointment Creado',
|
|
71
76
|
value: 'appointment.created',
|