@fiado/type-kit 3.620.0 → 3.621.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.
@@ -119,6 +119,24 @@ describe('respuestas de la revisión', () => {
119
119
  expect(catalog.storesPending).toBe(0);
120
120
  });
121
121
 
122
+ it('las respuestas GET exponen el motivo del aborto, el último error y el intento', () => {
123
+ const counts = { seen: 0, created: 0, updated: 0, deactivated: 0, reactivated: 0, skipped: 0 };
124
+ const org: GetOrgReconciliationResponse = {
125
+ runId: 'run-o', retailerId: 'r-1', entity: ReconciliationEntityEnum.STORES,
126
+ status: ReconciliationRunStatusEnum.ABORTED, trigger: ReconciliationTriggerEnum.MANUAL,
127
+ startedAt: '2026-10-25T10:00:00.000Z', pagesProcessed: 0, counts,
128
+ abortReason: 'RETAIL_INTEGRATION_CONNECTOR_UNAVAILABLE', lastErrorCode: 'RETAIL_INTEGRATION_CONNECTOR_UNAVAILABLE', attempt: 1, maxAttempts: 5,
129
+ };
130
+ const catalog: GetCatalogReconciliationResponse = {
131
+ runId: 'run-c', retailerId: 'r-1', entity: ReconciliationEntityEnum.CATALOG,
132
+ status: ReconciliationRunStatusEnum.RUNNING, trigger: ReconciliationTriggerEnum.SCHEDULED,
133
+ startedAt: '2026-10-25T10:00:00.000Z', pagesProcessed: 0, counts,
134
+ abortReason: null, lastErrorCode: 'RETAIL_INTEGRATION_CONNECTOR_UNAVAILABLE', attempt: 3, maxAttempts: 5,
135
+ };
136
+ expect(org.abortReason).toBe('RETAIL_INTEGRATION_CONNECTOR_UNAVAILABLE');
137
+ expect([catalog.attempt, catalog.maxAttempts]).toEqual([3, 5]);
138
+ });
139
+
122
140
  it('GetCatalogReconciliationResponse admite MOVEMENTS con su ventana', () => {
123
141
  const movements: GetCatalogReconciliationResponse = {
124
142
  runId: 'run-m',
@@ -3,8 +3,19 @@ import type { ReconciliationRunStatusEnum } from '../enums/ReconciliationRunStat
3
3
  import type { ReconciliationTriggerEnum } from '../enums/ReconciliationTriggerEnum';
4
4
  import type { ReconciliationPreview } from './ReconciliationPreview';
5
5
  import type { ReconciliationRunCounts } from './ReconciliationRunCounts';
6
+ /** Fallos de una corrida: por qué se abortó y en qué intento de SQS va la página que falla. */
7
+ export interface ReconciliationRunAttempts {
8
+ /** Motivo del ABORTED (`MAX_ATTEMPTS`, `ROW_WITHOUT_ID`, el `code` del externo caído, etc.); null si no se abortó. */
9
+ abortReason?: string | null;
10
+ /** `code` del último error de la página en curso; null si la página no ha fallado. */
11
+ lastErrorCode?: string | null;
12
+ /** Intento de SQS (1-based) en que falló la página en curso; null si no ha fallado. */
13
+ attempt?: number | null;
14
+ /** Intentos de SQS que tiene una página antes de abortar la corrida. */
15
+ maxAttempts?: number;
16
+ }
6
17
  /** Respuesta 200 de GET .../reconciliations/{runId} en org (backofficeGetOrgReconciliation). */
7
- export interface GetOrgReconciliationResponse {
18
+ export interface GetOrgReconciliationResponse extends ReconciliationRunAttempts {
8
19
  runId: string;
9
20
  retailerId: string;
10
21
  entity: ReconciliationEntityEnum.STORES | ReconciliationEntityEnum.USERS;
@@ -22,7 +33,7 @@ export interface GetOrgReconciliationResponse {
22
33
  preview?: ReconciliationPreview;
23
34
  }
24
35
  /** Respuesta 200 de GET .../reconciliations/{runId} en catalog (backofficeGetCatalogReconciliation). */
25
- export interface GetCatalogReconciliationResponse {
36
+ export interface GetCatalogReconciliationResponse extends ReconciliationRunAttempts {
26
37
  runId: string;
27
38
  retailerId: string;
28
39
  entity: ReconciliationEntityEnum.CATALOG | ReconciliationEntityEnum.INVENTORY | ReconciliationEntityEnum.MOVEMENTS;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.620.0",
3
+ "version": "3.621.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -4,8 +4,20 @@ import type { ReconciliationTriggerEnum } from '../enums/ReconciliationTriggerEn
4
4
  import type { ReconciliationPreview } from './ReconciliationPreview';
5
5
  import type { ReconciliationRunCounts } from './ReconciliationRunCounts';
6
6
 
7
+ /** Fallos de una corrida: por qué se abortó y en qué intento de SQS va la página que falla. */
8
+ export interface ReconciliationRunAttempts {
9
+ /** Motivo del ABORTED (`MAX_ATTEMPTS`, `ROW_WITHOUT_ID`, el `code` del externo caído, etc.); null si no se abortó. */
10
+ abortReason?: string | null;
11
+ /** `code` del último error de la página en curso; null si la página no ha fallado. */
12
+ lastErrorCode?: string | null;
13
+ /** Intento de SQS (1-based) en que falló la página en curso; null si no ha fallado. */
14
+ attempt?: number | null;
15
+ /** Intentos de SQS que tiene una página antes de abortar la corrida. */
16
+ maxAttempts?: number;
17
+ }
18
+
7
19
  /** Respuesta 200 de GET .../reconciliations/{runId} en org (backofficeGetOrgReconciliation). */
8
- export interface GetOrgReconciliationResponse {
20
+ export interface GetOrgReconciliationResponse extends ReconciliationRunAttempts {
9
21
  runId: string;
10
22
  retailerId: string;
11
23
  entity: ReconciliationEntityEnum.STORES | ReconciliationEntityEnum.USERS;
@@ -24,7 +36,7 @@ export interface GetOrgReconciliationResponse {
24
36
  }
25
37
 
26
38
  /** Respuesta 200 de GET .../reconciliations/{runId} en catalog (backofficeGetCatalogReconciliation). */
27
- export interface GetCatalogReconciliationResponse {
39
+ export interface GetCatalogReconciliationResponse extends ReconciliationRunAttempts {
28
40
  runId: string;
29
41
  retailerId: string;
30
42
  entity: ReconciliationEntityEnum.CATALOG | ReconciliationEntityEnum.INVENTORY | ReconciliationEntityEnum.MOVEMENTS;