c2-clinical 1.0.210 → 1.0.212

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.
@@ -58,7 +58,9 @@ class ProcessAnswerFlowTester {
58
58
  }
59
59
  // check minValue e maxValue
60
60
  if (relationed.typeAnswer === enum_1.TypeAnswerEnum.OPEN_NUMBER) {
61
- const validations = [];
61
+ const validations = [
62
+ ...(relationed.validations?.filter((v) => !v.auto) ?? [])
63
+ ];
62
64
  if (!isNaN(Number(relationed.minValue)) &&
63
65
  Number(relationed.answer) < Number(relationed.minValue)) {
64
66
  validations.push({
@@ -80,7 +82,7 @@ class ProcessAnswerFlowTester {
80
82
  });
81
83
  }
82
84
  if (validations.length) {
83
- relationed.validations = [...relationed.validations, ...validations];
85
+ relationed.validations = [...validations];
84
86
  }
85
87
  }
86
88
  // check options is enables
@@ -44,16 +44,22 @@ export declare const AnamneseAnswerSchema: Schema<any, import("mongoose").Model<
44
44
  type?: string | null | undefined;
45
45
  formulaToMessage?: string | null | undefined;
46
46
  message?: string | null | undefined;
47
+ minValue?: number | null | undefined;
48
+ maxValue?: number | null | undefined;
47
49
  }, Types.Subdocument<Types.ObjectId, any, {
48
50
  typeOutput: string;
49
51
  type?: string | null | undefined;
50
52
  formulaToMessage?: string | null | undefined;
51
53
  message?: string | null | undefined;
54
+ minValue?: number | null | undefined;
55
+ maxValue?: number | null | undefined;
52
56
  }> & {
53
57
  typeOutput: string;
54
58
  type?: string | null | undefined;
55
59
  formulaToMessage?: string | null | undefined;
56
60
  message?: string | null | undefined;
61
+ minValue?: number | null | undefined;
62
+ maxValue?: number | null | undefined;
57
63
  }>;
58
64
  anamnese: {
59
65
  prototype?: Types.ObjectId | null | undefined;
@@ -120,16 +126,22 @@ export declare const AnamneseAnswerSchema: Schema<any, import("mongoose").Model<
120
126
  type?: string | null | undefined;
121
127
  formulaToMessage?: string | null | undefined;
122
128
  message?: string | null | undefined;
129
+ minValue?: number | null | undefined;
130
+ maxValue?: number | null | undefined;
123
131
  }, Types.Subdocument<Types.ObjectId, any, {
124
132
  typeOutput: string;
125
133
  type?: string | null | undefined;
126
134
  formulaToMessage?: string | null | undefined;
127
135
  message?: string | null | undefined;
136
+ minValue?: number | null | undefined;
137
+ maxValue?: number | null | undefined;
128
138
  }> & {
129
139
  typeOutput: string;
130
140
  type?: string | null | undefined;
131
141
  formulaToMessage?: string | null | undefined;
132
142
  message?: string | null | undefined;
143
+ minValue?: number | null | undefined;
144
+ maxValue?: number | null | undefined;
133
145
  }>;
134
146
  anamnese: {
135
147
  prototype?: Types.ObjectId | null | undefined;
@@ -196,16 +208,22 @@ export declare const AnamneseAnswerSchema: Schema<any, import("mongoose").Model<
196
208
  type?: string | null | undefined;
197
209
  formulaToMessage?: string | null | undefined;
198
210
  message?: string | null | undefined;
211
+ minValue?: number | null | undefined;
212
+ maxValue?: number | null | undefined;
199
213
  }, Types.Subdocument<Types.ObjectId, any, {
200
214
  typeOutput: string;
201
215
  type?: string | null | undefined;
202
216
  formulaToMessage?: string | null | undefined;
203
217
  message?: string | null | undefined;
218
+ minValue?: number | null | undefined;
219
+ maxValue?: number | null | undefined;
204
220
  }> & {
205
221
  typeOutput: string;
206
222
  type?: string | null | undefined;
207
223
  formulaToMessage?: string | null | undefined;
208
224
  message?: string | null | undefined;
225
+ minValue?: number | null | undefined;
226
+ maxValue?: number | null | undefined;
209
227
  }>;
210
228
  anamnese: {
211
229
  prototype?: Types.ObjectId | null | undefined;
@@ -115,7 +115,9 @@ export declare enum TypeButtonAction {
115
115
  }
116
116
  export declare enum TypeValidationEnum {
117
117
  WARNING = "WARNING",
118
- REQUIRED = "REQUIRED"
118
+ REQUIRED = "REQUIRED",
119
+ MIN_VALUE = "MIN_VALUE",
120
+ MAX_VALUE = "MAX_VALUE"
119
121
  }
120
122
  export declare enum TypeTipEnum {
121
123
  IMAGE = "IMAGE",
@@ -133,6 +133,8 @@ var TypeValidationEnum;
133
133
  (function (TypeValidationEnum) {
134
134
  TypeValidationEnum["WARNING"] = "WARNING";
135
135
  TypeValidationEnum["REQUIRED"] = "REQUIRED";
136
+ TypeValidationEnum["MIN_VALUE"] = "MIN_VALUE";
137
+ TypeValidationEnum["MAX_VALUE"] = "MAX_VALUE";
136
138
  })(TypeValidationEnum || (exports.TypeValidationEnum = TypeValidationEnum = {}));
137
139
  var TypeTipEnum;
138
140
  (function (TypeTipEnum) {
@@ -44,6 +44,8 @@ export interface IValidationQuestion {
44
44
  typeOutput: TypeOutputValidationEnum;
45
45
  formulaToMessage: string;
46
46
  message?: string;
47
+ minValue?: number;
48
+ maxValue?: number;
47
49
  auto?: boolean;
48
50
  }
49
51
  export interface IRow {
@@ -228,16 +230,22 @@ export declare const ValidationSchema: Schema<any, import("mongoose").Model<any,
228
230
  type?: string | null | undefined;
229
231
  formulaToMessage?: string | null | undefined;
230
232
  message?: string | null | undefined;
233
+ minValue?: number | null | undefined;
234
+ maxValue?: number | null | undefined;
231
235
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
232
236
  typeOutput: string;
233
237
  type?: string | null | undefined;
234
238
  formulaToMessage?: string | null | undefined;
235
239
  message?: string | null | undefined;
240
+ minValue?: number | null | undefined;
241
+ maxValue?: number | null | undefined;
236
242
  }>, {}> & import("mongoose").FlatRecord<{
237
243
  typeOutput: string;
238
244
  type?: string | null | undefined;
239
245
  formulaToMessage?: string | null | undefined;
240
246
  message?: string | null | undefined;
247
+ minValue?: number | null | undefined;
248
+ maxValue?: number | null | undefined;
241
249
  }> & {
242
250
  _id: Types.ObjectId;
243
251
  } & {
@@ -296,16 +304,22 @@ export declare const FormUnitSchema: Schema<any, import("mongoose").Model<any, a
296
304
  type?: string | null | undefined;
297
305
  formulaToMessage?: string | null | undefined;
298
306
  message?: string | null | undefined;
307
+ minValue?: number | null | undefined;
308
+ maxValue?: number | null | undefined;
299
309
  }, Types.Subdocument<Types.ObjectId, any, {
300
310
  typeOutput: string;
301
311
  type?: string | null | undefined;
302
312
  formulaToMessage?: string | null | undefined;
303
313
  message?: string | null | undefined;
314
+ minValue?: number | null | undefined;
315
+ maxValue?: number | null | undefined;
304
316
  }> & {
305
317
  typeOutput: string;
306
318
  type?: string | null | undefined;
307
319
  formulaToMessage?: string | null | undefined;
308
320
  message?: string | null | undefined;
321
+ minValue?: number | null | undefined;
322
+ maxValue?: number | null | undefined;
309
323
  }>;
310
324
  show: boolean;
311
325
  readOnly: boolean;
@@ -335,6 +349,8 @@ export declare const FormUnitSchema: Schema<any, import("mongoose").Model<any, a
335
349
  }>;
336
350
  account?: Types.ObjectId | null | undefined;
337
351
  description?: string | null | undefined;
352
+ minValue?: number | null | undefined;
353
+ maxValue?: number | null | undefined;
338
354
  reference?: Types.ObjectId | null | undefined;
339
355
  formulaToDescription?: string | null | undefined;
340
356
  example?: string | null | undefined;
@@ -344,8 +360,6 @@ export declare const FormUnitSchema: Schema<any, import("mongoose").Model<any, a
344
360
  typeAnswer?: string | null | undefined;
345
361
  defaultAnswer?: any;
346
362
  width?: number | null | undefined;
347
- minValue?: number | null | undefined;
348
- maxValue?: number | null | undefined;
349
363
  variantView?: string | null | undefined;
350
364
  typeButtonAction?: string | null | undefined;
351
365
  externalFlowCode?: string | null | undefined;
@@ -448,16 +462,22 @@ export declare const FormUnitSchema: Schema<any, import("mongoose").Model<any, a
448
462
  type?: string | null | undefined;
449
463
  formulaToMessage?: string | null | undefined;
450
464
  message?: string | null | undefined;
465
+ minValue?: number | null | undefined;
466
+ maxValue?: number | null | undefined;
451
467
  }, Types.Subdocument<Types.ObjectId, any, {
452
468
  typeOutput: string;
453
469
  type?: string | null | undefined;
454
470
  formulaToMessage?: string | null | undefined;
455
471
  message?: string | null | undefined;
472
+ minValue?: number | null | undefined;
473
+ maxValue?: number | null | undefined;
456
474
  }> & {
457
475
  typeOutput: string;
458
476
  type?: string | null | undefined;
459
477
  formulaToMessage?: string | null | undefined;
460
478
  message?: string | null | undefined;
479
+ minValue?: number | null | undefined;
480
+ maxValue?: number | null | undefined;
461
481
  }>;
462
482
  show: boolean;
463
483
  readOnly: boolean;
@@ -487,6 +507,8 @@ export declare const FormUnitSchema: Schema<any, import("mongoose").Model<any, a
487
507
  }>;
488
508
  account?: Types.ObjectId | null | undefined;
489
509
  description?: string | null | undefined;
510
+ minValue?: number | null | undefined;
511
+ maxValue?: number | null | undefined;
490
512
  reference?: Types.ObjectId | null | undefined;
491
513
  formulaToDescription?: string | null | undefined;
492
514
  example?: string | null | undefined;
@@ -496,8 +518,6 @@ export declare const FormUnitSchema: Schema<any, import("mongoose").Model<any, a
496
518
  typeAnswer?: string | null | undefined;
497
519
  defaultAnswer?: any;
498
520
  width?: number | null | undefined;
499
- minValue?: number | null | undefined;
500
- maxValue?: number | null | undefined;
501
521
  variantView?: string | null | undefined;
502
522
  typeButtonAction?: string | null | undefined;
503
523
  externalFlowCode?: string | null | undefined;
@@ -600,16 +620,22 @@ export declare const FormUnitSchema: Schema<any, import("mongoose").Model<any, a
600
620
  type?: string | null | undefined;
601
621
  formulaToMessage?: string | null | undefined;
602
622
  message?: string | null | undefined;
623
+ minValue?: number | null | undefined;
624
+ maxValue?: number | null | undefined;
603
625
  }, Types.Subdocument<Types.ObjectId, any, {
604
626
  typeOutput: string;
605
627
  type?: string | null | undefined;
606
628
  formulaToMessage?: string | null | undefined;
607
629
  message?: string | null | undefined;
630
+ minValue?: number | null | undefined;
631
+ maxValue?: number | null | undefined;
608
632
  }> & {
609
633
  typeOutput: string;
610
634
  type?: string | null | undefined;
611
635
  formulaToMessage?: string | null | undefined;
612
636
  message?: string | null | undefined;
637
+ minValue?: number | null | undefined;
638
+ maxValue?: number | null | undefined;
613
639
  }>;
614
640
  show: boolean;
615
641
  readOnly: boolean;
@@ -639,6 +665,8 @@ export declare const FormUnitSchema: Schema<any, import("mongoose").Model<any, a
639
665
  }>;
640
666
  account?: Types.ObjectId | null | undefined;
641
667
  description?: string | null | undefined;
668
+ minValue?: number | null | undefined;
669
+ maxValue?: number | null | undefined;
642
670
  reference?: Types.ObjectId | null | undefined;
643
671
  formulaToDescription?: string | null | undefined;
644
672
  example?: string | null | undefined;
@@ -648,8 +676,6 @@ export declare const FormUnitSchema: Schema<any, import("mongoose").Model<any, a
648
676
  typeAnswer?: string | null | undefined;
649
677
  defaultAnswer?: any;
650
678
  width?: number | null | undefined;
651
- minValue?: number | null | undefined;
652
- maxValue?: number | null | undefined;
653
679
  variantView?: string | null | undefined;
654
680
  typeButtonAction?: string | null | undefined;
655
681
  externalFlowCode?: string | null | undefined;
@@ -30,7 +30,9 @@ exports.ValidationSchema = new mongoose_1.Schema({
30
30
  default: enum_1.TypeOutputValidationEnum.TEXT
31
31
  },
32
32
  formulaToMessage: { type: String },
33
- message: { type: String }
33
+ message: { type: String },
34
+ minValue: { type: Number },
35
+ maxValue: { type: Number }
34
36
  }, { _id: false });
35
37
  exports.FormUnitSchema = new mongoose_1.Schema({
36
38
  //account só é usado quando for montado por uma conta, quando for modelo disponível a todos ele deve estar sem preenchimento
@@ -44,16 +44,22 @@ export declare const QAAnswerSchema: Schema<any, import("mongoose").Model<any, a
44
44
  type?: string | null | undefined;
45
45
  formulaToMessage?: string | null | undefined;
46
46
  message?: string | null | undefined;
47
+ minValue?: number | null | undefined;
48
+ maxValue?: number | null | undefined;
47
49
  }, Types.Subdocument<Types.ObjectId, any, {
48
50
  typeOutput: string;
49
51
  type?: string | null | undefined;
50
52
  formulaToMessage?: string | null | undefined;
51
53
  message?: string | null | undefined;
54
+ minValue?: number | null | undefined;
55
+ maxValue?: number | null | undefined;
52
56
  }> & {
53
57
  typeOutput: string;
54
58
  type?: string | null | undefined;
55
59
  formulaToMessage?: string | null | undefined;
56
60
  message?: string | null | undefined;
61
+ minValue?: number | null | undefined;
62
+ maxValue?: number | null | undefined;
57
63
  }>;
58
64
  requestGraphicData: Types.DocumentArray<{
59
65
  method: string;
@@ -120,16 +126,22 @@ export declare const QAAnswerSchema: Schema<any, import("mongoose").Model<any, a
120
126
  type?: string | null | undefined;
121
127
  formulaToMessage?: string | null | undefined;
122
128
  message?: string | null | undefined;
129
+ minValue?: number | null | undefined;
130
+ maxValue?: number | null | undefined;
123
131
  }, Types.Subdocument<Types.ObjectId, any, {
124
132
  typeOutput: string;
125
133
  type?: string | null | undefined;
126
134
  formulaToMessage?: string | null | undefined;
127
135
  message?: string | null | undefined;
136
+ minValue?: number | null | undefined;
137
+ maxValue?: number | null | undefined;
128
138
  }> & {
129
139
  typeOutput: string;
130
140
  type?: string | null | undefined;
131
141
  formulaToMessage?: string | null | undefined;
132
142
  message?: string | null | undefined;
143
+ minValue?: number | null | undefined;
144
+ maxValue?: number | null | undefined;
133
145
  }>;
134
146
  requestGraphicData: Types.DocumentArray<{
135
147
  method: string;
@@ -196,16 +208,22 @@ export declare const QAAnswerSchema: Schema<any, import("mongoose").Model<any, a
196
208
  type?: string | null | undefined;
197
209
  formulaToMessage?: string | null | undefined;
198
210
  message?: string | null | undefined;
211
+ minValue?: number | null | undefined;
212
+ maxValue?: number | null | undefined;
199
213
  }, Types.Subdocument<Types.ObjectId, any, {
200
214
  typeOutput: string;
201
215
  type?: string | null | undefined;
202
216
  formulaToMessage?: string | null | undefined;
203
217
  message?: string | null | undefined;
218
+ minValue?: number | null | undefined;
219
+ maxValue?: number | null | undefined;
204
220
  }> & {
205
221
  typeOutput: string;
206
222
  type?: string | null | undefined;
207
223
  formulaToMessage?: string | null | undefined;
208
224
  message?: string | null | undefined;
225
+ minValue?: number | null | undefined;
226
+ maxValue?: number | null | undefined;
209
227
  }>;
210
228
  requestGraphicData: Types.DocumentArray<{
211
229
  method: string;
@@ -33,16 +33,22 @@ export declare const QPCAnswerSchema: Schema<any, import("mongoose").Model<any,
33
33
  type?: string | null | undefined;
34
34
  formulaToMessage?: string | null | undefined;
35
35
  message?: string | null | undefined;
36
+ minValue?: number | null | undefined;
37
+ maxValue?: number | null | undefined;
36
38
  }, Types.Subdocument<Types.ObjectId, any, {
37
39
  typeOutput: string;
38
40
  type?: string | null | undefined;
39
41
  formulaToMessage?: string | null | undefined;
40
42
  message?: string | null | undefined;
43
+ minValue?: number | null | undefined;
44
+ maxValue?: number | null | undefined;
41
45
  }> & {
42
46
  typeOutput: string;
43
47
  type?: string | null | undefined;
44
48
  formulaToMessage?: string | null | undefined;
45
49
  message?: string | null | undefined;
50
+ minValue?: number | null | undefined;
51
+ maxValue?: number | null | undefined;
46
52
  }>;
47
53
  requestGraphicData: Types.DocumentArray<{
48
54
  method: string;
@@ -100,16 +106,22 @@ export declare const QPCAnswerSchema: Schema<any, import("mongoose").Model<any,
100
106
  type?: string | null | undefined;
101
107
  formulaToMessage?: string | null | undefined;
102
108
  message?: string | null | undefined;
109
+ minValue?: number | null | undefined;
110
+ maxValue?: number | null | undefined;
103
111
  }, Types.Subdocument<Types.ObjectId, any, {
104
112
  typeOutput: string;
105
113
  type?: string | null | undefined;
106
114
  formulaToMessage?: string | null | undefined;
107
115
  message?: string | null | undefined;
116
+ minValue?: number | null | undefined;
117
+ maxValue?: number | null | undefined;
108
118
  }> & {
109
119
  typeOutput: string;
110
120
  type?: string | null | undefined;
111
121
  formulaToMessage?: string | null | undefined;
112
122
  message?: string | null | undefined;
123
+ minValue?: number | null | undefined;
124
+ maxValue?: number | null | undefined;
113
125
  }>;
114
126
  requestGraphicData: Types.DocumentArray<{
115
127
  method: string;
@@ -167,16 +179,22 @@ export declare const QPCAnswerSchema: Schema<any, import("mongoose").Model<any,
167
179
  type?: string | null | undefined;
168
180
  formulaToMessage?: string | null | undefined;
169
181
  message?: string | null | undefined;
182
+ minValue?: number | null | undefined;
183
+ maxValue?: number | null | undefined;
170
184
  }, Types.Subdocument<Types.ObjectId, any, {
171
185
  typeOutput: string;
172
186
  type?: string | null | undefined;
173
187
  formulaToMessage?: string | null | undefined;
174
188
  message?: string | null | undefined;
189
+ minValue?: number | null | undefined;
190
+ maxValue?: number | null | undefined;
175
191
  }> & {
176
192
  typeOutput: string;
177
193
  type?: string | null | undefined;
178
194
  formulaToMessage?: string | null | undefined;
179
195
  message?: string | null | undefined;
196
+ minValue?: number | null | undefined;
197
+ maxValue?: number | null | undefined;
180
198
  }>;
181
199
  requestGraphicData: Types.DocumentArray<{
182
200
  method: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-clinical",
3
- "version": "1.0.210",
3
+ "version": "1.0.212",
4
4
  "description": "Biblioteca Typescript para API NodeJS",
5
5
  "repository": {
6
6
  "type": "git",