@fiado/type-kit 3.16.0 → 3.18.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.
@@ -17,5 +17,11 @@ export declare class BannerCreateRequest {
17
17
  endDate?: number;
18
18
  content: BannerContentRequest;
19
19
  action?: BannerActionRequest;
20
- rulesVisibility: Record<string, unknown>;
20
+ /**
21
+ * Reglas de visibilidad. `null` se acepta como "banner público"
22
+ * (visible a todos los usuarios); `undefined` también — el backend
23
+ * normaliza ambos a "sin regla". Si se envía un objeto, debe pasar
24
+ * la validación del VisibilityRulesValidator.
25
+ */
26
+ rulesVisibility?: Record<string, unknown> | null;
21
27
  }
@@ -66,6 +66,7 @@ __decorate([
66
66
  __metadata("design:type", BannerActionRequest_1.BannerActionRequest)
67
67
  ], BannerCreateRequest.prototype, "action", void 0);
68
68
  __decorate([
69
+ (0, class_validator_1.ValidateIf)((_, value) => value !== null && value !== undefined),
69
70
  (0, class_validator_1.IsObject)(),
70
71
  __metadata("design:type", Object)
71
72
  ], BannerCreateRequest.prototype, "rulesVisibility", void 0);
@@ -16,5 +16,11 @@ export declare class BannerUpdateRequest {
16
16
  endDate?: number;
17
17
  content?: BannerContentRequest;
18
18
  action?: BannerActionRequest;
19
- rulesVisibility?: Record<string, unknown>;
19
+ /**
20
+ * Reglas de visibilidad — patch parcial:
21
+ * - `undefined` → no toca el campo existente.
22
+ * - `null` → limpia la regla (banner se vuelve público).
23
+ * - objeto → reemplaza la regla; debe pasar VisibilityRulesValidator.
24
+ */
25
+ rulesVisibility?: Record<string, unknown> | null;
20
26
  }
@@ -70,7 +70,7 @@ __decorate([
70
70
  __metadata("design:type", BannerActionRequest_1.BannerActionRequest)
71
71
  ], BannerUpdateRequest.prototype, "action", void 0);
72
72
  __decorate([
73
- (0, class_validator_1.IsOptional)(),
73
+ (0, class_validator_1.ValidateIf)((_, value) => value !== null && value !== undefined),
74
74
  (0, class_validator_1.IsObject)(),
75
75
  __metadata("design:type", Object)
76
76
  ], BannerUpdateRequest.prototype, "rulesVisibility", void 0);
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Estructura común para override manual de validaciones (CNBV, blacklist, etc.)
3
+ * por parte de un operador u oficial de cumplimiento.
4
+ *
5
+ * Sólo debe setearse desde un endpoint backoffice autenticado para que
6
+ * `by` venga del JWT del operador y quede traza auditable.
7
+ */
8
+ export interface ManualApproval {
9
+ /** email del operador que aprobó manualmente, tomado del JWT */
10
+ by: string;
11
+ /** ISO 8601 timestamp del momento de la aprobación */
12
+ at: string;
13
+ /** justificación obligatoria del override */
14
+ reason: string;
15
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -5,6 +5,7 @@ import { CPStatusEnum } from '../enums/CPStatusEnum';
5
5
  import { InfoSelfVerifiedStatus } from '../enums/InfoSelfVerifiedStatus';
6
6
  import { SexDocument } from '../enums/SexDocument';
7
7
  import { IdentificationDocument } from './IdentificationDocument';
8
+ import { ManualApproval } from './ManualApproval';
8
9
  export declare class PeopleResponse {
9
10
  id: string;
10
11
  createDate: string;
@@ -98,6 +99,7 @@ export declare class PeopleResponse {
98
99
  SSN_ITINRequired: boolean | null;
99
100
  hasSSN_ITIN: boolean | null;
100
101
  geoAppproved?: boolean | null;
102
+ cnbvManualApproval?: ManualApproval | null;
101
103
  };
102
104
  SIN: string | null;
103
105
  documentNumber: string;
@@ -4,6 +4,7 @@ import { CPStatusEnum } from "../enums/CPStatusEnum";
4
4
  import { InfoSelfVerifiedStatus } from "../enums/InfoSelfVerifiedStatus";
5
5
  import { SexDocument } from "../enums/SexDocument";
6
6
  import { IdentificationDocument } from "./IdentificationDocument";
7
+ import { ManualApproval } from "./ManualApproval";
7
8
  export declare class PeopleUpdateRequest {
8
9
  id?: string;
9
10
  creationMethod?: string;
@@ -48,6 +49,7 @@ export declare class PeopleUpdateRequest {
48
49
  fiadoListApproved?: boolean | null;
49
50
  ofacListApproved?: boolean | null;
50
51
  cnbvListApproved?: boolean | null;
52
+ cnbvManualApproval?: ManualApproval | null;
51
53
  blackListApproved?: boolean | null;
52
54
  whiteList?: boolean | null;
53
55
  hasOwner?: boolean;
@@ -1,4 +1,5 @@
1
1
  export * from './dtos/IdentificationDocument';
2
+ export * from './dtos/ManualApproval';
2
3
  export * from './dtos/PeopleCreateRequest';
3
4
  export * from './dtos/PeopleResponse';
4
5
  export * from './dtos/TypeOfDocument';
@@ -14,8 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- //dtos
17
+ //dtos
18
18
  __exportStar(require("./dtos/IdentificationDocument"), exports);
19
+ __exportStar(require("./dtos/ManualApproval"), exports);
19
20
  __exportStar(require("./dtos/PeopleCreateRequest"), exports);
20
21
  __exportStar(require("./dtos/PeopleResponse"), exports);
21
22
  __exportStar(require("./dtos/TypeOfDocument"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.16.0",
3
+ "version": "3.18.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -8,6 +8,7 @@ import {
8
8
  IsOptional,
9
9
  IsString,
10
10
  Min,
11
+ ValidateIf,
11
12
  ValidateNested,
12
13
  } from "class-validator";
13
14
  import { Type } from "class-transformer";
@@ -54,6 +55,13 @@ export class BannerCreateRequest {
54
55
  @Type(() => BannerActionRequest)
55
56
  action?: BannerActionRequest;
56
57
 
58
+ /**
59
+ * Reglas de visibilidad. `null` se acepta como "banner público"
60
+ * (visible a todos los usuarios); `undefined` también — el backend
61
+ * normaliza ambos a "sin regla". Si se envía un objeto, debe pasar
62
+ * la validación del VisibilityRulesValidator.
63
+ */
64
+ @ValidateIf((_, value) => value !== null && value !== undefined)
57
65
  @IsObject()
58
- rulesVisibility!: Record<string, unknown>;
66
+ rulesVisibility?: Record<string, unknown> | null;
59
67
  }
@@ -7,6 +7,7 @@ import {
7
7
  IsOptional,
8
8
  IsString,
9
9
  Min,
10
+ ValidateIf,
10
11
  ValidateNested,
11
12
  } from "class-validator";
12
13
  import { Type } from "class-transformer";
@@ -44,7 +45,13 @@ export class BannerUpdateRequest {
44
45
  @Type(() => BannerActionRequest)
45
46
  action?: BannerActionRequest;
46
47
 
47
- @IsOptional()
48
+ /**
49
+ * Reglas de visibilidad — patch parcial:
50
+ * - `undefined` → no toca el campo existente.
51
+ * - `null` → limpia la regla (banner se vuelve público).
52
+ * - objeto → reemplaza la regla; debe pasar VisibilityRulesValidator.
53
+ */
54
+ @ValidateIf((_, value) => value !== null && value !== undefined)
48
55
  @IsObject()
49
- rulesVisibility?: Record<string, unknown>;
56
+ rulesVisibility?: Record<string, unknown> | null;
50
57
  }
@@ -0,0 +1,16 @@
1
+
2
+ /**
3
+ * Estructura común para override manual de validaciones (CNBV, blacklist, etc.)
4
+ * por parte de un operador u oficial de cumplimiento.
5
+ *
6
+ * Sólo debe setearse desde un endpoint backoffice autenticado para que
7
+ * `by` venga del JWT del operador y quede traza auditable.
8
+ */
9
+ export interface ManualApproval {
10
+ /** email del operador que aprobó manualmente, tomado del JWT */
11
+ by: string;
12
+ /** ISO 8601 timestamp del momento de la aprobación */
13
+ at: string;
14
+ /** justificación obligatoria del override */
15
+ reason: string;
16
+ }
@@ -6,6 +6,7 @@ import { CPStatusEnum } from '../enums/CPStatusEnum';
6
6
  import { InfoSelfVerifiedStatus } from '../enums/InfoSelfVerifiedStatus';
7
7
  import { SexDocument } from '../enums/SexDocument';
8
8
  import { IdentificationDocument } from './IdentificationDocument';
9
+ import { ManualApproval } from './ManualApproval';
9
10
 
10
11
 
11
12
  export class PeopleResponse {
@@ -101,7 +102,8 @@ export class PeopleResponse {
101
102
  SSN_ITINRequired:boolean | null;
102
103
  hasSSN_ITIN:boolean | null;
103
104
  geoAppproved?:boolean | null;
104
-
105
+ cnbvManualApproval?: ManualApproval | null;
106
+
105
107
  }
106
108
  SIN: string | null;
107
109
  documentNumber: string;
@@ -4,6 +4,7 @@ import { CPStatusEnum } from "../enums/CPStatusEnum";
4
4
  import { InfoSelfVerifiedStatus } from "../enums/InfoSelfVerifiedStatus";
5
5
  import { SexDocument } from "../enums/SexDocument";
6
6
  import { IdentificationDocument } from "./IdentificationDocument";
7
+ import { ManualApproval } from "./ManualApproval";
7
8
 
8
9
 
9
10
  export class PeopleUpdateRequest {
@@ -51,6 +52,7 @@ export class PeopleUpdateRequest {
51
52
  fiadoListApproved?: boolean | null;
52
53
  ofacListApproved?: boolean | null;
53
54
  cnbvListApproved?: boolean | null;
55
+ cnbvManualApproval?: ManualApproval | null;
54
56
  blackListApproved?: boolean | null;
55
57
  whiteList?: boolean | null;
56
58
  hasOwner?: boolean;
@@ -1,6 +1,7 @@
1
1
 
2
- //dtos
2
+ //dtos
3
3
  export * from './dtos/IdentificationDocument'
4
+ export * from './dtos/ManualApproval';
4
5
  export * from './dtos/PeopleCreateRequest';
5
6
  export * from './dtos/PeopleResponse';
6
7
  export * from './dtos/TypeOfDocument';