@fiado/type-kit 3.591.0 → 3.593.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/_test_/unit/retailIntegration/reconciliationContracts.test.ts +18 -0
- package/bin/directory/dtos/AccountCreatedEventDetail.d.ts +16 -0
- package/bin/directory/dtos/AccountCreatedEventDetail.js +14 -0
- package/bin/directory/dtos/DirectoryUserScopeUpdateRequest.d.ts +5 -0
- package/bin/directory/dtos/DirectoryUserScopeUpdateRequest.js +34 -0
- package/bin/directory/index.d.ts +2 -0
- package/bin/directory/index.js +2 -0
- package/bin/retailIntegration/dtos/GetReconciliationResponses.d.ts +4 -0
- package/package.json +1 -1
- package/src/directory/dtos/AccountCreatedEventDetail.ts +21 -0
- package/src/directory/dtos/DirectoryUserScopeUpdateRequest.ts +19 -0
- package/src/directory/index.ts +2 -0
- package/src/retailIntegration/dtos/GetReconciliationResponses.ts +4 -0
|
@@ -134,6 +134,24 @@ describe('respuestas de la revisión', () => {
|
|
|
134
134
|
};
|
|
135
135
|
expect(movements.movementsTo).toBe('2026-10-25T00:00:00.000Z');
|
|
136
136
|
});
|
|
137
|
+
|
|
138
|
+
it('GetCatalogReconciliationResponse separa tiendas abortadas de las inexistentes', () => {
|
|
139
|
+
const inventory: GetCatalogReconciliationResponse = {
|
|
140
|
+
runId: 'run-i',
|
|
141
|
+
retailerId: 'r-1',
|
|
142
|
+
entity: ReconciliationEntityEnum.INVENTORY,
|
|
143
|
+
status: ReconciliationRunStatusEnum.COMPLETE,
|
|
144
|
+
trigger: ReconciliationTriggerEnum.MANUAL,
|
|
145
|
+
startedAt: '2026-10-25T10:00:00.000Z',
|
|
146
|
+
pagesProcessed: 3,
|
|
147
|
+
storesPending: 0,
|
|
148
|
+
storesAborted: 2,
|
|
149
|
+
storesNotFound: 1,
|
|
150
|
+
counts: { seen: 0, created: 0, updated: 0, deactivated: 0, reactivated: 0, skipped: 0 },
|
|
151
|
+
};
|
|
152
|
+
expect(inventory.storesAborted).toBe(2);
|
|
153
|
+
expect(inventory.storesNotFound).toBe(1);
|
|
154
|
+
});
|
|
137
155
|
});
|
|
138
156
|
|
|
139
157
|
describe('revisión con excludeExtraneousValues', () => {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CountryId } from "../../country/enums/CountryId";
|
|
2
|
+
export declare const DIRECTORY_EVENTS_SOURCE = "fiado.directory";
|
|
3
|
+
export declare enum DirectoryEventDetailTypeEnum {
|
|
4
|
+
/** Alta real del scope de un país (fiado.mx o fiado.us) en el directorio: la cuenta de ese lado quedó abierta. */
|
|
5
|
+
ACCOUNT_CREATED = "AccountCreated"
|
|
6
|
+
}
|
|
7
|
+
export declare class AccountCreatedEventDetail {
|
|
8
|
+
/** Fijo por directorio y país (`<countryId>#<directoryId>`): un reenvío llega con el mismo id y el consumidor lo descarta. */
|
|
9
|
+
eventId: string;
|
|
10
|
+
directoryId: string;
|
|
11
|
+
peopleId: string;
|
|
12
|
+
/** CountryId.MEX (484) o CountryId.USA (840). */
|
|
13
|
+
countryId: CountryId;
|
|
14
|
+
/** ISO 8601 del momento en que se guardó el scope. */
|
|
15
|
+
occurredAt: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AccountCreatedEventDetail = exports.DirectoryEventDetailTypeEnum = exports.DIRECTORY_EVENTS_SOURCE = void 0;
|
|
4
|
+
// Origen de los eventos de EventBridge que publica directory-business.
|
|
5
|
+
exports.DIRECTORY_EVENTS_SOURCE = "fiado.directory";
|
|
6
|
+
var DirectoryEventDetailTypeEnum;
|
|
7
|
+
(function (DirectoryEventDetailTypeEnum) {
|
|
8
|
+
/** Alta real del scope de un país (fiado.mx o fiado.us) en el directorio: la cuenta de ese lado quedó abierta. */
|
|
9
|
+
DirectoryEventDetailTypeEnum["ACCOUNT_CREATED"] = "AccountCreated";
|
|
10
|
+
})(DirectoryEventDetailTypeEnum || (exports.DirectoryEventDetailTypeEnum = DirectoryEventDetailTypeEnum = {}));
|
|
11
|
+
// `detail` del evento AccountCreated. Sale uno por país dado de alta.
|
|
12
|
+
class AccountCreatedEventDetail {
|
|
13
|
+
}
|
|
14
|
+
exports.AccountCreatedEventDetail = AccountCreatedEventDetail;
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DirectoryUserScopeUpdateRequest = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
// Body de POST /directories/users/scope (directory-business), sucesor de updateScope de fiado-directory-lambda.
|
|
15
|
+
// `scope` es el arreglo COMPLETO que queda guardado, no un delta. Se valida como string y no contra el enum
|
|
16
|
+
// Scope porque los llamadores reenvían el arreglo que ya tenía el directorio, como en v1.
|
|
17
|
+
class DirectoryUserScopeUpdateRequest {
|
|
18
|
+
}
|
|
19
|
+
exports.DirectoryUserScopeUpdateRequest = DirectoryUserScopeUpdateRequest;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, class_validator_1.IsString)(),
|
|
22
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], DirectoryUserScopeUpdateRequest.prototype, "directoryId", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_validator_1.IsArray)(),
|
|
27
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
28
|
+
__metadata("design:type", Array)
|
|
29
|
+
], DirectoryUserScopeUpdateRequest.prototype, "scope", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, class_validator_1.IsOptional)(),
|
|
32
|
+
(0, class_validator_1.IsString)(),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], DirectoryUserScopeUpdateRequest.prototype, "app", void 0);
|
package/bin/directory/index.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export * from './dtos/CreateDirectoryUserEventResponse';
|
|
|
8
8
|
export * from './dtos/DeleteByDirectoryResponse';
|
|
9
9
|
export * from './dtos/DirectoryAgentsBySponsorRequest';
|
|
10
10
|
export * from './dtos/DirectoryAgentsBySponsorResponse';
|
|
11
|
+
export * from './dtos/DirectoryUserScopeUpdateRequest';
|
|
12
|
+
export * from './dtos/AccountCreatedEventDetail';
|
|
11
13
|
export * from './dtos/External';
|
|
12
14
|
export * from './enums/TypeOfDirectoryId';
|
|
13
15
|
export * from './enums/DirectoryBackofficeStatusEnum';
|
package/bin/directory/index.js
CHANGED
|
@@ -25,6 +25,8 @@ __exportStar(require("./dtos/CreateDirectoryUserEventResponse"), exports);
|
|
|
25
25
|
__exportStar(require("./dtos/DeleteByDirectoryResponse"), exports);
|
|
26
26
|
__exportStar(require("./dtos/DirectoryAgentsBySponsorRequest"), exports);
|
|
27
27
|
__exportStar(require("./dtos/DirectoryAgentsBySponsorResponse"), exports);
|
|
28
|
+
__exportStar(require("./dtos/DirectoryUserScopeUpdateRequest"), exports);
|
|
29
|
+
__exportStar(require("./dtos/AccountCreatedEventDetail"), exports);
|
|
28
30
|
__exportStar(require("./dtos/External"), exports);
|
|
29
31
|
//enums
|
|
30
32
|
__exportStar(require("./enums/TypeOfDirectoryId"), exports);
|
|
@@ -31,6 +31,10 @@ export interface GetCatalogReconciliationResponse {
|
|
|
31
31
|
storeId?: string;
|
|
32
32
|
/** Tiendas de inventario que faltan por cerrar. */
|
|
33
33
|
storesPending?: number;
|
|
34
|
+
/** Tiendas de inventario cerradas como ABORTED (reintentos agotados, renglón sin id, etc.). */
|
|
35
|
+
storesAborted?: number;
|
|
36
|
+
/** Tiendas cerradas porque no existen en el retailer (404 STORE_NOT_FOUND); no cuentan en storesAborted. */
|
|
37
|
+
storesNotFound?: number;
|
|
34
38
|
/** Inicio ISO de la ventana revisada en movimientos. */
|
|
35
39
|
movementsFrom?: string;
|
|
36
40
|
/** Fin ISO de la ventana revisada en movimientos. */
|
package/package.json
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CountryId } from "../../country/enums/CountryId";
|
|
2
|
+
|
|
3
|
+
// Origen de los eventos de EventBridge que publica directory-business.
|
|
4
|
+
export const DIRECTORY_EVENTS_SOURCE = "fiado.directory";
|
|
5
|
+
|
|
6
|
+
export enum DirectoryEventDetailTypeEnum {
|
|
7
|
+
/** Alta real del scope de un país (fiado.mx o fiado.us) en el directorio: la cuenta de ese lado quedó abierta. */
|
|
8
|
+
ACCOUNT_CREATED = "AccountCreated",
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// `detail` del evento AccountCreated. Sale uno por país dado de alta.
|
|
12
|
+
export class AccountCreatedEventDetail {
|
|
13
|
+
/** Fijo por directorio y país (`<countryId>#<directoryId>`): un reenvío llega con el mismo id y el consumidor lo descarta. */
|
|
14
|
+
eventId!: string;
|
|
15
|
+
directoryId!: string;
|
|
16
|
+
peopleId!: string;
|
|
17
|
+
/** CountryId.MEX (484) o CountryId.USA (840). */
|
|
18
|
+
countryId!: CountryId;
|
|
19
|
+
/** ISO 8601 del momento en que se guardó el scope. */
|
|
20
|
+
occurredAt!: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IsArray, IsNotEmpty, IsOptional, IsString } from "class-validator";
|
|
2
|
+
|
|
3
|
+
// Body de POST /directories/users/scope (directory-business), sucesor de updateScope de fiado-directory-lambda.
|
|
4
|
+
// `scope` es el arreglo COMPLETO que queda guardado, no un delta. Se valida como string y no contra el enum
|
|
5
|
+
// Scope porque los llamadores reenvían el arreglo que ya tenía el directorio, como en v1.
|
|
6
|
+
export class DirectoryUserScopeUpdateRequest {
|
|
7
|
+
@IsString()
|
|
8
|
+
@IsNotEmpty()
|
|
9
|
+
directoryId!: string;
|
|
10
|
+
|
|
11
|
+
@IsArray()
|
|
12
|
+
@IsString({ each: true })
|
|
13
|
+
scope!: string[];
|
|
14
|
+
|
|
15
|
+
// App de origen tomada del token por quien llama; decide si se puede pedir el lado americano.
|
|
16
|
+
@IsOptional()
|
|
17
|
+
@IsString()
|
|
18
|
+
app?: string | null;
|
|
19
|
+
}
|
package/src/directory/index.ts
CHANGED
|
@@ -10,6 +10,8 @@ export * from './dtos/CreateDirectoryUserEventResponse';
|
|
|
10
10
|
export * from './dtos/DeleteByDirectoryResponse';
|
|
11
11
|
export * from './dtos/DirectoryAgentsBySponsorRequest';
|
|
12
12
|
export * from './dtos/DirectoryAgentsBySponsorResponse';
|
|
13
|
+
export * from './dtos/DirectoryUserScopeUpdateRequest';
|
|
14
|
+
export * from './dtos/AccountCreatedEventDetail';
|
|
13
15
|
|
|
14
16
|
export * from './dtos/External';
|
|
15
17
|
|
|
@@ -33,6 +33,10 @@ export interface GetCatalogReconciliationResponse {
|
|
|
33
33
|
storeId?: string;
|
|
34
34
|
/** Tiendas de inventario que faltan por cerrar. */
|
|
35
35
|
storesPending?: number;
|
|
36
|
+
/** Tiendas de inventario cerradas como ABORTED (reintentos agotados, renglón sin id, etc.). */
|
|
37
|
+
storesAborted?: number;
|
|
38
|
+
/** Tiendas cerradas porque no existen en el retailer (404 STORE_NOT_FOUND); no cuentan en storesAborted. */
|
|
39
|
+
storesNotFound?: number;
|
|
36
40
|
/** Inicio ISO de la ventana revisada en movimientos. */
|
|
37
41
|
movementsFrom?: string;
|
|
38
42
|
/** Fin ISO de la ventana revisada en movimientos. */
|