@fiado/type-kit 3.414.0 → 3.416.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/loanCredit/dtos/loanDeviceContract.test.ts +2 -2
- package/_test_/unit/mdm/dtos/mdmDeviceContract.test.ts +2 -2
- package/bin/loanCredit/dtos/LoanDeviceNotifyItem.d.ts +8 -2
- package/bin/loanCredit/dtos/LoanDeviceNotifyItem.js +2 -2
- package/bin/mdm/dtos/DeviceNotifyRequest.d.ts +13 -3
- package/bin/mdm/dtos/DeviceNotifyRequest.js +2 -2
- package/bin/networkConnector/dtos/CreateProfileRequest.d.ts +4 -1
- package/bin/networkConnector/dtos/CreateProfileRequest.js +1 -1
- package/bin/networkConnector/dtos/ProfileResponse.d.ts +3 -0
- package/bin/networkConnector/dtos/UpdateProfileRequest.d.ts +0 -1
- package/bin/networkConnector/dtos/UpdateProfileRequest.js +0 -6
- package/package.json +1 -1
- package/src/loanCredit/dtos/LoanDeviceNotifyItem.ts +10 -4
- package/src/mdm/dtos/DeviceNotifyRequest.ts +15 -5
- package/src/networkConnector/dtos/CreateProfileRequest.ts +5 -2
- package/src/networkConnector/dtos/ProfileResponse.ts +3 -0
- package/src/networkConnector/dtos/UpdateProfileRequest.ts +2 -1
|
@@ -334,8 +334,8 @@ describe('LoanDeviceNotifyRequest', () => {
|
|
|
334
334
|
/** Cota de cada campo de texto libre, para probar el borde exacto y el borde + 1. */
|
|
335
335
|
const NOTIFY_MAX_LENGTHS: ReadonlyArray<readonly [string, number]> = [
|
|
336
336
|
['notificationCode', 64],
|
|
337
|
-
['title',
|
|
338
|
-
['content',
|
|
337
|
+
['title', 50],
|
|
338
|
+
['content', 350],
|
|
339
339
|
];
|
|
340
340
|
|
|
341
341
|
it('valida happy path (0 errores)', async () => {
|
|
@@ -152,8 +152,8 @@ describe('DeviceNotifyRequest — topes de longitud de los tres textos', () => {
|
|
|
152
152
|
/** Mismos números que `LoanDeviceNotifyItem`: las dos puntas del contrato dicen lo mismo. */
|
|
153
153
|
const limits = [
|
|
154
154
|
['notificationCode', 64],
|
|
155
|
-
['title',
|
|
156
|
-
['content',
|
|
155
|
+
['title', 50],
|
|
156
|
+
['content', 350],
|
|
157
157
|
] as const;
|
|
158
158
|
|
|
159
159
|
it.each(limits)('acepta %s en el largo máximo', async (field, max) => {
|
|
@@ -14,8 +14,14 @@ export declare class LoanDeviceNotifyItem {
|
|
|
14
14
|
noticeType?: MdmNoticeTypeEnum;
|
|
15
15
|
/** Código del catálogo de Datacultr. Camino legacy: solo se lee si no viaja `noticeType`. */
|
|
16
16
|
notificationCode?: string;
|
|
17
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* Título crudo para Trustonic. Camino legacy: solo se lee si no viaja `noticeType`.
|
|
19
|
+
* El tope es el de Trustonic, que exige de 1 a 50 y responde `INVALID_RANGE` fuera de rango.
|
|
20
|
+
*/
|
|
18
21
|
title?: string;
|
|
19
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* Cuerpo crudo para Trustonic. Camino legacy: solo se lee si no viaja `noticeType`.
|
|
24
|
+
* El tope es el de Trustonic, que exige de 1 a 350 y responde `INVALID_RANGE` fuera de rango.
|
|
25
|
+
*/
|
|
20
26
|
content?: string;
|
|
21
27
|
}
|
|
@@ -51,7 +51,7 @@ __decorate([
|
|
|
51
51
|
(0, class_validator_1.IsOptional)(),
|
|
52
52
|
(0, class_validator_1.IsString)(),
|
|
53
53
|
(0, class_validator_1.IsNotEmpty)(),
|
|
54
|
-
(0, class_validator_1.MaxLength)(
|
|
54
|
+
(0, class_validator_1.MaxLength)(50),
|
|
55
55
|
__metadata("design:type", String)
|
|
56
56
|
], LoanDeviceNotifyItem.prototype, "title", void 0);
|
|
57
57
|
__decorate([
|
|
@@ -59,6 +59,6 @@ __decorate([
|
|
|
59
59
|
(0, class_validator_1.IsOptional)(),
|
|
60
60
|
(0, class_validator_1.IsString)(),
|
|
61
61
|
(0, class_validator_1.IsNotEmpty)(),
|
|
62
|
-
(0, class_validator_1.MaxLength)(
|
|
62
|
+
(0, class_validator_1.MaxLength)(350),
|
|
63
63
|
__metadata("design:type", String)
|
|
64
64
|
], LoanDeviceNotifyItem.prototype, "content", void 0);
|
|
@@ -8,11 +8,21 @@ export declare class DeviceNotifyRequest {
|
|
|
8
8
|
* Cuando viaja, manda: los connectors ignoran `notificationCode`, `title` y `content`.
|
|
9
9
|
*/
|
|
10
10
|
noticeType?: MdmNoticeTypeEnum;
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Código del catálogo de Datacultr. Camino legacy: solo se lee si no viaja `noticeType`.
|
|
13
|
+
* Es exclusivo de Datacultr: Trustonic no tiene catálogo de códigos y rechaza el ítem
|
|
14
|
+
* que solo trae este campo.
|
|
15
|
+
*/
|
|
12
16
|
notificationCode?: string;
|
|
13
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* Título crudo para Trustonic. Camino legacy: solo se lee si no viaja `noticeType`.
|
|
19
|
+
* El tope es el de Trustonic, que exige de 1 a 50 y responde `INVALID_RANGE` fuera de rango.
|
|
20
|
+
*/
|
|
14
21
|
title?: string;
|
|
15
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* Cuerpo crudo para Trustonic. Camino legacy: solo se lee si no viaja `noticeType`.
|
|
24
|
+
* El tope es el de Trustonic, que exige de 1 a 350 y responde `INVALID_RANGE` fuera de rango.
|
|
25
|
+
*/
|
|
16
26
|
content?: string;
|
|
17
27
|
operationReference: string;
|
|
18
28
|
}
|
|
@@ -47,7 +47,7 @@ __decorate([
|
|
|
47
47
|
(0, class_validator_1.IsOptional)(),
|
|
48
48
|
(0, class_validator_1.IsString)(),
|
|
49
49
|
(0, class_validator_1.IsNotEmpty)(),
|
|
50
|
-
(0, class_validator_1.MaxLength)(
|
|
50
|
+
(0, class_validator_1.MaxLength)(50),
|
|
51
51
|
__metadata("design:type", String)
|
|
52
52
|
], DeviceNotifyRequest.prototype, "title", void 0);
|
|
53
53
|
__decorate([
|
|
@@ -55,7 +55,7 @@ __decorate([
|
|
|
55
55
|
(0, class_validator_1.IsOptional)(),
|
|
56
56
|
(0, class_validator_1.IsString)(),
|
|
57
57
|
(0, class_validator_1.IsNotEmpty)(),
|
|
58
|
-
(0, class_validator_1.MaxLength)(
|
|
58
|
+
(0, class_validator_1.MaxLength)(350),
|
|
59
59
|
__metadata("design:type", String)
|
|
60
60
|
], DeviceNotifyRequest.prototype, "content", void 0);
|
|
61
61
|
__decorate([
|
|
@@ -5,7 +5,10 @@ export declare class CreateProfileRequest {
|
|
|
5
5
|
company?: string;
|
|
6
6
|
slug: string;
|
|
7
7
|
directoryId: string;
|
|
8
|
-
|
|
8
|
+
/** Requerido desde DEC: se usa como llave para resolver el codigo de referido
|
|
9
|
+
* (IOnboardingBusinessApi.getByPhoneNumber) al crear el perfil. Inmutable tras la creacion
|
|
10
|
+
* (UpdateProfileRequest ya no acepta este campo). */
|
|
11
|
+
phone: string;
|
|
9
12
|
email?: string;
|
|
10
13
|
bio?: string;
|
|
11
14
|
socialLinks?: Record<string, string>;
|
|
@@ -57,8 +57,8 @@ __decorate([
|
|
|
57
57
|
], CreateProfileRequest.prototype, "directoryId", void 0);
|
|
58
58
|
__decorate([
|
|
59
59
|
(0, class_transformer_1.Expose)(),
|
|
60
|
-
(0, class_validator_1.IsOptional)(),
|
|
61
60
|
(0, class_validator_1.IsString)(),
|
|
61
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
62
62
|
__metadata("design:type", String)
|
|
63
63
|
], CreateProfileRequest.prototype, "phone", void 0);
|
|
64
64
|
__decorate([
|
|
@@ -12,6 +12,9 @@ export interface ProfileResponse {
|
|
|
12
12
|
logoUrl?: string;
|
|
13
13
|
bio?: string;
|
|
14
14
|
socialLinks?: Record<string, string>;
|
|
15
|
+
/** Codigo de referido del promotor (myReferralCode de Onboarding), resuelto por telefono al
|
|
16
|
+
* crear el perfil. null si el telefono no tiene codigo asociado en Onboarding. */
|
|
17
|
+
referralCode?: string | null;
|
|
15
18
|
status: ProfileStatusEnum;
|
|
16
19
|
directoryId: string;
|
|
17
20
|
createdAt: number;
|
|
@@ -54,12 +54,6 @@ __decorate([
|
|
|
54
54
|
(0, class_validator_1.MaxLength)(100),
|
|
55
55
|
__metadata("design:type", String)
|
|
56
56
|
], UpdateProfileRequest.prototype, "slug", void 0);
|
|
57
|
-
__decorate([
|
|
58
|
-
(0, class_transformer_1.Expose)(),
|
|
59
|
-
(0, class_validator_1.IsOptional)(),
|
|
60
|
-
(0, class_validator_1.IsString)(),
|
|
61
|
-
__metadata("design:type", String)
|
|
62
|
-
], UpdateProfileRequest.prototype, "phone", void 0);
|
|
63
57
|
__decorate([
|
|
64
58
|
(0, class_transformer_1.Expose)(),
|
|
65
59
|
(0, class_validator_1.IsOptional)(),
|
package/package.json
CHANGED
|
@@ -34,19 +34,25 @@ export class LoanDeviceNotifyItem {
|
|
|
34
34
|
@MaxLength(64)
|
|
35
35
|
notificationCode?: string;
|
|
36
36
|
|
|
37
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* Título crudo para Trustonic. Camino legacy: solo se lee si no viaja `noticeType`.
|
|
39
|
+
* El tope es el de Trustonic, que exige de 1 a 50 y responde `INVALID_RANGE` fuera de rango.
|
|
40
|
+
*/
|
|
38
41
|
@Expose()
|
|
39
42
|
@IsOptional()
|
|
40
43
|
@IsString()
|
|
41
44
|
@IsNotEmpty()
|
|
42
|
-
@MaxLength(
|
|
45
|
+
@MaxLength(50)
|
|
43
46
|
title?: string;
|
|
44
47
|
|
|
45
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* Cuerpo crudo para Trustonic. Camino legacy: solo se lee si no viaja `noticeType`.
|
|
50
|
+
* El tope es el de Trustonic, que exige de 1 a 350 y responde `INVALID_RANGE` fuera de rango.
|
|
51
|
+
*/
|
|
46
52
|
@Expose()
|
|
47
53
|
@IsOptional()
|
|
48
54
|
@IsString()
|
|
49
55
|
@IsNotEmpty()
|
|
50
|
-
@MaxLength(
|
|
56
|
+
@MaxLength(350)
|
|
51
57
|
content?: string;
|
|
52
58
|
}
|
|
@@ -22,7 +22,11 @@ export class DeviceNotifyRequest {
|
|
|
22
22
|
@IsEnum(MdmNoticeTypeEnum)
|
|
23
23
|
noticeType?: MdmNoticeTypeEnum;
|
|
24
24
|
|
|
25
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Código del catálogo de Datacultr. Camino legacy: solo se lee si no viaja `noticeType`.
|
|
27
|
+
* Es exclusivo de Datacultr: Trustonic no tiene catálogo de códigos y rechaza el ítem
|
|
28
|
+
* que solo trae este campo.
|
|
29
|
+
*/
|
|
26
30
|
@Expose()
|
|
27
31
|
@IsOptional()
|
|
28
32
|
@IsString()
|
|
@@ -30,20 +34,26 @@ export class DeviceNotifyRequest {
|
|
|
30
34
|
@MaxLength(64)
|
|
31
35
|
notificationCode?: string;
|
|
32
36
|
|
|
33
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* Título crudo para Trustonic. Camino legacy: solo se lee si no viaja `noticeType`.
|
|
39
|
+
* El tope es el de Trustonic, que exige de 1 a 50 y responde `INVALID_RANGE` fuera de rango.
|
|
40
|
+
*/
|
|
34
41
|
@Expose()
|
|
35
42
|
@IsOptional()
|
|
36
43
|
@IsString()
|
|
37
44
|
@IsNotEmpty()
|
|
38
|
-
@MaxLength(
|
|
45
|
+
@MaxLength(50)
|
|
39
46
|
title?: string;
|
|
40
47
|
|
|
41
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* Cuerpo crudo para Trustonic. Camino legacy: solo se lee si no viaja `noticeType`.
|
|
50
|
+
* El tope es el de Trustonic, que exige de 1 a 350 y responde `INVALID_RANGE` fuera de rango.
|
|
51
|
+
*/
|
|
42
52
|
@Expose()
|
|
43
53
|
@IsOptional()
|
|
44
54
|
@IsString()
|
|
45
55
|
@IsNotEmpty()
|
|
46
|
-
@MaxLength(
|
|
56
|
+
@MaxLength(350)
|
|
47
57
|
content?: string;
|
|
48
58
|
|
|
49
59
|
@Expose()
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Expose } from 'class-transformer';
|
|
2
|
-
import { IsString, IsOptional, IsObject, MaxLength, MinLength } from 'class-validator';
|
|
2
|
+
import { IsString, IsOptional, IsNotEmpty, IsObject, MaxLength, MinLength } from 'class-validator';
|
|
3
3
|
|
|
4
4
|
export class CreateProfileRequest {
|
|
5
5
|
@Expose() @IsString() @MinLength(1) @MaxLength(100) firstName!: string;
|
|
@@ -8,7 +8,10 @@ export class CreateProfileRequest {
|
|
|
8
8
|
@Expose() @IsOptional() @IsString() @MaxLength(200) company?: string;
|
|
9
9
|
@Expose() @IsString() @MinLength(2) @MaxLength(100) slug!: string;
|
|
10
10
|
@Expose() @IsString() directoryId!: string;
|
|
11
|
-
|
|
11
|
+
/** Requerido desde DEC: se usa como llave para resolver el codigo de referido
|
|
12
|
+
* (IOnboardingBusinessApi.getByPhoneNumber) al crear el perfil. Inmutable tras la creacion
|
|
13
|
+
* (UpdateProfileRequest ya no acepta este campo). */
|
|
14
|
+
@Expose() @IsString() @IsNotEmpty() phone!: string;
|
|
12
15
|
@Expose() @IsOptional() @IsString() email?: string;
|
|
13
16
|
@Expose() @IsOptional() @IsString() @MaxLength(500) bio?: string;
|
|
14
17
|
@Expose() @IsOptional() @IsObject() socialLinks?: Record<string, string>;
|
|
@@ -13,6 +13,9 @@ export interface ProfileResponse {
|
|
|
13
13
|
logoUrl?: string;
|
|
14
14
|
bio?: string;
|
|
15
15
|
socialLinks?: Record<string, string>;
|
|
16
|
+
/** Codigo de referido del promotor (myReferralCode de Onboarding), resuelto por telefono al
|
|
17
|
+
* crear el perfil. null si el telefono no tiene codigo asociado en Onboarding. */
|
|
18
|
+
referralCode?: string | null;
|
|
16
19
|
status: ProfileStatusEnum;
|
|
17
20
|
directoryId: string;
|
|
18
21
|
createdAt: number;
|
|
@@ -8,7 +8,8 @@ export class UpdateProfileRequest {
|
|
|
8
8
|
@Expose() @IsOptional() @IsString() @MaxLength(200) title?: string;
|
|
9
9
|
@Expose() @IsOptional() @IsString() @MaxLength(200) company?: string;
|
|
10
10
|
@Expose() @IsOptional() @IsString() @MinLength(2) @MaxLength(100) slug?: string;
|
|
11
|
-
|
|
11
|
+
// phone es inmutable tras la creacion del perfil (queda asociado al numero con el que se
|
|
12
|
+
// creo la cuenta, usado para resolver el codigo de referido). No se acepta en Update.
|
|
12
13
|
@Expose() @IsOptional() @IsString() email?: string;
|
|
13
14
|
@Expose() @IsOptional() @IsString() @MaxLength(500) bio?: string;
|
|
14
15
|
@Expose() @IsOptional() @IsObject() socialLinks?: Record<string, string>;
|