@fiado/api-invoker 5.52.0 → 5.53.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.
@@ -1,6 +1,6 @@
1
1
  import type { IHttpRequest } from "@fiado/http-client";
2
2
  import { StandardResponse } from "@fiado/gateway-adapter";
3
- import { ConsumePromotionRequest, ConsumePromotionResponse, CreditPlanResponse, FinancierResponse, SimulateCreditPlanRequest, SimulationResultResponse } from "@fiado/type-kit/bin/loanOfferings/index.js";
3
+ import { ConsumePromotionRequest, PromotedSkusResponse, ConsumePromotionResponse, CreditPlanResponse, FinancierResponse, 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 5
@@ -23,4 +23,5 @@ 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
27
  }
@@ -50,6 +50,10 @@ 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)}`;
55
+ return await this.httpRequest.get(url);
56
+ }
53
57
  };
54
58
  LoanOfferingsBusinessApi = __decorate([
55
59
  injectable(),
@@ -1,5 +1,5 @@
1
1
  import { StandardResponse } from "@fiado/gateway-adapter";
2
- import { ConsumePromotionRequest, ConsumePromotionResponse, CreditPlanResponse, FinancierResponse, SimulateCreditPlanRequest, SimulationResultResponse } from "@fiado/type-kit/bin/loanOfferings/index.js";
2
+ import { ConsumePromotionRequest, PromotedSkusResponse, ConsumePromotionResponse, CreditPlanResponse, FinancierResponse, 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 5 endpoints privados service-to-service (VPC-only): 4 de LECTURA del catálogo SOFOM y
@@ -74,4 +74,13 @@ export interface ILoanOfferingsBusinessApi {
74
74
  * @throws si la promoción no existe (`404 PROMOTION_NOT_FOUND`).
75
75
  */
76
76
  consumePromotion(promotionId: string, input: ConsumePromotionRequest, tenantId: string): Promise<StandardResponse<ConsumePromotionResponse>>;
77
+ /**
78
+ * GET /private/promotions/promoted-skus — los SKUs con promoción viva en una tienda, para el
79
+ * badge del catálogo del wizard. Devuelve `{ skus: [] }` si no hay ninguna; nunca 404.
80
+ *
81
+ * El filtrado vive en el lambda, no acá: solo entran las promociones que alcanzan a CUALQUIER
82
+ * nivel (el catálogo se pinta antes del score) y las que ACOTAN por SKU (una general marcaría
83
+ * el catálogo entero). El caller no puede aflojar ese criterio.
84
+ */
85
+ listPromotedSkus(storeId: string, tenantId: string): Promise<StandardResponse<PromotedSkusResponse>>;
77
86
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "5.52.0",
3
+ "version": "5.53.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.375.0",
37
+ "@fiado/type-kit": "^3.381.0",
38
38
  "dotenv": "^16.4.7"
39
39
  },
40
40
  "peerDependencies": {
@@ -3,6 +3,7 @@ import type { IHttpRequest } from "@fiado/http-client";
3
3
  import { StandardResponse } from "@fiado/gateway-adapter";
4
4
  import {
5
5
  ConsumePromotionRequest,
6
+ PromotedSkusResponse,
6
7
  ConsumePromotionResponse,
7
8
  CreditPlanResponse,
8
9
  FinancierResponse,
@@ -70,4 +71,12 @@ export default class LoanOfferingsBusinessApi implements ILoanOfferingsBusinessA
70
71
  const url = `${this.baseUrl}/private/promotions/${encodeURIComponent(promotionId)}/consume?tenantId=${encodeURIComponent(tenantId)}`;
71
72
  return await this.httpRequest.post(url, input);
72
73
  }
74
+
75
+ async listPromotedSkus(
76
+ storeId: string,
77
+ tenantId: string,
78
+ ): Promise<StandardResponse<PromotedSkusResponse>> {
79
+ const url = `${this.baseUrl}/private/promotions/promoted-skus?storeId=${encodeURIComponent(storeId)}&tenantId=${encodeURIComponent(tenantId)}`;
80
+ return await this.httpRequest.get(url);
81
+ }
73
82
  }
@@ -1,6 +1,7 @@
1
1
  import { StandardResponse } from "@fiado/gateway-adapter";
2
2
  import {
3
3
  ConsumePromotionRequest,
4
+ PromotedSkusResponse,
4
5
  ConsumePromotionResponse,
5
6
  CreditPlanResponse,
6
7
  FinancierResponse,
@@ -102,4 +103,17 @@ export interface ILoanOfferingsBusinessApi {
102
103
  input: ConsumePromotionRequest,
103
104
  tenantId: string,
104
105
  ): Promise<StandardResponse<ConsumePromotionResponse>>;
106
+
107
+ /**
108
+ * GET /private/promotions/promoted-skus — los SKUs con promoción viva en una tienda, para el
109
+ * badge del catálogo del wizard. Devuelve `{ skus: [] }` si no hay ninguna; nunca 404.
110
+ *
111
+ * El filtrado vive en el lambda, no acá: solo entran las promociones que alcanzan a CUALQUIER
112
+ * nivel (el catálogo se pinta antes del score) y las que ACOTAN por SKU (una general marcaría
113
+ * el catálogo entero). El caller no puede aflojar ese criterio.
114
+ */
115
+ listPromotedSkus(
116
+ storeId: string,
117
+ tenantId: string,
118
+ ): Promise<StandardResponse<PromotedSkusResponse>>;
105
119
  }