rapida-partner 1.18.0 → 1.19.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.
Files changed (37) hide show
  1. package/package.json +1 -1
  2. package/rapidaObject.json +1 -1
  3. package/src/constants/secrets/database.ts +1 -0
  4. package/src/constants/secrets/others.ts +3 -0
  5. package/src/constants/secrets/storage.ts +1 -0
  6. package/src/examples/components/charts/movieGenre.chart.ts +34 -0
  7. package/src/examples/components/forms/character.form.ts +4 -4
  8. package/src/examples/components/forms/company.form.ts +458 -0
  9. package/src/examples/components/forms/movie.form.ts +21 -7
  10. package/src/examples/components/forms/movieEpisode.form.ts +47 -22
  11. package/src/examples/components/forms/movieGenre.form.ts +2 -2
  12. package/src/examples/components/forms/person.form.ts +565 -0
  13. package/src/examples/components/lists/actor.list.ts +17 -0
  14. package/src/examples/components/lists/character.list.ts +1 -1
  15. package/src/examples/components/lists/movie.list.ts +1 -1
  16. package/src/examples/components/lists/movieEpisode.list.ts +15 -11
  17. package/src/examples/components/lists/movieGenre.list.ts +2 -2
  18. package/src/examples/constants/options/countriesFromEarth.ts +2011 -0
  19. package/src/examples/constants/options/legalNature.ts +198 -0
  20. package/src/examples/modules/actor.ts +1 -1
  21. package/src/examples/modules/character.ts +1 -1
  22. package/src/examples/modules/movie.ts +3 -3
  23. package/src/examples/projects/movieBackoffice.ts +22 -2
  24. package/src/interfaces/data-chart.interface.ts +15 -12
  25. package/src/interfaces/e2e.interface.ts +4 -0
  26. package/src/interfaces/form.interface.ts +0 -2
  27. package/src/interfaces/project.interface.ts +58 -14
  28. package/src/schemas/business-rules.ref.json +175 -4
  29. package/src/schemas/component-one-of.ref.json +25 -10
  30. package/src/schemas/data-chart.ref.json +146 -42
  31. package/src/schemas/e2e.ref.json +21 -0
  32. package/src/schemas/module.ref.json +40 -14
  33. package/src/schemas/project.schema.json +34 -11
  34. package/src/interfaces/layout-dashboard.interface.ts +0 -52
  35. package/src/schemas/bdd-and-e2e-narratives.ref.json +0 -47
  36. package/src/schemas/bdd-and-e2e.json +0 -33
  37. package/src/schemas/dashboard.ref.json +0 -111
@@ -28,8 +28,8 @@ export const movieGenreForm: IForm = {
28
28
  id: "movieGenres",
29
29
  endpoint: "/movie-genres",
30
30
  actions: ["create", "get", "getById", "update", "softDelete"],
31
- request : {
32
- entity: "movieGenres",
31
+ request: {
32
+ entity: "MovieGenre",
33
33
  description: "",
34
34
  fields: [
35
35
  {
@@ -0,0 +1,565 @@
1
+ import { EDataType } from "../../../enums/form.enum";
2
+ import type { IForm } from "../../../interfaces/form.interface";
3
+ import { COUNTRIES_FROM_EARTH } from "../../constants/options/countriesFromEarth";
4
+
5
+ export const personForm: IForm = {
6
+ title: "Gerenciar pessoa",
7
+ componentType: "form",
8
+ id: "personForm",
9
+ guards: "isAuthorized",
10
+ elements: [
11
+ {
12
+ id: "personTab",
13
+ type: "tab",
14
+ tabs: [
15
+ {
16
+ id: "personMainDataTab",
17
+ title: "Dados principais",
18
+ elements: [
19
+ {
20
+ label: "Nacionalidade",
21
+ type: "select",
22
+ name: "country",
23
+ dataType: EDataType.NVARCHAR,
24
+ options: COUNTRIES_FROM_EARTH.map((country) => ({
25
+ label: country.originalName,
26
+ value: country.englishNameAsValue,
27
+ isSelected: country.englishNameAsValue === "brazil",
28
+ })),
29
+ isRequired: true,
30
+ space: 2,
31
+ },
32
+ {
33
+ label: "CPF",
34
+ type: "input",
35
+ dataType: EDataType.NVARCHAR,
36
+ name: "cpf",
37
+ validators: ["cpf"],
38
+ isUnique: true,
39
+ maskRegex: "^\\d{3}\\.\\d{3}\\.\\d{3}-\\d{2}$",
40
+ space: 2,
41
+ conditions: {
42
+ form: {
43
+ elements: [
44
+ {
45
+ key: "country",
46
+ value: "brazil",
47
+ comparisonOperator: "===",
48
+ },
49
+ ],
50
+ },
51
+ },
52
+ },
53
+ {
54
+ label: "Arquivo de CPF",
55
+ type: "file",
56
+ name: "cpfFile",
57
+ dataType: EDataType.NVARCHAR,
58
+ storageConfig: {
59
+ fileNameStrategy: "uuid",
60
+ path: "person/documents",
61
+ visibility: "public",
62
+ },
63
+ space: 4,
64
+ conditions: {
65
+ form: {
66
+ elements: [
67
+ {
68
+ key: "country",
69
+ value: "brazil",
70
+ comparisonOperator: "===",
71
+ },
72
+ ],
73
+ },
74
+ },
75
+ },
76
+ {
77
+ label: "Nome completo",
78
+ type: "input",
79
+ dataType: EDataType.NVARCHAR,
80
+ name: "name",
81
+ isRequired: true,
82
+ space: 4,
83
+ },
84
+ {
85
+ label: "Gênero",
86
+ type: "select",
87
+ dataType: EDataType.NVARCHAR,
88
+ name: "gender",
89
+ options: [
90
+ { label: "Masculino", value: "male" },
91
+ { label: "Feminino", value: "female" },
92
+ { label: "Outro", value: "other" },
93
+ ],
94
+ space: 1,
95
+ },
96
+ {
97
+ label: "Data de nascimento",
98
+ type: "input",
99
+ dataType: EDataType.DATETIME2,
100
+ name: "birthday",
101
+ space: 1,
102
+ },
103
+ {
104
+ label: "Estado civil",
105
+ type: "select",
106
+ dataType: EDataType.NVARCHAR,
107
+ name: "maritalStatus",
108
+ options: [
109
+ { label: "Solteiro", value: "single" },
110
+ { label: "Casado", value: "married" },
111
+ { label: "Divorciado", value: "divorced" },
112
+ { label: "Viúvo", value: "widower" },
113
+ { label: "Noivo", value: "engaged" },
114
+ { label: "União estável", value: "stableUnion" },
115
+ ],
116
+ space: 2,
117
+ },
118
+ {
119
+ title: "Telefone principal",
120
+ type: "fieldset",
121
+ id: "phoneOneFieldset",
122
+ elements: [
123
+ {
124
+ label: "DDI",
125
+ type: "select",
126
+ dataType: EDataType.NVARCHAR,
127
+ name: "phoneOneDdi",
128
+ options: COUNTRIES_FROM_EARTH.map((country) => ({
129
+ label: country.countryCode,
130
+ value: country.countryCode,
131
+ isSelected: country.countryCode === "+55",
132
+ })),
133
+ space: 1,
134
+ },
135
+ {
136
+ label: "Telefone",
137
+ type: "input",
138
+ dataType: EDataType.NVARCHAR,
139
+ name: "phoneOne",
140
+ maskRegex: "^\\d{15}$",
141
+ space: 3,
142
+ },
143
+ ],
144
+ },
145
+ {
146
+ label: "E-mail principal",
147
+ type: "input",
148
+ dataType: EDataType.NVARCHAR,
149
+ name: "emailOne",
150
+ space: 4,
151
+ },
152
+ ],
153
+ },
154
+ {
155
+ id: "addressTab",
156
+ title: "Endereços",
157
+ elements: [
158
+ {
159
+ title: "Endereço principal",
160
+ id: "mainAddress",
161
+ type: "fieldset",
162
+ elements: [
163
+ {
164
+ label: "CEP",
165
+ type: "input",
166
+ dataType: EDataType.NVARCHAR,
167
+ name: "mainAddressZipCode",
168
+ apiRequest: {
169
+ endpoint: "https://brasilapi.com.br/api/cep/v1/",
170
+ paramType: "path",
171
+ formFieldsFilledByApiResponse: [
172
+ {
173
+ formFieldName: "mainAddressStreet",
174
+ propertiesFromApiToFillFormField: ["street"],
175
+ },
176
+ {
177
+ formFieldName: "mainAddressDistrict",
178
+ propertiesFromApiToFillFormField: ["neighborhood"],
179
+ },
180
+ {
181
+ formFieldName: "mainAddressCity",
182
+ propertiesFromApiToFillFormField: ["city"],
183
+ },
184
+ {
185
+ formFieldName: "mainAddressState",
186
+ propertiesFromApiToFillFormField: ["state"],
187
+ },
188
+ ],
189
+ conditions: {
190
+ form: {
191
+ elements: [
192
+ {
193
+ key: "country",
194
+ value: "brazil",
195
+ comparisonOperator: "===",
196
+ },
197
+ ],
198
+ },
199
+ },
200
+ },
201
+ validators: ["cep"],
202
+ space: 1,
203
+ },
204
+ {
205
+ label: "Logradouro",
206
+ type: "input",
207
+ dataType: EDataType.NVARCHAR,
208
+ name: "mainAddressStreet",
209
+ space: 2,
210
+ },
211
+ {
212
+ label: "Número",
213
+ type: "input",
214
+ dataType: EDataType.NVARCHAR,
215
+ name: "mainAddressNumber",
216
+ space: 1,
217
+ },
218
+ {
219
+ label: "Bairro",
220
+ type: "input",
221
+ dataType: EDataType.NVARCHAR,
222
+ name: "mainAddressDistrict",
223
+ space: 2,
224
+ },
225
+ {
226
+ label: "Complemento",
227
+ type: "input",
228
+ dataType: EDataType.NVARCHAR,
229
+ name: "mainAddressComplement",
230
+ space: 2,
231
+ },
232
+ {
233
+ label: "Cidade",
234
+ type: "input",
235
+ dataType: EDataType.NVARCHAR,
236
+ name: "mainAddressCity",
237
+ space: 1,
238
+ },
239
+ {
240
+ label: "Estado",
241
+ type: "input",
242
+ dataType: EDataType.NVARCHAR,
243
+ name: "mainAddressState",
244
+ space: 1,
245
+ },
246
+ {
247
+ label: "Latitude",
248
+ type: "input",
249
+ dataType: EDataType.NVARCHAR,
250
+ name: "mainAddressLatitude",
251
+ space: 1,
252
+ },
253
+ {
254
+ label: "Longitude",
255
+ type: "input",
256
+ dataType: EDataType.NVARCHAR,
257
+ name: "mainAddressLongitude",
258
+ space: 1,
259
+ },
260
+ ],
261
+ },
262
+ {
263
+ title: "Outro endereço",
264
+ type: "fieldset",
265
+ id: "otherAddress",
266
+ elements: [
267
+ {
268
+ label: "CEP",
269
+ type: "input",
270
+ dataType: EDataType.NVARCHAR,
271
+ name: "otherAddressZipCode",
272
+ apiRequest: {
273
+ endpoint: "https://brasilapi.com.br/api/cep/v1/",
274
+ paramType: "path",
275
+ formFieldsFilledByApiResponse: [
276
+ {
277
+ formFieldName: "otherAddressStreet",
278
+ propertiesFromApiToFillFormField: ["street"],
279
+ },
280
+ {
281
+ formFieldName: "otherAddressDistrict",
282
+ propertiesFromApiToFillFormField: ["neighborhood"],
283
+ },
284
+ {
285
+ formFieldName: "otherAddressCity",
286
+ propertiesFromApiToFillFormField: ["city"],
287
+ },
288
+ {
289
+ formFieldName: "otherAddressState",
290
+ propertiesFromApiToFillFormField: ["state"],
291
+ },
292
+ ],
293
+ },
294
+ validators: ["cep"],
295
+ space: 1,
296
+ },
297
+ {
298
+ label: "Logradouro",
299
+ type: "input",
300
+ dataType: EDataType.NVARCHAR,
301
+ name: "otherAddressStreet",
302
+ space: 2,
303
+ },
304
+ {
305
+ label: "Número",
306
+ type: "input",
307
+ dataType: EDataType.NVARCHAR,
308
+ name: "otherAddressNumber",
309
+ space: 1,
310
+ },
311
+ {
312
+ label: "Bairro",
313
+ type: "input",
314
+ dataType: EDataType.NVARCHAR,
315
+ name: "otherAddressDistrict",
316
+ space: 2,
317
+ },
318
+ {
319
+ label: "Complemento",
320
+ type: "input",
321
+ dataType: EDataType.NVARCHAR,
322
+ name: "otherAddressComplement",
323
+ space: 2,
324
+ },
325
+ {
326
+ label: "Cidade",
327
+ type: "input",
328
+ dataType: EDataType.NVARCHAR,
329
+ name: "otherAddressCity",
330
+ space: 1,
331
+ },
332
+ {
333
+ label: "Estado",
334
+ type: "input",
335
+ dataType: EDataType.NVARCHAR,
336
+ name: "otherAddressState",
337
+ space: 1,
338
+ },
339
+ {
340
+ label: "Latitude",
341
+ type: "input",
342
+ dataType: EDataType.NVARCHAR,
343
+ name: "otherAddressLatitude",
344
+ space: 1,
345
+ },
346
+ {
347
+ label: "Longitude",
348
+ type: "input",
349
+ dataType: EDataType.NVARCHAR,
350
+ name: "otherAddressLongitude",
351
+ space: 1,
352
+ },
353
+ ],
354
+ },
355
+ ],
356
+ },
357
+ {
358
+ id: "personContactTab",
359
+ title: "Contatos e redes",
360
+ elements: [
361
+ {
362
+ title: "Telefone secundário",
363
+ type: "fieldset",
364
+ id: "phoneTwoFieldset",
365
+ elements: [
366
+ {
367
+ label: "DDI",
368
+ type: "select",
369
+ dataType: EDataType.NVARCHAR,
370
+ name: "phoneTwoDdi",
371
+ options: COUNTRIES_FROM_EARTH.map((country) => ({
372
+ label: country.countryCode,
373
+ value: country.countryCode,
374
+ isSelected: country.countryCode === "+55",
375
+ })),
376
+ space: 2,
377
+ },
378
+ {
379
+ label: "Telefone",
380
+ type: "input",
381
+ dataType: EDataType.NVARCHAR,
382
+ name: "phoneTwo",
383
+ maskRegex: "^\\d{15}$",
384
+ space: 2,
385
+ },
386
+ ],
387
+ },
388
+ {
389
+ label: "E-mail secundário",
390
+ type: "input",
391
+ dataType: EDataType.NVARCHAR,
392
+ name: "emailTwo",
393
+ space: 1,
394
+ },
395
+ {
396
+ label: "Site 1",
397
+ type: "input",
398
+ dataType: EDataType.NVARCHAR,
399
+ name: "siteOne",
400
+ space: 2,
401
+ },
402
+ {
403
+ label: "Site 2",
404
+ type: "input",
405
+ dataType: EDataType.NVARCHAR,
406
+ name: "siteTwo",
407
+ space: 2,
408
+ },
409
+ {
410
+ label: "Linkedin",
411
+ type: "input",
412
+ dataType: EDataType.NVARCHAR,
413
+ name: "linkedin",
414
+ space: 1,
415
+ },
416
+ {
417
+ label: "Instagram",
418
+ type: "input",
419
+ dataType: EDataType.NVARCHAR,
420
+ name: "instagram",
421
+ space: 1,
422
+ },
423
+ {
424
+ label: "Facebook",
425
+ type: "input",
426
+ dataType: EDataType.NVARCHAR,
427
+ name: "facebook",
428
+ space: 1,
429
+ },
430
+ ],
431
+ },
432
+ {
433
+ id: "documentationTab",
434
+ title: "Documentações",
435
+ elements: [
436
+ {
437
+ title: "RG",
438
+ type: "fieldset",
439
+ id: "rgFieldset",
440
+ elements: [
441
+ {
442
+ label: "RG",
443
+ name: "rg",
444
+ type: "input",
445
+ dataType: EDataType.NVARCHAR,
446
+ space: 2,
447
+ },
448
+ {
449
+ label: "Data de emissão do RG",
450
+ name: "rgIssueDate",
451
+ type: "input",
452
+ dataType: EDataType.DATETIME2,
453
+ space: 1,
454
+ },
455
+ {
456
+ label: "Data de validade do RG",
457
+ name: "rgExpiryDate",
458
+ type: "input",
459
+ dataType: EDataType.DATETIME2,
460
+ space: 1,
461
+ },
462
+ {
463
+ label: "Arquivo do RG",
464
+ name: "rgFile",
465
+ type: "file",
466
+ dataType: EDataType.NVARCHAR,
467
+ storageConfig: {
468
+ fileNameStrategy: "uuid",
469
+ path: "person/documents",
470
+ visibility: "public",
471
+ },
472
+ space: 4,
473
+ },
474
+ ],
475
+ },
476
+ {
477
+ title: "Passaporte",
478
+ type: "fieldset",
479
+ id: "passportFieldset",
480
+ elements: [
481
+ {
482
+ label: "Passaporte",
483
+ type: "input",
484
+ dataType: EDataType.NVARCHAR,
485
+ name: "passport",
486
+ isUnique: true,
487
+ space: 2,
488
+ },
489
+ {
490
+ label: "Data de emissão do passaporte",
491
+ type: "input",
492
+ dataType: EDataType.DATETIME2,
493
+ name: "passportIssueDate",
494
+ space: 1,
495
+ },
496
+ {
497
+ label: "Data de validade do passaporte",
498
+ type: "input",
499
+ dataType: EDataType.DATETIME2,
500
+ name: "passportExpiryDate",
501
+ space: 1,
502
+ },
503
+ {
504
+ label: "Arquivo do passaporte",
505
+ name: "passportFile",
506
+ type: "file",
507
+ dataType: EDataType.NVARCHAR,
508
+ storageConfig: {
509
+ fileNameStrategy: "uuid",
510
+ path: "person/documents",
511
+ visibility: "public",
512
+ },
513
+ space: 4,
514
+ },
515
+ ],
516
+ },
517
+ ],
518
+ },
519
+ {
520
+ id: "moreDetailsTab",
521
+ title: "Outros dados",
522
+ elements: [
523
+ {
524
+ label: "Foto da pessoa",
525
+ type: "file",
526
+ dataType: EDataType.NVARCHAR,
527
+ storageConfig: {
528
+ fileNameStrategy: "uuid",
529
+ path: "person/pictures",
530
+ visibility: "public",
531
+ },
532
+ name: "pictureUrl",
533
+ space: 4,
534
+ },
535
+ {
536
+ label: "Nome social",
537
+ type: "input",
538
+ dataType: EDataType.NVARCHAR,
539
+ name: "nickname",
540
+ space: 4,
541
+ },
542
+ {
543
+ label: "Descrição da pessoa",
544
+ type: "input",
545
+ dataType: EDataType.LONGTEXT,
546
+ name: "personDescription",
547
+ space: 4,
548
+ },
549
+ ],
550
+ },
551
+ ],
552
+ },
553
+ ],
554
+ contracts: [
555
+ {
556
+ id: "people",
557
+ endpoint: "/people",
558
+ actions: ["create", "get", "getById", "update", "softDelete"],
559
+ request: {
560
+ entity: "people",
561
+ fields: [],
562
+ },
563
+ },
564
+ ],
565
+ };
@@ -46,5 +46,22 @@ export const actorList: IList = {
46
46
  }
47
47
  ],
48
48
  contracts: [
49
+ {
50
+ id: "actors",
51
+ endpoint: "/actors",
52
+ actions: ["create", "get", "getById", "update", "softDelete"],
53
+ request: {
54
+ entity: "Actor",
55
+ description: "Represents an actor or actress in the system.",
56
+ fields: [
57
+ { name: "id", dataType: EDataType.UNIQUEIDENTIFIER, isRequired: true, isPrimaryKey: true },
58
+ { name: "name", dataType: EDataType.NVARCHAR, isRequired: true },
59
+ { name: "socialName", dataType: EDataType.NVARCHAR, isRequired: true },
60
+ { name: "birthDate", dataType: EDataType.DATETIME2, isRequired: true },
61
+ { name: "pictureFile", dataType: EDataType.NVARCHAR },
62
+ { name: "biography", dataType: EDataType.LONGTEXT },
63
+ ]
64
+ }
65
+ }
49
66
  ],
50
67
  };
@@ -49,7 +49,7 @@ export const characterList: IList = {
49
49
  {
50
50
  id: "characters",
51
51
  endpoint: "/characters",
52
- actions: ["get", "getById"],
52
+ actions: ["get", "getById", "softDelete", "create", "update"],
53
53
  request: {
54
54
  entity: "characters",
55
55
  description: "Represents a character in a story or narrative.",
@@ -22,7 +22,7 @@ export const movieList: IList = {
22
22
  property: "releaseDate", type: "subtitle", label: "Data de lançamento", dataType: EDataType.DATETIME2,
23
23
  },
24
24
  {
25
- property: "movieGenres.name", type: "subtitle", label: "Gênero", dataType: EDataType.NVARCHAR,
25
+ property: "movieGenresId.name", type: "subtitle", label: "Gênero", dataType: EDataType.NVARCHAR,
26
26
  },
27
27
  {
28
28
  property: "description", type: "description", label: "Descrição", isHtml: true, dataType: EDataType.LONGTEXT
@@ -51,7 +51,7 @@ export const movieEpisodeList: IList = {
51
51
  ],
52
52
  contracts: [
53
53
  {
54
- id: "moviesEpisodes",
54
+ id: "movieEpisodes",
55
55
  endpoint: "/movies-episodes",
56
56
  actions: ["create", "get", "getById", "update", "softDelete"],
57
57
  request: {
@@ -59,19 +59,23 @@ export const movieEpisodeList: IList = {
59
59
  description: "Represents an episode of a TV series or show.",
60
60
  fields: [
61
61
  { name: "_id", dataType: EDataType.UNIQUEIDENTIFIER, isRequired: true, isPrimaryKey: true },
62
- { name: "movieId", dataType: EDataType.UNIQUEIDENTIFIER, isRequired: true, foreignKey: {
63
- entity: "Movie",
64
- connectionAttribute: "_id",
65
- relationship: "one-to-many"
66
- } },
62
+ {
63
+ name: "movieId", dataType: EDataType.UNIQUEIDENTIFIER, isRequired: true, foreignKey: {
64
+ entity: "Movie",
65
+ connectionAttribute: "_id",
66
+ relationship: "one-to-many"
67
+ }
68
+ },
67
69
  { name: "title", dataType: EDataType.NVARCHAR, isRequired: true },
68
70
  { name: "description", dataType: EDataType.LONGTEXT, isRequired: true },
69
71
  { name: "releaseDate", dataType: EDataType.DATETIME2, isRequired: true },
70
- { name: "characters", dataType: EDataType.UNIQUEIDENTIFIER, isRequired: false, foreignKey: {
71
- entity: "Character",
72
- connectionAttribute: "_id",
73
- relationship: "many-to-many"
74
- } },
72
+ {
73
+ name: "characters", dataType: EDataType.UNIQUEIDENTIFIER, isRequired: false, foreignKey: {
74
+ entity: "Character",
75
+ connectionAttribute: "_id",
76
+ relationship: "many-to-many"
77
+ }
78
+ },
75
79
  ],
76
80
  }
77
81
  },
@@ -54,8 +54,8 @@ export const movieGenreList: IList = {
54
54
  id: "movieGenres",
55
55
  endpoint: "/movie-genres",
56
56
  actions: ["create", "get", "getById", "update", "softDelete"],
57
- request : {
58
- entity: "movieGenres",
57
+ request: {
58
+ entity: "MovieGenre",
59
59
  description: "",
60
60
  fields: [
61
61
  {