@fiado/type-kit 3.618.0 → 3.620.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/collection/authorizeCollectionMovementRequest.test.ts +33 -0
- package/_test_/unit/reconciliation/reconciliationCatalogs.test.ts +9 -0
- package/_test_/unit/reconciliation/reconciliationRequests.test.ts +23 -4
- package/_test_/unit/transferNote/transferNoteConfigAndPrivate.test.ts +23 -8
- package/bin/collection/dtos/AuthorizeCollectionMovementRequest.d.ts +1 -0
- package/bin/collection/dtos/AuthorizeCollectionMovementRequest.js +6 -0
- package/bin/reconciliation/constants/reconciliationErrorHttpStatus.d.ts +7 -3
- package/bin/reconciliation/constants/reconciliationErrorHttpStatus.js +4 -1
- package/bin/reconciliation/dtos/requests/PrivateReconciliationRequests.d.ts +49 -13
- package/bin/reconciliation/dtos/requests/PrivateReconciliationRequests.js +61 -13
- package/bin/reconciliation/dtos/requests/reconciliationRequestDecorators.d.ts +1 -3
- package/bin/reconciliation/dtos/requests/reconciliationRequestDecorators.js +3 -10
- package/bin/reconciliation/enums/ReconciliationFeedErrorCodeEnum.d.ts +4 -1
- package/bin/reconciliation/enums/ReconciliationFeedErrorCodeEnum.js +3 -0
- package/bin/transferNote/constants/transferNoteValidation.d.ts +2 -0
- package/bin/transferNote/constants/transferNoteValidation.js +3 -1
- package/bin/transferNote/dtos/requests/PrivateTransferNoteRequests.d.ts +41 -11
- package/bin/transferNote/dtos/requests/PrivateTransferNoteRequests.js +51 -11
- package/bin/transferNote/dtos/requests/transferNoteRequestDecorators.d.ts +4 -0
- package/bin/transferNote/dtos/requests/transferNoteRequestDecorators.js +26 -0
- package/package.json +1 -1
- package/src/collection/dtos/AuthorizeCollectionMovementRequest.ts +3 -1
- package/src/reconciliation/constants/reconciliationErrorHttpStatus.ts +6 -3
- package/src/reconciliation/dtos/requests/PrivateReconciliationRequests.ts +86 -26
- package/src/reconciliation/dtos/requests/reconciliationRequestDecorators.ts +2 -11
- package/src/reconciliation/enums/ReconciliationFeedErrorCodeEnum.ts +3 -0
- package/src/transferNote/constants/transferNoteValidation.ts +3 -0
- package/src/transferNote/dtos/requests/PrivateTransferNoteRequests.ts +72 -22
- package/src/transferNote/dtos/requests/transferNoteRequestDecorators.ts +33 -2
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
RevertTransferNoteSpeiRequest,
|
|
12
12
|
} from './TransferNoteActionRequests';
|
|
13
13
|
import { ListTransferNoteItemsQuery, ListTransferNotePoolQuery, ListTransferNotesQuery } from './TransferNoteQueries';
|
|
14
|
-
import {
|
|
14
|
+
import { OptionalEmail, RequiredActorId, RequiredId, RequiredReason } from './transferNoteRequestDecorators';
|
|
15
15
|
|
|
16
16
|
/** Tenant y servicio que llama; el lambda valida `author` contra su lista permitida. */
|
|
17
17
|
export class PrivateTransferNoteCaller {
|
|
@@ -22,10 +22,15 @@ export class PrivateTransferNoteCaller {
|
|
|
22
22
|
author!: string;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
/** Caller del espejo que llama fiado-dashboard;
|
|
25
|
+
/** Caller del espejo que llama fiado-dashboard; el operador viaja por `actorId`. */
|
|
26
26
|
export class PrivateTransferNoteOperatorCaller extends PrivateTransferNoteCaller {
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
/** `sub` de Azure AD del operador del dashboard. */
|
|
28
|
+
@RequiredActorId()
|
|
29
|
+
actorId!: string;
|
|
30
|
+
|
|
31
|
+
/** @deprecated Solo para la auditoría de loan-retail-audit. */
|
|
32
|
+
@OptionalEmail()
|
|
33
|
+
actor?: string;
|
|
29
34
|
}
|
|
30
35
|
|
|
31
36
|
/** Body de privatePreviewTransferNote. */
|
|
@@ -36,8 +41,13 @@ export class PrivatePreviewTransferNoteRequest extends PreviewTransferNoteReques
|
|
|
36
41
|
@RequiredId()
|
|
37
42
|
author!: string;
|
|
38
43
|
|
|
39
|
-
|
|
40
|
-
|
|
44
|
+
/** `sub` de Azure AD del operador del dashboard. */
|
|
45
|
+
@RequiredActorId()
|
|
46
|
+
actorId!: string;
|
|
47
|
+
|
|
48
|
+
/** @deprecated Solo para la auditoría de loan-retail-audit. */
|
|
49
|
+
@OptionalEmail()
|
|
50
|
+
actor?: string;
|
|
41
51
|
}
|
|
42
52
|
|
|
43
53
|
/** Body de privateIssueTransferNote. */
|
|
@@ -48,8 +58,13 @@ export class PrivateIssueTransferNoteRequest extends IssueTransferNoteRequest {
|
|
|
48
58
|
@RequiredId()
|
|
49
59
|
author!: string;
|
|
50
60
|
|
|
51
|
-
|
|
52
|
-
|
|
61
|
+
/** `sub` de Azure AD del operador del dashboard. */
|
|
62
|
+
@RequiredActorId()
|
|
63
|
+
actorId!: string;
|
|
64
|
+
|
|
65
|
+
/** @deprecated Solo para la auditoría de loan-retail-audit. */
|
|
66
|
+
@OptionalEmail()
|
|
67
|
+
actor?: string;
|
|
53
68
|
}
|
|
54
69
|
|
|
55
70
|
/** Body de privateCaptureTransferNoteSpei. */
|
|
@@ -60,8 +75,13 @@ export class PrivateCaptureTransferNoteSpeiRequest extends CaptureTransferNoteSp
|
|
|
60
75
|
@RequiredId()
|
|
61
76
|
author!: string;
|
|
62
77
|
|
|
63
|
-
|
|
64
|
-
|
|
78
|
+
/** `sub` de Azure AD del operador del dashboard. */
|
|
79
|
+
@RequiredActorId()
|
|
80
|
+
actorId!: string;
|
|
81
|
+
|
|
82
|
+
/** @deprecated Solo para la auditoría de loan-retail-audit. */
|
|
83
|
+
@OptionalEmail()
|
|
84
|
+
actor?: string;
|
|
65
85
|
}
|
|
66
86
|
|
|
67
87
|
/** Body de privateRevertTransferNoteSpei. */
|
|
@@ -72,8 +92,13 @@ export class PrivateRevertTransferNoteSpeiRequest extends RevertTransferNoteSpei
|
|
|
72
92
|
@RequiredId()
|
|
73
93
|
author!: string;
|
|
74
94
|
|
|
75
|
-
|
|
76
|
-
|
|
95
|
+
/** `sub` de Azure AD del operador del dashboard. */
|
|
96
|
+
@RequiredActorId()
|
|
97
|
+
actorId!: string;
|
|
98
|
+
|
|
99
|
+
/** @deprecated Solo para la auditoría de loan-retail-audit. */
|
|
100
|
+
@OptionalEmail()
|
|
101
|
+
actor?: string;
|
|
77
102
|
}
|
|
78
103
|
|
|
79
104
|
/** Body de privateCancelTransferNote. */
|
|
@@ -84,8 +109,13 @@ export class PrivateCancelTransferNoteRequest extends CancelTransferNoteRequest
|
|
|
84
109
|
@RequiredId()
|
|
85
110
|
author!: string;
|
|
86
111
|
|
|
87
|
-
|
|
88
|
-
|
|
112
|
+
/** `sub` de Azure AD del operador del dashboard. */
|
|
113
|
+
@RequiredActorId()
|
|
114
|
+
actorId!: string;
|
|
115
|
+
|
|
116
|
+
/** @deprecated Solo para la auditoría de loan-retail-audit. */
|
|
117
|
+
@OptionalEmail()
|
|
118
|
+
actor?: string;
|
|
89
119
|
}
|
|
90
120
|
|
|
91
121
|
/** Body de privateResolveTransferNoteDispute. */
|
|
@@ -96,8 +126,13 @@ export class PrivateResolveTransferNoteDisputeRequest extends ResolveTransferNot
|
|
|
96
126
|
@RequiredId()
|
|
97
127
|
author!: string;
|
|
98
128
|
|
|
99
|
-
|
|
100
|
-
|
|
129
|
+
/** `sub` de Azure AD del operador del dashboard. */
|
|
130
|
+
@RequiredActorId()
|
|
131
|
+
actorId!: string;
|
|
132
|
+
|
|
133
|
+
/** @deprecated Solo para la auditoría de loan-retail-audit. */
|
|
134
|
+
@OptionalEmail()
|
|
135
|
+
actor?: string;
|
|
101
136
|
}
|
|
102
137
|
|
|
103
138
|
/** Body de privateConfirmTransferNoteReception. */
|
|
@@ -129,8 +164,13 @@ export class PrivateListTransferNotesQuery extends ListTransferNotesQuery {
|
|
|
129
164
|
@RequiredId()
|
|
130
165
|
author!: string;
|
|
131
166
|
|
|
132
|
-
|
|
133
|
-
|
|
167
|
+
/** `sub` de Azure AD del operador del dashboard. */
|
|
168
|
+
@RequiredActorId()
|
|
169
|
+
actorId!: string;
|
|
170
|
+
|
|
171
|
+
/** @deprecated Solo para la auditoría de loan-retail-audit. */
|
|
172
|
+
@OptionalEmail()
|
|
173
|
+
actor?: string;
|
|
134
174
|
}
|
|
135
175
|
|
|
136
176
|
/** Query de privateListTransferNotePool. */
|
|
@@ -141,8 +181,13 @@ export class PrivateListTransferNotePoolQuery extends ListTransferNotePoolQuery
|
|
|
141
181
|
@RequiredId()
|
|
142
182
|
author!: string;
|
|
143
183
|
|
|
144
|
-
|
|
145
|
-
|
|
184
|
+
/** `sub` de Azure AD del operador del dashboard. */
|
|
185
|
+
@RequiredActorId()
|
|
186
|
+
actorId!: string;
|
|
187
|
+
|
|
188
|
+
/** @deprecated Solo para la auditoría de loan-retail-audit. */
|
|
189
|
+
@OptionalEmail()
|
|
190
|
+
actor?: string;
|
|
146
191
|
}
|
|
147
192
|
|
|
148
193
|
/** Query de privateListTransferNoteItems. */
|
|
@@ -153,8 +198,13 @@ export class PrivateListTransferNoteItemsQuery extends ListTransferNoteItemsQuer
|
|
|
153
198
|
@RequiredId()
|
|
154
199
|
author!: string;
|
|
155
200
|
|
|
156
|
-
|
|
157
|
-
|
|
201
|
+
/** `sub` de Azure AD del operador del dashboard. */
|
|
202
|
+
@RequiredActorId()
|
|
203
|
+
actorId!: string;
|
|
204
|
+
|
|
205
|
+
/** @deprecated Solo para la auditoría de loan-retail-audit. */
|
|
206
|
+
@OptionalEmail()
|
|
207
|
+
actor?: string;
|
|
158
208
|
}
|
|
159
209
|
|
|
160
210
|
/** Body de privateRunTransferNoteCutoff: responde 202 con `runId` y corre asíncrono. */
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { Expose, Transform, Type } from 'class-transformer';
|
|
2
|
-
import { IsEmail, IsInt, IsNotEmpty, IsOptional, IsString, Matches, Max, Min, MinLength } from 'class-validator';
|
|
3
|
-
import {
|
|
2
|
+
import { IsEmail, IsInt, IsNotEmpty, IsOptional, IsString, Matches, Max, MaxLength, Min, MinLength, ValidateBy, isEmail } from 'class-validator';
|
|
3
|
+
import {
|
|
4
|
+
TRANSFER_NOTE_ACTOR_ID_MAX_LENGTH,
|
|
5
|
+
TRANSFER_NOTE_ISO_WEEK_PATTERN,
|
|
6
|
+
TRANSFER_NOTE_MAX_PAGE_SIZE,
|
|
7
|
+
TRANSFER_NOTE_MIN_REASON_LENGTH,
|
|
8
|
+
} from '../../constants/transferNoteValidation';
|
|
4
9
|
|
|
5
10
|
const trim = Transform(({ value }) => (typeof value === 'string' ? value.trim() : value));
|
|
6
11
|
|
|
@@ -41,6 +46,32 @@ export function RequiredEmail(): PropertyDecorator {
|
|
|
41
46
|
};
|
|
42
47
|
}
|
|
43
48
|
|
|
49
|
+
/** Email opcional. */
|
|
50
|
+
export function OptionalEmail(): PropertyDecorator {
|
|
51
|
+
return (target, key) => {
|
|
52
|
+
Expose()(target, key);
|
|
53
|
+
IsOptional()(target, key);
|
|
54
|
+
IsEmail()(target, key);
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Id obligatorio del operador: no vacío, acotado y nunca con forma de email. */
|
|
59
|
+
export function RequiredActorId(): PropertyDecorator {
|
|
60
|
+
return (target, key) => {
|
|
61
|
+
Expose()(target, key);
|
|
62
|
+
IsString()(target, key);
|
|
63
|
+
IsNotEmpty()(target, key);
|
|
64
|
+
MaxLength(TRANSFER_NOTE_ACTOR_ID_MAX_LENGTH)(target, key);
|
|
65
|
+
ValidateBy({
|
|
66
|
+
name: 'isNotEmail',
|
|
67
|
+
validator: {
|
|
68
|
+
validate: (value) => typeof value === 'string' && !isEmail(value),
|
|
69
|
+
defaultMessage: () => '$property no puede ser un email',
|
|
70
|
+
},
|
|
71
|
+
})(target, key);
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
44
75
|
/** Semana ISO opcional `YYYY-Www`. */
|
|
45
76
|
export function OptionalIsoWeek(): PropertyDecorator {
|
|
46
77
|
return (target, key) => {
|