@fiado/api-invoker 5.150.0 → 5.151.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 +1 -1
- package/src/loanOfferings/api/LoanOfferingsBusinessApi.ts +18 -0
- package/src/loanOfferings/api/interfaces/ILoanOfferingsBusinessApi.ts +20 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IHttpRequest } from "@fiado/http-client";
|
|
2
2
|
import { StandardResponse } from "@fiado/gateway-adapter";
|
|
3
|
-
import { AmortizationScheduleResponse, ComputeAmortizationScheduleRequest, ConsumePromotionRequest, PromotedSkusResponse, ConsumePromotionResponse, CreditPlanLevelEnum, CreditPlanResponse, FinancierResponse, ReservePromotionBonusRequest, ReservePromotionBonusResponse, ResolveCustomerSegmentsRequest, ResolveCustomerSegmentsResponse, ScopeWidePromotionsResponse, SegmentCatalogResponse, SegmentStatusEnum, SkuPromotionsResponse, SettlePromotionBonusRequest, PromotionBonusResponse, SimulateCreditPlanRequest, SimulationResultResponse } from "@fiado/type-kit/bin/loanOfferings/index.js";
|
|
3
|
+
import { AmortizationScheduleResponse, ComputeAmortizationScheduleRequest, ConsumePromotionRequest, PromotedSkusResponse, ConsumePromotionResponse, CreditPlanLevelEnum, CreditPlanResponse, FinancierResponse, ListPromotedSkusRequest, ListSkuPromotionsRequest, ReservePromotionBonusRequest, ReservePromotionBonusResponse, ResolveCustomerSegmentsRequest, ResolveCustomerSegmentsResponse, ScopeWidePromotionsResponse, SegmentCatalogResponse, SegmentStatusEnum, SkuPromotionsResponse, SettlePromotionBonusRequest, PromotionBonusResponse, SimulateCreditPlanRequest, SimulationResultResponse } from "@fiado/type-kit/bin/loanOfferings/index.js";
|
|
4
4
|
import { SegmentMembersResponse } from "./dtos/SegmentMembers.js";
|
|
5
5
|
import { ILoanOfferingsBusinessApi } from "./interfaces/ILoanOfferingsBusinessApi.js";
|
|
6
6
|
/**
|
|
@@ -26,10 +26,12 @@ export default class LoanOfferingsBusinessApi implements ILoanOfferingsBusinessA
|
|
|
26
26
|
computeAmortizationSchedule(input: ComputeAmortizationScheduleRequest, tenantId: string): Promise<StandardResponse<AmortizationScheduleResponse>>;
|
|
27
27
|
consumePromotion(promotionId: string, input: ConsumePromotionRequest, tenantId: string): Promise<StandardResponse<ConsumePromotionResponse>>;
|
|
28
28
|
listPromotedSkus(storeId: string, tenantId: string, level?: CreditPlanLevelEnum, segmentId?: string): Promise<StandardResponse<PromotedSkusResponse>>;
|
|
29
|
+
listPromotedSkusBatch(input: ListPromotedSkusRequest, tenantId: string): Promise<StandardResponse<PromotedSkusResponse>>;
|
|
29
30
|
resolveCustomerSegments(input: ResolveCustomerSegmentsRequest, tenantId: string): Promise<StandardResponse<ResolveCustomerSegmentsResponse>>;
|
|
30
31
|
reservePromotionBonus(promotionId: string, input: ReservePromotionBonusRequest, tenantId: string): Promise<StandardResponse<ReservePromotionBonusResponse>>;
|
|
31
32
|
settlePromotionBonus(promotionId: string, input: SettlePromotionBonusRequest, tenantId: string): Promise<StandardResponse<PromotionBonusResponse>>;
|
|
32
33
|
listSkuPromotions(storeId: string, tenantId: string, level?: CreditPlanLevelEnum, segmentId?: string): Promise<StandardResponse<SkuPromotionsResponse>>;
|
|
34
|
+
listSkuPromotionsBatch(input: ListSkuPromotionsRequest, tenantId: string): Promise<StandardResponse<SkuPromotionsResponse>>;
|
|
33
35
|
listScopeWidePromotions(storeId: string, tenantId: string, level?: CreditPlanLevelEnum, segmentId?: string): Promise<StandardResponse<ScopeWidePromotionsResponse>>;
|
|
34
36
|
getSegmentMembers(retailCustomerIds: string[], tenantId: string): Promise<StandardResponse<SegmentMembersResponse>>;
|
|
35
37
|
listSegments(tenantId: string, status?: SegmentStatusEnum): Promise<StandardResponse<SegmentCatalogResponse>>;
|
|
@@ -62,6 +62,10 @@ let LoanOfferingsBusinessApi = class LoanOfferingsBusinessApi {
|
|
|
62
62
|
url += `&segmentId=${encodeURIComponent(segmentId)}`;
|
|
63
63
|
return await this.httpRequest.get(url);
|
|
64
64
|
}
|
|
65
|
+
async listPromotedSkusBatch(input, tenantId) {
|
|
66
|
+
const url = `${this.baseUrl}/private/promotions/promoted-skus?tenantId=${encodeURIComponent(tenantId)}`;
|
|
67
|
+
return await this.httpRequest.post(url, input);
|
|
68
|
+
}
|
|
65
69
|
async resolveCustomerSegments(input, tenantId) {
|
|
66
70
|
const url = `${this.baseUrl}/private/segments/resolve?tenantId=${encodeURIComponent(tenantId)}`;
|
|
67
71
|
return await this.httpRequest.post(url, input);
|
|
@@ -82,6 +86,10 @@ let LoanOfferingsBusinessApi = class LoanOfferingsBusinessApi {
|
|
|
82
86
|
url += `&segmentId=${encodeURIComponent(segmentId)}`;
|
|
83
87
|
return await this.httpRequest.get(url);
|
|
84
88
|
}
|
|
89
|
+
async listSkuPromotionsBatch(input, tenantId) {
|
|
90
|
+
const url = `${this.baseUrl}/private/promotions/by-sku?tenantId=${encodeURIComponent(tenantId)}`;
|
|
91
|
+
return await this.httpRequest.post(url, input);
|
|
92
|
+
}
|
|
85
93
|
async listScopeWidePromotions(storeId, tenantId, level, segmentId) {
|
|
86
94
|
let url = `${this.baseUrl}/private/promotions/scope-wide?storeId=${encodeURIComponent(storeId)}&tenantId=${encodeURIComponent(tenantId)}`;
|
|
87
95
|
if (level)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StandardResponse } from "@fiado/gateway-adapter";
|
|
2
2
|
import { SegmentMembersResponse } from "../dtos/SegmentMembers.js";
|
|
3
|
-
import { AmortizationScheduleResponse, ComputeAmortizationScheduleRequest, ConsumePromotionRequest, PromotedSkusResponse, ConsumePromotionResponse, CreditPlanLevelEnum, CreditPlanResponse, FinancierResponse, ReservePromotionBonusRequest, ReservePromotionBonusResponse, ResolveCustomerSegmentsRequest, ResolveCustomerSegmentsResponse, ScopeWidePromotionsResponse, SegmentCatalogResponse, SegmentStatusEnum, SkuPromotionsResponse, SettlePromotionBonusRequest, PromotionBonusResponse, SimulateCreditPlanRequest, SimulationResultResponse } from "@fiado/type-kit/bin/loanOfferings/index.js";
|
|
3
|
+
import { ListPromotedSkusRequest, ListSkuPromotionsRequest, AmortizationScheduleResponse, ComputeAmortizationScheduleRequest, ConsumePromotionRequest, PromotedSkusResponse, ConsumePromotionResponse, CreditPlanLevelEnum, CreditPlanResponse, FinancierResponse, ReservePromotionBonusRequest, ReservePromotionBonusResponse, ResolveCustomerSegmentsRequest, ResolveCustomerSegmentsResponse, ScopeWidePromotionsResponse, SegmentCatalogResponse, SegmentStatusEnum, SkuPromotionsResponse, SettlePromotionBonusRequest, PromotionBonusResponse, SimulateCreditPlanRequest, SimulationResultResponse } from "@fiado/type-kit/bin/loanOfferings/index.js";
|
|
4
4
|
/**
|
|
5
5
|
* Contrato del publisher HTTP del lambda `loan-offerings-business` (componente 07 SureKeep Fase 1)
|
|
6
6
|
* para sus endpoints privados service-to-service (VPC-only): LECTURAS del catálogo SOFOM y
|
|
@@ -92,6 +92,11 @@ export interface ILoanOfferingsBusinessApi {
|
|
|
92
92
|
* vienen, el lambda destino descarta las promociones que acotan por esa dimensión.
|
|
93
93
|
*/
|
|
94
94
|
listPromotedSkus(storeId: string, tenantId: string, level?: CreditPlanLevelEnum, segmentId?: string): Promise<StandardResponse<PromotedSkusResponse>>;
|
|
95
|
+
/**
|
|
96
|
+
* `POST /private/promotions/promoted-skus` — versión en lote de {@link listPromotedSkus}: cada SKU
|
|
97
|
+
* viaja con su tipo y gama, así entran las promos acotadas por tipo o gama. Hasta 100 SKUs.
|
|
98
|
+
*/
|
|
99
|
+
listPromotedSkusBatch(input: ListPromotedSkusRequest, tenantId: string): Promise<StandardResponse<PromotedSkusResponse>>;
|
|
95
100
|
/**
|
|
96
101
|
* POST /private/segments/resolve — los segmentos a los que pertenece el cliente HOY, evaluados
|
|
97
102
|
* en línea contra los hechos que manda el caller. No hay segmento persistido en el cliente.
|
|
@@ -129,6 +134,11 @@ export interface ILoanOfferingsBusinessApi {
|
|
|
129
134
|
* vienen, el lambda destino descarta las promociones que acotan por esa dimensión.
|
|
130
135
|
*/
|
|
131
136
|
listSkuPromotions(storeId: string, tenantId: string, level?: CreditPlanLevelEnum, segmentId?: string): Promise<StandardResponse<SkuPromotionsResponse>>;
|
|
137
|
+
/**
|
|
138
|
+
* `POST /private/promotions/by-sku` — versión en lote de {@link listSkuPromotions}: cada SKU
|
|
139
|
+
* viaja con su tipo y gama, así entran las promos acotadas por tipo o gama. Hasta 100 SKUs.
|
|
140
|
+
*/
|
|
141
|
+
listSkuPromotionsBatch(input: ListSkuPromotionsRequest, tenantId: string): Promise<StandardResponse<SkuPromotionsResponse>>;
|
|
132
142
|
/**
|
|
133
143
|
* `GET /private/promotions/scope-wide` — promociones que NO acotan por SKU (tienda, nivel,
|
|
134
144
|
* segmento o universales), para el banner de pantalla completa del paso 03 del wizard.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.151.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",
|
|
@@ -10,6 +10,8 @@ import {
|
|
|
10
10
|
CreditPlanLevelEnum,
|
|
11
11
|
CreditPlanResponse,
|
|
12
12
|
FinancierResponse,
|
|
13
|
+
ListPromotedSkusRequest,
|
|
14
|
+
ListSkuPromotionsRequest,
|
|
13
15
|
ReservePromotionBonusRequest,
|
|
14
16
|
ReservePromotionBonusResponse,
|
|
15
17
|
ResolveCustomerSegmentsRequest,
|
|
@@ -106,6 +108,14 @@ export default class LoanOfferingsBusinessApi implements ILoanOfferingsBusinessA
|
|
|
106
108
|
return await this.httpRequest.get(url);
|
|
107
109
|
}
|
|
108
110
|
|
|
111
|
+
async listPromotedSkusBatch(
|
|
112
|
+
input: ListPromotedSkusRequest,
|
|
113
|
+
tenantId: string,
|
|
114
|
+
): Promise<StandardResponse<PromotedSkusResponse>> {
|
|
115
|
+
const url = `${this.baseUrl}/private/promotions/promoted-skus?tenantId=${encodeURIComponent(tenantId)}`;
|
|
116
|
+
return await this.httpRequest.post(url, input);
|
|
117
|
+
}
|
|
118
|
+
|
|
109
119
|
async resolveCustomerSegments(
|
|
110
120
|
input: ResolveCustomerSegmentsRequest,
|
|
111
121
|
tenantId: string,
|
|
@@ -144,6 +154,14 @@ export default class LoanOfferingsBusinessApi implements ILoanOfferingsBusinessA
|
|
|
144
154
|
return await this.httpRequest.get(url);
|
|
145
155
|
}
|
|
146
156
|
|
|
157
|
+
async listSkuPromotionsBatch(
|
|
158
|
+
input: ListSkuPromotionsRequest,
|
|
159
|
+
tenantId: string,
|
|
160
|
+
): Promise<StandardResponse<SkuPromotionsResponse>> {
|
|
161
|
+
const url = `${this.baseUrl}/private/promotions/by-sku?tenantId=${encodeURIComponent(tenantId)}`;
|
|
162
|
+
return await this.httpRequest.post(url, input);
|
|
163
|
+
}
|
|
164
|
+
|
|
147
165
|
async listScopeWidePromotions(
|
|
148
166
|
storeId: string,
|
|
149
167
|
tenantId: string,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { StandardResponse } from "@fiado/gateway-adapter";
|
|
2
2
|
import { SegmentMembersResponse } from "../dtos/SegmentMembers.js";
|
|
3
3
|
import {
|
|
4
|
+
ListPromotedSkusRequest,
|
|
5
|
+
ListSkuPromotionsRequest,
|
|
4
6
|
AmortizationScheduleResponse,
|
|
5
7
|
ComputeAmortizationScheduleRequest,
|
|
6
8
|
ConsumePromotionRequest,
|
|
@@ -145,6 +147,15 @@ export interface ILoanOfferingsBusinessApi {
|
|
|
145
147
|
segmentId?: string,
|
|
146
148
|
): Promise<StandardResponse<PromotedSkusResponse>>;
|
|
147
149
|
|
|
150
|
+
/**
|
|
151
|
+
* `POST /private/promotions/promoted-skus` — versión en lote de {@link listPromotedSkus}: cada SKU
|
|
152
|
+
* viaja con su tipo y gama, así entran las promos acotadas por tipo o gama. Hasta 100 SKUs.
|
|
153
|
+
*/
|
|
154
|
+
listPromotedSkusBatch(
|
|
155
|
+
input: ListPromotedSkusRequest,
|
|
156
|
+
tenantId: string,
|
|
157
|
+
): Promise<StandardResponse<PromotedSkusResponse>>;
|
|
158
|
+
|
|
148
159
|
/**
|
|
149
160
|
* POST /private/segments/resolve — los segmentos a los que pertenece el cliente HOY, evaluados
|
|
150
161
|
* en línea contra los hechos que manda el caller. No hay segmento persistido en el cliente.
|
|
@@ -202,6 +213,15 @@ export interface ILoanOfferingsBusinessApi {
|
|
|
202
213
|
segmentId?: string,
|
|
203
214
|
): Promise<StandardResponse<SkuPromotionsResponse>>;
|
|
204
215
|
|
|
216
|
+
/**
|
|
217
|
+
* `POST /private/promotions/by-sku` — versión en lote de {@link listSkuPromotions}: cada SKU
|
|
218
|
+
* viaja con su tipo y gama, así entran las promos acotadas por tipo o gama. Hasta 100 SKUs.
|
|
219
|
+
*/
|
|
220
|
+
listSkuPromotionsBatch(
|
|
221
|
+
input: ListSkuPromotionsRequest,
|
|
222
|
+
tenantId: string,
|
|
223
|
+
): Promise<StandardResponse<SkuPromotionsResponse>>;
|
|
224
|
+
|
|
205
225
|
/**
|
|
206
226
|
* `GET /private/promotions/scope-wide` — promociones que NO acotan por SKU (tienda, nivel,
|
|
207
227
|
* segmento o universales), para el banner de pantalla completa del paso 03 del wizard.
|