@fiado/api-invoker 5.119.0 → 5.121.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/container.config.js +2 -0
- package/bin/notificationMessages/api/NotificationMessagesApi.d.ts +12 -0
- package/bin/notificationMessages/api/NotificationMessagesApi.js +35 -0
- package/bin/notificationMessages/api/interfaces/INotificationMessagesApi.d.ts +10 -0
- package/bin/notificationMessages/api/interfaces/INotificationMessagesApi.js +1 -0
- package/bin/notificationMessages/index.d.ts +2 -0
- package/bin/notificationMessages/index.js +2 -0
- package/bin/referral-business/ReferralBusinessApi.d.ts +6 -1
- package/bin/referral-business/ReferralBusinessApi.js +9 -1
- package/bin/referral-business/interfaces/IReferralBusinessApi.d.ts +14 -1
- package/package.json +2 -2
- package/src/container.config.ts +2 -1
- package/src/notificationMessages/api/NotificationMessagesApi.ts +28 -0
- package/src/notificationMessages/api/interfaces/INotificationMessagesApi.ts +14 -0
- package/src/notificationMessages/index.ts +3 -1
- package/src/referral-business/ReferralBusinessApi.ts +14 -2
- package/src/referral-business/interfaces/IReferralBusinessApi.ts +13 -1
package/bin/container.config.js
CHANGED
|
@@ -2,6 +2,7 @@ import { ContainerModule } from "inversify";
|
|
|
2
2
|
import { DirectoryApi } from "./directory/index.js";
|
|
3
3
|
import { IdentityApi } from "./identity/index.js";
|
|
4
4
|
import { FileStorageApi } from "./file-storage/index.js";
|
|
5
|
+
import { NotificationMessagesApi } from "./notificationMessages/index.js";
|
|
5
6
|
import NotificationMessagePublisher from "./notificationMessages/queue/NotificationMessagePublisher.js";
|
|
6
7
|
import TernApi from "./tern/api/TernApi.js";
|
|
7
8
|
import PomeloApi from "./pomelo/api/PomeloApi.js";
|
|
@@ -164,6 +165,7 @@ export const apiInvokerBindings = new ContainerModule(({ bind }) => {
|
|
|
164
165
|
bind("IBiometricsBusinessApi").to(BiometricsBusinessApi);
|
|
165
166
|
bind("IAccountFiadoSAApi").to(AccountFiadoSAApi);
|
|
166
167
|
bind("INotificationMessagesPublisher").to(NotificationMessagePublisher);
|
|
168
|
+
bind("INotificationMessagesApi").to(NotificationMessagesApi);
|
|
167
169
|
bind("INotificationWSMessagesPublisher").to(NotificationWSMessagePublisher);
|
|
168
170
|
bind("ISessionActivityPublisher").to(SessionActivityPublisher);
|
|
169
171
|
bind("ITransactionPublisher").to(TransactionPublisher);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IHttpRequest } from '@fiado/http-client';
|
|
2
|
+
type FiadoApiResponse<T> = import('@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js').default<T>;
|
|
3
|
+
import { MomentTemplateListResponse, MomentTemplateResponse, MomentTemplateUpsertRequest } from '@fiado/type-kit/bin/notificationMessages/index.js';
|
|
4
|
+
import { INotificationMessagesApi } from './interfaces/INotificationMessagesApi.js';
|
|
5
|
+
export declare class NotificationMessagesApi implements INotificationMessagesApi {
|
|
6
|
+
private readonly httpRequest;
|
|
7
|
+
private readonly baseUrl;
|
|
8
|
+
constructor(httpRequest: IHttpRequest);
|
|
9
|
+
upsertMomentTemplate(messageType: string, request: MomentTemplateUpsertRequest): Promise<FiadoApiResponse<MomentTemplateResponse>>;
|
|
10
|
+
listMomentTemplates(messageTypes: readonly string[]): Promise<FiadoApiResponse<MomentTemplateListResponse>>;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
import { inject, injectable } from 'inversify';
|
|
14
|
+
import { joinUrl } from '../../utils/joinUrl.js';
|
|
15
|
+
const MOMENT_TEMPLATES_PATH = 'notification-messages/private/moment-templates';
|
|
16
|
+
let NotificationMessagesApi = class NotificationMessagesApi {
|
|
17
|
+
httpRequest;
|
|
18
|
+
baseUrl = process.env.NOTIFICATION_MESSAGES_URL || '';
|
|
19
|
+
constructor(httpRequest) {
|
|
20
|
+
this.httpRequest = httpRequest;
|
|
21
|
+
}
|
|
22
|
+
async upsertMomentTemplate(messageType, request) {
|
|
23
|
+
const url = joinUrl(this.baseUrl, `${MOMENT_TEMPLATES_PATH}/${encodeURIComponent(messageType)}`);
|
|
24
|
+
return await this.httpRequest.put(url, request);
|
|
25
|
+
}
|
|
26
|
+
async listMomentTemplates(messageTypes) {
|
|
27
|
+
return await this.httpRequest.get(joinUrl(this.baseUrl, MOMENT_TEMPLATES_PATH), { messageTypes: messageTypes.join(',') });
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
NotificationMessagesApi = __decorate([
|
|
31
|
+
injectable(),
|
|
32
|
+
__param(0, inject('IHttpRequest')),
|
|
33
|
+
__metadata("design:paramtypes", [Object])
|
|
34
|
+
], NotificationMessagesApi);
|
|
35
|
+
export { NotificationMessagesApi };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type FiadoApiResponse<T> = import('@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js').default<T>;
|
|
2
|
+
import { MomentTemplateListResponse, MomentTemplateResponse, MomentTemplateUpsertRequest } from '@fiado/type-kit/bin/notificationMessages/index.js';
|
|
3
|
+
/** Plantillas push de los momentos del crédito en notification-messages-business (API privada). */
|
|
4
|
+
export interface INotificationMessagesApi {
|
|
5
|
+
/** Crea o actualiza `ES_<messageType>`. Responde 409 si la fila es del wallet. */
|
|
6
|
+
upsertMomentTemplate(messageType: string, request: MomentTemplateUpsertRequest): Promise<FiadoApiResponse<MomentTemplateResponse>>;
|
|
7
|
+
/** Lectura en lote: la plantilla que no existe no viene en `items`. */
|
|
8
|
+
listMomentTemplates(messageTypes: readonly string[]): Promise<FiadoApiResponse<MomentTemplateListResponse>>;
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,7 +2,7 @@ import type { IHttpRequest } from "@fiado/http-client";
|
|
|
2
2
|
import { IReferralBusinessApi } from "./interfaces/IReferralBusinessApi.js";
|
|
3
3
|
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
4
4
|
import { Scope } from "@fiado/type-kit/bin/directory/enums/Scope.js";
|
|
5
|
-
import type { AgentsByDirectoryIdsResponse } from "@fiado/type-kit/bin/referral-business/index.js";
|
|
5
|
+
import type { AgentsByDirectoryIdsResponse, GroupOwnersByGroupIdsResponse } from "@fiado/type-kit/bin/referral-business/index.js";
|
|
6
6
|
export declare class ReferralBusinessApi implements IReferralBusinessApi {
|
|
7
7
|
private httpRequest;
|
|
8
8
|
private readonly baseUrl;
|
|
@@ -24,5 +24,10 @@ export declare class ReferralBusinessApi implements IReferralBusinessApi {
|
|
|
24
24
|
accountOpeningsBySponsor(newDirectoryId: string, scope: Scope): Promise<FiadoApiResponse<any>>;
|
|
25
25
|
deleteAgent(directoryId: string): Promise<FiadoApiResponse<any>>;
|
|
26
26
|
getAgentsByDirectoryIds(directoryIds: string[]): Promise<AgentsByDirectoryIdsResponse>;
|
|
27
|
+
createGroupOwner(params: {
|
|
28
|
+
groupId: string;
|
|
29
|
+
directoryId: string;
|
|
30
|
+
}): Promise<FiadoApiResponse<unknown>>;
|
|
31
|
+
getGroupOwnersByGroupIds(groupIds: string[]): Promise<GroupOwnersByGroupIdsResponse>;
|
|
27
32
|
}
|
|
28
33
|
export {};
|
|
@@ -12,7 +12,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
12
12
|
};
|
|
13
13
|
import { inject, injectable } from "inversify";
|
|
14
14
|
import dotenv from 'dotenv';
|
|
15
|
-
import { AGENTS_BY_DIRECTORY_IDS_MAX_BATCH } from "@fiado/type-kit/bin/referral-business/index.js";
|
|
15
|
+
import { AGENTS_BY_DIRECTORY_IDS_MAX_BATCH, AgentRoleEnum, GROUP_OWNERS_BY_GROUP_IDS_MAX_BATCH } from "@fiado/type-kit/bin/referral-business/index.js";
|
|
16
16
|
import { joinUrl } from "../utils/joinUrl.js";
|
|
17
17
|
import { postIdsInBatches } from "../utils/postIdsInBatches.js";
|
|
18
18
|
dotenv.config();
|
|
@@ -46,6 +46,14 @@ let ReferralBusinessApi = class ReferralBusinessApi {
|
|
|
46
46
|
const url = joinUrl(this.baseUrl, "private/agents/by-directory-ids");
|
|
47
47
|
return await postIdsInBatches(this.httpRequest, url, "directoryIds", directoryIds, AGENTS_BY_DIRECTORY_IDS_MAX_BATCH);
|
|
48
48
|
}
|
|
49
|
+
async createGroupOwner(params) {
|
|
50
|
+
const url = joinUrl(this.baseUrl, "private/agents");
|
|
51
|
+
return await this.httpRequest.post(url, { directoryId: params.directoryId, groupId: params.groupId, agentRole: AgentRoleEnum.OWNER });
|
|
52
|
+
}
|
|
53
|
+
async getGroupOwnersByGroupIds(groupIds) {
|
|
54
|
+
const url = joinUrl(this.baseUrl, "private/agents/owners/by-group-ids");
|
|
55
|
+
return await postIdsInBatches(this.httpRequest, url, "groupIds", groupIds, GROUP_OWNERS_BY_GROUP_IDS_MAX_BATCH);
|
|
56
|
+
}
|
|
49
57
|
};
|
|
50
58
|
ReferralBusinessApi = __decorate([
|
|
51
59
|
injectable(),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
2
2
|
import { Scope } from "@fiado/type-kit/bin/directory/enums/Scope.js";
|
|
3
|
-
import type { AgentsByDirectoryIdsResponse } from "@fiado/type-kit/bin/referral-business/index.js";
|
|
3
|
+
import type { AgentsByDirectoryIdsResponse, GroupOwnersByGroupIdsResponse } from "@fiado/type-kit/bin/referral-business/index.js";
|
|
4
4
|
/**
|
|
5
5
|
* Interfaz para el servicio Payroll que permite operaciones sobre payroll.
|
|
6
6
|
*/
|
|
@@ -52,5 +52,18 @@ export interface IReferralBusinessApi {
|
|
|
52
52
|
* Devuelve el mapa ya desempaquetado de `.data`; lanza el error del http sin fallback.
|
|
53
53
|
*/
|
|
54
54
|
getAgentsByDirectoryIds(directoryIds: string[]): Promise<AgentsByDirectoryIdsResponse>;
|
|
55
|
+
/**
|
|
56
|
+
* POST private/agents con agentRole OWNER: crea el agente OWNER_<groupId> (y su membresía) en referral-business.
|
|
57
|
+
* El grupo ya debe existir en group-business. Lanza el error del http sin fallback (400 trae el code de referral).
|
|
58
|
+
*/
|
|
59
|
+
createGroupOwner(params: {
|
|
60
|
+
groupId: string;
|
|
61
|
+
directoryId: string;
|
|
62
|
+
}): Promise<FiadoApiResponse<unknown>>;
|
|
63
|
+
/**
|
|
64
|
+
* POST private/agents/owners/by-group-ids: owner de cada grupo, en lotes de 100.
|
|
65
|
+
* Devuelve el mapa ya desempaquetado de `.data`; un grupo sin owner no aparece. Lanza el error del http.
|
|
66
|
+
*/
|
|
67
|
+
getGroupOwnersByGroupIds(groupIds: string[]): Promise<GroupOwnersByGroupIdsResponse>;
|
|
55
68
|
}
|
|
56
69
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.121.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.14.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.522.0",
|
|
38
38
|
"dotenv": "^16.4.7"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
package/src/container.config.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ContainerModule } from "inversify";
|
|
|
2
2
|
import { DirectoryApi, IDirectoryApi } from "./directory/index.js";
|
|
3
3
|
import { IdentityApi, IIdentityApi } from "./identity/index.js";
|
|
4
4
|
import { FileStorageApi, IFileStorageApi } from "./file-storage/index.js";
|
|
5
|
-
import { INotificationMessagesPublisher } from "./notificationMessages/index.js";
|
|
5
|
+
import { INotificationMessagesApi, INotificationMessagesPublisher, NotificationMessagesApi } from "./notificationMessages/index.js";
|
|
6
6
|
import NotificationMessagePublisher from "./notificationMessages/queue/NotificationMessagePublisher.js";
|
|
7
7
|
import { ITernApi } from "./tern/index.js";
|
|
8
8
|
import TernApi from "./tern/api/TernApi.js";
|
|
@@ -237,6 +237,7 @@ export const apiInvokerBindings = new ContainerModule(({ bind }) => {
|
|
|
237
237
|
bind<IBiometricsBusinessApi>("IBiometricsBusinessApi").to(BiometricsBusinessApi);
|
|
238
238
|
bind<IAccountFiadoSAApi>("IAccountFiadoSAApi").to(AccountFiadoSAApi);
|
|
239
239
|
bind<INotificationMessagesPublisher>("INotificationMessagesPublisher").to(NotificationMessagePublisher);
|
|
240
|
+
bind<INotificationMessagesApi>("INotificationMessagesApi").to(NotificationMessagesApi);
|
|
240
241
|
bind<INotificationWSMessagesPublisher>("INotificationWSMessagesPublisher").to(NotificationWSMessagePublisher);
|
|
241
242
|
bind<ISessionActivityPublisher>("ISessionActivityPublisher").to(SessionActivityPublisher);
|
|
242
243
|
bind<ITransactionPublisher>("ITransactionPublisher").to(TransactionPublisher);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { inject, injectable } from 'inversify';
|
|
2
|
+
import type { IHttpRequest } from '@fiado/http-client';
|
|
3
|
+
type FiadoApiResponse<T> = import('@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js').default<T>;
|
|
4
|
+
import {
|
|
5
|
+
MomentTemplateListResponse,
|
|
6
|
+
MomentTemplateResponse,
|
|
7
|
+
MomentTemplateUpsertRequest,
|
|
8
|
+
} from '@fiado/type-kit/bin/notificationMessages/index.js';
|
|
9
|
+
import { INotificationMessagesApi } from './interfaces/INotificationMessagesApi.js';
|
|
10
|
+
import { joinUrl } from '../../utils/joinUrl.js';
|
|
11
|
+
|
|
12
|
+
const MOMENT_TEMPLATES_PATH = 'notification-messages/private/moment-templates';
|
|
13
|
+
|
|
14
|
+
@injectable()
|
|
15
|
+
export class NotificationMessagesApi implements INotificationMessagesApi {
|
|
16
|
+
private readonly baseUrl = process.env.NOTIFICATION_MESSAGES_URL || '';
|
|
17
|
+
|
|
18
|
+
constructor(@inject('IHttpRequest') private readonly httpRequest: IHttpRequest) {}
|
|
19
|
+
|
|
20
|
+
async upsertMomentTemplate(messageType: string, request: MomentTemplateUpsertRequest): Promise<FiadoApiResponse<MomentTemplateResponse>> {
|
|
21
|
+
const url = joinUrl(this.baseUrl, `${MOMENT_TEMPLATES_PATH}/${encodeURIComponent(messageType)}`);
|
|
22
|
+
return await this.httpRequest.put(url, request);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async listMomentTemplates(messageTypes: readonly string[]): Promise<FiadoApiResponse<MomentTemplateListResponse>> {
|
|
26
|
+
return await this.httpRequest.get(joinUrl(this.baseUrl, MOMENT_TEMPLATES_PATH), { messageTypes: messageTypes.join(',') });
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type FiadoApiResponse<T> = import('@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js').default<T>;
|
|
2
|
+
import {
|
|
3
|
+
MomentTemplateListResponse,
|
|
4
|
+
MomentTemplateResponse,
|
|
5
|
+
MomentTemplateUpsertRequest,
|
|
6
|
+
} from '@fiado/type-kit/bin/notificationMessages/index.js';
|
|
7
|
+
|
|
8
|
+
/** Plantillas push de los momentos del crédito en notification-messages-business (API privada). */
|
|
9
|
+
export interface INotificationMessagesApi {
|
|
10
|
+
/** Crea o actualiza `ES_<messageType>`. Responde 409 si la fila es del wallet. */
|
|
11
|
+
upsertMomentTemplate(messageType: string, request: MomentTemplateUpsertRequest): Promise<FiadoApiResponse<MomentTemplateResponse>>;
|
|
12
|
+
/** Lectura en lote: la plantilla que no existe no viene en `items`. */
|
|
13
|
+
listMomentTemplates(messageTypes: readonly string[]): Promise<FiadoApiResponse<MomentTemplateListResponse>>;
|
|
14
|
+
}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export * from './queue/NotificationMessagePublisher.js';
|
|
2
|
-
export * from './queue/interfaces/INotificationMessagesPublisher.js';
|
|
2
|
+
export * from './queue/interfaces/INotificationMessagesPublisher.js';
|
|
3
|
+
export * from './api/NotificationMessagesApi.js';
|
|
4
|
+
export * from './api/interfaces/INotificationMessagesApi.js';
|
|
@@ -4,8 +4,8 @@ import dotenv from 'dotenv';
|
|
|
4
4
|
import { IReferralBusinessApi } from "./interfaces/IReferralBusinessApi.js";
|
|
5
5
|
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
6
6
|
import { Scope } from "@fiado/type-kit/bin/directory/enums/Scope.js";
|
|
7
|
-
import { AGENTS_BY_DIRECTORY_IDS_MAX_BATCH } from "@fiado/type-kit/bin/referral-business/index.js";
|
|
8
|
-
import type { AgentByDirectoryIdItem, AgentsByDirectoryIdsResponse } from "@fiado/type-kit/bin/referral-business/index.js";
|
|
7
|
+
import { AGENTS_BY_DIRECTORY_IDS_MAX_BATCH, AgentRoleEnum, GROUP_OWNERS_BY_GROUP_IDS_MAX_BATCH } from "@fiado/type-kit/bin/referral-business/index.js";
|
|
8
|
+
import type { AgentByDirectoryIdItem, AgentsByDirectoryIdsResponse, GroupOwnerItem, GroupOwnersByGroupIdsResponse } from "@fiado/type-kit/bin/referral-business/index.js";
|
|
9
9
|
import { joinUrl } from "../utils/joinUrl.js";
|
|
10
10
|
import { postIdsInBatches } from "../utils/postIdsInBatches.js";
|
|
11
11
|
|
|
@@ -51,4 +51,16 @@ export class ReferralBusinessApi implements IReferralBusinessApi {
|
|
|
51
51
|
this.httpRequest, url, "directoryIds", directoryIds, AGENTS_BY_DIRECTORY_IDS_MAX_BATCH,
|
|
52
52
|
);
|
|
53
53
|
}
|
|
54
|
+
|
|
55
|
+
async createGroupOwner(params: { groupId: string; directoryId: string }): Promise<FiadoApiResponse<unknown>> {
|
|
56
|
+
const url = joinUrl(this.baseUrl, "private/agents");
|
|
57
|
+
return await this.httpRequest.post(url, { directoryId: params.directoryId, groupId: params.groupId, agentRole: AgentRoleEnum.OWNER });
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async getGroupOwnersByGroupIds(groupIds: string[]): Promise<GroupOwnersByGroupIdsResponse> {
|
|
61
|
+
const url = joinUrl(this.baseUrl, "private/agents/owners/by-group-ids");
|
|
62
|
+
return await postIdsInBatches<GroupOwnerItem>(
|
|
63
|
+
this.httpRequest, url, "groupIds", groupIds, GROUP_OWNERS_BY_GROUP_IDS_MAX_BATCH,
|
|
64
|
+
);
|
|
65
|
+
}
|
|
54
66
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
2
2
|
import { Scope } from "@fiado/type-kit/bin/directory/enums/Scope.js";
|
|
3
|
-
import type { AgentsByDirectoryIdsResponse } from "@fiado/type-kit/bin/referral-business/index.js";
|
|
3
|
+
import type { AgentsByDirectoryIdsResponse, GroupOwnersByGroupIdsResponse } from "@fiado/type-kit/bin/referral-business/index.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Interfaz para el servicio Payroll que permite operaciones sobre payroll.
|
|
@@ -49,4 +49,16 @@ export interface IReferralBusinessApi {
|
|
|
49
49
|
* Devuelve el mapa ya desempaquetado de `.data`; lanza el error del http sin fallback.
|
|
50
50
|
*/
|
|
51
51
|
getAgentsByDirectoryIds(directoryIds: string[]): Promise<AgentsByDirectoryIdsResponse>;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* POST private/agents con agentRole OWNER: crea el agente OWNER_<groupId> (y su membresía) en referral-business.
|
|
55
|
+
* El grupo ya debe existir en group-business. Lanza el error del http sin fallback (400 trae el code de referral).
|
|
56
|
+
*/
|
|
57
|
+
createGroupOwner(params: { groupId: string; directoryId: string }): Promise<FiadoApiResponse<unknown>>;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* POST private/agents/owners/by-group-ids: owner de cada grupo, en lotes de 100.
|
|
61
|
+
* Devuelve el mapa ya desempaquetado de `.data`; un grupo sin owner no aparece. Lanza el error del http.
|
|
62
|
+
*/
|
|
63
|
+
getGroupOwnersByGroupIds(groupIds: string[]): Promise<GroupOwnersByGroupIdsResponse>;
|
|
52
64
|
}
|