rapida-partner 1.0.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 (107) hide show
  1. package/README.md +85 -0
  2. package/index.ts +13 -0
  3. package/package.json +27 -0
  4. package/rapidaObject.json +3024 -0
  5. package/src/constants/options/agendaStatus.ts +3 -0
  6. package/src/constants/options/citiesFromBrazil.ts +27852 -0
  7. package/src/constants/options/countriesFromEarth.ts +1761 -0
  8. package/src/constants/options/currencies.ts +142 -0
  9. package/src/constants/options/eventJobs.ts +94 -0
  10. package/src/constants/options/events.ts +22 -0
  11. package/src/constants/options/hours.ts +26 -0
  12. package/src/constants/options/languages.ts +34 -0
  13. package/src/constants/options/statesFromBrazil.ts +29 -0
  14. package/src/controllers/ts_project_to_json_project.ts +17 -0
  15. package/src/controllers/validate-project-json-schema.ts +11 -0
  16. package/src/examples/components/forms/character.form.ts +92 -0
  17. package/src/examples/components/forms/company.form.ts +648 -0
  18. package/src/examples/components/forms/movie.form.ts +205 -0
  19. package/src/examples/components/forms/movieGenre.form.ts +43 -0
  20. package/src/examples/components/forms/person.form.ts +474 -0
  21. package/src/examples/components/lists/character.list.ts +47 -0
  22. package/src/examples/components/lists/company.list.ts +49 -0
  23. package/src/examples/components/lists/movie.list.ts +60 -0
  24. package/src/examples/components/lists/movieGenre.list.ts +51 -0
  25. package/src/examples/components/lists/person.list.ts +50 -0
  26. package/src/examples/modules/character.ts +13 -0
  27. package/src/examples/modules/company.ts +13 -0
  28. package/src/examples/modules/movie.ts +17 -0
  29. package/src/examples/modules/person.ts +13 -0
  30. package/src/examples/projects/movieBackoffice.ts +110 -0
  31. package/src/interfaces/backend-framework-structure.interface.ts +44 -0
  32. package/src/interfaces/data-card.interface.ts +102 -0
  33. package/src/interfaces/data-chart.interface.ts +84 -0
  34. package/src/interfaces/data-detail.interface.ts +123 -0
  35. package/src/interfaces/data-grid.interface.ts +48 -0
  36. package/src/interfaces/data-table.interface.ts +84 -0
  37. package/src/interfaces/form-array.interface.ts +14 -0
  38. package/src/interfaces/form-autocomplete.interface.ts +79 -0
  39. package/src/interfaces/form-button.interface.ts +34 -0
  40. package/src/interfaces/form-condition.interface.ts +26 -0
  41. package/src/interfaces/form-datepicker.interface.ts +18 -0
  42. package/src/interfaces/form-fieldset.interface.ts +13 -0
  43. package/src/interfaces/form-file.interface.ts +57 -0
  44. package/src/interfaces/form-input.interface.ts +69 -0
  45. package/src/interfaces/form-numeric.interface.ts +22 -0
  46. package/src/interfaces/form-pattern.interface.ts +16 -0
  47. package/src/interfaces/form-radiogroup.interface.ts +21 -0
  48. package/src/interfaces/form-select.interface.ts +60 -0
  49. package/src/interfaces/form-switch.interface.ts +15 -0
  50. package/src/interfaces/form-tab.interface.ts +17 -0
  51. package/src/interfaces/form.interface.ts +73 -0
  52. package/src/interfaces/frontend-framework-structure.interface.ts +39 -0
  53. package/src/interfaces/layout-dashboard.interface.ts +52 -0
  54. package/src/interfaces/layout-panel.interface.ts +45 -0
  55. package/src/interfaces/list.interface.ts +50 -0
  56. package/src/interfaces/project-backend.interface.ts +48 -0
  57. package/src/interfaces/project-style.interface.ts +129 -0
  58. package/src/interfaces/project.interface.ts +79 -0
  59. package/src/interfaces/yaml-template-skeleton.interface.ts +35 -0
  60. package/src/schemas/backend-framework-structure.schema.json +194 -0
  61. package/src/schemas/backend.ref.json +77 -0
  62. package/src/schemas/bdd-and-e2e-narratives.ref.json +57 -0
  63. package/src/schemas/bdd-and-e2e.json +36 -0
  64. package/src/schemas/business-plan.ref.json +25 -0
  65. package/src/schemas/business-rules.ref.json +34 -0
  66. package/src/schemas/component-one-of.ref.json +15 -0
  67. package/src/schemas/dashboard.ref.json +111 -0
  68. package/src/schemas/data-card.ref.json +245 -0
  69. package/src/schemas/data-chart.ref.json +168 -0
  70. package/src/schemas/data-detail.ref.json +297 -0
  71. package/src/schemas/data-grid.ref.json +101 -0
  72. package/src/schemas/data-table.ref.json +181 -0
  73. package/src/schemas/external-application.ref.json +97 -0
  74. package/src/schemas/form-array.ref.json +35 -0
  75. package/src/schemas/form-autocomplete-options-api.ref.json +53 -0
  76. package/src/schemas/form-autocomplete.ref.json +204 -0
  77. package/src/schemas/form-button.ref.json +88 -0
  78. package/src/schemas/form-common-api-request.ref.json +29 -0
  79. package/src/schemas/form-common-filters-from-other-form-fields.ref.json +22 -0
  80. package/src/schemas/form-common-form-fields-filled-by-api-response.ref.json +28 -0
  81. package/src/schemas/form-condition.ref.json +70 -0
  82. package/src/schemas/form-datepicker.ref.json +50 -0
  83. package/src/schemas/form-fieldset.ref.json +28 -0
  84. package/src/schemas/form-file.ref.json +115 -0
  85. package/src/schemas/form-input.ref.json +105 -0
  86. package/src/schemas/form-numeric.ref.json +60 -0
  87. package/src/schemas/form-one-of.ref.json +22 -0
  88. package/src/schemas/form-pattern.ref.json +42 -0
  89. package/src/schemas/form-radiogroup.ref.json +64 -0
  90. package/src/schemas/form-select.ref.json +123 -0
  91. package/src/schemas/form-switch.ref.json +39 -0
  92. package/src/schemas/form-tab.ref.json +50 -0
  93. package/src/schemas/form.ref.json +107 -0
  94. package/src/schemas/frontend-framework-structure.schema.json +178 -0
  95. package/src/schemas/frontend.ref.json +30 -0
  96. package/src/schemas/list.ref.json +196 -0
  97. package/src/schemas/module.ref.json +39 -0
  98. package/src/schemas/panel.ref.json +127 -0
  99. package/src/schemas/project.schema.json +39 -0
  100. package/src/schemas/todo.ref.json +10 -0
  101. package/src/utils/email.ts +56 -0
  102. package/src/utils/env.ts +9 -0
  103. package/src/utils/file.ts +139 -0
  104. package/src/utils/json.ts +100 -0
  105. package/src/utils/path.ts +51 -0
  106. package/src/utils/rapida-project.ts +17 -0
  107. package/tsconfig.json +27 -0
@@ -0,0 +1,474 @@
1
+ import { COUNTRIES_FROM_EARTH } from "../../../constants/options/countriesFromEarth";
2
+ import type { IForm } from "../../../interfaces/form.interface";
3
+
4
+ export const personForm: IForm = {
5
+ title: "Gerenciamento de cliente pessoa",
6
+ userStory: `Como um usuário autorizado, eu quero usar o formulário de gerenciamento de pessoa para inserir e editar informações de clientes, incluindo dados principais (como nome, nacionalidade, CPF, data de nascimento, gênero, foto, telefones e e-mails), contatos e redes sociais (como telefones secundários, e-mails e links de sites), e endereços, para que eu possa manter um registro completo e atualizado das pessoas no sistema.`,
7
+ componentType: "form",
8
+ id: "personForm",
9
+ contracts: [{
10
+ endpoint: "/people",
11
+ methods: [{ verb: "GET" }, { verb: "POST" }, { verb: "PUT" }, { verb: "DELETE" }],
12
+ request: {
13
+ body: [
14
+ { name: "country", dataType: "text" },
15
+ { name: "cpf", dataType: "text" },
16
+ { name: "passport", dataType: "text" },
17
+ { name: "passportIssueDate", dataType: "date" },
18
+ { name: "passportExpiryDate", dataType: "date" },
19
+ { name: "name", dataType: "text" },
20
+ { name: "gender", dataType: "text" },
21
+ { name: "birthday", dataType: "date" },
22
+ { name: "picture", dataType: "text" },
23
+ { name: "phoneOne", dataType: "text" },
24
+ { name: "emailOne", dataType: "email" },
25
+ { name: "addressOneZipCode", dataType: "text" },
26
+ { name: "addressOneStreet", dataType: "text" },
27
+ { name: "addressOneDistrict", dataType: "text" },
28
+ { name: "addressOneNumber", dataType: "text" },
29
+ { name: "addressOneComplement", dataType: "text" },
30
+ { name: "addressOneCity", dataType: "text" },
31
+ { name: "addressOneState", dataType: "text" },
32
+ { name: "addressOneLatitude", dataType: "text" },
33
+ { name: "addressOneLongitude", dataType: "text" },
34
+ { name: "addressTwoZipCode", dataType: "text" },
35
+ { name: "addressTwoStreet", dataType: "text" },
36
+ { name: "addressTwoDistrict", dataType: "text" },
37
+ { name: "addressTwoNumber", dataType: "text" },
38
+ { name: "addressTwoComplement", dataType: "text" },
39
+ { name: "addressTwoCity", dataType: "text" },
40
+ { name: "addressTwoState", dataType: "text" },
41
+ { name: "addressTwoLatitude", dataType: "text" },
42
+ { name: "addressTwoLongitude", dataType: "text" },
43
+ { name: "phoneTwo", dataType: "text" },
44
+ { name: "emailTwo", dataType: "email" },
45
+ { name: "siteOne", dataType: "text" },
46
+ { name: "siteTwo", dataType: "text" },
47
+ { name: "linkedin", dataType: "text" },
48
+ { name: "instagram", dataType: "text" },
49
+ { name: "facebook", dataType: "text" },
50
+ { name: "nickname", dataType: "text" },
51
+ { name: "personDescription", dataType: "wysiwyg" },
52
+ { name: "personMaritalStatus", dataType: "text" },
53
+ ]
54
+ }
55
+ }],
56
+ guards: "isAuthorized",
57
+ elements: [
58
+ {
59
+ id: "personTab",
60
+ type: "tab",
61
+ tabs: [
62
+ {
63
+ id: "personMainDataTab",
64
+ title: "Dados principais",
65
+ elements: [
66
+ {
67
+ label: "Nacionalidade",
68
+ type: "select",
69
+ name: "country",
70
+ dataType: "text",
71
+ options: COUNTRIES_FROM_EARTH.map(country => ({ label: country.brazilianPortugueseName, value: country.englishNameAsValue })),
72
+ isRequired: true,
73
+ },
74
+ {
75
+ label: "CPF",
76
+ type: "input",
77
+ dataType: "text",
78
+ name: "cpf",
79
+ validators: ["cpf"],
80
+ isUnique: true,
81
+ conditions: [
82
+ {
83
+ type: "form",
84
+ elements: [
85
+ {
86
+ key: "country",
87
+ value: "brazilian",
88
+ comparisonOperator: "===",
89
+ }
90
+ ]
91
+ },
92
+ ]
93
+ },
94
+ {
95
+ label: "Passaporte",
96
+ type: "input",
97
+ dataType: "text",
98
+ name: "passport",
99
+ isUnique: true,
100
+ conditions: [
101
+ {
102
+ type: "form",
103
+ elements: [
104
+ {
105
+ key: "country",
106
+ value: "brazilian",
107
+ comparisonOperator: "!==",
108
+ }
109
+ ]
110
+ },
111
+ ]
112
+ },
113
+ {
114
+ label: "Data de emissão do passaporte",
115
+ type: "input",
116
+ dataType: "date",
117
+ name: "passportIssueDate",
118
+ conditions: [
119
+ {
120
+ type: "form",
121
+ elements: [
122
+ {
123
+ key: "country",
124
+ value: "brazilian",
125
+ comparisonOperator: "!==",
126
+ }
127
+ ]
128
+ },
129
+ ],
130
+ },
131
+ {
132
+ label: "Data de validade do passaporte",
133
+ type: "input",
134
+ dataType: "date",
135
+ name: "passportExpiryDate",
136
+ conditions: [
137
+ {
138
+ type: "form",
139
+ elements: [
140
+ {
141
+ key: "country",
142
+ value: "brazilian",
143
+ comparisonOperator: "!==",
144
+ }
145
+ ]
146
+ },
147
+ ],
148
+ },
149
+ {
150
+ label: "Nome completo",
151
+ type: "input",
152
+ dataType: "text",
153
+ name: "name",
154
+ isRequired: true,
155
+ },
156
+ {
157
+ label: "Gênero",
158
+ type: "select",
159
+ dataType: "text",
160
+ name: "gender",
161
+ options: [
162
+ { label: "Masculino", value: "m" },
163
+ { label: "Feminino", value: "f" },
164
+ { label: "Outro", value: "o" },
165
+ ],
166
+ },
167
+ {
168
+ label: "Data de nascimento",
169
+ type: "input",
170
+ dataType: "date",
171
+ name: "birthday",
172
+ },
173
+ {
174
+ label: "Foto da pessoa",
175
+ type: "file",
176
+ dataType: "text",
177
+ storageConfig: {
178
+ fileNameStrategy: "uuid",
179
+ path: "person/pictures",
180
+ visibility: "public",
181
+ },
182
+ name: "picture",
183
+ },
184
+ {
185
+ label: "Telefone principal",
186
+ type: "input",
187
+ dataType: "text",
188
+ name: "phoneOne",
189
+ validators: ["phone"],
190
+ isRequired: true,
191
+ },
192
+ {
193
+ label: "E-mail principal",
194
+ type: "input",
195
+ dataType: "email",
196
+ name: "emailOne",
197
+ isRequired: true,
198
+ },
199
+ // {
200
+ // label: "Relacionamentos",
201
+ // type: "select",
202
+ // dataType: "text",
203
+ // name: "relationships",
204
+ // options: [
205
+ // {
206
+ // label: "Cliente",
207
+ // value: "customer",
208
+ // },
209
+ // {
210
+ // label: "Fornecedor",
211
+ // value: "supplier",
212
+ // },
213
+ // ],
214
+ // isMultiple: true,
215
+ // },
216
+ ],
217
+ },
218
+ {
219
+ id: "personAddressTab",
220
+ title: "Endereços",
221
+ elements: [
222
+ {
223
+ type: "fieldset",
224
+ id: "addressOne",
225
+ title: "Endereço 1",
226
+ elements: [
227
+ {
228
+ label: "CEP",
229
+ type: "input",
230
+ dataType: "text",
231
+ name: "addressOneZipCode",
232
+ apiRequest: {
233
+ endpoint: "https://brasilapi.com.br/api/cep/v1/",
234
+ paramType: "path",
235
+ formFieldsFilledByApiResponse: [
236
+ {
237
+ formFieldName: "addressOneStreet",
238
+ propertiesFromApiToFillFormField: ["street"]
239
+ },
240
+ {
241
+ formFieldName: "addressOneDistrict",
242
+ propertiesFromApiToFillFormField: ["neighborhood"]
243
+ },
244
+ {
245
+ formFieldName: "addressOneCity",
246
+ propertiesFromApiToFillFormField: ["city"]
247
+ },
248
+ {
249
+ formFieldName: "addressOneState",
250
+ propertiesFromApiToFillFormField: ["state"]
251
+ },
252
+ ],
253
+ },
254
+ validators: ["cep"],
255
+ },
256
+ {
257
+ label: "Logradouro",
258
+ type: "input",
259
+ dataType: "text",
260
+ name: "addressOneStreet",
261
+ },
262
+ {
263
+ label: "Bairro",
264
+ type: "input",
265
+ dataType: "text",
266
+ name: "addressOneDistrict",
267
+ },
268
+ {
269
+ label: "Número",
270
+ type: "input",
271
+ dataType: "text",
272
+ name: "addressOneNumber",
273
+ },
274
+ {
275
+ label: "Complemento",
276
+ type: "input",
277
+ dataType: "text",
278
+ name: "addressOneComplement",
279
+ }, {
280
+ label: "Cidade",
281
+ type: "input",
282
+ dataType: "text",
283
+ name: "addressOneCity",
284
+ },
285
+ {
286
+ label: "Estado",
287
+ type: "input",
288
+ dataType: "text",
289
+ name: "addressOneState",
290
+ },
291
+ {
292
+ label: "Latitude",
293
+ type: "input",
294
+ dataType: "text",
295
+ name: "addressOneLatitude",
296
+ },
297
+ {
298
+ label: "Longitude",
299
+ type: "input",
300
+ dataType: "text",
301
+ name: "addressOneLongitude",
302
+ }
303
+ ],
304
+ },
305
+ {
306
+ title: "Endereço 2",
307
+ type: "fieldset",
308
+ id: "addressTwo",
309
+ elements: [
310
+ {
311
+ label: "CEP",
312
+ type: "input",
313
+ dataType: "text",
314
+ name: "addressTwoZipCode",
315
+ apiRequest: {
316
+ endpoint: "https://brasilapi.com.br/api/cep/v1/",
317
+ paramType: "path",
318
+ formFieldsFilledByApiResponse: [
319
+ {
320
+ formFieldName: "addressTwoStreet",
321
+ propertiesFromApiToFillFormField: ["street"]
322
+ },
323
+ {
324
+ formFieldName: "addressTwoDistrict",
325
+ propertiesFromApiToFillFormField: ["neighborhood"]
326
+ },
327
+ {
328
+ formFieldName: "addressTwoCity",
329
+ propertiesFromApiToFillFormField: ["city"]
330
+ },
331
+ {
332
+ formFieldName: "addressTwoState",
333
+ propertiesFromApiToFillFormField: ["state"]
334
+ },
335
+ ],
336
+ },
337
+ validators: ["cep"],
338
+ },
339
+ {
340
+ label: "Logradouro",
341
+ type: "input",
342
+ dataType: "text",
343
+ name: "addressTwoStreet",
344
+ },
345
+ {
346
+ label: "Bairro",
347
+ type: "input",
348
+ dataType: "text",
349
+ name: "addressTwoDistrict",
350
+ },
351
+ {
352
+ label: "Número",
353
+ type: "input",
354
+ dataType: "text",
355
+ name: "addressTwoNumber",
356
+ },
357
+ {
358
+ label: "Complemento",
359
+ type: "input",
360
+ dataType: "text",
361
+ name: "addressTwoComplement",
362
+ }, {
363
+ label: "Cidade",
364
+ type: "input",
365
+ dataType: "text",
366
+ name: "addressTwoCity",
367
+ },
368
+ {
369
+ label: "Estado",
370
+ type: "input",
371
+ dataType: "text",
372
+ name: "addressTwoState",
373
+ },
374
+ {
375
+ label: "Latitude",
376
+ type: "input",
377
+ dataType: "text",
378
+ name: "addressTwoLatitude",
379
+ },
380
+ {
381
+ label: "Longitude",
382
+ type: "input",
383
+ dataType: "text",
384
+ name: "addressTwoLongitude",
385
+ }
386
+ ],
387
+ },
388
+ ],
389
+ },
390
+ {
391
+ id: "personContactTab",
392
+ title: "Contatos e redes",
393
+ elements: [
394
+ {
395
+ label: "Telefone secundário",
396
+ type: "input",
397
+ dataType: "text",
398
+ name: "phoneTwo",
399
+ validators: ["phone"],
400
+ },
401
+ {
402
+ label: "E-mail secundário",
403
+ type: "input",
404
+ dataType: "email",
405
+ name: "emailTwo",
406
+ },
407
+ {
408
+ label: "Site 1",
409
+ type: "input",
410
+ dataType: "text",
411
+ name: "siteOne",
412
+ },
413
+ {
414
+ label: "Site 2",
415
+ type: "input",
416
+ dataType: "text",
417
+ name: "siteTwo",
418
+ },
419
+ {
420
+ label: "Linkedin",
421
+ type: "input",
422
+ dataType: "text",
423
+ name: "linkedin",
424
+ },
425
+ {
426
+ label: "Instagram",
427
+ type: "input",
428
+ dataType: "text",
429
+ name: "instagram",
430
+ },
431
+ {
432
+ label: "Facebook",
433
+ type: "input",
434
+ dataType: "text",
435
+ name: "facebook",
436
+ },
437
+ ],
438
+ },
439
+ {
440
+ id: "moreDetailsTab",
441
+ title: "Outros dados",
442
+ elements: [
443
+ {
444
+ label: "Nome social",
445
+ type: "input",
446
+ dataType: "text",
447
+ name: "nickname",
448
+ },
449
+ {
450
+ label: "Descrição da pessoa",
451
+ type: "input",
452
+ dataType: "wysiwyg",
453
+ name: "personDescription",
454
+ },
455
+ {
456
+ label: "Estado civil",
457
+ type: "select",
458
+ dataType: "text",
459
+ name: "personMaritalStatus",
460
+ options: [
461
+ { label: "Solteiro", value: "single" },
462
+ { label: "Casado", value: "married" },
463
+ { label: "Divorciado", value: "divorced" },
464
+ { label: "Viúvo", value: "widower" },
465
+ { label: "Noivo", value: "engaged" },
466
+ { label: "União estável", value: "stableUnion" },
467
+ ],
468
+ },
469
+ ],
470
+ },
471
+ ],
472
+ }
473
+ ],
474
+ };
@@ -0,0 +1,47 @@
1
+ import type { IList } from "../../../interfaces/list.interface";
2
+
3
+ export const characterList: IList = {
4
+ title: "Lista de personagens",
5
+ componentType: "list",
6
+ id: "characterList",
7
+ guards: ["isAuthorized"],
8
+ dataSource: {
9
+ endpoint: "/characters",
10
+ paramType: "query",
11
+ hasAuthentication: true,
12
+ },
13
+ properties: [
14
+ { label: "Nome", property: "characterName", type: "title" },
15
+ { label: "Descrição", property: "characterDescription", type: "description", isHtml: true, },
16
+ ],
17
+ callsToActionMenu: [
18
+ {
19
+ label: "Editar",
20
+ icon: "pencil",
21
+ action: {
22
+ link: {
23
+ endpoint: "/character-form",
24
+ propertiesAsQueryParam: ["_id"],
25
+ },
26
+ },
27
+ },
28
+ {
29
+ label: "Excluir",
30
+ icon: "delete",
31
+ action: {
32
+ link: {
33
+ endpoint: "/character-list",
34
+ },
35
+ request: {
36
+ endpoint: "/characters",
37
+ verb: "delete",
38
+ propertiesAsPathParam: ["_id"],
39
+ dialog: {
40
+ title: "Excluir projeto",
41
+ message: "Deseja realmente excluir essa projeto?",
42
+ }
43
+ }
44
+ },
45
+ }
46
+ ]
47
+ };
@@ -0,0 +1,49 @@
1
+ import type { IList } from "../../../interfaces/list.interface";
2
+
3
+ export const companyList: IList = {
4
+ componentType: "list",
5
+ id: "companyList",
6
+ title: "Lista de empresas",
7
+ guards: ["isAuthorized"],
8
+ dataSource: {
9
+ endpoint: "/companies",
10
+ paramType: "query",
11
+ hasAuthentication: true,
12
+ },
13
+ properties: [
14
+ { label: "CNPJ", property: "companyCnpj", type: "title" },
15
+ { label: "Nome", property: "companyName", type: "title" },
16
+ { label: "Telefone", property: "companyPhoneOne", type: "subtitle" },
17
+ { label: "E-mail", property: "companyEmailOne", type: "subtitle" },
18
+ ],
19
+ callsToActionMenu: [
20
+ {
21
+ label: "Editar",
22
+ icon: "pencil",
23
+ action: {
24
+ link: {
25
+ endpoint: "/company-form",
26
+ propertiesAsQueryParam: ["_id"],
27
+ },
28
+ },
29
+ },
30
+ {
31
+ label: "Excluir",
32
+ icon: "delete",
33
+ action: {
34
+ link: {
35
+ endpoint: "/company-list",
36
+ },
37
+ request: {
38
+ endpoint: "/companies",
39
+ verb: "delete",
40
+ propertiesAsPathParam: ["_id"],
41
+ dialog: {
42
+ title: "Excluir empresa",
43
+ message: "Deseja realmente excluir essa empresa?",
44
+ }
45
+ }
46
+ },
47
+ }
48
+ ]
49
+ };
@@ -0,0 +1,60 @@
1
+ import type { IList } from "../../../interfaces/list.interface";
2
+
3
+ export const movieList: IList = {
4
+ componentType: "list",
5
+ id: "movieList",
6
+ title: "Lista de filmes",
7
+ guards: ["isAuthorized"],
8
+ dataSource: {
9
+ endpoint: "/movies",
10
+ paramType: "query",
11
+ hasAuthentication: true,
12
+ },
13
+ properties: [
14
+ {
15
+ property: "pictureFile", type: "image", label: "Cartaz",
16
+ },
17
+ {
18
+ property: "name", type: "title", label: "Nome",
19
+ },
20
+ {
21
+ property: "releaseDate", type: "subtitle", label: "Data de lançamento",
22
+ },
23
+ {
24
+ property: "movieGenres.name", type: "subtitle", label: "Gênero",
25
+ },
26
+ {
27
+ property: "description", type: "description", label: "Descrição", isHtml: true,
28
+ },
29
+ ],
30
+ callsToActionMenu: [
31
+ {
32
+ label: "Editar",
33
+ icon: "pencil",
34
+ action: {
35
+ link: {
36
+ endpoint: "/movie-form",
37
+ propertiesAsQueryParam: ["_id"],
38
+ },
39
+ },
40
+ },
41
+ {
42
+ label: "Excluir",
43
+ icon: "delete",
44
+ action: {
45
+ link: {
46
+ endpoint: "/movie-list",
47
+ },
48
+ request: {
49
+ endpoint: "/movies",
50
+ verb: "delete",
51
+ propertiesAsPathParam: ["_id"],
52
+ dialog: {
53
+ title: "Excluir conteúdo",
54
+ message: "Deseja realmente excluir esse conteúdo?",
55
+ }
56
+ }
57
+ },
58
+ }
59
+ ]
60
+ };
@@ -0,0 +1,51 @@
1
+ import type { IList } from "../../../interfaces/list.interface";
2
+
3
+ export const movieGenreList: IList = {
4
+ componentType: "list",
5
+ id: "movieGenreList",
6
+ title: "Lista de gêneros de filmes",
7
+ guards: ["isAuthorized"],
8
+ dataSource: {
9
+ endpoint: "/movies-genres",
10
+ paramType: "query",
11
+ hasAuthentication: true,
12
+ },
13
+ properties: [
14
+ {
15
+ property: "name", type: "title", label: "Nome",
16
+ },
17
+ {
18
+ property: "description", type: "description", label: "Descrição",
19
+ },
20
+ ],
21
+ callsToActionMenu: [
22
+ {
23
+ label: "Editar",
24
+ icon: "pencil",
25
+ action: {
26
+ link: {
27
+ endpoint: "/movie-genre-form",
28
+ propertiesAsQueryParam: ["_id"],
29
+ },
30
+ },
31
+ },
32
+ {
33
+ label: "Excluir",
34
+ icon: "delete",
35
+ action: {
36
+ link: {
37
+ endpoint: "/movie-genre-list",
38
+ },
39
+ request: {
40
+ endpoint: "/movies-genres",
41
+ verb: "delete",
42
+ propertiesAsPathParam: ["_id"],
43
+ dialog: {
44
+ title: "Excluir conteúdo",
45
+ message: "Deseja realmente excluir esse conteúdo?",
46
+ }
47
+ }
48
+ },
49
+ }
50
+ ]
51
+ };