rapida-partner 1.8.0 → 1.10.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.
@@ -1,5 +1,7 @@
1
+ import type { EDataType } from "../enums/form.enum";
1
2
  import type { IFormCondition } from "./condition.interface";
2
3
  import type { IApiRequest } from "./form-input.interface";
4
+ import type { IContractRequest } from "./form.interface";
3
5
  import type { IBusinessRule } from "./project.interface";
4
6
 
5
7
  export interface IList {
@@ -21,6 +23,7 @@ export interface IList {
21
23
  link: string; // e.g.: "/user"
22
24
  usePropertyAsQuery?: boolean; // if true then "/user/<email>"
23
25
  };
26
+ dataType: EDataType;
24
27
  conditions?: IFormCondition[];
25
28
  }[]; // properties taken from dataSource
26
29
  cardAsALink?: {
@@ -49,4 +52,13 @@ export interface IList {
49
52
  };
50
53
  };
51
54
  }[];
55
+ contracts: {
56
+ id: string;
57
+ endpoint: string;
58
+ actions: ("create" | "get" | "getById" | "update" | "delete" | "clone" | "sendEmail")[];
59
+ request?: IContractRequest;
60
+ conditions?: IFormCondition[];
61
+ businessRules?: IBusinessRule[];
62
+ userStory?: string;
63
+ }[];
52
64
  }
@@ -17,9 +17,9 @@ export interface IProject {
17
17
  businessPlan?: IBusinessPLan;
18
18
  businessRules?: IBusinessRule[];
19
19
  flow:
20
- | "backofficeByInvitationWithoutPermissions"
21
- | "backofficeByInvitationAndPermissionsByComponent"
22
- | "backofficeOpenedWithoutPermissions"
20
+ | "backofficeByInvitationWithoutPermissions"
21
+ | "backofficeByInvitationAndPermissionsByComponent"
22
+ | "backofficeOpenedWithoutPermissions"
23
23
  | "backofficeOpenedAndPermissionsByComponent"
24
24
  | "marketplace"
25
25
  | "landingPage"
@@ -20,15 +20,18 @@
20
20
  "name": {
21
21
  "type": "string"
22
22
  },
23
- "title": {
23
+ "label": {
24
24
  "type": "string"
25
25
  },
26
26
  "elements": {
27
27
  "$ref": "form-one-of.ref.json"
28
+ },
29
+ "isRequired": {
30
+ "type": "boolean"
28
31
  }
29
32
  },
30
33
  "required": [
31
34
  "type",
32
- "title"
35
+ "label"
33
36
  ]
34
37
  }
@@ -0,0 +1,29 @@
1
+ {
2
+ "$id": "form-flowchart-action-with-element.ref.json",
3
+ "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "type": "object",
5
+ "properties": {
6
+ "verb": {
7
+ "type": "string",
8
+ "enum": [
9
+ "create",
10
+ "get",
11
+ "getById",
12
+ "update",
13
+ "delete",
14
+ "clone",
15
+ "sendEmail"
16
+ ]
17
+ },
18
+ "elements": {
19
+ "type": "array",
20
+ "items": {
21
+ "$ref": "form-flowchart-element.ref.json"
22
+ }
23
+ },
24
+ "businessRules": {
25
+ "$ref": "business-rules.ref.json"
26
+ }
27
+ },
28
+ "required": ["verb"]
29
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "$id": "form-flowchart-actor.ref.json",
3
+ "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "type": "object",
5
+ "properties": {
6
+ "name": {
7
+ "type": "string"
8
+ },
9
+ "actionsWithElements": {
10
+ "type": "array",
11
+ "items": {
12
+ "$ref": "form-flowchart-action-with-element.ref.json"
13
+ }
14
+ },
15
+ "businessRules": {
16
+ "$ref": "business-rules.ref.json"
17
+ }
18
+ },
19
+ "required": ["name", "actionsWithElements"]
20
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "$id": "form-flowchart-element.ref.json",
3
+ "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "type": "object",
5
+ "properties": {
6
+ "name": {
7
+ "type": "string"
8
+ },
9
+ "businessRules": {
10
+ "$ref": "business-rules.ref.json"
11
+ }
12
+ },
13
+ "required": ["name", "businessRules"]
14
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "$id": "form-flowchart.ref.json",
3
+ "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "type": "object",
5
+ "properties": {
6
+ "actors": {
7
+ "type": "array",
8
+ "items": {
9
+ "$ref": "form-flowchart-actor.ref.json"
10
+ }
11
+ }
12
+ },
13
+ "required": ["actors"]
14
+ }
@@ -234,6 +234,9 @@
234
234
  "required": ["id", "endpoint", "actions"]
235
235
  }
236
236
  },
237
+ "flowChart": {
238
+ "$ref": "form-flowchart.ref.json"
239
+ },
237
240
  "kanban": {
238
241
  "type": "object",
239
242
  "properties": {
@@ -53,6 +53,10 @@
53
53
  "icon"
54
54
  ]
55
55
  },
56
+ "dataType": {
57
+ "type": "string",
58
+ "$ref": "types-datatype.ref.json"
59
+ },
56
60
  "isHtml": {
57
61
  "type": "boolean"
58
62
  },
@@ -77,7 +81,7 @@
77
81
  "required": ["link"]
78
82
  },
79
83
  "conditions": {
80
- "$ref": "condition.ref.json"
84
+ "$ref": "condition.ref.json"
81
85
  }
82
86
  },
83
87
  "required": ["property"]
@@ -193,7 +197,228 @@
193
197
  },
194
198
  "required": ["icon", "label", "action"]
195
199
  }
200
+ },
201
+ "contracts": {
202
+ "type": "array",
203
+ "items": {
204
+ "type": "object",
205
+ "properties": {
206
+ "id": {
207
+ "type": "string"
208
+ },
209
+ "endpoint": {
210
+ "type": "string"
211
+ },
212
+ "actions": {
213
+ "type": "array",
214
+ "items": {
215
+ "type": "string",
216
+ "enum": [
217
+ "create",
218
+ "get",
219
+ "getById",
220
+ "update",
221
+ "delete",
222
+ "clone",
223
+ "sendEmail"
224
+ ]
225
+ }
226
+ },
227
+ "request": {
228
+ "type": "object",
229
+ "properties": {
230
+ "entity": {
231
+ "type": "string"
232
+ },
233
+ "description": {
234
+ "type": "string"
235
+ },
236
+ "fields": {
237
+ "type": "array",
238
+ "items": {
239
+ "type": "object",
240
+ "properties": {
241
+ "name": {
242
+ "type": "string"
243
+ },
244
+ "dataType": {
245
+ "$ref": "types-datatype.ref.json"
246
+ },
247
+ "isRequired": {
248
+ "type": "boolean"
249
+ },
250
+ "requiredOneOf": {
251
+ "type": "array",
252
+ "items": {
253
+ "type": "string"
254
+ }
255
+ },
256
+ "isHidden": {
257
+ "type": "boolean",
258
+ "description": "If true, the attribute will not be exposed in the API."
259
+ },
260
+ "foreignKey": {
261
+ "type": "object",
262
+ "properties": {
263
+ "entity": {
264
+ "type": "string"
265
+ },
266
+ "connectionAttribute": {
267
+ "type": "string"
268
+ },
269
+ "relationship": {
270
+ "type": "string",
271
+ "enum": ["one-to-one", "one-to-many", "many-to-many"]
272
+ },
273
+ "fields": {
274
+ "type": "array",
275
+ "items": {
276
+ "type": "object",
277
+ "properties": {
278
+ "name": {
279
+ "type": "string"
280
+ },
281
+ "dataType": {
282
+ "$ref": "types-datatype.ref.json"
283
+ }
284
+ },
285
+ "required": ["name", "dataType"]
286
+ }
287
+ },
288
+ "isHidden": {
289
+ "type": "boolean",
290
+ "description": "If true, the connection attribute will not be exposed in the API."
291
+ }
292
+ },
293
+ "required": [
294
+ "entity",
295
+ "connectionAttribute",
296
+ "relationship"
297
+ ]
298
+ },
299
+ "isPrimaryKey": {
300
+ "type": "boolean"
301
+ },
302
+ "minSize": {
303
+ "type": "number"
304
+ },
305
+ "maxSize": {
306
+ "type": "number"
307
+ },
308
+ "enum": {
309
+ "type": "array",
310
+ "items": {
311
+ "oneOf": [
312
+ {
313
+ "type": "string"
314
+ },
315
+ {
316
+ "type": "number"
317
+ }
318
+ ]
319
+ }
320
+ },
321
+ "isUnique": {
322
+ "type": "boolean"
323
+ },
324
+ "uniqueComposedFields": {
325
+ "type": "array",
326
+ "items": {
327
+ "type": "string"
328
+ }
329
+ },
330
+ "actionsExceptions": {
331
+ "type": "array",
332
+ "items": {
333
+ "type": "string",
334
+ "enum": [
335
+ "create",
336
+ "get",
337
+ "getById",
338
+ "update",
339
+ "delete",
340
+ "clone",
341
+ "sendEmail"
342
+ ]
343
+ }
344
+ }
345
+ },
346
+ "required": ["name", "dataType"]
347
+ }
348
+ },
349
+ "relatedEntity": {
350
+ "type": "object",
351
+ "properties": {
352
+ "entity": {
353
+ "type": "string",
354
+ "description": "An attribute called 'relatedEntity' will be created in the main entity to refer to an entity that will be related to the main one."
355
+ },
356
+ "connectionAttribute": {
357
+ "type": "string",
358
+ "description": "An attribute called 'relatedEntityId' will be created in the main entity to set the value of the id over 'relatedEntity' to make the connection."
359
+ },
360
+ "fieldsFromEntity": {
361
+ "type": "array",
362
+ "items": {
363
+ "type": "object",
364
+ "properties": {
365
+ "fields": {
366
+ "$ref": "form.ref.json"
367
+ },
368
+ "contractId": {
369
+ "type": "string"
370
+ }
371
+ }
372
+ },
373
+ "required": ["fields", "contractId"]
374
+ }
375
+ },
376
+ "required": [
377
+ "entity",
378
+ "connectionAttribute",
379
+ "fieldsFromEntity"
380
+ ]
381
+ },
382
+ "uniqueConstraints": {
383
+ "type": "array",
384
+ "items": {
385
+ "type": "object",
386
+ "properties": {
387
+ "name": {
388
+ "type": "string"
389
+ },
390
+ "fields": {
391
+ "type": "array",
392
+ "items": {
393
+ "type": "string"
394
+ }
395
+ }
396
+ }
397
+ }
398
+ }
399
+ },
400
+ "required": ["entity", "fields"]
401
+ },
402
+ "conditions": {
403
+ "$ref": "condition.ref.json"
404
+ },
405
+ "businessRules": {
406
+ "$ref": "business-rules.ref.json"
407
+ },
408
+ "userStory": {
409
+ "type": "string"
410
+ }
411
+ },
412
+ "required": ["id", "endpoint", "actions"]
413
+ }
196
414
  }
197
415
  },
198
- "required": ["componentType", "id", "title", "dataSource", "properties"]
416
+ "required": [
417
+ "componentType",
418
+ "id",
419
+ "title",
420
+ "dataSource",
421
+ "properties",
422
+ "contracts"
423
+ ]
199
424
  }
@@ -1,49 +0,0 @@
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
- };
@@ -1,50 +0,0 @@
1
- import type { IList } from "../../../interfaces/list.interface";
2
-
3
- export const customerList: IList = {
4
- title: "Lista de clientes",
5
- id: "customerList",
6
- componentType: "list",
7
- dataSource: {
8
- endpoint: "/customers",
9
- paramType: "query",
10
- },
11
- properties: [
12
- { label: "Tipo", property: "entityRelated", type: "title", },
13
- { label: "Nome", property: "People.name", type: "subtitle", conditions: [{ type: "property", elements: [{ key: "entityRelated", comparisonOperator: "===", value: "People" }] }] },
14
- { label: "Telefone", property: "People.phoneOne", type: "subtitle", conditions: [{ type: "property", elements: [{ key: "entityRelated", comparisonOperator: "===", value: "People" }] }] },
15
- { label: "E-mail", property: "People.emailOne", type: "subtitle", conditions: [{ type: "property", elements: [{ key: "entityRelated", comparisonOperator: "===", value: "People" }] }] },
16
- { label: "Nome", property: "Companies.companyName", type: "subtitle", conditions: [{ type: "property", elements: [{ key: "entityRelated", comparisonOperator: "===", value: "Companies" }] }] },
17
- { label: "Telefone", property: "Companies.phoneOne", type: "subtitle", conditions: [{ type: "property", elements: [{ key: "entityRelated", comparisonOperator: "===", value: "Companies" }] }] },
18
- { label: "E-mail", property: "Companies.emailOne", type: "subtitle", conditions: [{ type: "property", elements: [{ key: "entityRelated", comparisonOperator: "===", value: "Companies" }] }] },
19
- ],
20
- callsToActionMenu: [
21
- {
22
- label: "Editar",
23
- icon: "pencil",
24
- action: {
25
- link: {
26
- endpoint: "/customer-form",
27
- propertiesAsQueryParam: ["_id"],
28
- },
29
- },
30
- },
31
- {
32
- label: "Excluir",
33
- icon: "delete",
34
- action: {
35
- link: {
36
- endpoint: "/customer-list",
37
- },
38
- request: {
39
- endpoint: "/customers",
40
- verb: "delete",
41
- propertiesAsPathParam: ["_id"],
42
- dialog: {
43
- title: "Excluir conteúdo",
44
- message: "Deseja realmente excluir esse conteúdo?",
45
- }
46
- }
47
- },
48
- }
49
- ]
50
- }
@@ -1,50 +0,0 @@
1
- import type { IList } from "../../../interfaces/list.interface";
2
-
3
- export const personList: IList = {
4
- componentType: "list",
5
- id: "personList",
6
- title: "Lista de pessoas",
7
- guards: ["isAuthorized"],
8
- dataSource: {
9
- endpoint: "/people",
10
- paramType: "query",
11
- hasAuthentication: true,
12
- },
13
- properties: [
14
- { label: "Foto", property: "personPicture", type: "image" },
15
- { label: "CPF", property: "personCpf", type: "title" },
16
- { label: "Nome", property: "personName", type: "title" },
17
- { label: "Telefone", property: "personPhoneOne", type: "subtitle" },
18
- { label: "E-mail", property: "personEmailOne", type: "subtitle" },
19
- ],
20
- callsToActionMenu: [
21
- {
22
- label: "Editar",
23
- icon: "pencil",
24
- action: {
25
- link: {
26
- endpoint: "/person-form",
27
- propertiesAsQueryParam: ["_id"],
28
- },
29
- },
30
- },
31
- {
32
- label: "Excluir",
33
- icon: "delete",
34
- action: {
35
- link: {
36
- endpoint: "/person-list",
37
- },
38
- request: {
39
- endpoint: "/people",
40
- verb: "delete",
41
- propertiesAsPathParam: ["_id"],
42
- dialog: {
43
- title: "Excluir pessoa",
44
- message: "Deseja realmente excluir essa pessoa?",
45
- }
46
- }
47
- },
48
- }
49
- ]
50
- };