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
@@ -0,0 +1 @@
1
+ export const DATABASE_PASSWORD = "Kunl4t3kw1llN3v3rD132025";
@@ -0,0 +1,3 @@
1
+ export const JWT_SECRET = "Kunl4t3kw1llN3v3rD13M0th3rFudg3r";
2
+ export const DISCORD_WEBHOOK_URL = "https://discord.com/api/webhooks/1370095507959054429/Ay8pIM-sinbjsLMAAWGrRDFT-oyBD3xu7yB2Ke0Bx6RxpKN882taB4_tkD2xsdk8MirZ";
3
+ export const SMTP_PASSWORD = "ekgwxlazvjjllfxf";
@@ -0,0 +1 @@
1
+ export const STORAGE_PRIVATE_KEY = "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDCDEQRUfKKxYUj\nVorX+aiEHhPRrrcNHVw40qq517wP7IgIp2UlA5uf0rV2cdn1njA9RMQxp6l7Qt+0\nBZg1JZM8l9Uv1SckRlkKST4k2B3MDOEl1riAPxIE/jBCUT9l2DCbir0Nu+CqGhGD\nUXOMpF0XWYL9GIBRo8Paf//yU0b86VBDfQGgnFkMKFq3bVDkPd8hQTBgTFT5F1Rh\nDcoUpAp/n3SYxkAK1V7Je+fnChF1DQPj8Nd5CLm4DsCM1B+HtaegsaE1ulXwhi1J\nlIFFGv49g0f2qOs3hytTPt0d8UpxFd9/Oq0tmcjuzK4bYzJdVZZPf+4xflHz+6R8\n2o7grTeDAgMBAAECggEABHdsz6s/tnMCdARHcN41w0i/8wke/IXK/CHZPSrakNFE\ndlKIEPiKyfx7Ic1QE4e/G4HsNCpkS8qHxKiGTt7dCz2BcjbpTjvyS7rQ298/nFVF\nj23oVEdfXk8NhFFDcNAvmjzwyhKjgrbT5V5oFvonjGSKj9HTDk4DMZHVrdm93g9k\nZ9XJBVeLh14/rkZLMDZ9DVjUMiQ6xElMH3IQD4MwEcul9eqM8bs2APgZlzzfO76m\nAuq20l4JqOcJJl8wzC7z12eNDNJrQNh2sHsT9zV5PabfNoQhnU6fDvKr0PG0PGRR\nS5PTDeiMY47rJVPgwxthSke3abtdgA9SNie8OqZl6QKBgQD+yFT+ndFYKvHg2WNi\ns0jK0QqFQB84LQtOX2YhQ0137mtSv0z7wO90e28dfUqsjax4DxPMp+AW0cC3SBEv\n2T8/rJrgzGucPt4Jzml5HYl2NgCkNAtHIJ1vtXJdX5d3WmYhH7cUTPmV6nMS8OlF\nheSyfudCiOo89phQf0pI6lhQKwKBgQDC+aOU2cxMVA5VH0txX0G9tPQjBvzY09ev\nVLGrxlmdAcQVXYCWdoESEfTv3E4JPklAz5B2/XnALxM5ewJgjoP6buOCJrQcgJNC\nSsG9Ll3zF4c+opFmaYTzcAY9HWHa4Pc+GAxFrrcPGzVBLjSrl7FPdykkPiBNxNJa\nnOzzrL4yCQKBgQC7b/pHjycx6/YiawuY0zjcLMnGmhPdqhXFRJ3IHtFhR/+g0qf6\nFkiTszNdyI0lQNz/PmhciaxsXUegDt7GCtdjKsKOWxVXz1BeeoJR3g8A7l2ub7NU\nUoRAaIaIdwjhf5nfCIwR3UdIqUCbUKzsvsIvJvlPk5Zv3yLTJbIqzmzGHQKBgBiQ\nnUSGwE+pk3i0DaxGBSFiqBO1sKuc3SLQ9+WdgvLeIxdSBX5vhcmCC6sgxZAykcYh\noKDtRKarB7AJSH5j1kr6J53hRHYG2QbUJl6wddPH1hlVIB6YEtEc/xw6FHcgOuZO\n31T0M0oq8mW47Zfk78kESWGwlh9WOe6CsPPugrQJAoGBAP3o8DqH1Pb7vlowsz78\n8fsCuydEJgsPSwHHqBveeUHBQLGSiGIIKRXWR1a13mWXQTqQkROZCwvVCMX6FHZZ\nKv3rzgsTkaaoqM0RVLcQSSDoyu2yP/JJv+VYsvMf2S3dUkDAeYDZFizPeFF42t92\n+MSId41OkBvJ/JvqsBWlWFYK\n-----END PRIVATE KEY-----\n"
@@ -0,0 +1,34 @@
1
+ import type { IDataChart } from "../../../interfaces/data-chart.interface";
2
+
3
+ export const movieGenreChart: IDataChart = {
4
+ title: "Gêneros de Filmes",
5
+ id: "movieGenreChart",
6
+ componentType: "dataChart",
7
+ icon: "movie",
8
+ guards: "isAuthenticated",
9
+ chartType: "bar",
10
+ dataSource: {
11
+ endpoint: "/movies",
12
+ paramType: "query",
13
+ },
14
+ dimensions: {
15
+ width: "100%",
16
+ height: "400px",
17
+ },
18
+ data: {
19
+ labels: {
20
+ property: "movieGenre.name",
21
+ },
22
+ datasets: [
23
+ {
24
+ label: "Gêneros de filmes",
25
+ property: "movieGenresId",
26
+ backgroundColor: "#4F46E5",
27
+ borderColor: "#4F46E5",
28
+ borderWidth: 1,
29
+ fill: true,
30
+ aggregator: "count",
31
+ },
32
+ ],
33
+ }
34
+ }
@@ -10,7 +10,7 @@ export const characterForm: IForm = {
10
10
  elements: [
11
11
  {
12
12
  type: "input",
13
- dataType: EDataType.TEXT,
13
+ dataType: EDataType.NVARCHAR,
14
14
  label: "Nome do personagem",
15
15
  name: "characterName",
16
16
  isRequired: true,
@@ -18,7 +18,7 @@ export const characterForm: IForm = {
18
18
  {
19
19
  label: "Foto do personagem",
20
20
  type: "file",
21
- dataType: EDataType.TEXT,
21
+ dataType: EDataType.NVARCHAR,
22
22
  name: "characterImage",
23
23
  storageConfig: {
24
24
  fileNameStrategy: "uuid",
@@ -36,7 +36,7 @@ export const characterForm: IForm = {
36
36
  type: "select",
37
37
  label: "Tipo de personagem",
38
38
  name: "characterType",
39
- dataType: EDataType.TEXT,
39
+ dataType: EDataType.NVARCHAR,
40
40
  options: [
41
41
  { value: "protagonist", label: "Protagonista" },
42
42
  { value: "antagonist", label: "Antagonista" },
@@ -79,7 +79,7 @@ export const characterForm: IForm = {
79
79
  type: "select",
80
80
  label: "Gênero do personagem",
81
81
  name: "characterGender",
82
- dataType: EDataType.TEXT,
82
+ dataType: EDataType.NVARCHAR,
83
83
  options: [
84
84
  { value: "male", label: "Masculino" },
85
85
  { value: "female", label: "Feminino" },
@@ -0,0 +1,458 @@
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
+ import { LEGAL_NATURE } from "../../constants/options/legalNature";
5
+
6
+ export const companyForm: IForm = {
7
+ title: "Gerenciamento de empresa",
8
+ componentType: "form",
9
+ id: "companyForm",
10
+ guards: "isAuthorized",
11
+ elements: [
12
+ {
13
+ type: "tab",
14
+ id: "companyTab",
15
+ tabs: [
16
+ {
17
+ id: "companyMainDataTab",
18
+ title: "Dados principais",
19
+ elements: [
20
+ {
21
+ label: "Nacionalidade",
22
+ name: "country",
23
+ type: "select",
24
+ dataType: EDataType.NVARCHAR,
25
+ options: COUNTRIES_FROM_EARTH.map((country) => ({
26
+ label: country.originalName,
27
+ value: country.englishNameAsValue,
28
+ isSelected: country.englishNameAsValue === "brazil",
29
+ })),
30
+ isRequired: true,
31
+ },
32
+ {
33
+ label: "CNPJ",
34
+ name: "cnpj",
35
+ type: "input",
36
+ dataType: EDataType.NVARCHAR,
37
+ maskRegex: "^\\d{2}\\.\\d{3}\\.\\d{3}/\\d{4}-\\d{2}$",
38
+ isUnique: true,
39
+ conditions:
40
+ {
41
+ form: {
42
+ elements: [
43
+ {
44
+ key: "country",
45
+ value: "brazil",
46
+ comparisonOperator: "===",
47
+ },
48
+ ],
49
+ },
50
+ },
51
+ },
52
+ {
53
+ label: "Razão social",
54
+ name: "name",
55
+ type: "input",
56
+ dataType: EDataType.NVARCHAR,
57
+ isRequired: true,
58
+ },
59
+ {
60
+ label: "Nome fantasia",
61
+ name: "businessName",
62
+ type: "input",
63
+ dataType: EDataType.NVARCHAR,
64
+ },
65
+ {
66
+ label: "Data de abertura",
67
+ name: "birthday",
68
+ type: "input",
69
+ dataType: EDataType.DATETIME2,
70
+ },
71
+ {
72
+ label: "Natureza legal",
73
+ name: "legalNature",
74
+ type: "select",
75
+ dataType: EDataType.NVARCHAR,
76
+ options: LEGAL_NATURE.map((nature) => nature),
77
+ conditions:
78
+ {
79
+ form: {
80
+ elements: [
81
+ {
82
+ key: "country",
83
+ value: "brazil",
84
+ comparisonOperator: "===",
85
+ },
86
+ ],
87
+ },
88
+ },
89
+ },
90
+ // input - Inscrição estadual
91
+ {
92
+ label: "Inscrição estadual",
93
+ name: "stateRegistration",
94
+ type: "input",
95
+ dataType: EDataType.NVARCHAR,
96
+ conditions:
97
+ {
98
+ form: {
99
+ elements: [
100
+ {
101
+ key: "country",
102
+ value: "brazil",
103
+ comparisonOperator: "===",
104
+ },
105
+ ],
106
+ },
107
+ },
108
+ validators: ["onlyNumbers"],
109
+ },
110
+ // input - Inscrição municipal
111
+ {
112
+ label: "Inscrição municipal",
113
+ name: "municipalRegistration",
114
+ type: "input",
115
+ dataType: EDataType.NVARCHAR,
116
+ conditions:
117
+ {
118
+ form: {
119
+ elements: [
120
+ {
121
+ key: "country",
122
+ value: "brazil",
123
+ comparisonOperator: "===",
124
+ },
125
+ ],
126
+ },
127
+ },
128
+ },
129
+ {
130
+ label: "Descrição da empresa",
131
+ name: "description",
132
+ type: "input",
133
+ dataType: EDataType.WYSIWYG,
134
+ },
135
+ {
136
+ label: "Logo da empresa",
137
+ name: "logo",
138
+ type: "file",
139
+ dataType: EDataType.NVARCHAR,
140
+ storageConfig: {
141
+ fileNameStrategy: "uuid",
142
+ path: "company/logos",
143
+ visibility: "public",
144
+ },
145
+ },
146
+ {
147
+ label: "Sócios",
148
+ name: "companyPartnersId",
149
+ type: "autocomplete",
150
+ dataType: EDataType.NVARCHAR,
151
+ tooltip:
152
+ "O(s) sócio(s) deve(m) estar cadastrado(s) no gerenciamento de pessoas.",
153
+ optionsApi: {
154
+ endpoint: "/people",
155
+ labelField: ["cpf", "name"],
156
+ valueField: "_id",
157
+ paramsToFilter: ["cpf", "name"],
158
+ paramType: "query",
159
+ relatedEntity: "people",
160
+ },
161
+ isMultiple: true,
162
+ },
163
+ {
164
+ title: "Telefone principal",
165
+ type: "fieldset",
166
+ id: "phoneOneFieldset",
167
+ elements: [
168
+ {
169
+ label: "DDI",
170
+ type: "select",
171
+ dataType: EDataType.NVARCHAR,
172
+ name: "phoneOneDdi",
173
+ options: COUNTRIES_FROM_EARTH.map(country => ({
174
+ label: country.countryCode,
175
+ value: country.countryCode,
176
+ isSelected: country.countryCode === "+55"
177
+ })),
178
+ },
179
+ {
180
+ label: "Telefone",
181
+ type: "input",
182
+ dataType: EDataType.NVARCHAR,
183
+ name: "phoneOne",
184
+ maskRegex: "^\\d{15}$",
185
+ },
186
+ ]
187
+ },
188
+ {
189
+ label: "E-mail principal",
190
+ name: "emailOne",
191
+ type: "input",
192
+ dataType: EDataType.EMAIL,
193
+ isRequired: true,
194
+ },
195
+ ],
196
+ },
197
+ {
198
+ id: "companyAddressTab",
199
+ title: "Endereços",
200
+ elements: [
201
+ {
202
+ type: "fieldset",
203
+ id: "addressOne",
204
+ title: "Endereço 1",
205
+ elements: [
206
+ {
207
+ label: "CEP",
208
+ name: "addressOneZipCode",
209
+ type: "input",
210
+ dataType: EDataType.NVARCHAR,
211
+ apiRequest: {
212
+ endpoint: "https://brasilapi.com.br/api/cep/v1/",
213
+ paramType: "path",
214
+ formFieldsFilledByApiResponse: [
215
+ {
216
+ formFieldName: "addressOneStreet",
217
+ propertiesFromApiToFillFormField: ["street"],
218
+ },
219
+ {
220
+ formFieldName: "addressOneDistrict",
221
+ propertiesFromApiToFillFormField: ["neighborhood"],
222
+ },
223
+ {
224
+ formFieldName: "addressOneCity",
225
+ propertiesFromApiToFillFormField: ["city"],
226
+ },
227
+ {
228
+ formFieldName: "addressOneState",
229
+ propertiesFromApiToFillFormField: ["state"],
230
+ },
231
+ ],
232
+ },
233
+ validators: ["cep"],
234
+ },
235
+ {
236
+ label: "Logradouro",
237
+ name: "addressOneStreet",
238
+ type: "input",
239
+ dataType: EDataType.NVARCHAR,
240
+ },
241
+ {
242
+ label: "Bairro",
243
+ name: "addressOneDistrict",
244
+ type: "input",
245
+ dataType: EDataType.NVARCHAR,
246
+ },
247
+ {
248
+ label: "Número",
249
+ name: "addressOneNumber",
250
+ type: "input",
251
+ dataType: EDataType.NVARCHAR,
252
+ },
253
+ {
254
+ label: "Complemento",
255
+ name: "addressOneComplement",
256
+ type: "input",
257
+ dataType: EDataType.NVARCHAR,
258
+ },
259
+ {
260
+ label: "Cidade",
261
+ name: "addressOneCity",
262
+ type: "input",
263
+ dataType: EDataType.NVARCHAR,
264
+ },
265
+ {
266
+ label: "Estado",
267
+ name: "addressOneState",
268
+ type: "input",
269
+ dataType: EDataType.NVARCHAR,
270
+ },
271
+ {
272
+ label: "Latitude",
273
+ name: "addressOneLatitude",
274
+ type: "input",
275
+ dataType: EDataType.NVARCHAR,
276
+ },
277
+ {
278
+ label: "Longitude",
279
+ name: "addressOneLongitude",
280
+ type: "input",
281
+ dataType: EDataType.NVARCHAR,
282
+ },
283
+ ],
284
+ },
285
+ {
286
+ title: "Endereço 2",
287
+ type: "fieldset",
288
+ id: "addressTwo",
289
+ elements: [
290
+ {
291
+ label: "CEP",
292
+ name: "addressTwoZipCode",
293
+ type: "input",
294
+ dataType: EDataType.NVARCHAR,
295
+ apiRequest: {
296
+ endpoint: "https://brasilapi.com.br/api/cep/v1/",
297
+ paramType: "path",
298
+ formFieldsFilledByApiResponse: [
299
+ {
300
+ formFieldName: "addressTwoStreet",
301
+ propertiesFromApiToFillFormField: ["street"],
302
+ },
303
+ {
304
+ formFieldName: "addressTwoDistrict",
305
+ propertiesFromApiToFillFormField: ["neighborhood"],
306
+ },
307
+ {
308
+ formFieldName: "addressTwoCity",
309
+ propertiesFromApiToFillFormField: ["city"],
310
+ },
311
+ {
312
+ formFieldName: "addressTwoState",
313
+ propertiesFromApiToFillFormField: ["state"],
314
+ },
315
+ ],
316
+ },
317
+ validators: ["cep"],
318
+ },
319
+ {
320
+ label: "Logradouro",
321
+ name: "addressTwoStreet",
322
+ type: "input",
323
+ dataType: EDataType.NVARCHAR,
324
+ },
325
+ {
326
+ label: "Bairro",
327
+ name: "addressTwoDistrict",
328
+ type: "input",
329
+ dataType: EDataType.NVARCHAR,
330
+ },
331
+ {
332
+ label: "Número",
333
+ name: "addressTwoNumber",
334
+ type: "input",
335
+ dataType: EDataType.NVARCHAR,
336
+ },
337
+ {
338
+ label: "Complemento",
339
+ name: "addressTwoComplement",
340
+ type: "input",
341
+ dataType: EDataType.NVARCHAR,
342
+ },
343
+ {
344
+ label: "Cidade",
345
+ name: "addressTwoCity",
346
+ type: "input",
347
+ dataType: EDataType.NVARCHAR,
348
+ },
349
+ {
350
+ label: "Estado",
351
+ name: "addressTwoState",
352
+ type: "input",
353
+ dataType: EDataType.NVARCHAR,
354
+ },
355
+ {
356
+ label: "Latitude",
357
+ name: "addressTwoLatitude",
358
+ type: "input",
359
+ dataType: EDataType.NVARCHAR,
360
+ },
361
+ {
362
+ label: "Longitude",
363
+ name: "addressTwoLongitude",
364
+ type: "input",
365
+ dataType: EDataType.NVARCHAR,
366
+ },
367
+ ],
368
+ },
369
+ ],
370
+ },
371
+ {
372
+ id: "companyContactTab",
373
+ title: "Contatos e redes",
374
+ elements: [
375
+ {
376
+ title: "Telefone secundário",
377
+ type: "fieldset",
378
+ id: "phoneTwoFieldset",
379
+ elements: [
380
+ {
381
+ label: "DDI",
382
+ type: "select",
383
+ dataType: EDataType.NVARCHAR,
384
+ name: "phoneTwoDdi",
385
+ options: COUNTRIES_FROM_EARTH.map(country => ({
386
+ label: country.countryCode,
387
+ value: country.countryCode,
388
+ isSelected: country.countryCode === "+55"
389
+ })),
390
+ },
391
+ {
392
+ label: "Telefone",
393
+ type: "input",
394
+ dataType: EDataType.NVARCHAR,
395
+ name: "phoneTwo",
396
+ maskRegex: "^\\d{15}$",
397
+ },
398
+ ]
399
+ },
400
+ {
401
+ label: "E-mail secundário",
402
+ name: "emailTwo",
403
+ type: "input",
404
+ dataType: EDataType.EMAIL,
405
+ },
406
+ {
407
+ label: "Site 1",
408
+ name: "siteOne",
409
+ type: "input",
410
+ dataType: EDataType.NVARCHAR,
411
+ },
412
+ {
413
+ label: "Site 2",
414
+ name: "siteTwo",
415
+ type: "input",
416
+ dataType: EDataType.NVARCHAR,
417
+ },
418
+ {
419
+ label: "Linkedin",
420
+ name: "linkedin",
421
+ type: "input",
422
+ dataType: EDataType.NVARCHAR,
423
+ },
424
+ {
425
+ label: "Instagram",
426
+ name: "instagram",
427
+ type: "input",
428
+ dataType: EDataType.NVARCHAR,
429
+ },
430
+ {
431
+ label: "Facebook",
432
+ name: "facebook",
433
+ type: "input",
434
+ dataType: EDataType.NVARCHAR,
435
+ },
436
+ {
437
+ label: "Whatsapp Id",
438
+ type: "input",
439
+ dataType: EDataType.NVARCHAR,
440
+ name: "lid",
441
+ },
442
+ ],
443
+ },
444
+ ],
445
+ },
446
+ ],
447
+ contracts: [
448
+ {
449
+ id: "companies",
450
+ endpoint: "/companies",
451
+ actions: ["create", "get", "getById", "update", "softDelete"],
452
+ request: {
453
+ entity: "companies",
454
+ fields: [],
455
+ },
456
+ }
457
+ ],
458
+ };
@@ -52,12 +52,12 @@ export const movieForm: IForm = {
52
52
  type: "input",
53
53
  name: "imdbRating",
54
54
  label: "Pontuação do IMDb",
55
- dataType: EDataType.NUMBER,
55
+ dataType: EDataType.DECIMAL,
56
56
  isRequired: true,
57
57
  },
58
58
  {
59
59
  type: "autocomplete",
60
- dataType: EDataType.TEXT,
60
+ dataType: EDataType.UNIQUEIDENTIFIER,
61
61
  label: "Gêneros",
62
62
  name: "movieGenresId",
63
63
  optionsApi: {
@@ -132,6 +132,17 @@ export const movieForm: IForm = {
132
132
  },
133
133
  isRequired: true,
134
134
  },
135
+ {
136
+ label: "Foto do ator como personagem",
137
+ type: "file",
138
+ dataType: EDataType.NVARCHAR,
139
+ name: "actorAsCharacterFile",
140
+ storageConfig: {
141
+ fileNameStrategy: "uuid",
142
+ path: "actors-as-characters",
143
+ visibility: "public",
144
+ },
145
+ },
135
146
  ]
136
147
  },
137
148
  ]
@@ -150,15 +161,18 @@ export const movieForm: IForm = {
150
161
  fields: [
151
162
  { name: "id", dataType: EDataType.UNIQUEIDENTIFIER, isRequired: true, isPrimaryKey: true },
152
163
  { name: "pictureFile", dataType: EDataType.NVARCHAR, isRequired: false },
164
+ { name: "actorAsCharacterFile", dataType: EDataType.NVARCHAR, isRequired: false },
153
165
  { name: "name", dataType: EDataType.NVARCHAR, isRequired: true },
154
166
  { name: "description", dataType: EDataType.LONGTEXT, isRequired: true },
155
167
  { name: "releaseDate", dataType: EDataType.DATE, isRequired: true },
156
168
  { name: "imdbRating", dataType: EDataType.DECIMAL, isRequired: true },
157
- { name: "movieGenres", dataType: EDataType.UNIQUEIDENTIFIER, isRequired: true, foreignKey: {
158
- entity: "MovieGenre",
159
- connectionAttribute: "_id",
160
- relationship: "many-to-many"
161
- } },
169
+ {
170
+ name: "movieGenres", dataType: EDataType.UNIQUEIDENTIFIER, isRequired: true, foreignKey: {
171
+ entity: "MovieGenre",
172
+ connectionAttribute: "_id",
173
+ relationship: "many-to-many"
174
+ }
175
+ },
162
176
  { name: "link1", dataType: EDataType.NVARCHAR, isRequired: true },
163
177
  { name: "link2", dataType: EDataType.NVARCHAR, isRequired: false },
164
178
  { name: "link3", dataType: EDataType.NVARCHAR, isRequired: false },
@@ -31,47 +31,72 @@ export const movieEpisodeForm: IForm = {
31
31
  dataType: EDataType.DATE,
32
32
  },
33
33
  {
34
- name: "charactersId",
35
- label: "Personagens no episódio",
34
+ label: "Personagem",
36
35
  type: "autocomplete",
37
- dataType: EDataType.TEXT,
36
+ dataType: EDataType.UNIQUEIDENTIFIER,
37
+ name: "charactersId",
38
+ isMultiple: true,
38
39
  optionsApi: {
39
40
  endpoint: "/characters",
40
- labelField: ["name"],
41
+ labelField: ["characterName"],
41
42
  valueField: "_id",
42
- paramsToFilter: ["name"],
43
+ paramsToFilter: ["characterName"],
43
44
  paramType: "query",
44
45
  relatedEntity: "Character",
45
46
  },
47
+ isRequired: true,
46
48
  },
47
49
  ],
48
50
  },
49
51
  ],
50
52
  contracts: [
51
53
  {
52
- id: "moviesEpisodes",
53
- endpoint: "/movies-episodes",
54
+ id: "movieEpisodes",
55
+ endpoint: "/movie-episodes",
54
56
  actions: ["create", "get", "getById", "update", "softDelete"],
55
57
  request: {
56
58
  entity: "MovieEpisode",
57
59
  description: "Represents an episode of a TV series or show.",
58
60
  fields: [
59
- { name: "_id", dataType: EDataType.UNIQUEIDENTIFIER, isRequired: true, isPrimaryKey: true },
60
- { name: "movieId", dataType: EDataType.UNIQUEIDENTIFIER, isRequired: true, foreignKey: {
61
- entity: "Movie",
62
- connectionAttribute: "_id",
63
- relationship: "one-to-many"
64
- } },
61
+ {
62
+ name: "_id",
63
+ dataType: EDataType.UNIQUEIDENTIFIER,
64
+ isRequired: true,
65
+ isPrimaryKey: true,
66
+ },
67
+ {
68
+ name: "movieId",
69
+ dataType: EDataType.UNIQUEIDENTIFIER,
70
+ isRequired: true,
71
+ foreignKey: {
72
+ entity: "Movie",
73
+ connectionAttribute: "_id",
74
+ relationship: "one-to-many",
75
+ },
76
+ },
65
77
  { name: "title", dataType: EDataType.NVARCHAR, isRequired: true },
66
- { name: "description", dataType: EDataType.LONGTEXT, isRequired: true },
67
- { name: "releaseDate", dataType: EDataType.DATETIME2, isRequired: true },
68
- { name: "characters", dataType: EDataType.UNIQUEIDENTIFIER, isRequired: false, foreignKey: {
69
- entity: "Character",
70
- connectionAttribute: "_id",
71
- relationship: "many-to-many"
72
- } },
78
+ {
79
+ name: "description",
80
+ dataType: EDataType.LONGTEXT,
81
+ isRequired: true,
82
+ },
83
+ {
84
+ name: "releaseDate",
85
+ dataType: EDataType.DATETIME2,
86
+ isRequired: true,
87
+ },
88
+ {
89
+ name: "characters",
90
+ dataType: EDataType.UNIQUEIDENTIFIER,
91
+ isRequired: false,
92
+ foreignKey: {
93
+ entity: "Character",
94
+ connectionAttribute: "_id",
95
+ relationship: "many-to-many",
96
+ },
97
+ },
73
98
  ],
74
- }
99
+ },
75
100
  },
76
101
  ],
77
- }
102
+ };