@fiado/api-invoker 5.112.0 → 5.113.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/index.d.ts +1 -0
- package/bin/index.js +1 -0
- package/bin/retailCommission/RetailCommissionBusinessApi.d.ts +12 -0
- package/bin/retailCommission/RetailCommissionBusinessApi.js +35 -0
- package/bin/retailCommission/index.d.ts +2 -0
- package/bin/retailCommission/index.js +2 -0
- package/bin/retailCommission/interfaces/IRetailCommissionBusinessApi.d.ts +16 -0
- package/bin/retailCommission/interfaces/IRetailCommissionBusinessApi.js +1 -0
- package/bin/retailOrg/api/RetailOrgBusinessApi.d.ts +4 -2
- package/bin/retailOrg/api/RetailOrgBusinessApi.js +11 -1
- package/bin/retailOrg/api/interfaces/IRetailOrgBusinessApi.d.ts +11 -2
- package/package.json +2 -2
- package/src/index.ts +1 -0
- package/src/retailCommission/RetailCommissionBusinessApi.ts +25 -0
- package/src/retailCommission/index.ts +2 -0
- package/src/retailCommission/interfaces/IRetailCommissionBusinessApi.ts +20 -0
- package/src/retailOrg/api/RetailOrgBusinessApi.ts +17 -0
- package/src/retailOrg/api/interfaces/IRetailOrgBusinessApi.ts +18 -0
package/bin/index.d.ts
CHANGED
|
@@ -90,6 +90,7 @@ export * from "./retailCards/index.js";
|
|
|
90
90
|
export * from "./retailNotifications/index.js";
|
|
91
91
|
export * from "./retailWizard/index.js";
|
|
92
92
|
export * from "./retailPromotions/index.js";
|
|
93
|
+
export * from "./retailCommission/index.js";
|
|
93
94
|
export * from "./retailIntegration/index.js";
|
|
94
95
|
export * from "./shortlink/index.js";
|
|
95
96
|
export * from "./loanConfig/index.js";
|
package/bin/index.js
CHANGED
|
@@ -90,6 +90,7 @@ export * from "./retailCards/index.js";
|
|
|
90
90
|
export * from "./retailNotifications/index.js";
|
|
91
91
|
export * from "./retailWizard/index.js";
|
|
92
92
|
export * from "./retailPromotions/index.js";
|
|
93
|
+
export * from "./retailCommission/index.js";
|
|
93
94
|
export * from "./retailIntegration/index.js";
|
|
94
95
|
export * from "./shortlink/index.js";
|
|
95
96
|
export * from "./loanConfig/index.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IHttpRequest } from "@fiado/http-client";
|
|
2
|
+
import type { StandardResponse } from "@fiado/gateway-adapter";
|
|
3
|
+
import type { PrivateLatestClosedPayoutResponse } from "@fiado/type-kit/bin/retailCommission/index.js";
|
|
4
|
+
import type { IRetailCommissionBusinessApi } from "./interfaces/IRetailCommissionBusinessApi.js";
|
|
5
|
+
/** Publisher HTTP de `retail-commission-business`. Contrato → `IRetailCommissionBusinessApi`. */
|
|
6
|
+
export declare class RetailCommissionBusinessApi implements IRetailCommissionBusinessApi {
|
|
7
|
+
private readonly httpRequest;
|
|
8
|
+
constructor(httpRequest: IHttpRequest);
|
|
9
|
+
/** La URL del SSM termina en `/v1/`; se quita la barra final para no duplicarla. */
|
|
10
|
+
private get baseUrl();
|
|
11
|
+
getLatestClosedPayout(retailerId: string, tenantId: string): Promise<StandardResponse<PrivateLatestClosedPayoutResponse>>;
|
|
12
|
+
}
|
|
@@ -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
|
+
/** Publisher HTTP de `retail-commission-business`. Contrato → `IRetailCommissionBusinessApi`. */
|
|
15
|
+
let RetailCommissionBusinessApi = class RetailCommissionBusinessApi {
|
|
16
|
+
httpRequest;
|
|
17
|
+
constructor(httpRequest) {
|
|
18
|
+
this.httpRequest = httpRequest;
|
|
19
|
+
}
|
|
20
|
+
/** La URL del SSM termina en `/v1/`; se quita la barra final para no duplicarla. */
|
|
21
|
+
get baseUrl() {
|
|
22
|
+
return (process.env.RETAIL_COMMISSION_BUSINESS_URL || "").replace(/\/+$/, "");
|
|
23
|
+
}
|
|
24
|
+
async getLatestClosedPayout(retailerId, tenantId) {
|
|
25
|
+
const path = `/private/retailers/${encodeURIComponent(retailerId)}/payouts/latest-closed`;
|
|
26
|
+
const query = new URLSearchParams({ tenantId });
|
|
27
|
+
return await this.httpRequest.get(`${this.baseUrl}${path}?${query.toString()}`);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
RetailCommissionBusinessApi = __decorate([
|
|
31
|
+
injectable(),
|
|
32
|
+
__param(0, inject("IHttpRequest")),
|
|
33
|
+
__metadata("design:paramtypes", [Object])
|
|
34
|
+
], RetailCommissionBusinessApi);
|
|
35
|
+
export { RetailCommissionBusinessApi };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { StandardResponse } from "@fiado/gateway-adapter";
|
|
2
|
+
import type { PrivateLatestClosedPayoutResponse } from "@fiado/type-kit/bin/retailCommission/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Publisher de los endpoints privados de `retail-commission-business` (motor de comisiones de
|
|
5
|
+
* VentasLuga). No confundir con `commission-business`, que es otro servicio.
|
|
6
|
+
*
|
|
7
|
+
* Env var requerida en el consumer: `RETAIL_COMMISSION_BUSINESS_URL: '{{resolve:ssm:retail-commission-business}}'`.
|
|
8
|
+
* `tenantId` es obligatorio: los privados no llevan token y el silo lo declara el caller.
|
|
9
|
+
*/
|
|
10
|
+
export interface IRetailCommissionBusinessApi {
|
|
11
|
+
/**
|
|
12
|
+
* `GET /private/retailers/{retailerId}/payouts/latest-closed` — el último corte semanal CERRADO
|
|
13
|
+
* de la cadena, con lo que le pagó a cada vendedor. Sin corte cerrado reciente: `period: null`.
|
|
14
|
+
*/
|
|
15
|
+
getLatestClosedPayout(retailerId: string, tenantId: string): Promise<StandardResponse<PrivateLatestClosedPayoutResponse>>;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IHttpRequest } from "@fiado/http-client";
|
|
2
2
|
import { StandardResponse } from "@fiado/gateway-adapter";
|
|
3
|
-
import { RetailerValidationDto, StoreValidationDto, RetailUserValidationDto, CollectorValidationDto, PrivateSellerListResponse, RetailUserStatusEnum } from "@fiado/type-kit/bin/retailOrg/index.js";
|
|
3
|
+
import { RetailerValidationDto, StoreValidationDto, RetailUserValidationDto, CollectorValidationDto, PrivateSellerListResponse, PrivateGoalListResponse, GoalTargetTypeEnum, RetailUserStatusEnum } from "@fiado/type-kit/bin/retailOrg/index.js";
|
|
4
4
|
import type { ApplyRetailUserEventRequest, ApplyRetailUserEventResponse, ApplyStoreEventRequest, ApplyStoreEventResponse } from "@fiado/type-kit/bin/retailIntegration/index.js";
|
|
5
5
|
import { IRetailOrgBusinessApi, RetailerRosterStatusFilter, StoreRosterStatusFilter } from "./interfaces/IRetailOrgBusinessApi.js";
|
|
6
6
|
/**
|
|
@@ -49,7 +49,9 @@ export default class RetailOrgBusinessApi implements IRetailOrgBusinessApi {
|
|
|
49
49
|
* ⚠️ Es el único método de este publisher con el `retailerId` en el QUERY y no anidado en el
|
|
50
50
|
* path: el caller no está validando un recurso, está pidiendo una colección entera.
|
|
51
51
|
*/
|
|
52
|
-
listSellers(retailerId: string, tenantId: string, callerService: string, status?: RetailUserStatusEnum): Promise<StandardResponse<PrivateSellerListResponse>>;
|
|
52
|
+
listSellers(retailerId: string, tenantId: string, callerService: string, status?: RetailUserStatusEnum, includePhone?: boolean): Promise<StandardResponse<PrivateSellerListResponse>>;
|
|
53
|
+
/** Metas del periodo de una cadena. Contrato → `IRetailOrgBusinessApi.listGoals`. */
|
|
54
|
+
listGoals(retailerId: string, tenantId: string, periodId: string, targetType?: GoalTargetTypeEnum): Promise<StandardResponse<PrivateGoalListResponse>>;
|
|
53
55
|
privateApplyStoreEvent(request: ApplyStoreEventRequest): Promise<StandardResponse<ApplyStoreEventResponse>>;
|
|
54
56
|
privateApplyRetailUserEvent(request: ApplyRetailUserEventRequest): Promise<StandardResponse<ApplyRetailUserEventResponse>>;
|
|
55
57
|
private applyRetailEvent;
|
|
@@ -92,14 +92,24 @@ let RetailOrgBusinessApi = class RetailOrgBusinessApi {
|
|
|
92
92
|
* ⚠️ Es el único método de este publisher con el `retailerId` en el QUERY y no anidado en el
|
|
93
93
|
* path: el caller no está validando un recurso, está pidiendo una colección entera.
|
|
94
94
|
*/
|
|
95
|
-
async listSellers(retailerId, tenantId, callerService, status) {
|
|
95
|
+
async listSellers(retailerId, tenantId, callerService, status, includePhone) {
|
|
96
96
|
// `URLSearchParams` en vez de concatenar: `status` es opcional y armar el `&status=` a mano
|
|
97
97
|
// deja un `&status=undefined` en cuanto alguien se distrae.
|
|
98
98
|
const query = new URLSearchParams({ retailerId, tenantId, callerService });
|
|
99
99
|
if (status)
|
|
100
100
|
query.set("status", status);
|
|
101
|
+
if (includePhone)
|
|
102
|
+
query.set("includePhone", "true");
|
|
101
103
|
return await this.httpRequest.get(`${this.baseUrl}/private/sellers?${query.toString()}`);
|
|
102
104
|
}
|
|
105
|
+
/** Metas del periodo de una cadena. Contrato → `IRetailOrgBusinessApi.listGoals`. */
|
|
106
|
+
async listGoals(retailerId, tenantId, periodId, targetType) {
|
|
107
|
+
const query = new URLSearchParams({ tenantId, periodId });
|
|
108
|
+
if (targetType)
|
|
109
|
+
query.set("targetType", targetType);
|
|
110
|
+
const path = `/private/retailers/${encodeURIComponent(retailerId)}/goals`;
|
|
111
|
+
return await this.httpRequest.get(`${this.baseUrl}${path}?${query.toString()}`);
|
|
112
|
+
}
|
|
103
113
|
async privateApplyStoreEvent(request) {
|
|
104
114
|
return await this.applyRetailEvent("/private/integration/store-events", request);
|
|
105
115
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StandardResponse } from "@fiado/gateway-adapter";
|
|
2
|
-
import { RetailerValidationDto, StoreValidationDto, RetailUserValidationDto, CollectorValidationDto, PrivateSellerListResponse, RetailUserStatusEnum, RetailerStatusEnum, StoreStatusEnum } from "@fiado/type-kit/bin/retailOrg/index.js";
|
|
2
|
+
import { RetailerValidationDto, StoreValidationDto, RetailUserValidationDto, CollectorValidationDto, PrivateSellerListResponse, PrivateGoalListResponse, GoalTargetTypeEnum, RetailUserStatusEnum, RetailerStatusEnum, StoreStatusEnum } from "@fiado/type-kit/bin/retailOrg/index.js";
|
|
3
3
|
import type { ApplyRetailUserEventRequest, ApplyRetailUserEventResponse, ApplyStoreEventRequest, ApplyStoreEventResponse } from "@fiado/type-kit/bin/retailIntegration/index.js";
|
|
4
4
|
/**
|
|
5
5
|
* Filtro de `listStoresByRetailer`. `"ALL"` no es un estado de tienda: es la ausencia de filtro, y
|
|
@@ -206,6 +206,8 @@ export interface IRetailOrgBusinessApi {
|
|
|
206
206
|
* lo perdería en silencio sin dejar ninguna forma de pedir el padrón completo. Si el motor
|
|
207
207
|
* quiere solo activos, que lo diga explícito.
|
|
208
208
|
*
|
|
209
|
+
* `includePhone: true` agrega el teléfono de cada vendedor (PII, por eso es opt-in).
|
|
210
|
+
*
|
|
209
211
|
* ── `callerService`: quién exportó la nómina ─────────────────────────────────────────────────
|
|
210
212
|
* El endpoint es `Feature.ANONIMUS` (sin token de usuario), así que **no hay `actorId`** al que
|
|
211
213
|
* atribuirle la lectura — y esto exporta la nómina completa de una cadena en una sola llamada.
|
|
@@ -218,7 +220,14 @@ export interface IRetailOrgBusinessApi {
|
|
|
218
220
|
* cerraría el corte sin devengos sin que nadie se entere hasta el día de pago.
|
|
219
221
|
* @throws `400 VALIDATION_ERROR` si `retailerId` no es un ULID · `400 UNKNOWN_TENANT` sin `tenantId`.
|
|
220
222
|
*/
|
|
221
|
-
listSellers(retailerId: string, tenantId: string, callerService: string, status?: RetailUserStatusEnum): Promise<StandardResponse<PrivateSellerListResponse>>;
|
|
223
|
+
listSellers(retailerId: string, tenantId: string, callerService: string, status?: RetailUserStatusEnum, includePhone?: boolean): Promise<StandardResponse<PrivateSellerListResponse>>;
|
|
224
|
+
/**
|
|
225
|
+
* `GET /private/retailers/{retailerId}/goals` — las metas del periodo (`YYYY-MM`) de una cadena,
|
|
226
|
+
* con `monthCents`/`weekCents`/`dayCents` ya derivadas. Sin metas devuelve `goals: []`, no 404.
|
|
227
|
+
*
|
|
228
|
+
* @throws `400 VALIDATION_ERROR` con un periodo o tipo inválido · `400 UNKNOWN_TENANT` sin tenant.
|
|
229
|
+
*/
|
|
230
|
+
listGoals(retailerId: string, tenantId: string, periodId: string, targetType?: GoalTargetTypeEnum): Promise<StandardResponse<PrivateGoalListResponse>>;
|
|
222
231
|
/** `POST /private/integration/store-events?tenantId=` — aplica un evento de tienda del retailer. */
|
|
223
232
|
privateApplyStoreEvent(request: ApplyStoreEventRequest): Promise<StandardResponse<ApplyStoreEventResponse>>;
|
|
224
233
|
/** `POST /private/integration/retail-user-events?tenantId=` — aplica un evento de usuario del retailer. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.113.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.506.0",
|
|
38
38
|
"dotenv": "^16.4.7"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
package/src/index.ts
CHANGED
|
@@ -90,6 +90,7 @@ export * from "./retailCards/index.js";
|
|
|
90
90
|
export * from "./retailNotifications/index.js";
|
|
91
91
|
export * from "./retailWizard/index.js";
|
|
92
92
|
export * from "./retailPromotions/index.js";
|
|
93
|
+
export * from "./retailCommission/index.js";
|
|
93
94
|
export * from "./retailIntegration/index.js";
|
|
94
95
|
export * from "./shortlink/index.js";
|
|
95
96
|
export * from "./loanConfig/index.js";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { inject, injectable } from "inversify";
|
|
2
|
+
import type { IHttpRequest } from "@fiado/http-client";
|
|
3
|
+
import type { StandardResponse } from "@fiado/gateway-adapter";
|
|
4
|
+
import type { PrivateLatestClosedPayoutResponse } from "@fiado/type-kit/bin/retailCommission/index.js";
|
|
5
|
+
import type { IRetailCommissionBusinessApi } from "./interfaces/IRetailCommissionBusinessApi.js";
|
|
6
|
+
|
|
7
|
+
/** Publisher HTTP de `retail-commission-business`. Contrato → `IRetailCommissionBusinessApi`. */
|
|
8
|
+
@injectable()
|
|
9
|
+
export class RetailCommissionBusinessApi implements IRetailCommissionBusinessApi {
|
|
10
|
+
constructor(@inject("IHttpRequest") private readonly httpRequest: IHttpRequest) {}
|
|
11
|
+
|
|
12
|
+
/** La URL del SSM termina en `/v1/`; se quita la barra final para no duplicarla. */
|
|
13
|
+
private get baseUrl(): string {
|
|
14
|
+
return (process.env.RETAIL_COMMISSION_BUSINESS_URL || "").replace(/\/+$/, "");
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
async getLatestClosedPayout(
|
|
18
|
+
retailerId: string,
|
|
19
|
+
tenantId: string,
|
|
20
|
+
): Promise<StandardResponse<PrivateLatestClosedPayoutResponse>> {
|
|
21
|
+
const path = `/private/retailers/${encodeURIComponent(retailerId)}/payouts/latest-closed`;
|
|
22
|
+
const query = new URLSearchParams({ tenantId });
|
|
23
|
+
return await this.httpRequest.get(`${this.baseUrl}${path}?${query.toString()}`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { StandardResponse } from "@fiado/gateway-adapter";
|
|
2
|
+
import type { PrivateLatestClosedPayoutResponse } from "@fiado/type-kit/bin/retailCommission/index.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Publisher de los endpoints privados de `retail-commission-business` (motor de comisiones de
|
|
6
|
+
* VentasLuga). No confundir con `commission-business`, que es otro servicio.
|
|
7
|
+
*
|
|
8
|
+
* Env var requerida en el consumer: `RETAIL_COMMISSION_BUSINESS_URL: '{{resolve:ssm:retail-commission-business}}'`.
|
|
9
|
+
* `tenantId` es obligatorio: los privados no llevan token y el silo lo declara el caller.
|
|
10
|
+
*/
|
|
11
|
+
export interface IRetailCommissionBusinessApi {
|
|
12
|
+
/**
|
|
13
|
+
* `GET /private/retailers/{retailerId}/payouts/latest-closed` — el último corte semanal CERRADO
|
|
14
|
+
* de la cadena, con lo que le pagó a cada vendedor. Sin corte cerrado reciente: `period: null`.
|
|
15
|
+
*/
|
|
16
|
+
getLatestClosedPayout(
|
|
17
|
+
retailerId: string,
|
|
18
|
+
tenantId: string,
|
|
19
|
+
): Promise<StandardResponse<PrivateLatestClosedPayoutResponse>>;
|
|
20
|
+
}
|
|
@@ -7,6 +7,8 @@ import {
|
|
|
7
7
|
RetailUserValidationDto,
|
|
8
8
|
CollectorValidationDto,
|
|
9
9
|
PrivateSellerListResponse,
|
|
10
|
+
PrivateGoalListResponse,
|
|
11
|
+
GoalTargetTypeEnum,
|
|
10
12
|
RetailUserStatusEnum,
|
|
11
13
|
} from "@fiado/type-kit/bin/retailOrg/index.js";
|
|
12
14
|
import type {
|
|
@@ -142,14 +144,29 @@ export default class RetailOrgBusinessApi implements IRetailOrgBusinessApi {
|
|
|
142
144
|
tenantId: string,
|
|
143
145
|
callerService: string,
|
|
144
146
|
status?: RetailUserStatusEnum,
|
|
147
|
+
includePhone?: boolean,
|
|
145
148
|
): Promise<StandardResponse<PrivateSellerListResponse>> {
|
|
146
149
|
// `URLSearchParams` en vez de concatenar: `status` es opcional y armar el `&status=` a mano
|
|
147
150
|
// deja un `&status=undefined` en cuanto alguien se distrae.
|
|
148
151
|
const query = new URLSearchParams({ retailerId, tenantId, callerService });
|
|
149
152
|
if (status) query.set("status", status);
|
|
153
|
+
if (includePhone) query.set("includePhone", "true");
|
|
150
154
|
return await this.httpRequest.get(`${this.baseUrl}/private/sellers?${query.toString()}`);
|
|
151
155
|
}
|
|
152
156
|
|
|
157
|
+
/** Metas del periodo de una cadena. Contrato → `IRetailOrgBusinessApi.listGoals`. */
|
|
158
|
+
async listGoals(
|
|
159
|
+
retailerId: string,
|
|
160
|
+
tenantId: string,
|
|
161
|
+
periodId: string,
|
|
162
|
+
targetType?: GoalTargetTypeEnum,
|
|
163
|
+
): Promise<StandardResponse<PrivateGoalListResponse>> {
|
|
164
|
+
const query = new URLSearchParams({ tenantId, periodId });
|
|
165
|
+
if (targetType) query.set("targetType", targetType);
|
|
166
|
+
const path = `/private/retailers/${encodeURIComponent(retailerId)}/goals`;
|
|
167
|
+
return await this.httpRequest.get(`${this.baseUrl}${path}?${query.toString()}`);
|
|
168
|
+
}
|
|
169
|
+
|
|
153
170
|
async privateApplyStoreEvent(request: ApplyStoreEventRequest): Promise<StandardResponse<ApplyStoreEventResponse>> {
|
|
154
171
|
return await this.applyRetailEvent("/private/integration/store-events", request);
|
|
155
172
|
}
|
|
@@ -5,6 +5,8 @@ import {
|
|
|
5
5
|
RetailUserValidationDto,
|
|
6
6
|
CollectorValidationDto,
|
|
7
7
|
PrivateSellerListResponse,
|
|
8
|
+
PrivateGoalListResponse,
|
|
9
|
+
GoalTargetTypeEnum,
|
|
8
10
|
RetailUserStatusEnum,
|
|
9
11
|
RetailerStatusEnum,
|
|
10
12
|
StoreStatusEnum,
|
|
@@ -258,6 +260,8 @@ export interface IRetailOrgBusinessApi {
|
|
|
258
260
|
* lo perdería en silencio sin dejar ninguna forma de pedir el padrón completo. Si el motor
|
|
259
261
|
* quiere solo activos, que lo diga explícito.
|
|
260
262
|
*
|
|
263
|
+
* `includePhone: true` agrega el teléfono de cada vendedor (PII, por eso es opt-in).
|
|
264
|
+
*
|
|
261
265
|
* ── `callerService`: quién exportó la nómina ─────────────────────────────────────────────────
|
|
262
266
|
* El endpoint es `Feature.ANONIMUS` (sin token de usuario), así que **no hay `actorId`** al que
|
|
263
267
|
* atribuirle la lectura — y esto exporta la nómina completa de una cadena en una sola llamada.
|
|
@@ -275,8 +279,22 @@ export interface IRetailOrgBusinessApi {
|
|
|
275
279
|
tenantId: string,
|
|
276
280
|
callerService: string,
|
|
277
281
|
status?: RetailUserStatusEnum,
|
|
282
|
+
includePhone?: boolean,
|
|
278
283
|
): Promise<StandardResponse<PrivateSellerListResponse>>;
|
|
279
284
|
|
|
285
|
+
/**
|
|
286
|
+
* `GET /private/retailers/{retailerId}/goals` — las metas del periodo (`YYYY-MM`) de una cadena,
|
|
287
|
+
* con `monthCents`/`weekCents`/`dayCents` ya derivadas. Sin metas devuelve `goals: []`, no 404.
|
|
288
|
+
*
|
|
289
|
+
* @throws `400 VALIDATION_ERROR` con un periodo o tipo inválido · `400 UNKNOWN_TENANT` sin tenant.
|
|
290
|
+
*/
|
|
291
|
+
listGoals(
|
|
292
|
+
retailerId: string,
|
|
293
|
+
tenantId: string,
|
|
294
|
+
periodId: string,
|
|
295
|
+
targetType?: GoalTargetTypeEnum,
|
|
296
|
+
): Promise<StandardResponse<PrivateGoalListResponse>>;
|
|
297
|
+
|
|
280
298
|
/** `POST /private/integration/store-events?tenantId=` — aplica un evento de tienda del retailer. */
|
|
281
299
|
privateApplyStoreEvent(request: ApplyStoreEventRequest): Promise<StandardResponse<ApplyStoreEventResponse>>;
|
|
282
300
|
|