n8n-nodes-aivencerealtycrm 1.3.0 → 1.5.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.
@@ -1040,12 +1040,26 @@ class AivenceRealty {
1040
1040
  displayOptions: {
1041
1041
  show: {
1042
1042
  resource: ['contractor'],
1043
- operation: ['list'],
1043
+ operation: ['list', 'getNextAvailable'],
1044
1044
  },
1045
1045
  },
1046
1046
  default: 10,
1047
1047
  description: 'Número máximo de resultados (1-100)',
1048
1048
  },
1049
+ {
1050
+ displayName: 'Exclude Contractor ID',
1051
+ name: 'excludeContractorId',
1052
+ type: 'string',
1053
+ displayOptions: {
1054
+ show: {
1055
+ resource: ['contractor'],
1056
+ operation: ['getNextAvailable'],
1057
+ },
1058
+ },
1059
+ default: '',
1060
+ description: 'ID del contratista a excluir de los resultados',
1061
+ placeholder: '={{ $json.contractor_id }}',
1062
+ },
1049
1063
  // Contractor Create: JSON from previous node
1050
1064
  {
1051
1065
  displayName: 'Modo de entrada',
@@ -1520,7 +1534,7 @@ class AivenceRealty {
1520
1534
  }
1521
1535
  }
1522
1536
  // ============================================
1523
- // MAINTENANCE REQUEST RESOURCE
1537
+ // MAINTENANCE REQUEST RESOURCE (API Española)
1524
1538
  // ============================================
1525
1539
  else if (resource === 'maintenanceRequest') {
1526
1540
  if (operation === 'list') {
@@ -1531,19 +1545,19 @@ class AivenceRealty {
1531
1545
  const limitMaintenance = this.getNodeParameter('limitMaintenance', i, 10);
1532
1546
  const queryParams = [];
1533
1547
  if (propertyIdFilter)
1534
- queryParams.push(`property_id=${encodeURIComponent(propertyIdFilter)}`);
1548
+ queryParams.push(`propiedad_id=${encodeURIComponent(propertyIdFilter)}`);
1535
1549
  if (statusFilter)
1536
- queryParams.push(`status=${encodeURIComponent(statusFilter)}`);
1550
+ queryParams.push(`estado=${encodeURIComponent(statusFilter)}`);
1537
1551
  if (tenantIdFilter)
1538
- queryParams.push(`tenant_id=${encodeURIComponent(tenantIdFilter)}`);
1552
+ queryParams.push(`inquilino_id=${encodeURIComponent(tenantIdFilter)}`);
1539
1553
  if (priorityFilter)
1540
- queryParams.push(`priority=${encodeURIComponent(priorityFilter)}`);
1554
+ queryParams.push(`prioridad=${encodeURIComponent(priorityFilter)}`);
1541
1555
  if (limitMaintenance)
1542
- queryParams.push(`per_page=${limitMaintenance}`);
1556
+ queryParams.push(`por_pagina=${limitMaintenance}`);
1543
1557
  const queryString = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
1544
1558
  responseData = await this.helpers.httpRequest({
1545
1559
  method: 'GET',
1546
- url: `${baseUrl}/api/maintenance-requests${queryString}`,
1560
+ url: `${baseUrl}/api/v1/mantenimiento/solicitudes${queryString}`,
1547
1561
  json: true,
1548
1562
  });
1549
1563
  }
@@ -1551,7 +1565,7 @@ class AivenceRealty {
1551
1565
  const requestId = this.getNodeParameter('requestId', i);
1552
1566
  responseData = await this.helpers.httpRequest({
1553
1567
  method: 'GET',
1554
- url: `${baseUrl}/api/maintenance-requests/${requestId}`,
1568
+ url: `${baseUrl}/api/v1/mantenimiento/solicitudes/${requestId}`,
1555
1569
  json: true,
1556
1570
  });
1557
1571
  }
@@ -1560,7 +1574,7 @@ class AivenceRealty {
1560
1574
  const body = useJsonInput ? items[i].json : {};
1561
1575
  responseData = await this.helpers.httpRequest({
1562
1576
  method: 'POST',
1563
- url: `${baseUrl}/api/maintenance-requests`,
1577
+ url: `${baseUrl}/api/v1/mantenimiento/solicitudes`,
1564
1578
  body,
1565
1579
  json: true,
1566
1580
  });
@@ -1570,8 +1584,8 @@ class AivenceRealty {
1570
1584
  const useJsonInput = this.getNodeParameter('useJsonInput', i, true);
1571
1585
  const body = useJsonInput ? items[i].json : {};
1572
1586
  responseData = await this.helpers.httpRequest({
1573
- method: 'PATCH',
1574
- url: `${baseUrl}/api/maintenance-requests/${requestId}`,
1587
+ method: 'POST',
1588
+ url: `${baseUrl}/api/v1/mantenimiento/solicitudes/${requestId}/confirmar`,
1575
1589
  body,
1576
1590
  json: true,
1577
1591
  });
@@ -1580,11 +1594,13 @@ class AivenceRealty {
1580
1594
  const requestId = this.getNodeParameter('requestId', i);
1581
1595
  const message = this.getNodeParameter('message', i);
1582
1596
  const body = {
1583
- message: message,
1597
+ remitente: 'sistema',
1598
+ mensaje: message,
1599
+ canal: 'interno',
1584
1600
  };
1585
1601
  responseData = await this.helpers.httpRequest({
1586
- method: 'PATCH',
1587
- url: `${baseUrl}/api/maintenance-requests/${requestId}/add-message`,
1602
+ method: 'POST',
1603
+ url: `${baseUrl}/api/v1/mantenimiento/solicitudes/${requestId}/agregar-mensaje`,
1588
1604
  body,
1589
1605
  json: true,
1590
1606
  });
@@ -1595,7 +1611,7 @@ class AivenceRealty {
1595
1611
  responseData = await this.helpers.httpRequest({
1596
1612
  method: 'POST',
1597
1613
  url: `${baseUrl}/api/v1/solicitudes-mantenimiento/${requestId}/asignar-contratista`,
1598
- body: { contractor_id: contractorId },
1614
+ body: { contratista_id: contractorId },
1599
1615
  json: true,
1600
1616
  });
1601
1617
  }
@@ -1647,13 +1663,19 @@ class AivenceRealty {
1647
1663
  }
1648
1664
  else if (operation === 'getNextAvailable') {
1649
1665
  const specializationFilter = this.getNodeParameter('specializationFilter', i, '');
1666
+ const excludeContractorId = this.getNodeParameter('excludeContractorId', i, '');
1667
+ const limitContractor = this.getNodeParameter('limitContractor', i, 3);
1650
1668
  const queryParams = [];
1651
1669
  if (specializationFilter)
1652
- queryParams.push(`category=${encodeURIComponent(specializationFilter)}`);
1670
+ queryParams.push(`categoria=${encodeURIComponent(specializationFilter)}`);
1671
+ if (excludeContractorId)
1672
+ queryParams.push(`excluir_id=${encodeURIComponent(excludeContractorId)}`);
1673
+ if (limitContractor)
1674
+ queryParams.push(`limite=${limitContractor}`);
1653
1675
  const queryString = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
1654
1676
  responseData = await this.helpers.httpRequest({
1655
1677
  method: 'GET',
1656
- url: `${baseUrl}/api/contractors/next-available${queryString}`,
1678
+ url: `${baseUrl}/api/v1/mantenimiento/contratistas/mejor-match${queryString}`,
1657
1679
  json: true,
1658
1680
  });
1659
1681
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-aivencerealtycrm",
3
- "version": "1.3.0",
3
+ "version": "1.5.0",
4
4
  "description": "Nodo n8n para integrar el CRM inmobiliario AivenceRealty",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",
@@ -9,7 +9,8 @@
9
9
  "CRM",
10
10
  "Real Estate",
11
11
  "Inmobiliario",
12
- "Laravel"
12
+ "Property Management",
13
+ "API Integration"
13
14
  ],
14
15
  "license": "MIT",
15
16
  "homepage": "https://realty.aivence.com",