n8n-nodes-aivence-realty 0.1.3 → 0.1.4

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.
@@ -82,6 +82,12 @@ class AivenceRealty {
82
82
  },
83
83
  },
84
84
  options: [
85
+ {
86
+ name: 'Search',
87
+ value: 'search',
88
+ description: 'Buscar propiedades con filtros avanzados',
89
+ action: 'Buscar propiedades',
90
+ },
85
91
  {
86
92
  name: 'List',
87
93
  value: 'list',
@@ -104,6 +110,177 @@ class AivenceRealty {
104
110
  default: 'list',
105
111
  },
106
112
  // ============================================
113
+ // PROPERTY SEARCH PARAMETERS
114
+ // ============================================
115
+ {
116
+ displayName: 'Property ID',
117
+ name: 'propertyId',
118
+ type: 'number',
119
+ displayOptions: {
120
+ show: {
121
+ resource: ['property'],
122
+ operation: ['search'],
123
+ },
124
+ },
125
+ default: 0,
126
+ description: 'ID específico de la propiedad (opcional)',
127
+ },
128
+ {
129
+ displayName: 'Operación',
130
+ name: 'operacion',
131
+ type: 'options',
132
+ displayOptions: {
133
+ show: {
134
+ resource: ['property'],
135
+ operation: ['search'],
136
+ },
137
+ },
138
+ options: [
139
+ { name: 'Alquiler', value: 'Alquiler' },
140
+ { name: 'Compra', value: 'Compra' },
141
+ ],
142
+ default: 'Alquiler',
143
+ description: 'Tipo de operación inmobiliaria',
144
+ },
145
+ {
146
+ displayName: 'Tipo de Propiedad',
147
+ name: 'tipoPropiedad',
148
+ type: 'options',
149
+ displayOptions: {
150
+ show: {
151
+ resource: ['property'],
152
+ operation: ['search'],
153
+ },
154
+ },
155
+ options: [
156
+ { name: 'Casa', value: 'casa' },
157
+ { name: 'Apartamento', value: 'apartamento' },
158
+ { name: 'Departamento', value: 'apartamento' },
159
+ { name: 'Duplex', value: 'duplex' },
160
+ { name: 'PH', value: 'ph' },
161
+ { name: 'Local Comercial', value: 'local_comercial' },
162
+ { name: 'Oficina', value: 'oficina' },
163
+ { name: 'Terreno', value: 'terreno' },
164
+ { name: 'Bodega', value: 'bodega' },
165
+ { name: 'Quinta', value: 'quinta' },
166
+ { name: 'Cochera', value: 'cochera' },
167
+ ],
168
+ default: '',
169
+ description: 'Tipo de propiedad a buscar',
170
+ },
171
+ {
172
+ displayName: 'Zonas (Barrios)',
173
+ name: 'zonas',
174
+ type: 'string',
175
+ displayOptions: {
176
+ show: {
177
+ resource: ['property'],
178
+ operation: ['search'],
179
+ },
180
+ },
181
+ default: '',
182
+ placeholder: 'Núñez, Saavedra, Belgrano',
183
+ description: 'Zonas separadas por coma (Smart Zone Logic aplicado automáticamente)',
184
+ },
185
+ {
186
+ displayName: 'Dormitorios Mínimo',
187
+ name: 'dormitoriosMinimo',
188
+ type: 'number',
189
+ displayOptions: {
190
+ show: {
191
+ resource: ['property'],
192
+ operation: ['search'],
193
+ },
194
+ },
195
+ default: 0,
196
+ description: 'Cantidad mínima de dormitorios',
197
+ },
198
+ {
199
+ displayName: 'Dormitorios Máximo',
200
+ name: 'dormitoriosMaximo',
201
+ type: 'number',
202
+ displayOptions: {
203
+ show: {
204
+ resource: ['property'],
205
+ operation: ['search'],
206
+ },
207
+ },
208
+ default: 0,
209
+ description: 'Cantidad máxima de dormitorios',
210
+ },
211
+ {
212
+ displayName: 'Baños',
213
+ name: 'banos',
214
+ type: 'number',
215
+ displayOptions: {
216
+ show: {
217
+ resource: ['property'],
218
+ operation: ['search'],
219
+ },
220
+ },
221
+ default: 0,
222
+ description: 'Cantidad de baños',
223
+ },
224
+ {
225
+ displayName: 'Precio Mínimo',
226
+ name: 'precioMinimo',
227
+ type: 'number',
228
+ displayOptions: {
229
+ show: {
230
+ resource: ['property'],
231
+ operation: ['search'],
232
+ },
233
+ },
234
+ default: 0,
235
+ description: 'Precio mínimo en USD',
236
+ },
237
+ {
238
+ displayName: 'Precio Máximo',
239
+ name: 'precioMaximo',
240
+ type: 'number',
241
+ displayOptions: {
242
+ show: {
243
+ resource: ['property'],
244
+ operation: ['search'],
245
+ },
246
+ },
247
+ default: 0,
248
+ description: 'Precio máximo en USD',
249
+ },
250
+ {
251
+ displayName: 'Estado',
252
+ name: 'estado',
253
+ type: 'options',
254
+ displayOptions: {
255
+ show: {
256
+ resource: ['property'],
257
+ operation: ['search'],
258
+ },
259
+ },
260
+ options: [
261
+ { name: 'Activo', value: 'activo' },
262
+ { name: 'Inactivo', value: 'inactivo' },
263
+ { name: 'Vendido', value: 'vendido' },
264
+ { name: 'Alquilado', value: 'alquilado' },
265
+ ],
266
+ default: 'activo',
267
+ description: 'Estado de la propiedad',
268
+ },
269
+ {
270
+ displayName: 'Amenidades',
271
+ name: 'amenidades',
272
+ type: 'string',
273
+ displayOptions: {
274
+ show: {
275
+ resource: ['property'],
276
+ operation: ['search'],
277
+ },
278
+ },
279
+ default: '',
280
+ placeholder: 'Piscina, Gimnasio, Parrilla',
281
+ description: 'Amenidades separadas por coma',
282
+ },
283
+ // ============================================
107
284
  // LEAD OPERATIONS
108
285
  // ============================================
109
286
  {
@@ -700,7 +877,72 @@ class AivenceRealty {
700
877
  // PROPERTY RESOURCE
701
878
  // ============================================
702
879
  if (resource === 'property') {
703
- if (operation === 'list') {
880
+ if (operation === 'search') {
881
+ // ============================================
882
+ // PROPERTY SEARCH - Smart Zone Logic
883
+ // ============================================
884
+ const qs = {};
885
+ // Property ID (búsqueda directa por ID)
886
+ const propertyId = this.getNodeParameter('propertyId', i);
887
+ if (propertyId > 0) {
888
+ qs.id = propertyId;
889
+ }
890
+ // Operación (Alquiler/Compra)
891
+ const operacion = this.getNodeParameter('operacion', i);
892
+ if (operacion && operacion !== 'NULL') {
893
+ qs.operacion = operacion;
894
+ }
895
+ // Tipo de Propiedad
896
+ const tipoPropiedad = this.getNodeParameter('tipoPropiedad', i);
897
+ if (tipoPropiedad && tipoPropiedad !== '' && tipoPropiedad !== 'NULL') {
898
+ qs.tipo_propiedad = tipoPropiedad;
899
+ }
900
+ // Zonas (barrios) - Smart Zone Logic aplicado en el workflow
901
+ const zonas = this.getNodeParameter('zonas', i);
902
+ if (zonas && zonas !== '' && zonas !== 'NULL' && zonas !== 'null') {
903
+ qs.barrio = zonas; // Ya viene con formato "Núñez, Saavedra, Belgrano"
904
+ }
905
+ // Dormitorios
906
+ const dormitoriosMinimo = this.getNodeParameter('dormitoriosMinimo', i);
907
+ if (dormitoriosMinimo > 0) {
908
+ qs.dormitorios_minimo = dormitoriosMinimo;
909
+ }
910
+ const dormitoriosMaximo = this.getNodeParameter('dormitoriosMaximo', i);
911
+ if (dormitoriosMaximo > 0) {
912
+ qs.dormitorios_maximo = dormitoriosMaximo;
913
+ }
914
+ // Baños
915
+ const banos = this.getNodeParameter('banos', i);
916
+ if (banos > 0) {
917
+ qs.banos = banos;
918
+ }
919
+ // Precio
920
+ const precioMinimo = this.getNodeParameter('precioMinimo', i);
921
+ if (precioMinimo > 0) {
922
+ qs.precio_minimo = precioMinimo;
923
+ }
924
+ const precioMaximo = this.getNodeParameter('precioMaximo', i);
925
+ if (precioMaximo > 0) {
926
+ qs.precio_maximo = precioMaximo;
927
+ }
928
+ // Estado
929
+ const estado = this.getNodeParameter('estado', i);
930
+ if (estado && estado !== '') {
931
+ qs.estado = estado;
932
+ }
933
+ // Amenidades
934
+ const amenidades = this.getNodeParameter('amenidades', i);
935
+ if (amenidades && amenidades !== '' && amenidades !== 'NULL') {
936
+ qs.amenidades = amenidades;
937
+ }
938
+ responseData = await this.helpers.httpRequest({
939
+ method: 'GET',
940
+ url: `${baseUrl}/api/v1/properties`,
941
+ qs,
942
+ json: true,
943
+ });
944
+ }
945
+ else if (operation === 'list') {
704
946
  responseData = await this.helpers.httpRequest({
705
947
  method: 'GET',
706
948
  url: `${baseUrl}/api/v1/properties`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-aivence-realty",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Nodo n8n para integrar el CRM inmobiliario AivenceRealty",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",