rapida-partner 1.19.1 → 2.1.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.
- package/README.md +73 -43
- package/index.ts +87 -13
- package/package.json +2 -2
- package/src/controllers/ts_project_to_json_project.ts +12 -11
- package/src/enums/form.enum.ts +3 -0
- package/src/examples/components/forms/actor.form.ts +57 -5
- package/src/examples/components/forms/character.form.ts +6 -1
- package/src/examples/components/forms/company.form.ts +9 -5
- package/src/examples/components/forms/movie.form.ts +21 -5
- package/src/examples/components/forms/movieEpisode.form.ts +10 -5
- package/src/examples/components/forms/movieGenre.form.ts +6 -1
- package/src/examples/components/forms/person.form.ts +9 -14
- package/src/examples/components/forms/project.form.ts +295 -0
- package/src/examples/components/forms/taskWithProject.form.ts +310 -0
- package/src/examples/components/lists/actor.list.ts +15 -9
- package/src/examples/components/lists/character.list.ts +13 -7
- package/src/examples/components/lists/movie.list.ts +104 -24
- package/src/examples/components/lists/movieEpisode.list.ts +17 -11
- package/src/examples/components/lists/movieGenre.list.ts +12 -6
- package/src/examples/components/lists/project.list.ts +78 -0
- package/src/examples/components/lists/taskWithProject.list.ts +202 -0
- package/src/examples/components/tables/character.table.ts +40 -0
- package/src/examples/modules/character.ts +1 -0
- package/src/examples/modules/project.ts +18 -0
- package/src/examples/projects/assets/images/favicon/android-chrome-192x192.png +0 -0
- package/src/examples/projects/assets/images/favicon/android-chrome-512x512.png +0 -0
- package/src/examples/projects/assets/images/favicon/apple-touch-icon.png +0 -0
- package/src/examples/projects/assets/images/favicon/favicon-16x16.png +0 -0
- package/src/examples/projects/assets/images/favicon/favicon-32x32.png +0 -0
- package/src/examples/projects/assets/images/favicon/favicon.ico +0 -0
- package/src/examples/projects/assets/images/logo.png +0 -0
- package/src/examples/projects/movieBackoffice.ts +62 -62
- package/src/interfaces/ai-agent.interface.ts +179 -0
- package/src/interfaces/condition.interface.ts +0 -1
- package/src/interfaces/data-chart.interface.ts +74 -56
- package/src/interfaces/data-table.interface.ts +43 -0
- package/src/interfaces/form-array.interface.ts +1 -0
- package/src/interfaces/form-autocomplete.interface.ts +1 -0
- package/src/interfaces/form-checkbox.interface.ts +27 -0
- package/src/interfaces/form-contract.interface.ts +12 -2
- package/src/interfaces/form-file.interface.ts +2 -1
- package/src/interfaces/form-input.interface.ts +18 -3
- package/src/interfaces/form-radio.interface.ts +27 -0
- package/src/interfaces/form-select.interface.ts +1 -1
- package/src/interfaces/form.interface.ts +13 -4
- package/src/interfaces/kanban.interface.ts +82 -0
- package/src/interfaces/list.interface.ts +15 -1
- package/src/interfaces/notification.interface.ts +27 -0
- package/src/interfaces/project-backend.interface.ts +61 -2
- package/src/interfaces/project-repositories.interface.ts +18 -0
- package/src/interfaces/project-style.interface.ts +15 -96
- package/src/interfaces/project.interface.ts +52 -5
- package/src/interfaces/record-reminder.interface.ts +14 -0
- package/src/interfaces/trusted-caller.interface.ts +21 -0
- package/src/schemas/ai-agent-config.ref.json +232 -0
- package/src/schemas/backend.ref.json +87 -1
- package/src/schemas/component-one-of.ref.json +4 -1
- package/src/schemas/data-chart.ref.json +3 -0
- package/src/schemas/data-table.ref.json +24 -0
- package/src/schemas/form-array.ref.json +3 -0
- package/src/schemas/form-autocomplete.ref.json +6 -0
- package/src/schemas/form-checkbox.ref.json +73 -0
- package/src/schemas/form-contract-request.ref.json +1 -0
- package/src/schemas/form-contract.ref.json +2 -1
- package/src/schemas/form-file.ref.json +4 -0
- package/src/schemas/form-input.ref.json +8 -2
- package/src/schemas/form-one-of.ref.json +4 -2
- package/src/schemas/form-public-contract.ref.json +16 -5
- package/src/schemas/form-radio.ref.json +73 -0
- package/src/schemas/form-switch.ref.json +3 -12
- package/src/schemas/form.ref.json +14 -50
- package/src/schemas/frontend.ref.json +26 -1
- package/src/schemas/kanban.ref.json +259 -0
- package/src/schemas/list.ref.json +65 -313
- package/src/schemas/module.ref.json +3 -0
- package/src/schemas/notification-condition.ref.json +20 -0
- package/src/schemas/notification-recipients.ref.json +31 -0
- package/src/schemas/notification.ref.json +65 -0
- package/src/schemas/project-repositories.ref.json +19 -0
- package/src/schemas/project-style.ref.json +28 -12
- package/src/schemas/project.schema.json +115 -4
- package/src/schemas/record-reminder.ref.json +41 -0
- package/src/schemas/send-message.ref.json +33 -0
- package/src/schemas/trusted-caller.ref.json +28 -0
- package/src/schemas/types-datatype.ref.json +1 -0
- package/src/utils/json.ts +3 -11
- package/src/utils/path.ts +22 -27
- package/rapidaObject.json +0 -1
- package/src/constants/secrets/database.ts +0 -1
- package/src/constants/secrets/others.ts +0 -3
- package/src/constants/secrets/storage.ts +0 -1
- package/src/schemas/project-style-theme.ref.json +0 -98
- package/src/utils/env.ts +0 -9
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Projeto Rapida Partner
|
|
2
2
|
|
|
3
|
-
Este repositório
|
|
3
|
+
Este repositório contém a ferramenta `rapida-partner`, que atua como uma ponte entre a idealização de um projeto de software e sua implementação técnica. Seu objetivo principal é traduzir a lógica de negócio e os requisitos de engenharia em um objeto JSON unificado, servindo como um "mapa" detalhado para a criação de qualquer projeto.
|
|
4
4
|
|
|
5
5
|
O "Movie Backoffice" é apenas um exemplo prático, mostrando como as interfaces do `rapida-partner` podem ser utilizadas para descrever um sistema completo. Ele detalha desde o plano de negócios e as regras de negócio até a estrutura do frontend e backend, além de definir módulos e componentes como formulários e listas.
|
|
6
6
|
|
|
@@ -10,79 +10,109 @@ O projeto `Movie Backoffice` demonstra o uso do `rapida-partner` para um sistema
|
|
|
10
10
|
|
|
11
11
|
A arquitetura técnica é definida da seguinte forma:
|
|
12
12
|
|
|
13
|
-
- **Frontend**:
|
|
14
|
-
|
|
13
|
+
- **Frontend**: Angular com Flowbite UI Kit.
|
|
15
14
|
- **Backend**: NestJS com banco de dados MongoDB.
|
|
16
|
-
|
|
17
|
-
- **
|
|
18
|
-
|
|
19
|
-
- **Módulos**: `personModule`, `companyModule`, `movieModule`, e `characterModule`.
|
|
20
|
-
|
|
15
|
+
- **Fluxos**: Autenticação, permissão, registro e perfis (pessoa/empresa).
|
|
16
|
+
- **Módulos**: `movieModule`, `actorModule`, `characterModule` e `productModule`.
|
|
21
17
|
|
|
22
18
|
## Como Usar o `rapida-partner`
|
|
23
19
|
|
|
24
|
-
### 1. Instalação
|
|
20
|
+
### 1. Instalação
|
|
25
21
|
|
|
26
22
|
Este projeto utiliza **Bun** como runtime e gerenciador de pacotes.
|
|
27
23
|
|
|
28
|
-
1. **Clone o repositório:**
|
|
29
|
-
|
|
30
24
|
```bash
|
|
31
25
|
git clone [URL_DO_REPOSITORIO]
|
|
32
26
|
cd rapida-partner
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
1. **Instale as dependências:**
|
|
36
|
-
```bash
|
|
37
27
|
bun install
|
|
38
28
|
```
|
|
39
29
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
As configurações de backend, como `database`, `storage`, `logging` e `email`, são definidas diretamente no objeto do projeto TypeScript (`movieBackoffice.ts`).
|
|
47
|
-
|
|
30
|
+
### 2. Geração do Mapa do Projeto (JSON)
|
|
31
|
+
|
|
32
|
+
O `rapida-partner` agora funciona como uma **CLI (Interface de Linha de Comando)**. Você informa o caminho do arquivo TypeScript que descreve o projeto, e a ferramenta gera o JSON correspondente.
|
|
33
|
+
|
|
34
|
+
**Sintaxe:**
|
|
48
35
|
|
|
49
|
-
|
|
36
|
+
```bash
|
|
50
37
|
|
|
51
|
-
|
|
38
|
+
bun index.ts <caminho-para-arquivo-do-projeto> [caminho-para-json-de-saída]
|
|
39
|
+
```
|
|
52
40
|
|
|
53
|
-
|
|
41
|
+
**Exemplo com o projeto de exemplo:**
|
|
54
42
|
|
|
55
43
|
```bash
|
|
56
|
-
|
|
44
|
+
|
|
45
|
+
bun index.ts ./src/examples/projects/movieBackoffice.ts ./rapidaObject.json
|
|
57
46
|
```
|
|
58
47
|
|
|
59
|
-
|
|
48
|
+
- O primeiro argumento é **obrigatório** e deve apontar para um arquivo TypeScript que exporte (`export default` ou `export const`) um objeto que implemente a interface `IProject`.
|
|
49
|
+
|
|
50
|
+
- O segundo argumento é **opcional** e define onde o JSON gerado será salvo. Se omitido, o arquivo será criado como `./rapidaObject.json`.
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
### 3. Validação Automática
|
|
60
54
|
|
|
61
|
-
|
|
55
|
+
Após gerar o JSON, o script automaticamente valida o conteúdo contra o esquema `project.schema.json` e todas as suas referências (arquivos `.ref.json`). Se a validação falhar, os erros são exibidos no console, permitindo que você corrija as inconsistências.
|
|
62
56
|
|
|
63
|
-
|
|
57
|
+
### 4. Estrutura do Projeto (Interfaces)
|
|
64
58
|
|
|
65
|
-
|
|
59
|
+
Para criar seu próprio "mapa", utilize as interfaces TypeScript disponíveis na pasta `src/interfaces/`. Elas definem cada componente e regra de negócio que você pode descrever.
|
|
60
|
+
|
|
61
|
+
- `project.interface.ts`: Define a estrutura de um projeto, incluindo plano de negócios, regras de negócio, módulos e dashboard.
|
|
66
62
|
|
|
67
|
-
- `project-backend.interface.ts`: Detalha as configurações de backend (framework, banco de dados, armazenamento, etc.).
|
|
63
|
+
- `project-backend.interface.ts`: Detalha as configurações de backend (framework, banco de dados, armazenamento, logging, email, marketplace, etc.).
|
|
68
64
|
|
|
69
|
-
- `form.interface.ts`,
|
|
65
|
+
- `form.interface.ts`, `list.interface.ts`, `data-table.interface.ts`, `data-chart.interface.ts`, etc.: Definem os tipos de componentes de UI e suas propriedades (campos de formulário, listas, tabelas, gráficos, etc.).
|
|
70
66
|
|
|
71
67
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
### 4. Como o "Mapa" é Validado
|
|
68
|
+
### 5. Como Funciona a Validação
|
|
75
69
|
|
|
76
|
-
A validação
|
|
70
|
+
A validação é feita através do módulo `src/utils/json.ts`, que utiliza as bibliotecas `ajv` e `ajv-formats`. O processo:
|
|
77
71
|
|
|
78
|
-
|
|
72
|
+
1. Carrega o esquema principal (`project.schema.json`).
|
|
79
73
|
|
|
80
|
-
|
|
74
|
+
2. Coleta recursivamente todas as referências (`$ref`) e adiciona os esquemas correspondentes.
|
|
81
75
|
|
|
82
|
-
|
|
76
|
+
3. Compila o validador e verifica o JSON gerado.
|
|
77
|
+
|
|
78
|
+
4. Exibe os erros de validação caso o projeto não esteja em conformidade.
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
## Problemas Conhecidos
|
|
82
|
+
|
|
83
|
+
- No atributo `contracts[n].request.fields[n]`, se o `dataType` for `"array"`, é necessário inserir um campo `elements` para descrever melhor a estrutura do array no contrato.
|
|
83
84
|
|
|
84
85
|
|
|
85
|
-
|
|
86
|
+
## Remoção da Dependência do `.env`
|
|
87
|
+
|
|
88
|
+
Diferentemente de versões anteriores, o `rapida-partner` **não requer mais** um arquivo `.env` para funcionar. As variáveis de ambiente (como `ROOT_PATH`) foram substituídas por caminhos calculados dinamicamente a partir do diretório do pacote. Portanto, não há necessidade de configurar nenhuma variável externa.
|
|
89
|
+
|
|
90
|
+
## Licença
|
|
91
|
+
Este projeto está licenciado sob os termos da licença MIT.
|
|
92
|
+
```text
|
|
93
|
+
MIT License
|
|
94
|
+
|
|
95
|
+
Copyright (c) [ano] [seu nome]
|
|
96
|
+
|
|
97
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
98
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
99
|
+
in the Software without restriction, including without limitation the rights
|
|
100
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
101
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
102
|
+
furnished to do so, subject to the following conditions:
|
|
103
|
+
|
|
104
|
+
The above copyright notice and this permission notice shall be included in all
|
|
105
|
+
copies or substantial portions of the Software.
|
|
106
|
+
|
|
107
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
108
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
109
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
110
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
111
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
112
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
113
|
+
SOFTWARE.
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Contribuição
|
|
86
117
|
|
|
87
|
-
|
|
88
|
-
- No atributo `contracts[n].request.body[n]`, se o `dataType` for `array`, é preciso inserir `elements` pra melhorar a descrição do contrato.
|
|
118
|
+
Contribuições são bem-vindas. Abra uma issue ou pull request para sugestões e melhorias.
|
package/index.ts
CHANGED
|
@@ -1,13 +1,87 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { tsProjectToJsonProject } from "./src/controllers/ts_project_to_json_project";
|
|
4
|
+
import { validateProjectJson } from "./src/utils/json";
|
|
5
|
+
import type { IProject } from "./src/interfaces/project.interface";
|
|
6
|
+
import * as fs from "fs";
|
|
7
|
+
import * as path from "path";
|
|
8
|
+
|
|
9
|
+
function isProjectObject(obj: any): obj is IProject {
|
|
10
|
+
return obj && typeof obj === "object" && obj.id && obj.title && obj.skeleton;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
async function main() {
|
|
14
|
+
const args = process.argv.slice(2);
|
|
15
|
+
|
|
16
|
+
if (args.length === 0) {
|
|
17
|
+
console.error(
|
|
18
|
+
"Usage: bun index.ts <path-to-project-file> [output-json-path]",
|
|
19
|
+
);
|
|
20
|
+
console.error(
|
|
21
|
+
"Example: bun index.ts ./src/examples/projects/movieBackoffice.ts ./rapidaObject.json",
|
|
22
|
+
);
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const projectFilePath = path.resolve(args[0]);
|
|
27
|
+
const outputPath = args[1] || "./rapidaObject.json";
|
|
28
|
+
|
|
29
|
+
if (!fs.existsSync(projectFilePath)) {
|
|
30
|
+
console.error(`File not found: ${projectFilePath}`);
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
try {
|
|
35
|
+
// Dynamically import the project module
|
|
36
|
+
const module = await import(projectFilePath);
|
|
37
|
+
|
|
38
|
+
let project: IProject | undefined;
|
|
39
|
+
|
|
40
|
+
// 1. Check for default export
|
|
41
|
+
if (module.default && isProjectObject(module.default)) {
|
|
42
|
+
project = module.default;
|
|
43
|
+
}
|
|
44
|
+
// 2. Check for named export 'project'
|
|
45
|
+
else if (module.project && isProjectObject(module.project)) {
|
|
46
|
+
project = module.project;
|
|
47
|
+
}
|
|
48
|
+
// 3. Scan all exports and find the first valid project object
|
|
49
|
+
else {
|
|
50
|
+
const exportKeys = Object.keys(module);
|
|
51
|
+
for (const key of exportKeys) {
|
|
52
|
+
const exported = module[key];
|
|
53
|
+
if (isProjectObject(exported)) {
|
|
54
|
+
project = exported;
|
|
55
|
+
console.info(`Using export "${key}" as project.`);
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (!project) {
|
|
62
|
+
const availableExports = Object.keys(module).join(", ");
|
|
63
|
+
console.error(`No valid project export found in ${projectFilePath}.`);
|
|
64
|
+
console.error(`Available exports: ${availableExports || "none"}`);
|
|
65
|
+
console.error("Expected an object with properties: id, title, skeleton");
|
|
66
|
+
process.exit(1);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Generate JSON from project
|
|
70
|
+
const jsonString = tsProjectToJsonProject(project, outputPath);
|
|
71
|
+
const jsonObject = JSON.parse(jsonString);
|
|
72
|
+
|
|
73
|
+
// Validate generated JSON against schema
|
|
74
|
+
const isValid = validateProjectJson(jsonObject, "project");
|
|
75
|
+
if (!isValid) {
|
|
76
|
+
console.error("Generated JSON validation failed.");
|
|
77
|
+
process.exit(1);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
console.info("Project JSON successfully generated and validated.");
|
|
81
|
+
} catch (error) {
|
|
82
|
+
console.error("Error processing project:", error);
|
|
83
|
+
process.exit(1);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
main();
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rapida-partner",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "index.ts",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist/",
|
|
8
8
|
"src/",
|
|
9
|
+
"!src/constants",
|
|
9
10
|
"index.ts",
|
|
10
|
-
"rapidaObject.json",
|
|
11
11
|
"tsconfig.json"
|
|
12
12
|
],
|
|
13
13
|
"devDependencies": {
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import type { IProject } from "../interfaces/project.interface";
|
|
2
2
|
import { writeFile } from "../utils/file";
|
|
3
|
-
import { rootPath } from "../utils/env";
|
|
4
3
|
|
|
5
|
-
const tsProjectToJsonProject = (
|
|
6
|
-
|
|
4
|
+
const tsProjectToJsonProject = (
|
|
5
|
+
project: IProject,
|
|
6
|
+
outputPath?: string,
|
|
7
|
+
): string => {
|
|
8
|
+
console.log(project);
|
|
9
|
+
const json = JSON.stringify(project, null, 2); // Pretty print for readability
|
|
10
|
+
const finalOutputPath = outputPath || "./rapidaObject.json";
|
|
7
11
|
|
|
8
|
-
|
|
12
|
+
writeFile(json, finalOutputPath);
|
|
13
|
+
console.info(`Project written to file: ${finalOutputPath}`);
|
|
9
14
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return json;
|
|
13
|
-
}
|
|
15
|
+
return json;
|
|
16
|
+
};
|
|
14
17
|
|
|
15
|
-
export {
|
|
16
|
-
tsProjectToJsonProject
|
|
17
|
-
}
|
|
18
|
+
export { tsProjectToJsonProject };
|
package/src/enums/form.enum.ts
CHANGED
|
@@ -19,6 +19,9 @@ export enum EDataType {
|
|
|
19
19
|
CLOB = "clob",
|
|
20
20
|
NCLOB = "nclob",
|
|
21
21
|
DECIMAL = "decimal",
|
|
22
|
+
// Valor monetário: armazenado como número decimal (2 casas), exibido/mascarado
|
|
23
|
+
// como moeda (BRL por padrão) no form, list, detail, card e kanban.
|
|
24
|
+
CURRENCY = "currency",
|
|
22
25
|
NUMERIC = "numeric",
|
|
23
26
|
INTEGER = "integer",
|
|
24
27
|
FLOAT = "float",
|
|
@@ -25,7 +25,17 @@ export const actorForm: IForm = {
|
|
|
25
25
|
label: "Data de nascimento",
|
|
26
26
|
name: "birthDate",
|
|
27
27
|
type: "input",
|
|
28
|
-
dataType: EDataType.
|
|
28
|
+
dataType: EDataType.DATE,
|
|
29
|
+
isRequired: true,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: "Sexo",
|
|
33
|
+
name: "gender",
|
|
34
|
+
type: "radio",
|
|
35
|
+
options: [
|
|
36
|
+
{ label: "Masculino", value: "male" },
|
|
37
|
+
{ label: "Feminino", value: "female" },
|
|
38
|
+
],
|
|
29
39
|
isRequired: true,
|
|
30
40
|
},
|
|
31
41
|
{
|
|
@@ -43,8 +53,48 @@ export const actorForm: IForm = {
|
|
|
43
53
|
label: "Biografia",
|
|
44
54
|
name: "biography",
|
|
45
55
|
type: "input",
|
|
46
|
-
dataType: EDataType.
|
|
47
|
-
|
|
56
|
+
dataType: EDataType.WYSIWYG,
|
|
57
|
+
storageConfig: {
|
|
58
|
+
fileNameStrategy: "uuid",
|
|
59
|
+
path: "actors/biography-images",
|
|
60
|
+
visibility: "public",
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
label: "Hobbies",
|
|
65
|
+
name: "hobbies",
|
|
66
|
+
type: "checkbox",
|
|
67
|
+
options: [
|
|
68
|
+
{ label: "Esportes", value: "sports" },
|
|
69
|
+
{ label: "Ler", value: "reading" },
|
|
70
|
+
{ label: "Trabalhar", value: "working" },
|
|
71
|
+
{ label: "Outros", value: "other" },
|
|
72
|
+
],
|
|
73
|
+
isRequired: true,
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
label: "Outros hobbies",
|
|
77
|
+
name: "otherHobbies",
|
|
78
|
+
type: "input",
|
|
79
|
+
dataType: EDataType.NVARCHAR,
|
|
80
|
+
isRequired: true,
|
|
81
|
+
conditions: {
|
|
82
|
+
form: {
|
|
83
|
+
elements: [
|
|
84
|
+
{
|
|
85
|
+
key: "hobbies",
|
|
86
|
+
value: "other",
|
|
87
|
+
comparisonOperator: "==="
|
|
88
|
+
}
|
|
89
|
+
]
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
label: "Dados verificados",
|
|
95
|
+
name: "verifiedData",
|
|
96
|
+
type: "switch",
|
|
97
|
+
},
|
|
48
98
|
],
|
|
49
99
|
contracts: [
|
|
50
100
|
{
|
|
@@ -52,15 +102,17 @@ export const actorForm: IForm = {
|
|
|
52
102
|
endpoint: "/actors",
|
|
53
103
|
actions: ["create", "get", "getById", "update", "softDelete"],
|
|
54
104
|
request: {
|
|
55
|
-
entity: "
|
|
105
|
+
entity: "actors",
|
|
56
106
|
description: "Represents an actor or actress in the system.",
|
|
57
107
|
fields: [
|
|
58
108
|
{ name: "id", dataType: EDataType.UNIQUEIDENTIFIER, isRequired: true, isPrimaryKey: true },
|
|
59
109
|
{ name: "name", dataType: EDataType.NVARCHAR, isRequired: true },
|
|
60
110
|
{ name: "socialName", dataType: EDataType.NVARCHAR, isRequired: true },
|
|
61
|
-
{ name: "birthDate", dataType: EDataType.
|
|
111
|
+
{ name: "birthDate", dataType: EDataType.DATE, isRequired: true },
|
|
112
|
+
{ name: "gender", dataType: EDataType.NVARCHAR, isRequired: true },
|
|
62
113
|
{ name: "pictureFile", dataType: EDataType.NVARCHAR },
|
|
63
114
|
{ name: "biography", dataType: EDataType.LONGTEXT },
|
|
115
|
+
{ name: "verifiedData", dataType: EDataType.BOOLEAN, isRequired: true },
|
|
64
116
|
]
|
|
65
117
|
}
|
|
66
118
|
}
|
|
@@ -18,7 +18,7 @@ export const characterForm: IForm = {
|
|
|
18
18
|
{
|
|
19
19
|
label: "Foto do personagem",
|
|
20
20
|
type: "file",
|
|
21
|
-
dataType: EDataType.
|
|
21
|
+
dataType: EDataType.TEXT,
|
|
22
22
|
name: "characterImage",
|
|
23
23
|
storageConfig: {
|
|
24
24
|
fileNameStrategy: "uuid",
|
|
@@ -31,6 +31,11 @@ export const characterForm: IForm = {
|
|
|
31
31
|
dataType: EDataType.WYSIWYG,
|
|
32
32
|
label: "Descrição do personagem",
|
|
33
33
|
name: "characterDescription",
|
|
34
|
+
storageConfig: {
|
|
35
|
+
fileNameStrategy: "uuid",
|
|
36
|
+
path: "characters/description-images",
|
|
37
|
+
visibility: "public",
|
|
38
|
+
},
|
|
34
39
|
},
|
|
35
40
|
{
|
|
36
41
|
type: "select",
|
|
@@ -34,7 +34,8 @@ export const companyForm: IForm = {
|
|
|
34
34
|
name: "cnpj",
|
|
35
35
|
type: "input",
|
|
36
36
|
dataType: EDataType.NVARCHAR,
|
|
37
|
-
|
|
37
|
+
mask: "00.000.000/0000-00",
|
|
38
|
+
validators: ["cnpj"],
|
|
38
39
|
isUnique: true,
|
|
39
40
|
conditions:
|
|
40
41
|
{
|
|
@@ -66,7 +67,7 @@ export const companyForm: IForm = {
|
|
|
66
67
|
label: "Data de abertura",
|
|
67
68
|
name: "birthday",
|
|
68
69
|
type: "input",
|
|
69
|
-
dataType: EDataType.
|
|
70
|
+
dataType: EDataType.DATE,
|
|
70
71
|
},
|
|
71
72
|
{
|
|
72
73
|
label: "Natureza legal",
|
|
@@ -131,6 +132,11 @@ export const companyForm: IForm = {
|
|
|
131
132
|
name: "description",
|
|
132
133
|
type: "input",
|
|
133
134
|
dataType: EDataType.WYSIWYG,
|
|
135
|
+
storageConfig: {
|
|
136
|
+
fileNameStrategy: "uuid",
|
|
137
|
+
path: "companies/description-images",
|
|
138
|
+
visibility: "public",
|
|
139
|
+
},
|
|
134
140
|
},
|
|
135
141
|
{
|
|
136
142
|
label: "Logo da empresa",
|
|
@@ -147,7 +153,7 @@ export const companyForm: IForm = {
|
|
|
147
153
|
label: "Sócios",
|
|
148
154
|
name: "companyPartnersId",
|
|
149
155
|
type: "autocomplete",
|
|
150
|
-
dataType: EDataType.
|
|
156
|
+
dataType: EDataType.UNIQUEIDENTIFIER,
|
|
151
157
|
tooltip:
|
|
152
158
|
"O(s) sócio(s) deve(m) estar cadastrado(s) no gerenciamento de pessoas.",
|
|
153
159
|
optionsApi: {
|
|
@@ -181,7 +187,6 @@ export const companyForm: IForm = {
|
|
|
181
187
|
type: "input",
|
|
182
188
|
dataType: EDataType.NVARCHAR,
|
|
183
189
|
name: "phoneOne",
|
|
184
|
-
maskRegex: "^\\d{15}$",
|
|
185
190
|
},
|
|
186
191
|
]
|
|
187
192
|
},
|
|
@@ -393,7 +398,6 @@ export const companyForm: IForm = {
|
|
|
393
398
|
type: "input",
|
|
394
399
|
dataType: EDataType.NVARCHAR,
|
|
395
400
|
name: "phoneTwo",
|
|
396
|
-
maskRegex: "^\\d{15}$",
|
|
397
401
|
},
|
|
398
402
|
]
|
|
399
403
|
},
|
|
@@ -39,6 +39,11 @@ export const movieForm: IForm = {
|
|
|
39
39
|
dataType: EDataType.WYSIWYG,
|
|
40
40
|
label: "Descrição",
|
|
41
41
|
name: "description",
|
|
42
|
+
storageConfig: {
|
|
43
|
+
fileNameStrategy: "uuid",
|
|
44
|
+
path: "movies/description-images",
|
|
45
|
+
visibility: "public",
|
|
46
|
+
},
|
|
42
47
|
isRequired: true,
|
|
43
48
|
},
|
|
44
49
|
{
|
|
@@ -66,7 +71,7 @@ export const movieForm: IForm = {
|
|
|
66
71
|
valueField: "_id",
|
|
67
72
|
paramsToFilter: ["name"],
|
|
68
73
|
paramType: "query",
|
|
69
|
-
relatedEntity: "
|
|
74
|
+
relatedEntity: "movieGenres"
|
|
70
75
|
},
|
|
71
76
|
isMultiple: true,
|
|
72
77
|
isRequired: true,
|
|
@@ -112,7 +117,7 @@ export const movieForm: IForm = {
|
|
|
112
117
|
valueField: "_id",
|
|
113
118
|
paramsToFilter: ["name"],
|
|
114
119
|
paramType: "query",
|
|
115
|
-
relatedEntity: "
|
|
120
|
+
relatedEntity: "actors"
|
|
116
121
|
},
|
|
117
122
|
isRequired: true,
|
|
118
123
|
},
|
|
@@ -128,7 +133,7 @@ export const movieForm: IForm = {
|
|
|
128
133
|
valueField: "_id",
|
|
129
134
|
paramsToFilter: ["characterName"],
|
|
130
135
|
paramType: "query",
|
|
131
|
-
relatedEntity: "
|
|
136
|
+
relatedEntity: "characters"
|
|
132
137
|
},
|
|
133
138
|
isRequired: true,
|
|
134
139
|
},
|
|
@@ -143,6 +148,17 @@ export const movieForm: IForm = {
|
|
|
143
148
|
visibility: "public",
|
|
144
149
|
},
|
|
145
150
|
},
|
|
151
|
+
{
|
|
152
|
+
label: "Tipo de foto",
|
|
153
|
+
type: "select",
|
|
154
|
+
dataType: EDataType.NVARCHAR,
|
|
155
|
+
name: "photoType",
|
|
156
|
+
options: [
|
|
157
|
+
{ label: "Ator", value: "actor" },
|
|
158
|
+
{ label: "Personagem", value: "character" },
|
|
159
|
+
],
|
|
160
|
+
isRequired: true,
|
|
161
|
+
},
|
|
146
162
|
]
|
|
147
163
|
},
|
|
148
164
|
]
|
|
@@ -156,7 +172,7 @@ export const movieForm: IForm = {
|
|
|
156
172
|
endpoint: "/movies",
|
|
157
173
|
actions: ["create", "update", "getById", "get", "softDelete"],
|
|
158
174
|
request: {
|
|
159
|
-
entity: "
|
|
175
|
+
entity: "movies",
|
|
160
176
|
description: "Represents a movie or TV series in the system.",
|
|
161
177
|
fields: [
|
|
162
178
|
{ name: "id", dataType: EDataType.UNIQUEIDENTIFIER, isRequired: true, isPrimaryKey: true },
|
|
@@ -168,7 +184,7 @@ export const movieForm: IForm = {
|
|
|
168
184
|
{ name: "imdbRating", dataType: EDataType.DECIMAL, isRequired: true },
|
|
169
185
|
{
|
|
170
186
|
name: "movieGenres", dataType: EDataType.UNIQUEIDENTIFIER, isRequired: true, foreignKey: {
|
|
171
|
-
entity: "
|
|
187
|
+
entity: "movieGenres",
|
|
172
188
|
connectionAttribute: "_id",
|
|
173
189
|
relationship: "many-to-many"
|
|
174
190
|
}
|
|
@@ -23,6 +23,11 @@ export const movieEpisodeForm: IForm = {
|
|
|
23
23
|
name: "episodeDescription",
|
|
24
24
|
type: "input",
|
|
25
25
|
dataType: EDataType.WYSIWYG,
|
|
26
|
+
storageConfig: {
|
|
27
|
+
fileNameStrategy: "uuid",
|
|
28
|
+
path: "movie-episodes/description-images",
|
|
29
|
+
visibility: "public",
|
|
30
|
+
},
|
|
26
31
|
},
|
|
27
32
|
{
|
|
28
33
|
label: "Data de lançamento do episódio",
|
|
@@ -42,7 +47,7 @@ export const movieEpisodeForm: IForm = {
|
|
|
42
47
|
valueField: "_id",
|
|
43
48
|
paramsToFilter: ["characterName"],
|
|
44
49
|
paramType: "query",
|
|
45
|
-
relatedEntity: "
|
|
50
|
+
relatedEntity: "characters",
|
|
46
51
|
},
|
|
47
52
|
isRequired: true,
|
|
48
53
|
},
|
|
@@ -55,7 +60,7 @@ export const movieEpisodeForm: IForm = {
|
|
|
55
60
|
endpoint: "/movie-episodes",
|
|
56
61
|
actions: ["create", "get", "getById", "update", "softDelete"],
|
|
57
62
|
request: {
|
|
58
|
-
entity: "
|
|
63
|
+
entity: "movieEpisodes",
|
|
59
64
|
description: "Represents an episode of a TV series or show.",
|
|
60
65
|
fields: [
|
|
61
66
|
{
|
|
@@ -69,7 +74,7 @@ export const movieEpisodeForm: IForm = {
|
|
|
69
74
|
dataType: EDataType.UNIQUEIDENTIFIER,
|
|
70
75
|
isRequired: true,
|
|
71
76
|
foreignKey: {
|
|
72
|
-
entity: "
|
|
77
|
+
entity: "movies",
|
|
73
78
|
connectionAttribute: "_id",
|
|
74
79
|
relationship: "one-to-many",
|
|
75
80
|
},
|
|
@@ -82,7 +87,7 @@ export const movieEpisodeForm: IForm = {
|
|
|
82
87
|
},
|
|
83
88
|
{
|
|
84
89
|
name: "releaseDate",
|
|
85
|
-
dataType: EDataType.
|
|
90
|
+
dataType: EDataType.DATE,
|
|
86
91
|
isRequired: true,
|
|
87
92
|
},
|
|
88
93
|
{
|
|
@@ -90,7 +95,7 @@ export const movieEpisodeForm: IForm = {
|
|
|
90
95
|
dataType: EDataType.UNIQUEIDENTIFIER,
|
|
91
96
|
isRequired: false,
|
|
92
97
|
foreignKey: {
|
|
93
|
-
entity: "
|
|
98
|
+
entity: "characters",
|
|
94
99
|
connectionAttribute: "_id",
|
|
95
100
|
relationship: "many-to-many",
|
|
96
101
|
},
|
|
@@ -20,6 +20,11 @@ export const movieGenreForm: IForm = {
|
|
|
20
20
|
dataType: EDataType.WYSIWYG,
|
|
21
21
|
label: "Descrição",
|
|
22
22
|
name: "description",
|
|
23
|
+
storageConfig: {
|
|
24
|
+
fileNameStrategy: "uuid",
|
|
25
|
+
path: "movie-genres/description-images",
|
|
26
|
+
visibility: "public",
|
|
27
|
+
},
|
|
23
28
|
isRequired: true,
|
|
24
29
|
},
|
|
25
30
|
],
|
|
@@ -29,7 +34,7 @@ export const movieGenreForm: IForm = {
|
|
|
29
34
|
endpoint: "/movie-genres",
|
|
30
35
|
actions: ["create", "get", "getById", "update", "softDelete"],
|
|
31
36
|
request: {
|
|
32
|
-
entity: "
|
|
37
|
+
entity: "movieGenres",
|
|
33
38
|
description: "",
|
|
34
39
|
fields: [
|
|
35
40
|
{
|