@fiado/api-invoker 5.55.0 → 5.56.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.
- package/bin/loanOfferings/api/LoanOfferingsBusinessApi.d.ts +3 -1
- package/bin/loanOfferings/api/LoanOfferingsBusinessApi.js +8 -0
- package/bin/loanOfferings/api/interfaces/ILoanOfferingsBusinessApi.d.ts +11 -1
- package/package.json +2 -2
- package/src/loanOfferings/api/LoanOfferingsBusinessApi.ts +22 -0
- package/src/loanOfferings/api/interfaces/ILoanOfferingsBusinessApi.ts +24 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IHttpRequest } from "@fiado/http-client";
|
|
2
2
|
import { StandardResponse } from "@fiado/gateway-adapter";
|
|
3
|
-
import { ConsumePromotionRequest, PromotedSkusResponse, ConsumePromotionResponse, CreditPlanResponse, FinancierResponse, ResolveCustomerSegmentsRequest, ResolveCustomerSegmentsResponse, SimulateCreditPlanRequest, SimulationResultResponse } from "@fiado/type-kit/bin/loanOfferings/index.js";
|
|
3
|
+
import { ConsumePromotionRequest, PromotedSkusResponse, ConsumePromotionResponse, CreditPlanResponse, FinancierResponse, ReservePromotionBonusRequest, ReservePromotionBonusResponse, ResolveCustomerSegmentsRequest, ResolveCustomerSegmentsResponse, SettlePromotionBonusRequest, PromotionBonusResponse, SimulateCreditPlanRequest, SimulationResultResponse } from "@fiado/type-kit/bin/loanOfferings/index.js";
|
|
4
4
|
import { ILoanOfferingsBusinessApi } from "./interfaces/ILoanOfferingsBusinessApi.js";
|
|
5
5
|
/**
|
|
6
6
|
* Publisher HTTP del lambda `loan-offerings-business` (componente 07 SureKeep Fase 1) para sus
|
|
@@ -25,4 +25,6 @@ export default class LoanOfferingsBusinessApi implements ILoanOfferingsBusinessA
|
|
|
25
25
|
consumePromotion(promotionId: string, input: ConsumePromotionRequest, tenantId: string): Promise<StandardResponse<ConsumePromotionResponse>>;
|
|
26
26
|
listPromotedSkus(storeId: string, tenantId: string): Promise<StandardResponse<PromotedSkusResponse>>;
|
|
27
27
|
resolveCustomerSegments(input: ResolveCustomerSegmentsRequest, tenantId: string): Promise<StandardResponse<ResolveCustomerSegmentsResponse>>;
|
|
28
|
+
reservePromotionBonus(promotionId: string, input: ReservePromotionBonusRequest, tenantId: string): Promise<StandardResponse<ReservePromotionBonusResponse>>;
|
|
29
|
+
settlePromotionBonus(promotionId: string, input: SettlePromotionBonusRequest, tenantId: string): Promise<StandardResponse<PromotionBonusResponse>>;
|
|
28
30
|
}
|
|
@@ -58,6 +58,14 @@ let LoanOfferingsBusinessApi = class LoanOfferingsBusinessApi {
|
|
|
58
58
|
const url = `${this.baseUrl}/private/segments/resolve?tenantId=${encodeURIComponent(tenantId)}`;
|
|
59
59
|
return await this.httpRequest.post(url, input);
|
|
60
60
|
}
|
|
61
|
+
async reservePromotionBonus(promotionId, input, tenantId) {
|
|
62
|
+
const url = `${this.baseUrl}/private/promotions/${encodeURIComponent(promotionId)}/bonus-payment?tenantId=${encodeURIComponent(tenantId)}`;
|
|
63
|
+
return await this.httpRequest.post(url, input);
|
|
64
|
+
}
|
|
65
|
+
async settlePromotionBonus(promotionId, input, tenantId) {
|
|
66
|
+
const url = `${this.baseUrl}/private/promotions/${encodeURIComponent(promotionId)}/bonus-payment/result?tenantId=${encodeURIComponent(tenantId)}`;
|
|
67
|
+
return await this.httpRequest.put(url, input);
|
|
68
|
+
}
|
|
61
69
|
};
|
|
62
70
|
LoanOfferingsBusinessApi = __decorate([
|
|
63
71
|
injectable(),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StandardResponse } from "@fiado/gateway-adapter";
|
|
2
|
-
import { ConsumePromotionRequest, PromotedSkusResponse, ConsumePromotionResponse, CreditPlanResponse, FinancierResponse, ResolveCustomerSegmentsRequest, ResolveCustomerSegmentsResponse, SimulateCreditPlanRequest, SimulationResultResponse } from "@fiado/type-kit/bin/loanOfferings/index.js";
|
|
2
|
+
import { ConsumePromotionRequest, PromotedSkusResponse, ConsumePromotionResponse, CreditPlanResponse, FinancierResponse, ReservePromotionBonusRequest, ReservePromotionBonusResponse, ResolveCustomerSegmentsRequest, ResolveCustomerSegmentsResponse, SettlePromotionBonusRequest, PromotionBonusResponse, SimulateCreditPlanRequest, SimulationResultResponse } from "@fiado/type-kit/bin/loanOfferings/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* Contrato del publisher HTTP del lambda `loan-offerings-business` (componente 07 SureKeep Fase 1)
|
|
5
5
|
* para sus endpoints privados service-to-service (VPC-only): LECTURAS del catálogo SOFOM y
|
|
@@ -102,4 +102,14 @@ export interface ILoanOfferingsBusinessApi {
|
|
|
102
102
|
* (`400`), o si falta el tenant (`400 UNKNOWN_TENANT`).
|
|
103
103
|
*/
|
|
104
104
|
resolveCustomerSegments(input: ResolveCustomerSegmentsRequest, tenantId: string): Promise<StandardResponse<ResolveCustomerSegmentsResponse>>;
|
|
105
|
+
/**
|
|
106
|
+
* `POST /private/promotions/{promotionId}/bonus-payment` — reserva el bono PCF de un crédito
|
|
107
|
+
* recién activado. El candado es el `creditId`: reenviarlo devuelve `reserved: false`.
|
|
108
|
+
*/
|
|
109
|
+
reservePromotionBonus(promotionId: string, input: ReservePromotionBonusRequest, tenantId: string): Promise<StandardResponse<ReservePromotionBonusResponse>>;
|
|
110
|
+
/**
|
|
111
|
+
* `PUT /private/promotions/{promotionId}/bonus-payment/result` — cierra el asiento con lo que
|
|
112
|
+
* contestó el processor. Se llama SIEMPRE, haya pagado o no.
|
|
113
|
+
*/
|
|
114
|
+
settlePromotionBonus(promotionId: string, input: SettlePromotionBonusRequest, tenantId: string): Promise<StandardResponse<PromotionBonusResponse>>;
|
|
105
115
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.56.0",
|
|
4
4
|
"description": "Sirve como un puente entre diferentes funciones lambda, facilitando la comunicación entre ellas a través de invocaciones http",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "bin/index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@fiado/gateway-adapter": "^3.9.0",
|
|
35
35
|
"@fiado/http-client": "^2.0.1",
|
|
36
36
|
"@fiado/logger": "^1.1.3",
|
|
37
|
-
"@fiado/type-kit": "^3.
|
|
37
|
+
"@fiado/type-kit": "^3.385.0",
|
|
38
38
|
"dotenv": "^16.4.7"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -7,8 +7,12 @@ import {
|
|
|
7
7
|
ConsumePromotionResponse,
|
|
8
8
|
CreditPlanResponse,
|
|
9
9
|
FinancierResponse,
|
|
10
|
+
ReservePromotionBonusRequest,
|
|
11
|
+
ReservePromotionBonusResponse,
|
|
10
12
|
ResolveCustomerSegmentsRequest,
|
|
11
13
|
ResolveCustomerSegmentsResponse,
|
|
14
|
+
SettlePromotionBonusRequest,
|
|
15
|
+
PromotionBonusResponse,
|
|
12
16
|
SimulateCreditPlanRequest,
|
|
13
17
|
SimulationResultResponse,
|
|
14
18
|
} from "@fiado/type-kit/bin/loanOfferings/index.js";
|
|
@@ -89,4 +93,22 @@ export default class LoanOfferingsBusinessApi implements ILoanOfferingsBusinessA
|
|
|
89
93
|
const url = `${this.baseUrl}/private/segments/resolve?tenantId=${encodeURIComponent(tenantId)}`;
|
|
90
94
|
return await this.httpRequest.post(url, input);
|
|
91
95
|
}
|
|
96
|
+
|
|
97
|
+
async reservePromotionBonus(
|
|
98
|
+
promotionId: string,
|
|
99
|
+
input: ReservePromotionBonusRequest,
|
|
100
|
+
tenantId: string,
|
|
101
|
+
): Promise<StandardResponse<ReservePromotionBonusResponse>> {
|
|
102
|
+
const url = `${this.baseUrl}/private/promotions/${encodeURIComponent(promotionId)}/bonus-payment?tenantId=${encodeURIComponent(tenantId)}`;
|
|
103
|
+
return await this.httpRequest.post(url, input);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
async settlePromotionBonus(
|
|
107
|
+
promotionId: string,
|
|
108
|
+
input: SettlePromotionBonusRequest,
|
|
109
|
+
tenantId: string,
|
|
110
|
+
): Promise<StandardResponse<PromotionBonusResponse>> {
|
|
111
|
+
const url = `${this.baseUrl}/private/promotions/${encodeURIComponent(promotionId)}/bonus-payment/result?tenantId=${encodeURIComponent(tenantId)}`;
|
|
112
|
+
return await this.httpRequest.put(url, input);
|
|
113
|
+
}
|
|
92
114
|
}
|
|
@@ -5,8 +5,12 @@ import {
|
|
|
5
5
|
ConsumePromotionResponse,
|
|
6
6
|
CreditPlanResponse,
|
|
7
7
|
FinancierResponse,
|
|
8
|
+
ReservePromotionBonusRequest,
|
|
9
|
+
ReservePromotionBonusResponse,
|
|
8
10
|
ResolveCustomerSegmentsRequest,
|
|
9
11
|
ResolveCustomerSegmentsResponse,
|
|
12
|
+
SettlePromotionBonusRequest,
|
|
13
|
+
PromotionBonusResponse,
|
|
10
14
|
SimulateCreditPlanRequest,
|
|
11
15
|
SimulationResultResponse,
|
|
12
16
|
} from "@fiado/type-kit/bin/loanOfferings/index.js";
|
|
@@ -141,4 +145,24 @@ export interface ILoanOfferingsBusinessApi {
|
|
|
141
145
|
input: ResolveCustomerSegmentsRequest,
|
|
142
146
|
tenantId: string,
|
|
143
147
|
): Promise<StandardResponse<ResolveCustomerSegmentsResponse>>;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* `POST /private/promotions/{promotionId}/bonus-payment` — reserva el bono PCF de un crédito
|
|
151
|
+
* recién activado. El candado es el `creditId`: reenviarlo devuelve `reserved: false`.
|
|
152
|
+
*/
|
|
153
|
+
reservePromotionBonus(
|
|
154
|
+
promotionId: string,
|
|
155
|
+
input: ReservePromotionBonusRequest,
|
|
156
|
+
tenantId: string,
|
|
157
|
+
): Promise<StandardResponse<ReservePromotionBonusResponse>>;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* `PUT /private/promotions/{promotionId}/bonus-payment/result` — cierra el asiento con lo que
|
|
161
|
+
* contestó el processor. Se llama SIEMPRE, haya pagado o no.
|
|
162
|
+
*/
|
|
163
|
+
settlePromotionBonus(
|
|
164
|
+
promotionId: string,
|
|
165
|
+
input: SettlePromotionBonusRequest,
|
|
166
|
+
tenantId: string,
|
|
167
|
+
): Promise<StandardResponse<PromotionBonusResponse>>;
|
|
144
168
|
}
|