@fiado/api-invoker 5.102.0 → 5.103.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/retailCards/api/RetailCardsBusinessApi.d.ts +2 -1
- package/bin/retailCards/api/RetailCardsBusinessApi.js +4 -0
- package/bin/retailCards/api/interfaces/IRetailCardsBusinessApi.d.ts +3 -1
- package/package.json +2 -2
- package/src/retailCards/api/RetailCardsBusinessApi.ts +6 -0
- package/src/retailCards/api/interfaces/IRetailCardsBusinessApi.ts +4 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IHttpRequest } from "@fiado/http-client";
|
|
2
2
|
import { StandardResponse } from "@fiado/gateway-adapter";
|
|
3
|
-
import { CardDeliveryResponse, RegisterCardDeliveryRequest, ReverseCardMovementRequest } from "@fiado/type-kit/bin/retailCards/index.js";
|
|
3
|
+
import { CardBalanceResponse, CardDeliveryResponse, RegisterCardDeliveryRequest, ReverseCardMovementRequest } from "@fiado/type-kit/bin/retailCards/index.js";
|
|
4
4
|
import { IRetailCardsBusinessApi } from "./interfaces/IRetailCardsBusinessApi.js";
|
|
5
5
|
/**
|
|
6
6
|
* Publisher HTTP del lambda `retail-cards-business` (SureKeep Fase 1, pista Retail) para sus endpoints
|
|
@@ -20,4 +20,5 @@ export default class RetailCardsBusinessApi implements IRetailCardsBusinessApi {
|
|
|
20
20
|
constructor(httpRequest: IHttpRequest);
|
|
21
21
|
registerDelivery(storeId: string, body: RegisterCardDeliveryRequest, tenantId: string): Promise<StandardResponse<CardDeliveryResponse>>;
|
|
22
22
|
reverseDelivery(storeId: string, body: ReverseCardMovementRequest, tenantId: string): Promise<StandardResponse<void>>;
|
|
23
|
+
getBalance(storeId: string, tenantId: string): Promise<StandardResponse<CardBalanceResponse>>;
|
|
23
24
|
}
|
|
@@ -38,6 +38,10 @@ let RetailCardsBusinessApi = class RetailCardsBusinessApi {
|
|
|
38
38
|
const url = `${this.baseUrl}/private/stores/${encodeURIComponent(storeId)}/card-movements/reverse?tenantId=${encodeURIComponent(tenantId)}`;
|
|
39
39
|
return await this.httpRequest.post(url, body);
|
|
40
40
|
}
|
|
41
|
+
async getBalance(storeId, tenantId) {
|
|
42
|
+
const url = `${this.baseUrl}/private/stores/${encodeURIComponent(storeId)}/card-balance?tenantId=${encodeURIComponent(tenantId)}`;
|
|
43
|
+
return await this.httpRequest.get(url);
|
|
44
|
+
}
|
|
41
45
|
};
|
|
42
46
|
RetailCardsBusinessApi = __decorate([
|
|
43
47
|
injectable(),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StandardResponse } from "@fiado/gateway-adapter";
|
|
2
|
-
import { CardDeliveryResponse, RegisterCardDeliveryRequest, ReverseCardMovementRequest } from "@fiado/type-kit/bin/retailCards/index.js";
|
|
2
|
+
import { CardBalanceResponse, CardDeliveryResponse, RegisterCardDeliveryRequest, ReverseCardMovementRequest } from "@fiado/type-kit/bin/retailCards/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* Contrato del publisher HTTP del lambda `retail-cards-business` (SureKeep Fase 1, pista Retail) para
|
|
5
5
|
* sus endpoints privados del inventario de tarjetas físicas PCF, consumidos por el wizard F2 (paso 09).
|
|
@@ -34,4 +34,6 @@ export interface IRetailCardsBusinessApi {
|
|
|
34
34
|
* cancela (DEC-007 destino). Escribe un contraasiento, no borra el original.
|
|
35
35
|
*/
|
|
36
36
|
reverseDelivery(storeId: string, body: ReverseCardMovementRequest, tenantId: string): Promise<StandardResponse<void>>;
|
|
37
|
+
/** GET `/private/stores/{storeId}/card-balance` — tarjetas disponibles en la tienda; sin saldo, `available: 0`. */
|
|
38
|
+
getBalance(storeId: string, tenantId: string): Promise<StandardResponse<CardBalanceResponse>>;
|
|
37
39
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.103.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.486.0",
|
|
38
38
|
"dotenv": "^16.4.7"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -2,6 +2,7 @@ import { inject, injectable } from "inversify";
|
|
|
2
2
|
import type { IHttpRequest } from "@fiado/http-client";
|
|
3
3
|
import { StandardResponse } from "@fiado/gateway-adapter";
|
|
4
4
|
import {
|
|
5
|
+
CardBalanceResponse,
|
|
5
6
|
CardDeliveryResponse,
|
|
6
7
|
RegisterCardDeliveryRequest,
|
|
7
8
|
ReverseCardMovementRequest,
|
|
@@ -44,4 +45,9 @@ export default class RetailCardsBusinessApi implements IRetailCardsBusinessApi {
|
|
|
44
45
|
const url = `${this.baseUrl}/private/stores/${encodeURIComponent(storeId)}/card-movements/reverse?tenantId=${encodeURIComponent(tenantId)}`;
|
|
45
46
|
return await this.httpRequest.post(url, body);
|
|
46
47
|
}
|
|
48
|
+
|
|
49
|
+
async getBalance(storeId: string, tenantId: string): Promise<StandardResponse<CardBalanceResponse>> {
|
|
50
|
+
const url = `${this.baseUrl}/private/stores/${encodeURIComponent(storeId)}/card-balance?tenantId=${encodeURIComponent(tenantId)}`;
|
|
51
|
+
return await this.httpRequest.get(url);
|
|
52
|
+
}
|
|
47
53
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { StandardResponse } from "@fiado/gateway-adapter";
|
|
2
2
|
import {
|
|
3
|
+
CardBalanceResponse,
|
|
3
4
|
CardDeliveryResponse,
|
|
4
5
|
RegisterCardDeliveryRequest,
|
|
5
6
|
ReverseCardMovementRequest,
|
|
@@ -48,4 +49,7 @@ export interface IRetailCardsBusinessApi {
|
|
|
48
49
|
body: ReverseCardMovementRequest,
|
|
49
50
|
tenantId: string,
|
|
50
51
|
): Promise<StandardResponse<void>>;
|
|
52
|
+
|
|
53
|
+
/** GET `/private/stores/{storeId}/card-balance` — tarjetas disponibles en la tienda; sin saldo, `available: 0`. */
|
|
54
|
+
getBalance(storeId: string, tenantId: string): Promise<StandardResponse<CardBalanceResponse>>;
|
|
51
55
|
}
|