n8n-nodes-aivence-realty 0.1.1 → 0.1.3
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.
- package/README.md +60 -0
- package/dist/nodes/AivenceRealty/AivenceRealty.node.js +164 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -52,6 +52,11 @@ O desde la interfaz de n8n: **Community Nodes → Install** y escribir `n8n-node
|
|
|
52
52
|
### 7. **WhatsApp**
|
|
53
53
|
- `sendMessage` - Enviar mensaje por WhatsApp (Evolution API)
|
|
54
54
|
|
|
55
|
+
### 8. **Calculator** (Calculadoras Financieras) ✨ NUEVO
|
|
56
|
+
- `mortgage` - Calcular cuota mensual de hipoteca
|
|
57
|
+
- `rentalYield` - Calcular rentabilidad de inversión (ROI)
|
|
58
|
+
- `closingCosts` - Calcular costos de escrituración
|
|
59
|
+
|
|
55
60
|
## 🎯 Ejemplos de Uso
|
|
56
61
|
|
|
57
62
|
### Crear un Lead
|
|
@@ -82,6 +87,54 @@ O desde la interfaz de n8n: **Community Nodes → Install** y escribir `n8n-node
|
|
|
82
87
|
}
|
|
83
88
|
```
|
|
84
89
|
|
|
90
|
+
### Calcular Hipoteca
|
|
91
|
+
|
|
92
|
+
```json
|
|
93
|
+
{
|
|
94
|
+
"resource": "calculator",
|
|
95
|
+
"operation": "mortgage",
|
|
96
|
+
"propertyValue": 150000,
|
|
97
|
+
"downPaymentPercent": 20,
|
|
98
|
+
"interestRate": 4.5,
|
|
99
|
+
"loanTermYears": 30
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Respuesta:**
|
|
104
|
+
```json
|
|
105
|
+
{
|
|
106
|
+
"monthly_payment": 608.02,
|
|
107
|
+
"total_loan": 120000,
|
|
108
|
+
"down_payment": 30000,
|
|
109
|
+
"total_interest": 98887.20,
|
|
110
|
+
"total_paid": 218887.20
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Calcular Rentabilidad
|
|
115
|
+
|
|
116
|
+
```json
|
|
117
|
+
{
|
|
118
|
+
"resource": "calculator",
|
|
119
|
+
"operation": "rentalYield",
|
|
120
|
+
"propertyValue": 150000,
|
|
121
|
+
"monthlyRent": 1200,
|
|
122
|
+
"annualExpenses": 3000
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**Respuesta:**
|
|
127
|
+
```json
|
|
128
|
+
{
|
|
129
|
+
"annual_rent": 14400,
|
|
130
|
+
"net_annual_income": 11400,
|
|
131
|
+
"gross_yield": 9.6,
|
|
132
|
+
"net_yield": 7.6,
|
|
133
|
+
"roi": 7.6,
|
|
134
|
+
"payback_years": 13.16
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
85
138
|
## 🔧 Desarrollo Local
|
|
86
139
|
|
|
87
140
|
```bash
|
|
@@ -106,6 +159,13 @@ n8n start
|
|
|
106
159
|
|
|
107
160
|
## 📝 Changelog
|
|
108
161
|
|
|
162
|
+
### v0.1.3 (2025-10-12)
|
|
163
|
+
- ✨ Nuevo recurso: **Calculator** (Calculadoras Financieras)
|
|
164
|
+
- ➕ Operación: Calcular hipoteca (mortgage)
|
|
165
|
+
- ➕ Operación: Calcular rentabilidad (rentalYield)
|
|
166
|
+
- ➕ Operación: Calcular costos de cierre (closingCosts)
|
|
167
|
+
- 📚 README actualizado con ejemplos de calculadoras
|
|
168
|
+
|
|
109
169
|
### v0.1.0 (2025-10-09)
|
|
110
170
|
- 🎉 Versión inicial
|
|
111
171
|
- ✅ 7 recursos implementados
|
|
@@ -60,6 +60,10 @@ class AivenceRealty {
|
|
|
60
60
|
name: 'WhatsApp',
|
|
61
61
|
value: 'whatsapp',
|
|
62
62
|
},
|
|
63
|
+
{
|
|
64
|
+
name: 'Calculator',
|
|
65
|
+
value: 'calculator',
|
|
66
|
+
},
|
|
63
67
|
],
|
|
64
68
|
default: 'property',
|
|
65
69
|
description: 'Recurso del CRM a operar',
|
|
@@ -562,6 +566,123 @@ class AivenceRealty {
|
|
|
562
566
|
},
|
|
563
567
|
default: '',
|
|
564
568
|
},
|
|
569
|
+
// ============================================
|
|
570
|
+
// CALCULATOR OPERATIONS
|
|
571
|
+
// ============================================
|
|
572
|
+
{
|
|
573
|
+
displayName: 'Operación',
|
|
574
|
+
name: 'operation',
|
|
575
|
+
type: 'options',
|
|
576
|
+
noDataExpression: true,
|
|
577
|
+
displayOptions: {
|
|
578
|
+
show: {
|
|
579
|
+
resource: ['calculator'],
|
|
580
|
+
},
|
|
581
|
+
},
|
|
582
|
+
options: [
|
|
583
|
+
{
|
|
584
|
+
name: 'Mortgage',
|
|
585
|
+
value: 'mortgage',
|
|
586
|
+
description: 'Calcular cuota mensual de hipoteca',
|
|
587
|
+
action: 'Calcular hipoteca',
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
name: 'Rental Yield',
|
|
591
|
+
value: 'rentalYield',
|
|
592
|
+
description: 'Calcular rentabilidad de inversión (ROI)',
|
|
593
|
+
action: 'Calcular rentabilidad',
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
name: 'Closing Costs',
|
|
597
|
+
value: 'closingCosts',
|
|
598
|
+
description: 'Calcular costos de escrituración',
|
|
599
|
+
action: 'Calcular costos de cierre',
|
|
600
|
+
},
|
|
601
|
+
],
|
|
602
|
+
default: 'mortgage',
|
|
603
|
+
},
|
|
604
|
+
// Calculator - Mortgage Fields
|
|
605
|
+
{
|
|
606
|
+
displayName: 'Property Value (USD)',
|
|
607
|
+
name: 'propertyValue',
|
|
608
|
+
type: 'number',
|
|
609
|
+
required: true,
|
|
610
|
+
displayOptions: {
|
|
611
|
+
show: {
|
|
612
|
+
resource: ['calculator'],
|
|
613
|
+
operation: ['mortgage', 'rentalYield', 'closingCosts'],
|
|
614
|
+
},
|
|
615
|
+
},
|
|
616
|
+
default: 150000,
|
|
617
|
+
description: 'Valor de la propiedad en dólares',
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
displayName: 'Down Payment (%)',
|
|
621
|
+
name: 'downPaymentPercent',
|
|
622
|
+
type: 'number',
|
|
623
|
+
displayOptions: {
|
|
624
|
+
show: {
|
|
625
|
+
resource: ['calculator'],
|
|
626
|
+
operation: ['mortgage'],
|
|
627
|
+
},
|
|
628
|
+
},
|
|
629
|
+
default: 20,
|
|
630
|
+
description: 'Porcentaje de entrada',
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
displayName: 'Interest Rate (%)',
|
|
634
|
+
name: 'interestRate',
|
|
635
|
+
type: 'number',
|
|
636
|
+
displayOptions: {
|
|
637
|
+
show: {
|
|
638
|
+
resource: ['calculator'],
|
|
639
|
+
operation: ['mortgage'],
|
|
640
|
+
},
|
|
641
|
+
},
|
|
642
|
+
default: 4.5,
|
|
643
|
+
description: 'Tasa de interés anual',
|
|
644
|
+
},
|
|
645
|
+
{
|
|
646
|
+
displayName: 'Loan Term (Years)',
|
|
647
|
+
name: 'loanTermYears',
|
|
648
|
+
type: 'number',
|
|
649
|
+
displayOptions: {
|
|
650
|
+
show: {
|
|
651
|
+
resource: ['calculator'],
|
|
652
|
+
operation: ['mortgage'],
|
|
653
|
+
},
|
|
654
|
+
},
|
|
655
|
+
default: 30,
|
|
656
|
+
description: 'Plazo del préstamo en años',
|
|
657
|
+
},
|
|
658
|
+
// Calculator - Rental Yield Fields
|
|
659
|
+
{
|
|
660
|
+
displayName: 'Monthly Rent (USD)',
|
|
661
|
+
name: 'monthlyRent',
|
|
662
|
+
type: 'number',
|
|
663
|
+
required: true,
|
|
664
|
+
displayOptions: {
|
|
665
|
+
show: {
|
|
666
|
+
resource: ['calculator'],
|
|
667
|
+
operation: ['rentalYield'],
|
|
668
|
+
},
|
|
669
|
+
},
|
|
670
|
+
default: 1200,
|
|
671
|
+
description: 'Renta mensual estimada',
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
displayName: 'Annual Expenses (USD)',
|
|
675
|
+
name: 'annualExpenses',
|
|
676
|
+
type: 'number',
|
|
677
|
+
displayOptions: {
|
|
678
|
+
show: {
|
|
679
|
+
resource: ['calculator'],
|
|
680
|
+
operation: ['rentalYield'],
|
|
681
|
+
},
|
|
682
|
+
},
|
|
683
|
+
default: 3000,
|
|
684
|
+
description: 'Gastos anuales (mantenimiento, impuestos, etc.)',
|
|
685
|
+
},
|
|
565
686
|
],
|
|
566
687
|
};
|
|
567
688
|
}
|
|
@@ -755,6 +876,49 @@ class AivenceRealty {
|
|
|
755
876
|
});
|
|
756
877
|
}
|
|
757
878
|
}
|
|
879
|
+
// ============================================
|
|
880
|
+
// CALCULATOR RESOURCE
|
|
881
|
+
// ============================================
|
|
882
|
+
else if (resource === 'calculator') {
|
|
883
|
+
if (operation === 'mortgage') {
|
|
884
|
+
const body = {
|
|
885
|
+
property_value: this.getNodeParameter('propertyValue', i),
|
|
886
|
+
down_payment_percent: this.getNodeParameter('downPaymentPercent', i),
|
|
887
|
+
interest_rate: this.getNodeParameter('interestRate', i),
|
|
888
|
+
loan_term_years: this.getNodeParameter('loanTermYears', i),
|
|
889
|
+
};
|
|
890
|
+
responseData = await this.helpers.httpRequest({
|
|
891
|
+
method: 'POST',
|
|
892
|
+
url: `${baseUrl}/api/calculators/mortgage`,
|
|
893
|
+
body,
|
|
894
|
+
json: true,
|
|
895
|
+
});
|
|
896
|
+
}
|
|
897
|
+
else if (operation === 'rentalYield') {
|
|
898
|
+
const body = {
|
|
899
|
+
property_value: this.getNodeParameter('propertyValue', i),
|
|
900
|
+
monthly_rent: this.getNodeParameter('monthlyRent', i),
|
|
901
|
+
annual_expenses: this.getNodeParameter('annualExpenses', i),
|
|
902
|
+
};
|
|
903
|
+
responseData = await this.helpers.httpRequest({
|
|
904
|
+
method: 'POST',
|
|
905
|
+
url: `${baseUrl}/api/calculators/rental-yield`,
|
|
906
|
+
body,
|
|
907
|
+
json: true,
|
|
908
|
+
});
|
|
909
|
+
}
|
|
910
|
+
else if (operation === 'closingCosts') {
|
|
911
|
+
const body = {
|
|
912
|
+
property_value: this.getNodeParameter('propertyValue', i),
|
|
913
|
+
};
|
|
914
|
+
responseData = await this.helpers.httpRequest({
|
|
915
|
+
method: 'POST',
|
|
916
|
+
url: `${baseUrl}/api/calculators/closing-costs`,
|
|
917
|
+
body,
|
|
918
|
+
json: true,
|
|
919
|
+
});
|
|
920
|
+
}
|
|
921
|
+
}
|
|
758
922
|
// Formatear respuesta
|
|
759
923
|
const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
|
|
760
924
|
returnData.push(...executionData);
|