@fiado/api-invoker 1.1.55 → 1.1.57

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.
Files changed (31) hide show
  1. package/bin/account-pagoconfiado/AccountPagoConfiadoApi.d.ts +1 -0
  2. package/bin/account-pagoconfiado/AccountPagoConfiadoApi.js +4 -0
  3. package/bin/account-pagoconfiado/interfaces/IAccountPagoConfiadoApi.d.ts +1 -0
  4. package/bin/activity/ActivityApi.d.ts +17 -0
  5. package/bin/activity/ActivityApi.js +72 -0
  6. package/bin/activity/index.d.ts +2 -0
  7. package/bin/activity/index.js +18 -0
  8. package/bin/activity/interfaces/IActivityApi.d.ts +39 -0
  9. package/bin/activity/interfaces/IActivityApi.js +2 -0
  10. package/bin/cnbv-business/CnbvApi.d.ts +8 -0
  11. package/bin/cnbv-business/CnbvApi.js +31 -0
  12. package/bin/cnbv-business/index.d.ts +2 -0
  13. package/bin/cnbv-business/index.js +18 -0
  14. package/bin/cnbv-business/interfaces/ICnbvApi.d.ts +3 -0
  15. package/bin/cnbv-business/interfaces/ICnbvApi.js +2 -0
  16. package/bin/container.config.js +2 -0
  17. package/bin/index.d.ts +1 -0
  18. package/bin/index.js +1 -0
  19. package/bin/stpAccount/api/STPAccountApi.d.ts +4 -0
  20. package/bin/stpAccount/api/STPAccountApi.js +4 -0
  21. package/bin/stpAccount/api/interfaces/ISTPAccountApi.d.ts +4 -0
  22. package/package.json +2 -2
  23. package/src/account-pagoconfiado/AccountPagoConfiadoApi.ts +5 -1
  24. package/src/account-pagoconfiado/interfaces/IAccountPagoConfiadoApi.ts +2 -0
  25. package/src/cnbv-business/CnbvApi.ts +22 -0
  26. package/src/cnbv-business/index.ts +4 -0
  27. package/src/cnbv-business/interfaces/ICnbvApi.ts +7 -0
  28. package/src/container.config.ts +3 -0
  29. package/src/index.ts +2 -1
  30. package/src/stpAccount/api/STPAccountApi.ts +5 -0
  31. package/src/stpAccount/api/interfaces/ISTPAccountApi.ts +1 -0
@@ -6,6 +6,7 @@ export default class AccountPagoConfiadoApi implements IAccountPagoConfiadoApi {
6
6
  private httpRequest;
7
7
  private readonly baseUrl;
8
8
  constructor(httpRequest: IHttpRequest);
9
+ cancelAccount(accountNumber: string, documentNumber: string): Promise<ApiGatewayResponse<void>>;
9
10
  createAccount(data: AccountCreateRequest): Promise<ApiGatewayResponse<AccountCreateResponse>>;
10
11
  getAccountByDirectoryId(directoryId: string): Promise<ApiGatewayResponse<GetAccountResponse[]>>;
11
12
  updateAccountBalance(accountId: string, params: AccountUpdateBalanceRequest): Promise<ApiGatewayResponse<Boolean>>;
@@ -18,6 +18,10 @@ let AccountPagoConfiadoApi = class AccountPagoConfiadoApi {
18
18
  this.httpRequest = httpRequest;
19
19
  this.baseUrl = process.env.ACCOUNT_PAGOCONFIADO_LAMBDA_URL || "";
20
20
  }
21
+ async cancelAccount(accountNumber, documentNumber) {
22
+ const url = `${this.baseUrl}/cancel`;
23
+ return await this.httpRequest.post(url, { accountNumber, documentNumber });
24
+ }
21
25
  async createAccount(data) {
22
26
  const url = `${this.baseUrl}`;
23
27
  return await this.httpRequest.post(url, data);
@@ -7,4 +7,5 @@ export interface IAccountPagoConfiadoApi {
7
7
  update(directoryId: string, data: AccountUpdateRequest): Promise<ApiGatewayResponse<void>>;
8
8
  updateByAccountNumber(accountNumber: string, data: AccountUpdateRequest): Promise<ApiGatewayResponse<void>>;
9
9
  getAccountByAccountNumber(accountNumber: string): Promise<ApiGatewayResponse<void>>;
10
+ cancelAccount(accountNumber: string, documentNumber: string): Promise<ApiGatewayResponse<void>>;
10
11
  }
@@ -0,0 +1,17 @@
1
+ import { IHttpRequest } from "@fiado/http-client";
2
+ import { IActivityApi } from './interfaces/IActivityApi';
3
+ import { TypeOfDirectoryId } from '@fiado/type-kit/bin/directory';
4
+ export declare class ActivityApi implements IActivityApi {
5
+ private httpRequest;
6
+ private readonly baseUrl;
7
+ constructor(httpRequest: IHttpRequest);
8
+ getActivities(typeOfActivities: string[]): Promise<any>;
9
+ getActivitiesByDirectoryIdAndTypeOfActivity(directoryId: string, typeOfActivities: string[]): Promise<any>;
10
+ postActivity(params: {
11
+ directoryId: string;
12
+ typeOfDirectoryId: TypeOfDirectoryId;
13
+ typeOfActivity: string;
14
+ amount: string;
15
+ date: string;
16
+ }): Promise<any>;
17
+ }
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var __importDefault = (this && this.__importDefault) || function (mod) {
15
+ return (mod && mod.__esModule) ? mod : { "default": mod };
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.ActivityApi = void 0;
19
+ const dotenv_1 = __importDefault(require("dotenv"));
20
+ const inversify_1 = require("inversify");
21
+ dotenv_1.default.config();
22
+ let ActivityApi = class ActivityApi {
23
+ constructor(httpRequest) {
24
+ this.httpRequest = httpRequest;
25
+ this.baseUrl = process.env.ACTIVITY_LAMBDA_URL || "";
26
+ }
27
+ async getActivities(typeOfActivities) {
28
+ let url = `${this.baseUrl}activities`;
29
+ if (typeOfActivities.length > 0) {
30
+ url = `${this.baseUrl}activities?${typeOfActivities.map(id => `typeOfActivities=${encodeURIComponent(id)}`).join('&')}`;
31
+ }
32
+ const operationName = "getActivities";
33
+ return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
34
+ }
35
+ async getActivitiesByDirectoryIdAndTypeOfActivity(directoryId, typeOfActivities) {
36
+ if (directoryId == null || directoryId == undefined || directoryId == "") {
37
+ throw new Error("At least directory ID is required.");
38
+ }
39
+ let url = `${this.baseUrl}activities/directory/${directoryId}`;
40
+ if (typeOfActivities.length > 0) {
41
+ url = `${this.baseUrl}activities/directory/${directoryId}?${typeOfActivities.map(id => `typeOfActivities=${encodeURIComponent(id)}`).join('&')}`;
42
+ }
43
+ const operationName = "getActivitiesByDirectoryIdAndTypeOfActivity";
44
+ return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
45
+ }
46
+ async postActivity(params) {
47
+ if (params.directoryId == null || params.directoryId == undefined || params.directoryId == "") {
48
+ throw new Error("At least directory ID is required.");
49
+ }
50
+ if (params.typeOfDirectoryId == null || params.typeOfDirectoryId == undefined) {
51
+ throw new Error("At least typeOfDirectoryId is required.");
52
+ }
53
+ if (params.typeOfActivity == null || params.typeOfActivity == undefined || params.typeOfActivity == "") {
54
+ throw new Error("At least typeOfActivity is required.");
55
+ }
56
+ if (params.amount == null || params.amount == undefined || params.amount == "") {
57
+ throw new Error("At least amount is required.");
58
+ }
59
+ if (params.date == null || params.date == undefined || params.date == "") {
60
+ throw new Error("At least date is required.");
61
+ }
62
+ const url = `${this.baseUrl}/activities/create`;
63
+ const operationName = "postActivity";
64
+ return await this.httpRequest.post(`${url}`, params, { 'operationName': operationName });
65
+ }
66
+ };
67
+ exports.ActivityApi = ActivityApi;
68
+ exports.ActivityApi = ActivityApi = __decorate([
69
+ (0, inversify_1.injectable)(),
70
+ __param(0, (0, inversify_1.inject)("IHttpRequest")),
71
+ __metadata("design:paramtypes", [Object])
72
+ ], ActivityApi);
@@ -0,0 +1,2 @@
1
+ export * from './interfaces/IActivityApi';
2
+ export * from './ActivityApi';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./interfaces/IActivityApi"), exports);
18
+ __exportStar(require("./ActivityApi"), exports);
@@ -0,0 +1,39 @@
1
+ import { TypeOfDirectoryId } from "@fiado/type-kit/bin/directory";
2
+ /**
3
+ * Interfaz para el servicio Directory que permite operaciones sobre directorios.
4
+ */
5
+ export interface IActivityApi {
6
+ /**
7
+ * Obtiene una lista de entidades de la tabla ActivityDirectory.
8
+ * @param directoryId Directorio que se va a consultar.
9
+ * @param typeOfActivities Array de tipos de actividades (Opcional).
10
+ * @returns Retorna un arreglo de objetos de ActivityDirectory.
11
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
12
+ */
13
+ getActivitiesByDirectoryIdAndTypeOfActivity(directoryId: string, typeOfActivities: string[]): Promise<any>;
14
+ /**
15
+ * Obtener actividades globales.
16
+ * @param typeOfActivity Tipo de actividad
17
+ * Puede devolver un arreglo vacío si no se encuentran coincidencias.
18
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
19
+ */
20
+ getActivities(typeOfActivities: string[]): Promise<any>;
21
+ /**
22
+ * Proceso para agregar a las actividades.
23
+ * @param directoryId Directorio
24
+ * @param typeOfDirectoryId Tipo de directorio
25
+ * @param typeOfActivity Tipo de actividad
26
+ * @param amount Monto de la actividad
27
+ * @param date Fecha de la actividad
28
+ * @returns Retorna un objeto de ActivityDirectory.
29
+ * Puede devolver un arreglo vacío si no se encuentran coincidencias.
30
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
31
+ */
32
+ postActivity(params: {
33
+ directoryId: string;
34
+ typeOfDirectoryId: TypeOfDirectoryId;
35
+ typeOfActivity: string;
36
+ amount: string;
37
+ date: string;
38
+ }): Promise<any>;
39
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ import { IHttpRequest } from "@fiado/http-client";
2
+ import { ICnbvApi } from "./interfaces/ICnbvApi";
3
+ export default class CnbvApi implements ICnbvApi {
4
+ private httpRequest;
5
+ private readonly baseUrl;
6
+ constructor(httpRequest: IHttpRequest);
7
+ validateConcidence(fullName: string, yearOfBirth: string): Promise<any>;
8
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const inversify_1 = require("inversify");
16
+ let CnbvApi = class CnbvApi {
17
+ constructor(httpRequest) {
18
+ this.httpRequest = httpRequest;
19
+ this.baseUrl = process.env.CNBV_LAMBDA_URL || "";
20
+ }
21
+ async validateConcidence(fullName, yearOfBirth) {
22
+ const url = `${this.baseUrl}?value=${yearOfBirth}&param=YEAR_OF_BIRTH&fullName=${fullName}`;
23
+ return await this.httpRequest.get(url);
24
+ }
25
+ };
26
+ CnbvApi = __decorate([
27
+ (0, inversify_1.injectable)(),
28
+ __param(0, (0, inversify_1.inject)("IHttpRequest")),
29
+ __metadata("design:paramtypes", [Object])
30
+ ], CnbvApi);
31
+ exports.default = CnbvApi;
@@ -0,0 +1,2 @@
1
+ export * from './interfaces/ICnbvApi';
2
+ export * from './CnbvApi';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./interfaces/ICnbvApi"), exports);
18
+ __exportStar(require("./CnbvApi"), exports);
@@ -0,0 +1,3 @@
1
+ export interface ICnbvApi {
2
+ validateConcidence(fullName: string, yearOfBirth: string): Promise<any>;
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -38,6 +38,7 @@ const RiskProfileApi_1 = __importDefault(require("./riskProfile/api/RiskProfileA
38
38
  const riskProfile_1 = require("./riskProfile");
39
39
  const contactInformation_1 = require("./contactInformation");
40
40
  const fiadoMessages_1 = require("./fiadoMessages");
41
+ const CnbvApi_1 = __importDefault(require("./cnbv-business/CnbvApi"));
41
42
  exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
42
43
  bind("IDirectoryApi").to(directory_1.DirectoryApi);
43
44
  bind("IIdentityApi").to(identity_1.IdentityApi);
@@ -72,4 +73,5 @@ exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
72
73
  bind("ITransactionAlarmPublisher").to(riskProfile_1.TransactionAlarmPublisher);
73
74
  bind("IContactInformationApi").to(contactInformation_1.ContactInformationApi);
74
75
  bind("IFiadoMessagesApi").to(fiadoMessages_1.FiadoMessagesApi);
76
+ bind("ICnbvApi").to(CnbvApi_1.default);
75
77
  });
package/bin/index.d.ts CHANGED
@@ -28,3 +28,4 @@ export * from "./activity-business";
28
28
  export * from "./transactionProcessor";
29
29
  export * from "./riskProfile";
30
30
  export * from "./fiadoMessages";
31
+ export * from "./cnbv-business";
package/bin/index.js CHANGED
@@ -44,3 +44,4 @@ __exportStar(require("./activity-business"), exports);
44
44
  __exportStar(require("./transactionProcessor"), exports);
45
45
  __exportStar(require("./riskProfile"), exports);
46
46
  __exportStar(require("./fiadoMessages"), exports);
47
+ __exportStar(require("./cnbv-business"), exports);
@@ -8,4 +8,8 @@ export default class STPAccountApi implements ISTPAccountApi {
8
8
  constructor(httpRequest: IHttpRequest);
9
9
  updateAccountDetails(request: CreateAccountWebhookDetail): Promise<any>;
10
10
  createAccount(request: AccountCreateRequest): Promise<any>;
11
+ cancelAccount(request: {
12
+ accountNumber: string;
13
+ documentNumber: string;
14
+ }): Promise<any>;
11
15
  }
@@ -26,6 +26,10 @@ let STPAccountApi = class STPAccountApi {
26
26
  const url = `${this.baseUrl}account/create`;
27
27
  return await this.httpRequest.post(url, request);
28
28
  }
29
+ async cancelAccount(request) {
30
+ const url = `${this.baseUrl}account/cancel`;
31
+ return await this.httpRequest.post(url, request);
32
+ }
29
33
  };
30
34
  STPAccountApi = __decorate([
31
35
  (0, inversify_1.injectable)(),
@@ -3,4 +3,8 @@ import { CreateAccountWebhookDetail } from "@fiado/type-kit/bin/stpAccount";
3
3
  export interface ISTPAccountApi {
4
4
  createAccount(request: AccountCreateRequest): Promise<any>;
5
5
  updateAccountDetails(request: CreateAccountWebhookDetail): Promise<any>;
6
+ cancelAccount(request: {
7
+ accountNumber: string;
8
+ documentNumber: string;
9
+ }): Promise<any>;
6
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "1.1.55",
3
+ "version": "1.1.57",
4
4
  "description": "Sirve como un puente entre diferentes funciones lambda, facilitando la comunicación entre ellas a traves de invocaciones http",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -16,7 +16,7 @@
16
16
  "@fiado/gateway-adapter": "^1.1.33",
17
17
  "@fiado/http-client": "^1.0.2",
18
18
  "@fiado/logger": "^1.0.2",
19
- "@fiado/type-kit": "^1.4.41",
19
+ "@fiado/type-kit": "^1.4.46",
20
20
  "dotenv": "^16.4.5",
21
21
  "inversify": "^6.0.2",
22
22
  "reflect-metadata": "^0.2.1",
@@ -8,7 +8,11 @@ import {IHttpRequest} from "@fiado/http-client";
8
8
  export default class AccountPagoConfiadoApi implements IAccountPagoConfiadoApi {
9
9
  private readonly baseUrl = process.env.ACCOUNT_PAGOCONFIADO_LAMBDA_URL || "";
10
10
 
11
- constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
11
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {}
12
+
13
+ async cancelAccount(accountNumber: string, documentNumber: string): Promise<ApiGatewayResponse<void>> {
14
+ const url = `${this.baseUrl}/cancel`;
15
+ return await this.httpRequest.post(url, {accountNumber, documentNumber});
12
16
  }
13
17
 
14
18
  async createAccount(data: AccountCreateRequest): Promise<ApiGatewayResponse<AccountCreateResponse>> {
@@ -20,4 +20,6 @@ export interface IAccountPagoConfiadoApi {
20
20
  updateByAccountNumber(accountNumber: string, data: AccountUpdateRequest): Promise<ApiGatewayResponse<void>>;
21
21
 
22
22
  getAccountByAccountNumber(accountNumber: string): Promise<ApiGatewayResponse<void>>;
23
+
24
+ cancelAccount(accountNumber:string,documentNumber:string): Promise<ApiGatewayResponse<void>>;
23
25
  }
@@ -0,0 +1,22 @@
1
+ import { IHttpRequest } from "@fiado/http-client";
2
+ import { inject, injectable } from "inversify";
3
+ import { ICnbvApi } from "./interfaces/ICnbvApi";
4
+
5
+
6
+
7
+ @injectable()
8
+ export default class CnbvApi implements ICnbvApi {
9
+
10
+ private readonly baseUrl = process.env.CNBV_LAMBDA_URL || "";
11
+
12
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
13
+
14
+
15
+ async validateConcidence(fullName: string, yearOfBirth: string): Promise<any> {
16
+
17
+ const url = `${this.baseUrl}?value=${yearOfBirth}&param=YEAR_OF_BIRTH&fullName=${fullName}`;
18
+
19
+ return await this.httpRequest.get(url);
20
+ }
21
+ }
22
+
@@ -0,0 +1,4 @@
1
+
2
+
3
+ export * from './interfaces/ICnbvApi';
4
+ export * from './CnbvApi';
@@ -0,0 +1,7 @@
1
+
2
+
3
+ export interface ICnbvApi {
4
+
5
+ validateConcidence(fullName:string, yearOfBirth: string): Promise<any>
6
+
7
+ }
@@ -47,6 +47,8 @@ import RiskProfileApi from "./riskProfile/api/RiskProfileApi";
47
47
  import {IRiskProfileApi, ITransactionAlarmPublisher, TransactionAlarmPublisher} from "./riskProfile";
48
48
  import {ContactInformationApi, IContactInformationApi} from "./contactInformation";
49
49
  import {FiadoMessagesApi, IFiadoMessagesApi} from "./fiadoMessages";
50
+ import CnbvApi from "./cnbv-business/CnbvApi";
51
+ import { ICnbvApi } from "./cnbv-business";
50
52
 
51
53
  export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) => {
52
54
  bind<IDirectoryApi>("IDirectoryApi").to(DirectoryApi);
@@ -82,4 +84,5 @@ export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) =>
82
84
  bind<ITransactionAlarmPublisher>("ITransactionAlarmPublisher").to(TransactionAlarmPublisher);
83
85
  bind<IContactInformationApi>("IContactInformationApi").to(ContactInformationApi);
84
86
  bind<IFiadoMessagesApi>("IFiadoMessagesApi").to(FiadoMessagesApi);
87
+ bind<ICnbvApi>("ICnbvApi").to(CnbvApi);
85
88
  });
package/src/index.ts CHANGED
@@ -27,4 +27,5 @@ export * from "./group";
27
27
  export * from "./activity-business";
28
28
  export * from "./transactionProcessor";
29
29
  export * from "./riskProfile";
30
- export * from "./fiadoMessages";
30
+ export * from "./fiadoMessages";
31
+ export * from "./cnbv-business";
@@ -24,6 +24,11 @@ export default class STPAccountApi implements ISTPAccountApi {
24
24
  return await this.httpRequest.post(url, request);
25
25
  }
26
26
 
27
+ async cancelAccount(request: {accountNumber:string, documentNumber:string}): Promise<any> {
28
+ const url: string = `${this.baseUrl}account/cancel`;
29
+ return await this.httpRequest.post(url, request);
30
+ }
31
+
27
32
 
28
33
  // //USER
29
34
  // async createUser(request: CreateBankAccountUserRequest): Promise<any> {
@@ -4,4 +4,5 @@ import { CreateAccountWebhookDetail } from "@fiado/type-kit/bin/stpAccount";
4
4
  export interface ISTPAccountApi {
5
5
  createAccount(request: AccountCreateRequest): Promise<any>;
6
6
  updateAccountDetails(request: CreateAccountWebhookDetail): Promise<any>;
7
+ cancelAccount(request: {accountNumber:string, documentNumber:string}): Promise<any>
7
8
  }