@fiado/type-kit 3.598.0 → 3.600.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/remittance/RemittanceProviderCost.test.ts +13 -0
- package/_test_/unit/retailIntegration/reconciliationPreviewContracts.test.ts +94 -0
- package/bin/remittance/dtos/RemittancePayerConfig.d.ts +6 -0
- package/bin/remittance/dtos/RemittancePayerConfig.js +8 -0
- package/bin/retailIntegration/dtos/GetReconciliationResponses.d.ts +9 -0
- package/bin/retailIntegration/dtos/ReconciliationPreview.d.ts +21 -0
- package/bin/retailIntegration/dtos/ReconciliationPreview.js +5 -0
- package/bin/retailIntegration/dtos/RetailEventResult.d.ts +12 -0
- package/bin/retailIntegration/dtos/StartCatalogReconciliationRequest.d.ts +2 -0
- package/bin/retailIntegration/dtos/StartCatalogReconciliationRequest.js +6 -0
- package/bin/retailIntegration/dtos/StartOrgReconciliationRequest.d.ts +2 -0
- package/bin/retailIntegration/dtos/StartOrgReconciliationRequest.js +6 -0
- package/bin/retailIntegration/index.d.ts +1 -0
- package/bin/retailIntegration/index.js +1 -0
- package/package.json +1 -1
- package/src/remittance/dtos/RemittancePayerConfig.ts +12 -1
- package/src/retailIntegration/dtos/GetReconciliationResponses.ts +9 -0
- package/src/retailIntegration/dtos/ReconciliationPreview.ts +23 -0
- package/src/retailIntegration/dtos/RetailEventResult.ts +13 -0
- package/src/retailIntegration/dtos/StartCatalogReconciliationRequest.ts +7 -1
- package/src/retailIntegration/dtos/StartOrgReconciliationRequest.ts +7 -1
- package/src/retailIntegration/index.ts +1 -0
|
@@ -4,6 +4,7 @@ import { validateSync } from "class-validator";
|
|
|
4
4
|
import { ProviderCostUpdateRequest } from "../../../src/remittance/dtos/RemittanceProviderCost";
|
|
5
5
|
import { SimulatePricingRequest, UpdatePricingRequest } from "../../../src/remittance/dtos/RemittancePricing";
|
|
6
6
|
import { PricingResolveRequest } from "../../../src/remittance/dtos/internal/RemittancePricingResolve";
|
|
7
|
+
import { RemittancePayerConfigUpdateRequest } from "../../../src/remittance/dtos/RemittancePayerConfig";
|
|
7
8
|
|
|
8
9
|
const errorsOf = <T extends object>(cls: new () => T, plain: object) =>
|
|
9
10
|
validateSync(plainToInstance(cls, plain), { whitelist: true, forbidNonWhitelisted: true });
|
|
@@ -76,3 +77,15 @@ describe("PricingResolveRequest", () => {
|
|
|
76
77
|
})).not.toHaveLength(0);
|
|
77
78
|
});
|
|
78
79
|
});
|
|
80
|
+
|
|
81
|
+
describe("RemittancePayerConfigUpdateRequest.disabledMethods", () => {
|
|
82
|
+
it("acepta métodos válidos y lista vacía", () => {
|
|
83
|
+
expect(errorsOf(RemittancePayerConfigUpdateRequest, { disabledMethods: ["CASH_PICKUP"] })).toHaveLength(0);
|
|
84
|
+
expect(errorsOf(RemittancePayerConfigUpdateRequest, { disabledMethods: [] })).toHaveLength(0);
|
|
85
|
+
expect(errorsOf(RemittancePayerConfigUpdateRequest, { enabled: true })).toHaveLength(0);
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it("rechaza un método que no existe", () => {
|
|
89
|
+
expect(errorsOf(RemittancePayerConfigUpdateRequest, { disabledMethods: ["CARRIER_PIGEON"] })).not.toHaveLength(0);
|
|
90
|
+
});
|
|
91
|
+
});
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { plainToInstance, type ClassConstructor } from 'class-transformer';
|
|
3
|
+
import { validateSync } from 'class-validator';
|
|
4
|
+
import {
|
|
5
|
+
type GetCatalogReconciliationResponse,
|
|
6
|
+
type GetOrgReconciliationResponse,
|
|
7
|
+
RECONCILIATION_PREVIEW_MAX_ITEMS,
|
|
8
|
+
type ReconciliationPreview,
|
|
9
|
+
ReconciliationEntityEnum,
|
|
10
|
+
ReconciliationRunStatusEnum,
|
|
11
|
+
ReconciliationTriggerEnum,
|
|
12
|
+
RetailEventRejectCodeEnum,
|
|
13
|
+
type RetailEventResult,
|
|
14
|
+
RetailEventResultEnum,
|
|
15
|
+
StartCatalogReconciliationRequest,
|
|
16
|
+
StartOrgReconciliationRequest,
|
|
17
|
+
} from '../../../src/retailIntegration';
|
|
18
|
+
|
|
19
|
+
function propsWithErrors<T extends object>(cls: ClassConstructor<T>, payload: object): string[] {
|
|
20
|
+
return validateSync(plainToInstance(cls, payload)).map((e) => e.property);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function exposed<T extends object>(cls: ClassConstructor<T>, payload: object): T {
|
|
24
|
+
return plainToInstance(cls, payload, { excludeExtraneousValues: true });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
describe.each([
|
|
28
|
+
['StartOrgReconciliationRequest', StartOrgReconciliationRequest as ClassConstructor<object>, 'STORES'],
|
|
29
|
+
['StartCatalogReconciliationRequest', StartCatalogReconciliationRequest as ClassConstructor<object>, 'CATALOG'],
|
|
30
|
+
] as const)('%s.dryRun', (_name, cls, entity) => {
|
|
31
|
+
it('es opcional', () => {
|
|
32
|
+
expect(propsWithErrors(cls, { entity })).toEqual([]);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it.each([true, false])('acepta %p', (dryRun) => {
|
|
36
|
+
expect(propsWithErrors(cls, { entity, dryRun })).toEqual([]);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it.each(['true', 1, 'yes'])('rechaza %p', (dryRun) => {
|
|
40
|
+
expect(propsWithErrors(cls, { entity, dryRun })).toContain('dryRun');
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('sobrevive a excludeExtraneousValues', () => {
|
|
44
|
+
expect({ ...exposed(cls, { entity, dryRun: true }) }).toMatchObject({ entity, dryRun: true });
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
describe('vista previa de la revisión', () => {
|
|
49
|
+
const counts = { seen: 3, created: 1, updated: 1, deactivated: 1, reactivated: 0, skipped: 0 };
|
|
50
|
+
const preview: ReconciliationPreview = {
|
|
51
|
+
created: [{ id: 's-1', label: 'Tienda Centro' }],
|
|
52
|
+
updated: [{ id: 'SKU-1', label: 'Equipo X', fields: ['price'] }],
|
|
53
|
+
deactivated: [{ id: '356938035643809', storeId: 's-1' }],
|
|
54
|
+
reactivated: [],
|
|
55
|
+
truncated: false,
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
it('el tope por lista es 200', () => {
|
|
59
|
+
expect(RECONCILIATION_PREVIEW_MAX_ITEMS).toBe(200);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('las respuestas del GET llevan dryRun y preview', () => {
|
|
63
|
+
const org: GetOrgReconciliationResponse = {
|
|
64
|
+
runId: 'run-1',
|
|
65
|
+
retailerId: 'r-1',
|
|
66
|
+
entity: ReconciliationEntityEnum.STORES,
|
|
67
|
+
status: ReconciliationRunStatusEnum.COMPLETE,
|
|
68
|
+
trigger: ReconciliationTriggerEnum.MANUAL,
|
|
69
|
+
startedAt: '2026-10-27T10:00:00.000Z',
|
|
70
|
+
pagesProcessed: 1,
|
|
71
|
+
counts,
|
|
72
|
+
dryRun: true,
|
|
73
|
+
preview,
|
|
74
|
+
};
|
|
75
|
+
const catalog: GetCatalogReconciliationResponse = { ...org, entity: ReconciliationEntityEnum.INVENTORY };
|
|
76
|
+
expect(org.preview?.updated[0].fields).toEqual(['price']);
|
|
77
|
+
expect(catalog.dryRun).toBe(true);
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
describe('RetailEventResult.errors', () => {
|
|
82
|
+
it('lista todos los renglones malos de un REJECTED', () => {
|
|
83
|
+
const result: RetailEventResult = {
|
|
84
|
+
eventId: 'e-1',
|
|
85
|
+
result: RetailEventResultEnum.REJECTED,
|
|
86
|
+
code: RetailEventRejectCodeEnum.INVALID_IMEI,
|
|
87
|
+
errors: [
|
|
88
|
+
{ index: 0, kind: 'piece', identifier: '123', sku: 'SKU-1', storeId: 's-1', code: RetailEventRejectCodeEnum.INVALID_IMEI },
|
|
89
|
+
{ index: 2, kind: 'stock', sku: 'SKU-2', code: RetailEventRejectCodeEnum.SKU_NOT_STOCKABLE },
|
|
90
|
+
],
|
|
91
|
+
};
|
|
92
|
+
expect(result.errors?.map((e) => e.index)).toEqual([0, 2]);
|
|
93
|
+
});
|
|
94
|
+
});
|
|
@@ -21,6 +21,8 @@ export declare class RemittancePayerConfigItem {
|
|
|
21
21
|
logoUrl?: string;
|
|
22
22
|
/** Grupo de costo UniTeller de cada método (solo lectura aquí; se edita en Costos UniTeller). */
|
|
23
23
|
costGroupByMethod?: CostGroupByMethod;
|
|
24
|
+
/** Métodos apagados por Ops; ausente o vacío = todos prendidos. */
|
|
25
|
+
disabledMethods?: ReceptionMethod[];
|
|
24
26
|
}
|
|
25
27
|
/** Response de GET /backoffice/config/payers (config chica, sin paginación). */
|
|
26
28
|
export declare class RemittancePayerConfigListResponse {
|
|
@@ -30,6 +32,8 @@ export declare class RemittancePayerConfigListResponse {
|
|
|
30
32
|
export declare class RemittancePayerConfigUpdateRequest {
|
|
31
33
|
enabled?: boolean;
|
|
32
34
|
name?: string | null;
|
|
35
|
+
/** Métodos a apagar; reemplaza la lista guardada. [] = todos prendidos. */
|
|
36
|
+
disabledMethods?: ReceptionMethod[];
|
|
33
37
|
}
|
|
34
38
|
/** Fila cruda de config (endpoint privado → connector, que la mergea al servir el catálogo). */
|
|
35
39
|
export declare class RemittancePayerConfigEntry {
|
|
@@ -37,5 +41,7 @@ export declare class RemittancePayerConfigEntry {
|
|
|
37
41
|
countryISO: string;
|
|
38
42
|
enabled: boolean;
|
|
39
43
|
name?: string;
|
|
44
|
+
/** Métodos apagados por Ops; ausente o vacío = todos prendidos. */
|
|
45
|
+
disabledMethods?: ReceptionMethod[];
|
|
40
46
|
updatedAt: string;
|
|
41
47
|
}
|
|
@@ -11,6 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.RemittancePayerConfigEntry = exports.RemittancePayerConfigUpdateRequest = exports.RemittancePayerConfigListResponse = exports.RemittancePayerConfigItem = void 0;
|
|
13
13
|
const class_validator_1 = require("class-validator");
|
|
14
|
+
const ReceptionMethod_1 = require("../enums/ReceptionMethod");
|
|
14
15
|
/**
|
|
15
16
|
* DTOs de la administración de payers desde el backoffice (v1: enabled + override de nombre).
|
|
16
17
|
* La lista de payers la dicta el catálogo UniTeller; la config es un overlay por payerCode.
|
|
@@ -39,6 +40,13 @@ __decorate([
|
|
|
39
40
|
(0, class_validator_1.Length)(1, 60),
|
|
40
41
|
__metadata("design:type", String)
|
|
41
42
|
], RemittancePayerConfigUpdateRequest.prototype, "name", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, class_validator_1.IsOptional)(),
|
|
45
|
+
(0, class_validator_1.IsArray)(),
|
|
46
|
+
(0, class_validator_1.ArrayMaxSize)(3),
|
|
47
|
+
(0, class_validator_1.IsEnum)(ReceptionMethod_1.ReceptionMethod, { each: true }),
|
|
48
|
+
__metadata("design:type", Array)
|
|
49
|
+
], RemittancePayerConfigUpdateRequest.prototype, "disabledMethods", void 0);
|
|
42
50
|
/** Fila cruda de config (endpoint privado → connector, que la mergea al servir el catálogo). */
|
|
43
51
|
class RemittancePayerConfigEntry {
|
|
44
52
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ReconciliationEntityEnum } from '../enums/ReconciliationEntityEnum';
|
|
2
2
|
import type { ReconciliationRunStatusEnum } from '../enums/ReconciliationRunStatusEnum';
|
|
3
3
|
import type { ReconciliationTriggerEnum } from '../enums/ReconciliationTriggerEnum';
|
|
4
|
+
import type { ReconciliationPreview } from './ReconciliationPreview';
|
|
4
5
|
import type { ReconciliationRunCounts } from './ReconciliationRunCounts';
|
|
5
6
|
/** Respuesta 200 de GET .../reconciliations/{runId} en org (backofficeGetOrgReconciliation). */
|
|
6
7
|
export interface GetOrgReconciliationResponse {
|
|
@@ -15,6 +16,10 @@ export interface GetOrgReconciliationResponse {
|
|
|
15
16
|
finishedAt?: string;
|
|
16
17
|
pagesProcessed: number;
|
|
17
18
|
counts: ReconciliationRunCounts;
|
|
19
|
+
/** La corrida fue en modo prueba y no escribió nada. */
|
|
20
|
+
dryRun?: boolean;
|
|
21
|
+
/** Vista previa de una corrida en modo prueba. */
|
|
22
|
+
preview?: ReconciliationPreview;
|
|
18
23
|
}
|
|
19
24
|
/** Respuesta 200 de GET .../reconciliations/{runId} en catalog (backofficeGetCatalogReconciliation). */
|
|
20
25
|
export interface GetCatalogReconciliationResponse {
|
|
@@ -40,4 +45,8 @@ export interface GetCatalogReconciliationResponse {
|
|
|
40
45
|
/** Fin ISO de la ventana revisada en movimientos. */
|
|
41
46
|
movementsTo?: string;
|
|
42
47
|
counts: ReconciliationRunCounts;
|
|
48
|
+
/** La corrida fue en modo prueba y no escribió nada. */
|
|
49
|
+
dryRun?: boolean;
|
|
50
|
+
/** Vista previa de una corrida en modo prueba. */
|
|
51
|
+
preview?: ReconciliationPreview;
|
|
43
52
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Tope de renglones por lista de la vista previa; si se pasa, `truncated` es true. */
|
|
2
|
+
export declare const RECONCILIATION_PREVIEW_MAX_ITEMS = 200;
|
|
3
|
+
/** Renglón de la vista previa: `id` es storeId, retailUserId, sku o identifier según la entidad. */
|
|
4
|
+
export interface ReconciliationPreviewItem {
|
|
5
|
+
id: string;
|
|
6
|
+
/** Nombre legible para mostrar en el backoffice. */
|
|
7
|
+
label?: string;
|
|
8
|
+
/** Campos que cambiarían, solo en `updated`. */
|
|
9
|
+
fields?: string[];
|
|
10
|
+
/** Tienda de la pieza en inventario. */
|
|
11
|
+
storeId?: string;
|
|
12
|
+
}
|
|
13
|
+
/** Lo que haría una corrida en modo prueba (`dryRun`), sin escribir nada. */
|
|
14
|
+
export interface ReconciliationPreview {
|
|
15
|
+
created: ReconciliationPreviewItem[];
|
|
16
|
+
updated: ReconciliationPreviewItem[];
|
|
17
|
+
deactivated: ReconciliationPreviewItem[];
|
|
18
|
+
reactivated: ReconciliationPreviewItem[];
|
|
19
|
+
/** Alguna lista se cortó en RECONCILIATION_PREVIEW_MAX_ITEMS. */
|
|
20
|
+
truncated: boolean;
|
|
21
|
+
}
|
|
@@ -1,9 +1,21 @@
|
|
|
1
|
+
import type { RetailEventRejectCodeEnum } from '../enums/RetailEventRejectCodeEnum';
|
|
1
2
|
import { RetailEventResultEnum } from '../enums/RetailEventResultEnum';
|
|
3
|
+
/** Renglón inválido de un evento de inventario; `index` es 0-based en `pieces` o en `stock` según `kind`. */
|
|
4
|
+
export interface RetailEventItemError {
|
|
5
|
+
index: number;
|
|
6
|
+
kind?: 'piece' | 'stock';
|
|
7
|
+
identifier?: string;
|
|
8
|
+
sku?: string;
|
|
9
|
+
storeId?: string;
|
|
10
|
+
code: RetailEventRejectCodeEnum;
|
|
11
|
+
}
|
|
2
12
|
/** Resultado de un evento; `code` explica un `REJECTED` y es `null` en los demás. */
|
|
3
13
|
export interface RetailEventResult {
|
|
4
14
|
eventId: string;
|
|
5
15
|
result: RetailEventResultEnum;
|
|
6
16
|
code: string | null;
|
|
17
|
+
/** Todos los renglones inválidos de un `REJECTED` de inventario, no solo el primero. */
|
|
18
|
+
errors?: RetailEventItemError[];
|
|
7
19
|
}
|
|
8
20
|
export type ReceiveStoreEventResponse = RetailEventResult;
|
|
9
21
|
export type ReceiveRetailUserEventResponse = RetailEventResult;
|
|
@@ -4,6 +4,8 @@ export declare class StartCatalogReconciliationRequest {
|
|
|
4
4
|
entity: ReconciliationEntityEnum.CATALOG | ReconciliationEntityEnum.INVENTORY;
|
|
5
5
|
/** Tienda a revisar en inventario; sin ella se revisan todas las del padrón. */
|
|
6
6
|
storeId?: string;
|
|
7
|
+
/** Modo prueba: calcula la vista previa sin escribir nada. */
|
|
8
|
+
dryRun?: boolean;
|
|
7
9
|
}
|
|
8
10
|
/** Respuesta 202 del arranque en catalog. */
|
|
9
11
|
export interface StartCatalogReconciliationResponse {
|
|
@@ -29,3 +29,9 @@ __decorate([
|
|
|
29
29
|
(0, class_validator_1.IsNotEmpty)(),
|
|
30
30
|
__metadata("design:type", String)
|
|
31
31
|
], StartCatalogReconciliationRequest.prototype, "storeId", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, class_transformer_1.Expose)(),
|
|
34
|
+
(0, class_validator_1.IsOptional)(),
|
|
35
|
+
(0, class_validator_1.IsBoolean)(),
|
|
36
|
+
__metadata("design:type", Boolean)
|
|
37
|
+
], StartCatalogReconciliationRequest.prototype, "dryRun", void 0);
|
|
@@ -2,6 +2,8 @@ import { ReconciliationEntityEnum } from '../enums/ReconciliationEntityEnum';
|
|
|
2
2
|
/** Body de POST /backoffice/retailers/{retailerId}/reconciliations en org (backofficeStartOrgReconciliation). */
|
|
3
3
|
export declare class StartOrgReconciliationRequest {
|
|
4
4
|
entity: ReconciliationEntityEnum.STORES | ReconciliationEntityEnum.USERS;
|
|
5
|
+
/** Modo prueba: calcula la vista previa sin escribir nada. */
|
|
6
|
+
dryRun?: boolean;
|
|
5
7
|
}
|
|
6
8
|
/** Respuesta 202 del arranque en org. */
|
|
7
9
|
export interface StartOrgReconciliationResponse {
|
|
@@ -22,3 +22,9 @@ __decorate([
|
|
|
22
22
|
(0, class_validator_1.IsIn)([ReconciliationEntityEnum_1.ReconciliationEntityEnum.STORES, ReconciliationEntityEnum_1.ReconciliationEntityEnum.USERS]),
|
|
23
23
|
__metadata("design:type", String)
|
|
24
24
|
], StartOrgReconciliationRequest.prototype, "entity", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_transformer_1.Expose)(),
|
|
27
|
+
(0, class_validator_1.IsOptional)(),
|
|
28
|
+
(0, class_validator_1.IsBoolean)(),
|
|
29
|
+
__metadata("design:type", Boolean)
|
|
30
|
+
], StartOrgReconciliationRequest.prototype, "dryRun", void 0);
|
|
@@ -38,5 +38,6 @@ export * from './models/RetailSystemSale';
|
|
|
38
38
|
export * from './dtos/StartOrgReconciliationRequest';
|
|
39
39
|
export * from './dtos/StartCatalogReconciliationRequest';
|
|
40
40
|
export * from './dtos/ReconciliationRunCounts';
|
|
41
|
+
export * from './dtos/ReconciliationPreview';
|
|
41
42
|
export * from './dtos/GetReconciliationResponses';
|
|
42
43
|
export * from './dtos/ReconciliationPageMessage';
|
|
@@ -54,5 +54,6 @@ __exportStar(require("./models/RetailSystemSale"), exports);
|
|
|
54
54
|
__exportStar(require("./dtos/StartOrgReconciliationRequest"), exports);
|
|
55
55
|
__exportStar(require("./dtos/StartCatalogReconciliationRequest"), exports);
|
|
56
56
|
__exportStar(require("./dtos/ReconciliationRunCounts"), exports);
|
|
57
|
+
__exportStar(require("./dtos/ReconciliationPreview"), exports);
|
|
57
58
|
__exportStar(require("./dtos/GetReconciliationResponses"), exports);
|
|
58
59
|
__exportStar(require("./dtos/ReconciliationPageMessage"), exports);
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IsBoolean, IsOptional, IsString, Length } from "class-validator";
|
|
1
|
+
import { ArrayMaxSize, IsArray, IsBoolean, IsEnum, IsOptional, IsString, Length } from "class-validator";
|
|
2
2
|
import { ReceptionMethod } from "../enums/ReceptionMethod";
|
|
3
3
|
import { CostGroupByMethod } from "./RemittanceProviderCost";
|
|
4
4
|
|
|
@@ -24,6 +24,8 @@ export class RemittancePayerConfigItem {
|
|
|
24
24
|
logoUrl?: string;
|
|
25
25
|
/** Grupo de costo UniTeller de cada método (solo lectura aquí; se edita en Costos UniTeller). */
|
|
26
26
|
costGroupByMethod?: CostGroupByMethod;
|
|
27
|
+
/** Métodos apagados por Ops; ausente o vacío = todos prendidos. */
|
|
28
|
+
disabledMethods?: ReceptionMethod[];
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
/** Response de GET /backoffice/config/payers (config chica, sin paginación). */
|
|
@@ -41,6 +43,13 @@ export class RemittancePayerConfigUpdateRequest {
|
|
|
41
43
|
@IsString()
|
|
42
44
|
@Length(1, 60)
|
|
43
45
|
name?: string | null;
|
|
46
|
+
|
|
47
|
+
/** Métodos a apagar; reemplaza la lista guardada. [] = todos prendidos. */
|
|
48
|
+
@IsOptional()
|
|
49
|
+
@IsArray()
|
|
50
|
+
@ArrayMaxSize(3)
|
|
51
|
+
@IsEnum(ReceptionMethod, { each: true })
|
|
52
|
+
disabledMethods?: ReceptionMethod[];
|
|
44
53
|
}
|
|
45
54
|
|
|
46
55
|
/** Fila cruda de config (endpoint privado → connector, que la mergea al servir el catálogo). */
|
|
@@ -49,5 +58,7 @@ export class RemittancePayerConfigEntry {
|
|
|
49
58
|
countryISO!: string;
|
|
50
59
|
enabled!: boolean;
|
|
51
60
|
name?: string;
|
|
61
|
+
/** Métodos apagados por Ops; ausente o vacío = todos prendidos. */
|
|
62
|
+
disabledMethods?: ReceptionMethod[];
|
|
52
63
|
updatedAt!: string;
|
|
53
64
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ReconciliationEntityEnum } from '../enums/ReconciliationEntityEnum';
|
|
2
2
|
import type { ReconciliationRunStatusEnum } from '../enums/ReconciliationRunStatusEnum';
|
|
3
3
|
import type { ReconciliationTriggerEnum } from '../enums/ReconciliationTriggerEnum';
|
|
4
|
+
import type { ReconciliationPreview } from './ReconciliationPreview';
|
|
4
5
|
import type { ReconciliationRunCounts } from './ReconciliationRunCounts';
|
|
5
6
|
|
|
6
7
|
/** Respuesta 200 de GET .../reconciliations/{runId} en org (backofficeGetOrgReconciliation). */
|
|
@@ -16,6 +17,10 @@ export interface GetOrgReconciliationResponse {
|
|
|
16
17
|
finishedAt?: string;
|
|
17
18
|
pagesProcessed: number;
|
|
18
19
|
counts: ReconciliationRunCounts;
|
|
20
|
+
/** La corrida fue en modo prueba y no escribió nada. */
|
|
21
|
+
dryRun?: boolean;
|
|
22
|
+
/** Vista previa de una corrida en modo prueba. */
|
|
23
|
+
preview?: ReconciliationPreview;
|
|
19
24
|
}
|
|
20
25
|
|
|
21
26
|
/** Respuesta 200 de GET .../reconciliations/{runId} en catalog (backofficeGetCatalogReconciliation). */
|
|
@@ -42,4 +47,8 @@ export interface GetCatalogReconciliationResponse {
|
|
|
42
47
|
/** Fin ISO de la ventana revisada en movimientos. */
|
|
43
48
|
movementsTo?: string;
|
|
44
49
|
counts: ReconciliationRunCounts;
|
|
50
|
+
/** La corrida fue en modo prueba y no escribió nada. */
|
|
51
|
+
dryRun?: boolean;
|
|
52
|
+
/** Vista previa de una corrida en modo prueba. */
|
|
53
|
+
preview?: ReconciliationPreview;
|
|
45
54
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** Tope de renglones por lista de la vista previa; si se pasa, `truncated` es true. */
|
|
2
|
+
export const RECONCILIATION_PREVIEW_MAX_ITEMS = 200;
|
|
3
|
+
|
|
4
|
+
/** Renglón de la vista previa: `id` es storeId, retailUserId, sku o identifier según la entidad. */
|
|
5
|
+
export interface ReconciliationPreviewItem {
|
|
6
|
+
id: string;
|
|
7
|
+
/** Nombre legible para mostrar en el backoffice. */
|
|
8
|
+
label?: string;
|
|
9
|
+
/** Campos que cambiarían, solo en `updated`. */
|
|
10
|
+
fields?: string[];
|
|
11
|
+
/** Tienda de la pieza en inventario. */
|
|
12
|
+
storeId?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** Lo que haría una corrida en modo prueba (`dryRun`), sin escribir nada. */
|
|
16
|
+
export interface ReconciliationPreview {
|
|
17
|
+
created: ReconciliationPreviewItem[];
|
|
18
|
+
updated: ReconciliationPreviewItem[];
|
|
19
|
+
deactivated: ReconciliationPreviewItem[];
|
|
20
|
+
reactivated: ReconciliationPreviewItem[];
|
|
21
|
+
/** Alguna lista se cortó en RECONCILIATION_PREVIEW_MAX_ITEMS. */
|
|
22
|
+
truncated: boolean;
|
|
23
|
+
}
|
|
@@ -1,10 +1,23 @@
|
|
|
1
|
+
import type { RetailEventRejectCodeEnum } from '../enums/RetailEventRejectCodeEnum';
|
|
1
2
|
import { RetailEventResultEnum } from '../enums/RetailEventResultEnum';
|
|
2
3
|
|
|
4
|
+
/** Renglón inválido de un evento de inventario; `index` es 0-based en `pieces` o en `stock` según `kind`. */
|
|
5
|
+
export interface RetailEventItemError {
|
|
6
|
+
index: number;
|
|
7
|
+
kind?: 'piece' | 'stock';
|
|
8
|
+
identifier?: string;
|
|
9
|
+
sku?: string;
|
|
10
|
+
storeId?: string;
|
|
11
|
+
code: RetailEventRejectCodeEnum;
|
|
12
|
+
}
|
|
13
|
+
|
|
3
14
|
/** Resultado de un evento; `code` explica un `REJECTED` y es `null` en los demás. */
|
|
4
15
|
export interface RetailEventResult {
|
|
5
16
|
eventId: string;
|
|
6
17
|
result: RetailEventResultEnum;
|
|
7
18
|
code: string | null;
|
|
19
|
+
/** Todos los renglones inválidos de un `REJECTED` de inventario, no solo el primero. */
|
|
20
|
+
errors?: RetailEventItemError[];
|
|
8
21
|
}
|
|
9
22
|
|
|
10
23
|
export type ReceiveStoreEventResponse = RetailEventResult;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Expose } from 'class-transformer';
|
|
2
|
-
import { IsIn, IsNotEmpty, IsOptional, IsString } from 'class-validator';
|
|
2
|
+
import { IsBoolean, IsIn, IsNotEmpty, IsOptional, IsString } from 'class-validator';
|
|
3
3
|
import { ReconciliationEntityEnum } from '../enums/ReconciliationEntityEnum';
|
|
4
4
|
|
|
5
5
|
/** Body de POST /backoffice/retailers/{retailerId}/reconciliations en catalog (backofficeStartCatalogReconciliation). */
|
|
@@ -14,6 +14,12 @@ export class StartCatalogReconciliationRequest {
|
|
|
14
14
|
@IsString()
|
|
15
15
|
@IsNotEmpty()
|
|
16
16
|
storeId?: string;
|
|
17
|
+
|
|
18
|
+
/** Modo prueba: calcula la vista previa sin escribir nada. */
|
|
19
|
+
@Expose()
|
|
20
|
+
@IsOptional()
|
|
21
|
+
@IsBoolean()
|
|
22
|
+
dryRun?: boolean;
|
|
17
23
|
}
|
|
18
24
|
|
|
19
25
|
/** Respuesta 202 del arranque en catalog. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Expose } from 'class-transformer';
|
|
2
|
-
import { IsIn } from 'class-validator';
|
|
2
|
+
import { IsBoolean, IsIn, IsOptional } from 'class-validator';
|
|
3
3
|
import { ReconciliationEntityEnum } from '../enums/ReconciliationEntityEnum';
|
|
4
4
|
|
|
5
5
|
/** Body de POST /backoffice/retailers/{retailerId}/reconciliations en org (backofficeStartOrgReconciliation). */
|
|
@@ -7,6 +7,12 @@ export class StartOrgReconciliationRequest {
|
|
|
7
7
|
@Expose()
|
|
8
8
|
@IsIn([ReconciliationEntityEnum.STORES, ReconciliationEntityEnum.USERS])
|
|
9
9
|
entity!: ReconciliationEntityEnum.STORES | ReconciliationEntityEnum.USERS;
|
|
10
|
+
|
|
11
|
+
/** Modo prueba: calcula la vista previa sin escribir nada. */
|
|
12
|
+
@Expose()
|
|
13
|
+
@IsOptional()
|
|
14
|
+
@IsBoolean()
|
|
15
|
+
dryRun?: boolean;
|
|
10
16
|
}
|
|
11
17
|
|
|
12
18
|
/** Respuesta 202 del arranque en org. */
|
|
@@ -38,5 +38,6 @@ export * from './models/RetailSystemSale';
|
|
|
38
38
|
export * from './dtos/StartOrgReconciliationRequest';
|
|
39
39
|
export * from './dtos/StartCatalogReconciliationRequest';
|
|
40
40
|
export * from './dtos/ReconciliationRunCounts';
|
|
41
|
+
export * from './dtos/ReconciliationPreview';
|
|
41
42
|
export * from './dtos/GetReconciliationResponses';
|
|
42
43
|
export * from './dtos/ReconciliationPageMessage';
|