@fiado/api-invoker 5.59.0 → 5.60.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.
@@ -27,6 +27,6 @@ export default class LoanOfferingsBusinessApi implements ILoanOfferingsBusinessA
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
  }
@@ -66,8 +66,12 @@ let LoanOfferingsBusinessApi = class LoanOfferingsBusinessApi {
66
66
  const url = `${this.baseUrl}/private/promotions/${encodeURIComponent(promotionId)}/bonus-payment/result?tenantId=${encodeURIComponent(tenantId)}`;
67
67
  return await this.httpRequest.put(url, input);
68
68
  }
69
- async listSkuPromotions(storeId, tenantId) {
70
- const url = `${this.baseUrl}/private/promotions/by-sku?storeId=${encodeURIComponent(storeId)}&tenantId=${encodeURIComponent(tenantId)}`;
69
+ async listSkuPromotions(storeId, tenantId, level, segmentId) {
70
+ let url = `${this.baseUrl}/private/promotions/by-sku?storeId=${encodeURIComponent(storeId)}&tenantId=${encodeURIComponent(tenantId)}`;
71
+ if (level)
72
+ url += `&level=${encodeURIComponent(level)}`;
73
+ if (segmentId)
74
+ url += `&segmentId=${encodeURIComponent(segmentId)}`;
71
75
  return await this.httpRequest.get(url);
72
76
  }
73
77
  async listScopeWidePromotions(storeId, tenantId, level, segmentId) {
@@ -115,8 +115,11 @@ export interface ILoanOfferingsBusinessApi {
115
115
  /**
116
116
  * `GET /private/promotions/by-sku` — promociones vivas por SKU con su efecto y sus niveles.
117
117
  * Es el detalle del panel del paso 03; el badge lo resuelve {@link listPromotedSkus}.
118
+ *
119
+ * `level`/`segmentId` son opcionales, mismo criterio que `listScopeWidePromotions`: si no
120
+ * vienen, el lambda destino descarta las promociones que acotan por esa dimensión.
118
121
  */
119
- listSkuPromotions(storeId: string, tenantId: string): Promise<StandardResponse<SkuPromotionsResponse>>;
122
+ listSkuPromotions(storeId: string, tenantId: string, level?: CreditPlanLevelEnum, segmentId?: string): Promise<StandardResponse<SkuPromotionsResponse>>;
120
123
  /**
121
124
  * `GET /private/promotions/scope-wide` — promociones que NO acotan por SKU (tienda, nivel,
122
125
  * 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.60.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",
@@ -118,8 +118,12 @@ export default class LoanOfferingsBusinessApi implements ILoanOfferingsBusinessA
118
118
  async listSkuPromotions(
119
119
  storeId: string,
120
120
  tenantId: string,
121
+ level?: CreditPlanLevelEnum,
122
+ segmentId?: string,
121
123
  ): Promise<StandardResponse<SkuPromotionsResponse>> {
122
- const url = `${this.baseUrl}/private/promotions/by-sku?storeId=${encodeURIComponent(storeId)}&tenantId=${encodeURIComponent(tenantId)}`;
124
+ let url = `${this.baseUrl}/private/promotions/by-sku?storeId=${encodeURIComponent(storeId)}&tenantId=${encodeURIComponent(tenantId)}`;
125
+ if (level) url += `&level=${encodeURIComponent(level)}`;
126
+ if (segmentId) url += `&segmentId=${encodeURIComponent(segmentId)}`;
123
127
  return await this.httpRequest.get(url);
124
128
  }
125
129
 
@@ -172,10 +172,15 @@ export interface ILoanOfferingsBusinessApi {
172
172
  /**
173
173
  * `GET /private/promotions/by-sku` — promociones vivas por SKU con su efecto y sus niveles.
174
174
  * Es el detalle del panel del paso 03; el badge lo resuelve {@link listPromotedSkus}.
175
+ *
176
+ * `level`/`segmentId` son opcionales, mismo criterio que `listScopeWidePromotions`: si no
177
+ * vienen, el lambda destino descarta las promociones que acotan por esa dimensión.
175
178
  */
176
179
  listSkuPromotions(
177
180
  storeId: string,
178
181
  tenantId: string,
182
+ level?: CreditPlanLevelEnum,
183
+ segmentId?: string,
179
184
  ): Promise<StandardResponse<SkuPromotionsResponse>>;
180
185
 
181
186
  /**