@fiado/api-invoker 5.59.0 → 5.61.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.
@@ -23,10 +23,10 @@ export default class LoanOfferingsBusinessApi implements ILoanOfferingsBusinessA
23
23
  listActiveFinanciers(tenantId: string): Promise<StandardResponse<FinancierResponse[]>>;
24
24
  simulate(planId: string, input: SimulateCreditPlanRequest, tenantId: string): Promise<StandardResponse<SimulationResultResponse>>;
25
25
  consumePromotion(promotionId: string, input: ConsumePromotionRequest, tenantId: string): Promise<StandardResponse<ConsumePromotionResponse>>;
26
- listPromotedSkus(storeId: string, tenantId: string): Promise<StandardResponse<PromotedSkusResponse>>;
26
+ listPromotedSkus(storeId: string, tenantId: string, level?: CreditPlanLevelEnum, segmentId?: string): Promise<StandardResponse<PromotedSkusResponse>>;
27
27
  resolveCustomerSegments(input: ResolveCustomerSegmentsRequest, tenantId: string): Promise<StandardResponse<ResolveCustomerSegmentsResponse>>;
28
28
  reservePromotionBonus(promotionId: string, input: ReservePromotionBonusRequest, tenantId: string): Promise<StandardResponse<ReservePromotionBonusResponse>>;
29
29
  settlePromotionBonus(promotionId: string, input: SettlePromotionBonusRequest, tenantId: string): Promise<StandardResponse<PromotionBonusResponse>>;
30
- listSkuPromotions(storeId: string, tenantId: string): Promise<StandardResponse<SkuPromotionsResponse>>;
30
+ listSkuPromotions(storeId: string, tenantId: string, level?: CreditPlanLevelEnum, segmentId?: string): Promise<StandardResponse<SkuPromotionsResponse>>;
31
31
  listScopeWidePromotions(storeId: string, tenantId: string, level?: CreditPlanLevelEnum, segmentId?: string): Promise<StandardResponse<ScopeWidePromotionsResponse>>;
32
32
  }
@@ -50,8 +50,12 @@ let LoanOfferingsBusinessApi = class LoanOfferingsBusinessApi {
50
50
  const url = `${this.baseUrl}/private/promotions/${encodeURIComponent(promotionId)}/consume?tenantId=${encodeURIComponent(tenantId)}`;
51
51
  return await this.httpRequest.post(url, input);
52
52
  }
53
- async listPromotedSkus(storeId, tenantId) {
54
- const url = `${this.baseUrl}/private/promotions/promoted-skus?storeId=${encodeURIComponent(storeId)}&tenantId=${encodeURIComponent(tenantId)}`;
53
+ async listPromotedSkus(storeId, tenantId, level, segmentId) {
54
+ let url = `${this.baseUrl}/private/promotions/promoted-skus?storeId=${encodeURIComponent(storeId)}&tenantId=${encodeURIComponent(tenantId)}`;
55
+ if (level)
56
+ url += `&level=${encodeURIComponent(level)}`;
57
+ if (segmentId)
58
+ url += `&segmentId=${encodeURIComponent(segmentId)}`;
55
59
  return await this.httpRequest.get(url);
56
60
  }
57
61
  async resolveCustomerSegments(input, tenantId) {
@@ -66,8 +70,12 @@ let LoanOfferingsBusinessApi = class LoanOfferingsBusinessApi {
66
70
  const url = `${this.baseUrl}/private/promotions/${encodeURIComponent(promotionId)}/bonus-payment/result?tenantId=${encodeURIComponent(tenantId)}`;
67
71
  return await this.httpRequest.put(url, input);
68
72
  }
69
- async listSkuPromotions(storeId, tenantId) {
70
- const url = `${this.baseUrl}/private/promotions/by-sku?storeId=${encodeURIComponent(storeId)}&tenantId=${encodeURIComponent(tenantId)}`;
73
+ async listSkuPromotions(storeId, tenantId, level, segmentId) {
74
+ let url = `${this.baseUrl}/private/promotions/by-sku?storeId=${encodeURIComponent(storeId)}&tenantId=${encodeURIComponent(tenantId)}`;
75
+ if (level)
76
+ url += `&level=${encodeURIComponent(level)}`;
77
+ if (segmentId)
78
+ url += `&segmentId=${encodeURIComponent(segmentId)}`;
71
79
  return await this.httpRequest.get(url);
72
80
  }
73
81
  async listScopeWidePromotions(storeId, tenantId, level, segmentId) {
@@ -81,8 +81,11 @@ export interface ILoanOfferingsBusinessApi {
81
81
  * El filtrado vive en el lambda, no acá: solo entran las promociones que alcanzan a CUALQUIER
82
82
  * nivel (el catálogo se pinta antes del score) y las que ACOTAN por SKU (una general marcaría
83
83
  * el catálogo entero). El caller no puede aflojar ese criterio.
84
+ *
85
+ * `level`/`segmentId` son opcionales, mismo criterio que {@link listSkuPromotions}: si no
86
+ * vienen, el lambda destino descarta las promociones que acotan por esa dimensión.
84
87
  */
85
- listPromotedSkus(storeId: string, tenantId: string): Promise<StandardResponse<PromotedSkusResponse>>;
88
+ listPromotedSkus(storeId: string, tenantId: string, level?: CreditPlanLevelEnum, segmentId?: string): Promise<StandardResponse<PromotedSkusResponse>>;
86
89
  /**
87
90
  * POST /private/segments/resolve — los segmentos a los que pertenece el cliente HOY, evaluados
88
91
  * en línea contra los hechos que manda el caller. No hay segmento persistido en el cliente.
@@ -115,8 +118,11 @@ export interface ILoanOfferingsBusinessApi {
115
118
  /**
116
119
  * `GET /private/promotions/by-sku` — promociones vivas por SKU con su efecto y sus niveles.
117
120
  * Es el detalle del panel del paso 03; el badge lo resuelve {@link listPromotedSkus}.
121
+ *
122
+ * `level`/`segmentId` son opcionales, mismo criterio que `listScopeWidePromotions`: si no
123
+ * vienen, el lambda destino descarta las promociones que acotan por esa dimensión.
118
124
  */
119
- listSkuPromotions(storeId: string, tenantId: string): Promise<StandardResponse<SkuPromotionsResponse>>;
125
+ listSkuPromotions(storeId: string, tenantId: string, level?: CreditPlanLevelEnum, segmentId?: string): Promise<StandardResponse<SkuPromotionsResponse>>;
120
126
  /**
121
127
  * `GET /private/promotions/scope-wide` — promociones que NO acotan por SKU (tienda, nivel,
122
128
  * 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.59.0",
3
+ "version": "5.61.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",
@@ -84,8 +84,12 @@ export default class LoanOfferingsBusinessApi implements ILoanOfferingsBusinessA
84
84
  async listPromotedSkus(
85
85
  storeId: string,
86
86
  tenantId: string,
87
+ level?: CreditPlanLevelEnum,
88
+ segmentId?: string,
87
89
  ): Promise<StandardResponse<PromotedSkusResponse>> {
88
- const url = `${this.baseUrl}/private/promotions/promoted-skus?storeId=${encodeURIComponent(storeId)}&tenantId=${encodeURIComponent(tenantId)}`;
90
+ let url = `${this.baseUrl}/private/promotions/promoted-skus?storeId=${encodeURIComponent(storeId)}&tenantId=${encodeURIComponent(tenantId)}`;
91
+ if (level) url += `&level=${encodeURIComponent(level)}`;
92
+ if (segmentId) url += `&segmentId=${encodeURIComponent(segmentId)}`;
89
93
  return await this.httpRequest.get(url);
90
94
  }
91
95
 
@@ -118,8 +122,12 @@ export default class LoanOfferingsBusinessApi implements ILoanOfferingsBusinessA
118
122
  async listSkuPromotions(
119
123
  storeId: string,
120
124
  tenantId: string,
125
+ level?: CreditPlanLevelEnum,
126
+ segmentId?: string,
121
127
  ): Promise<StandardResponse<SkuPromotionsResponse>> {
122
- const url = `${this.baseUrl}/private/promotions/by-sku?storeId=${encodeURIComponent(storeId)}&tenantId=${encodeURIComponent(tenantId)}`;
128
+ let url = `${this.baseUrl}/private/promotions/by-sku?storeId=${encodeURIComponent(storeId)}&tenantId=${encodeURIComponent(tenantId)}`;
129
+ if (level) url += `&level=${encodeURIComponent(level)}`;
130
+ if (segmentId) url += `&segmentId=${encodeURIComponent(segmentId)}`;
123
131
  return await this.httpRequest.get(url);
124
132
  }
125
133
 
@@ -120,10 +120,15 @@ export interface ILoanOfferingsBusinessApi {
120
120
  * El filtrado vive en el lambda, no acá: solo entran las promociones que alcanzan a CUALQUIER
121
121
  * nivel (el catálogo se pinta antes del score) y las que ACOTAN por SKU (una general marcaría
122
122
  * el catálogo entero). El caller no puede aflojar ese criterio.
123
+ *
124
+ * `level`/`segmentId` son opcionales, mismo criterio que {@link listSkuPromotions}: si no
125
+ * vienen, el lambda destino descarta las promociones que acotan por esa dimensión.
123
126
  */
124
127
  listPromotedSkus(
125
128
  storeId: string,
126
129
  tenantId: string,
130
+ level?: CreditPlanLevelEnum,
131
+ segmentId?: string,
127
132
  ): Promise<StandardResponse<PromotedSkusResponse>>;
128
133
 
129
134
  /**
@@ -172,10 +177,15 @@ export interface ILoanOfferingsBusinessApi {
172
177
  /**
173
178
  * `GET /private/promotions/by-sku` — promociones vivas por SKU con su efecto y sus niveles.
174
179
  * Es el detalle del panel del paso 03; el badge lo resuelve {@link listPromotedSkus}.
180
+ *
181
+ * `level`/`segmentId` son opcionales, mismo criterio que `listScopeWidePromotions`: si no
182
+ * vienen, el lambda destino descarta las promociones que acotan por esa dimensión.
175
183
  */
176
184
  listSkuPromotions(
177
185
  storeId: string,
178
186
  tenantId: string,
187
+ level?: CreditPlanLevelEnum,
188
+ segmentId?: string,
179
189
  ): Promise<StandardResponse<SkuPromotionsResponse>>;
180
190
 
181
191
  /**