@fiado/type-kit 3.587.0 → 3.589.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.
@@ -118,6 +118,22 @@ describe('respuestas de la revisión', () => {
118
118
  expect(org.counts.seen).toBe(10);
119
119
  expect(catalog.storesPending).toBe(0);
120
120
  });
121
+
122
+ it('GetCatalogReconciliationResponse admite MOVEMENTS con su ventana', () => {
123
+ const movements: GetCatalogReconciliationResponse = {
124
+ runId: 'run-m',
125
+ retailerId: 'r-1',
126
+ entity: ReconciliationEntityEnum.MOVEMENTS,
127
+ status: ReconciliationRunStatusEnum.RUNNING,
128
+ trigger: ReconciliationTriggerEnum.DAILY,
129
+ startedAt: '2026-10-25T10:00:00.000Z',
130
+ pagesProcessed: 1,
131
+ movementsFrom: '2026-10-24T00:00:00.000Z',
132
+ movementsTo: '2026-10-25T00:00:00.000Z',
133
+ counts: { seen: 0, created: 0, updated: 0, deactivated: 0, reactivated: 0, skipped: 0 },
134
+ };
135
+ expect(movements.movementsTo).toBe('2026-10-25T00:00:00.000Z');
136
+ });
121
137
  });
122
138
 
123
139
  describe('revisión con excludeExtraneousValues', () => {
@@ -20,7 +20,7 @@ export interface GetOrgReconciliationResponse {
20
20
  export interface GetCatalogReconciliationResponse {
21
21
  runId: string;
22
22
  retailerId: string;
23
- entity: ReconciliationEntityEnum.CATALOG | ReconciliationEntityEnum.INVENTORY;
23
+ entity: ReconciliationEntityEnum.CATALOG | ReconciliationEntityEnum.INVENTORY | ReconciliationEntityEnum.MOVEMENTS;
24
24
  status: ReconciliationRunStatusEnum;
25
25
  trigger: ReconciliationTriggerEnum;
26
26
  triggeredBy?: string;
@@ -31,5 +31,9 @@ export interface GetCatalogReconciliationResponse {
31
31
  storeId?: string;
32
32
  /** Tiendas de inventario que faltan por cerrar. */
33
33
  storesPending?: number;
34
+ /** Inicio ISO de la ventana revisada en movimientos. */
35
+ movementsFrom?: string;
36
+ /** Fin ISO de la ventana revisada en movimientos. */
37
+ movementsTo?: string;
34
38
  counts: ReconciliationRunCounts;
35
39
  }
@@ -1,4 +1,3 @@
1
- import { MaterialType } from '../enums/MaterialType';
2
1
  import { OwnerType } from '../enums/OwnerType';
3
2
  import { TaskType } from '../enums/TaskType';
4
3
  /** Query de GET /v2/backoffice/tasks. Los valores llegan como string desde API Gateway. */
@@ -7,7 +6,8 @@ export declare class ListTasksQuery {
7
6
  status?: string;
8
7
  ownerType?: OwnerType;
9
8
  ownerId?: string;
10
- materialType?: MaterialType;
9
+ /** Clave del catálogo AppSelection (`TaskManagerMaterialType`). */
10
+ materialType?: string;
11
11
  overdue?: boolean;
12
12
  closedWithinDays?: number;
13
13
  }
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ListTasksQuery = void 0;
13
13
  const class_transformer_1 = require("class-transformer");
14
14
  const class_validator_1 = require("class-validator");
15
- const MaterialType_1 = require("../enums/MaterialType");
15
+ const MarketingMaterialDetails_1 = require("./MarketingMaterialDetails");
16
16
  const OwnerType_1 = require("../enums/OwnerType");
17
17
  const TaskType_1 = require("../enums/TaskType");
18
18
  /** Query de GET /v2/backoffice/tasks. Los valores llegan como string desde API Gateway. */
@@ -41,7 +41,7 @@ __decorate([
41
41
  ], ListTasksQuery.prototype, "ownerId", void 0);
42
42
  __decorate([
43
43
  (0, class_validator_1.IsOptional)(),
44
- (0, class_validator_1.IsEnum)(MaterialType_1.MaterialType),
44
+ (0, class_validator_1.Matches)(MarketingMaterialDetails_1.MATERIAL_TYPE_PATTERN),
45
45
  __metadata("design:type", String)
46
46
  ], ListTasksQuery.prototype, "materialType", void 0);
47
47
  __decorate([
@@ -1,6 +1,12 @@
1
- import { MaterialType } from '../enums/MaterialType';
2
- /** `details` de una tarea MARKETING_MATERIAL. */
1
+ /** Clave de un tipo de material: el `value` del catálogo AppSelection (`TaskManagerMaterialType`), p. ej. `PLASTIC_CARD`. */
2
+ export declare const MATERIAL_TYPE_PATTERN: RegExp;
3
+ /**
4
+ * `details` de una tarea MARKETING_MATERIAL. El tipo sale del catálogo AppSelection (`TaskManagerMaterialType`), así que
5
+ * se pueden agregar tipos sin tocar código; `MaterialType` queda sólo con los cuatro de origen.
6
+ */
3
7
  export declare class MarketingMaterialDetails {
4
- materialType: MaterialType;
8
+ materialType: string;
9
+ /** Nombre del tipo tal cual se ve en el catálogo (displayName). Es el que se manda a Asana. */
10
+ materialTypeLabel?: string;
5
11
  description?: string;
6
12
  }
@@ -9,17 +9,28 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.MarketingMaterialDetails = void 0;
12
+ exports.MarketingMaterialDetails = exports.MATERIAL_TYPE_PATTERN = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
- const MaterialType_1 = require("../enums/MaterialType");
15
- /** `details` de una tarea MARKETING_MATERIAL. */
14
+ /** Clave de un tipo de material: el `value` del catálogo AppSelection (`TaskManagerMaterialType`), p. ej. `PLASTIC_CARD`. */
15
+ exports.MATERIAL_TYPE_PATTERN = /^[A-Z0-9_]{1,40}$/;
16
+ /**
17
+ * `details` de una tarea MARKETING_MATERIAL. El tipo sale del catálogo AppSelection (`TaskManagerMaterialType`), así que
18
+ * se pueden agregar tipos sin tocar código; `MaterialType` queda sólo con los cuatro de origen.
19
+ */
16
20
  class MarketingMaterialDetails {
17
21
  }
18
22
  exports.MarketingMaterialDetails = MarketingMaterialDetails;
19
23
  __decorate([
20
- (0, class_validator_1.IsEnum)(MaterialType_1.MaterialType),
24
+ (0, class_validator_1.IsString)(),
25
+ (0, class_validator_1.Matches)(exports.MATERIAL_TYPE_PATTERN, { message: 'materialType: clave del catálogo en mayúsculas (A-Z, 0-9, _)' }),
21
26
  __metadata("design:type", String)
22
27
  ], MarketingMaterialDetails.prototype, "materialType", void 0);
28
+ __decorate([
29
+ (0, class_validator_1.IsOptional)(),
30
+ (0, class_validator_1.IsString)(),
31
+ (0, class_validator_1.MaxLength)(80),
32
+ __metadata("design:type", String)
33
+ ], MarketingMaterialDetails.prototype, "materialTypeLabel", void 0);
23
34
  __decorate([
24
35
  (0, class_validator_1.IsOptional)(),
25
36
  (0, class_validator_1.IsString)(),
@@ -0,0 +1,12 @@
1
+ import { TaskType } from '../enums/TaskType';
2
+ import { TaskOwnerInput } from './CreateTaskRequest';
3
+ /**
4
+ * Body de PUT /v2/backoffice/tasks/{taskId}: cambia los datos de una tarea ya creada. Lo que no viene se queda igual.
5
+ * El estado no se cambia aquí (va por transitions). `details`, si viene, es completo y se valida con el DTO del tipo.
6
+ */
7
+ export declare class UpdateTaskRequest {
8
+ taskType: TaskType;
9
+ dueDate?: string;
10
+ owner?: TaskOwnerInput;
11
+ details?: Record<string, unknown>;
12
+ }
@@ -0,0 +1,44 @@
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.UpdateTaskRequest = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ const TaskType_1 = require("../enums/TaskType");
16
+ const CreateTaskRequest_1 = require("./CreateTaskRequest");
17
+ /**
18
+ * Body de PUT /v2/backoffice/tasks/{taskId}: cambia los datos de una tarea ya creada. Lo que no viene se queda igual.
19
+ * El estado no se cambia aquí (va por transitions). `details`, si viene, es completo y se valida con el DTO del tipo.
20
+ */
21
+ class UpdateTaskRequest {
22
+ }
23
+ exports.UpdateTaskRequest = UpdateTaskRequest;
24
+ __decorate([
25
+ (0, class_validator_1.IsEnum)(TaskType_1.TaskType),
26
+ __metadata("design:type", String)
27
+ ], UpdateTaskRequest.prototype, "taskType", void 0);
28
+ __decorate([
29
+ (0, class_validator_1.IsOptional)(),
30
+ (0, class_validator_1.Matches)(/^\d{4}-\d{2}-\d{2}$/, { message: 'dueDate debe tener formato YYYY-MM-DD' }),
31
+ (0, class_validator_1.IsDateString)({ strict: true }, { message: 'dueDate debe ser una fecha válida' }),
32
+ __metadata("design:type", String)
33
+ ], UpdateTaskRequest.prototype, "dueDate", void 0);
34
+ __decorate([
35
+ (0, class_validator_1.IsOptional)(),
36
+ (0, class_validator_1.ValidateNested)(),
37
+ (0, class_transformer_1.Type)(() => CreateTaskRequest_1.TaskOwnerInput),
38
+ __metadata("design:type", CreateTaskRequest_1.TaskOwnerInput)
39
+ ], UpdateTaskRequest.prototype, "owner", void 0);
40
+ __decorate([
41
+ (0, class_validator_1.IsOptional)(),
42
+ (0, class_validator_1.IsObject)(),
43
+ __metadata("design:type", Object)
44
+ ], UpdateTaskRequest.prototype, "details", void 0);
@@ -1,4 +1,8 @@
1
- /** Materiales de marketing que se prometen a un promotor. OTHER + descripción cubre lo no listado. */
1
+ /**
2
+ * Los cuatro tipos de material de origen. Desde la versión con catálogo, los tipos viven en AppSelection
3
+ * (`TaskManagerMaterialType`) y `MarketingMaterialDetails.materialType` es la clave del catálogo; este enum queda para
4
+ * los valores iniciales y compatibilidad.
5
+ */
2
6
  export declare enum MaterialType {
3
7
  PLASTIC_CARD = "PLASTIC_CARD",
4
8
  REEL = "REEL",
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MaterialType = void 0;
4
- /** Materiales de marketing que se prometen a un promotor. OTHER + descripción cubre lo no listado. */
4
+ /**
5
+ * Los cuatro tipos de material de origen. Desde la versión con catálogo, los tipos viven en AppSelection
6
+ * (`TaskManagerMaterialType`) y `MarketingMaterialDetails.materialType` es la clave del catálogo; este enum queda para
7
+ * los valores iniciales y compatibilidad.
8
+ */
5
9
  var MaterialType;
6
10
  (function (MaterialType) {
7
11
  MaterialType["PLASTIC_CARD"] = "PLASTIC_CARD";
@@ -3,6 +3,7 @@ export * from './enums/OwnerType';
3
3
  export * from './enums/MaterialType';
4
4
  export * from './enums/MarketingMaterialStatus';
5
5
  export * from './dtos/CreateTaskRequest';
6
+ export * from './dtos/UpdateTaskRequest';
6
7
  export * from './dtos/TransitionTaskRequest';
7
8
  export * from './dtos/ListTasksQuery';
8
9
  export * from './dtos/TaskTypeQuery';
@@ -21,6 +21,7 @@ __exportStar(require("./enums/MaterialType"), exports);
21
21
  __exportStar(require("./enums/MarketingMaterialStatus"), exports);
22
22
  //dtos
23
23
  __exportStar(require("./dtos/CreateTaskRequest"), exports);
24
+ __exportStar(require("./dtos/UpdateTaskRequest"), exports);
24
25
  __exportStar(require("./dtos/TransitionTaskRequest"), exports);
25
26
  __exportStar(require("./dtos/ListTasksQuery"), exports);
26
27
  __exportStar(require("./dtos/TaskTypeQuery"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.587.0",
3
+ "version": "3.589.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -22,7 +22,7 @@ export interface GetOrgReconciliationResponse {
22
22
  export interface GetCatalogReconciliationResponse {
23
23
  runId: string;
24
24
  retailerId: string;
25
- entity: ReconciliationEntityEnum.CATALOG | ReconciliationEntityEnum.INVENTORY;
25
+ entity: ReconciliationEntityEnum.CATALOG | ReconciliationEntityEnum.INVENTORY | ReconciliationEntityEnum.MOVEMENTS;
26
26
  status: ReconciliationRunStatusEnum;
27
27
  trigger: ReconciliationTriggerEnum;
28
28
  triggeredBy?: string;
@@ -33,5 +33,9 @@ export interface GetCatalogReconciliationResponse {
33
33
  storeId?: string;
34
34
  /** Tiendas de inventario que faltan por cerrar. */
35
35
  storesPending?: number;
36
+ /** Inicio ISO de la ventana revisada en movimientos. */
37
+ movementsFrom?: string;
38
+ /** Fin ISO de la ventana revisada en movimientos. */
39
+ movementsTo?: string;
36
40
  counts: ReconciliationRunCounts;
37
41
  }
@@ -1,6 +1,6 @@
1
1
  import { Transform, Type } from 'class-transformer';
2
2
  import { IsBoolean, IsEnum, IsInt, IsOptional, IsString, Length, Matches, Max, Min } from 'class-validator';
3
- import { MaterialType } from '../enums/MaterialType';
3
+ import { MATERIAL_TYPE_PATTERN } from './MarketingMaterialDetails';
4
4
  import { OwnerType } from '../enums/OwnerType';
5
5
  import { TaskType } from '../enums/TaskType';
6
6
 
@@ -22,9 +22,10 @@ export class ListTasksQuery {
22
22
  @Length(1, 64)
23
23
  ownerId?: string;
24
24
 
25
+ /** Clave del catálogo AppSelection (`TaskManagerMaterialType`). */
25
26
  @IsOptional()
26
- @IsEnum(MaterialType)
27
- materialType?: MaterialType;
27
+ @Matches(MATERIAL_TYPE_PATTERN)
28
+ materialType?: string;
28
29
 
29
30
  @IsOptional()
30
31
  @Transform(({ value }) => (value === 'true' ? true : value === 'false' ? false : value))
@@ -1,10 +1,22 @@
1
- import { IsEnum, IsOptional, IsString, MaxLength } from 'class-validator';
2
- import { MaterialType } from '../enums/MaterialType';
1
+ import { IsOptional, IsString, Matches, MaxLength } from 'class-validator';
3
2
 
4
- /** `details` de una tarea MARKETING_MATERIAL. */
3
+ /** Clave de un tipo de material: el `value` del catálogo AppSelection (`TaskManagerMaterialType`), p. ej. `PLASTIC_CARD`. */
4
+ export const MATERIAL_TYPE_PATTERN = /^[A-Z0-9_]{1,40}$/;
5
+
6
+ /**
7
+ * `details` de una tarea MARKETING_MATERIAL. El tipo sale del catálogo AppSelection (`TaskManagerMaterialType`), así que
8
+ * se pueden agregar tipos sin tocar código; `MaterialType` queda sólo con los cuatro de origen.
9
+ */
5
10
  export class MarketingMaterialDetails {
6
- @IsEnum(MaterialType)
7
- materialType: MaterialType;
11
+ @IsString()
12
+ @Matches(MATERIAL_TYPE_PATTERN, { message: 'materialType: clave del catálogo en mayúsculas (A-Z, 0-9, _)' })
13
+ materialType: string;
14
+
15
+ /** Nombre del tipo tal cual se ve en el catálogo (displayName). Es el que se manda a Asana. */
16
+ @IsOptional()
17
+ @IsString()
18
+ @MaxLength(80)
19
+ materialTypeLabel?: string;
8
20
 
9
21
  @IsOptional()
10
22
  @IsString()
@@ -0,0 +1,27 @@
1
+ import { Type } from 'class-transformer';
2
+ import { IsDateString, IsEnum, IsObject, IsOptional, Matches, ValidateNested } from 'class-validator';
3
+ import { TaskType } from '../enums/TaskType';
4
+ import { TaskOwnerInput } from './CreateTaskRequest';
5
+
6
+ /**
7
+ * Body de PUT /v2/backoffice/tasks/{taskId}: cambia los datos de una tarea ya creada. Lo que no viene se queda igual.
8
+ * El estado no se cambia aquí (va por transitions). `details`, si viene, es completo y se valida con el DTO del tipo.
9
+ */
10
+ export class UpdateTaskRequest {
11
+ @IsEnum(TaskType)
12
+ taskType: TaskType;
13
+
14
+ @IsOptional()
15
+ @Matches(/^\d{4}-\d{2}-\d{2}$/, { message: 'dueDate debe tener formato YYYY-MM-DD' })
16
+ @IsDateString({ strict: true }, { message: 'dueDate debe ser una fecha válida' })
17
+ dueDate?: string;
18
+
19
+ @IsOptional()
20
+ @ValidateNested()
21
+ @Type(() => TaskOwnerInput)
22
+ owner?: TaskOwnerInput;
23
+
24
+ @IsOptional()
25
+ @IsObject()
26
+ details?: Record<string, unknown>;
27
+ }
@@ -1,4 +1,8 @@
1
- /** Materiales de marketing que se prometen a un promotor. OTHER + descripción cubre lo no listado. */
1
+ /**
2
+ * Los cuatro tipos de material de origen. Desde la versión con catálogo, los tipos viven en AppSelection
3
+ * (`TaskManagerMaterialType`) y `MarketingMaterialDetails.materialType` es la clave del catálogo; este enum queda para
4
+ * los valores iniciales y compatibilidad.
5
+ */
2
6
  export enum MaterialType {
3
7
  PLASTIC_CARD = 'PLASTIC_CARD',
4
8
  REEL = 'REEL',
@@ -5,6 +5,7 @@ export * from './enums/MaterialType';
5
5
  export * from './enums/MarketingMaterialStatus';
6
6
  //dtos
7
7
  export * from './dtos/CreateTaskRequest';
8
+ export * from './dtos/UpdateTaskRequest';
8
9
  export * from './dtos/TransitionTaskRequest';
9
10
  export * from './dtos/ListTasksQuery';
10
11
  export * from './dtos/TaskTypeQuery';