@hed-hog/contact 0.0.275 → 0.0.276
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 +39 -39
- package/hedhog/data/menu.yaml +163 -43
- package/hedhog/data/setting_group.yaml +21 -21
- package/hedhog/frontend/app/_components/crm-coming-soon.tsx.ejs +110 -0
- package/hedhog/frontend/app/_components/crm-nav.tsx.ejs +73 -0
- package/hedhog/frontend/app/_lib/crm-mocks.ts.ejs +256 -0
- package/hedhog/frontend/app/_lib/crm-sections.tsx.ejs +81 -0
- package/hedhog/frontend/app/accounts/page.tsx.ejs +15 -0
- package/hedhog/frontend/app/activities/page.tsx.ejs +15 -0
- package/hedhog/frontend/app/contact-type/page.tsx.ejs +1 -1
- package/hedhog/frontend/app/dashboard/page.tsx.ejs +573 -0
- package/hedhog/frontend/app/document-type/page.tsx.ejs +1 -1
- package/hedhog/frontend/app/follow-ups/page.tsx.ejs +15 -0
- package/hedhog/frontend/app/page.tsx.ejs +5 -0
- package/hedhog/frontend/app/person/_components/delete-person-dialog.tsx.ejs +59 -59
- package/hedhog/frontend/app/person/_components/person-field-with-create.tsx.ejs +461 -461
- package/hedhog/frontend/app/person/_components/person-interaction-dialog.tsx.ejs +275 -0
- package/hedhog/frontend/app/person/page.tsx.ejs +5 -0
- package/hedhog/frontend/app/pipeline/page.tsx.ejs +299 -0
- package/hedhog/frontend/app/reports/page.tsx.ejs +15 -0
- package/hedhog/frontend/messages/en.json +223 -3
- package/hedhog/frontend/messages/pt.json +217 -3
- package/hedhog/table/person_address.yaml +18 -18
- package/hedhog/table/person_company.yaml +26 -26
- package/hedhog/table/person_individual.yaml +17 -17
- package/hedhog/table/person_individual_relation.yaml +39 -39
- package/package.json +4 -4
- package/src/address-type.enum.ts +8 -8
- package/src/contact.module.ts +45 -45
- package/src/contact.service.ts +28 -28
- package/src/index.ts +5 -5
- package/src/language/en.json +9 -9
- package/src/language/pt.json +9 -9
- package/src/person/dto/create.dto.ts +62 -62
- package/src/person/dto/update.dto.ts +147 -147
- package/src/person-relation-type/person-relation-type.service.ts +84 -84
- package/dist/address-type/address-type.controller.d.ts +0 -22
- package/dist/address-type/address-type.controller.d.ts.map +0 -1
- package/dist/address-type/address-type.controller.js +0 -94
- package/dist/address-type/address-type.controller.js.map +0 -1
- package/dist/address-type/address-type.enum.d.ts +0 -10
- package/dist/address-type/address-type.enum.d.ts.map +0 -1
- package/dist/address-type/address-type.enum.js +0 -14
- package/dist/address-type/address-type.enum.js.map +0 -1
- package/dist/address-type/address-type.module.d.ts +0 -3
- package/dist/address-type/address-type.module.d.ts.map +0 -1
- package/dist/address-type/address-type.module.js +0 -31
- package/dist/address-type/address-type.module.js.map +0 -1
- package/dist/address-type/address-type.service.d.ts +0 -30
- package/dist/address-type/address-type.service.d.ts.map +0 -1
- package/dist/address-type/address-type.service.js +0 -87
- package/dist/address-type/address-type.service.js.map +0 -1
- package/dist/address-type/dto/create.dto.d.ts +0 -7
- package/dist/address-type/dto/create.dto.d.ts.map +0 -1
- package/dist/address-type/dto/create.dto.js +0 -33
- package/dist/address-type/dto/create.dto.js.map +0 -1
- package/dist/address-type/dto/update.dto.d.ts +0 -9
- package/dist/address-type/dto/update.dto.d.ts.map +0 -1
- package/dist/address-type/dto/update.dto.js +0 -24
- package/dist/address-type/dto/update.dto.js.map +0 -1
- package/dist/person/address/address.controller.d.ts +0 -48
- package/dist/person/address/address.controller.d.ts.map +0 -1
- package/dist/person/address/address.controller.js +0 -90
- package/dist/person/address/address.controller.js.map +0 -1
- package/dist/person/address/address.service.d.ts +0 -50
- package/dist/person/address/address.service.d.ts.map +0 -1
- package/dist/person/address/address.service.js +0 -88
- package/dist/person/address/address.service.js.map +0 -1
- package/dist/person/address/dto/create.dto.d.ts +0 -11
- package/dist/person/address/dto/create.dto.d.ts.map +0 -1
- package/dist/person/address/dto/create.dto.js +0 -52
- package/dist/person/address/dto/create.dto.js.map +0 -1
- package/dist/person/address/dto/update.dto.d.ts +0 -6
- package/dist/person/address/dto/update.dto.d.ts.map +0 -1
- package/dist/person/address/dto/update.dto.js +0 -9
- package/dist/person/address/dto/update.dto.js.map +0 -1
- package/dist/person/contact/contact.controller.d.ts +0 -38
- package/dist/person/contact/contact.controller.d.ts.map +0 -1
- package/dist/person/contact/contact.controller.js +0 -90
- package/dist/person/contact/contact.controller.js.map +0 -1
- package/dist/person/contact/contact.service.d.ts +0 -40
- package/dist/person/contact/contact.service.d.ts.map +0 -1
- package/dist/person/contact/contact.service.js +0 -72
- package/dist/person/contact/contact.service.js.map +0 -1
- package/dist/person/contact/dto/create.dto.d.ts +0 -6
- package/dist/person/contact/dto/create.dto.d.ts.map +0 -1
- package/dist/person/contact/dto/create.dto.js +0 -31
- package/dist/person/contact/dto/create.dto.js.map +0 -1
- package/dist/person/contact/dto/update.dto.d.ts +0 -6
- package/dist/person/contact/dto/update.dto.d.ts.map +0 -1
- package/dist/person/contact/dto/update.dto.js +0 -9
- package/dist/person/contact/dto/update.dto.js.map +0 -1
- package/dist/person/document/document.controller.d.ts +0 -36
- package/dist/person/document/document.controller.d.ts.map +0 -1
- package/dist/person/document/document.controller.js +0 -90
- package/dist/person/document/document.controller.js.map +0 -1
- package/dist/person/document/document.service.d.ts +0 -38
- package/dist/person/document/document.service.d.ts.map +0 -1
- package/dist/person/document/document.service.js +0 -72
- package/dist/person/document/document.service.js.map +0 -1
- package/dist/person/document/dto/create.dto.d.ts +0 -5
- package/dist/person/document/dto/create.dto.d.ts.map +0 -1
- package/dist/person/document/dto/create.dto.js +0 -26
- package/dist/person/document/dto/create.dto.js.map +0 -1
- package/dist/person/document/dto/update.dto.d.ts +0 -6
- package/dist/person/document/dto/update.dto.d.ts.map +0 -1
- package/dist/person/document/dto/update.dto.js +0 -9
- package/dist/person/document/dto/update.dto.js.map +0 -1
- package/dist/person/person-company/dto/create.dto.d.ts +0 -5
- package/dist/person/person-company/dto/create.dto.d.ts.map +0 -1
- package/dist/person/person-company/dto/create.dto.js +0 -30
- package/dist/person/person-company/dto/create.dto.js.map +0 -1
- package/dist/person/person-company/dto/update.dto.d.ts +0 -6
- package/dist/person/person-company/dto/update.dto.d.ts.map +0 -1
- package/dist/person/person-company/dto/update.dto.js +0 -9
- package/dist/person/person-company/dto/update.dto.js.map +0 -1
- package/dist/person/person-company/person-company.controller.d.ts +0 -29
- package/dist/person/person-company/person-company.controller.d.ts.map +0 -1
- package/dist/person/person-company/person-company.controller.js +0 -65
- package/dist/person/person-company/person-company.controller.js.map +0 -1
- package/dist/person/person-company/person-company.service.d.ts +0 -29
- package/dist/person/person-company/person-company.service.d.ts.map +0 -1
- package/dist/person/person-company/person-company.service.js +0 -45
- package/dist/person/person-company/person-company.service.js.map +0 -1
- package/dist/person/person-individual/dto/create.dto.d.ts +0 -10
- package/dist/person/person-individual/dto/create.dto.d.ts.map +0 -1
- package/dist/person/person-individual/dto/create.dto.js +0 -36
- package/dist/person/person-individual/dto/create.dto.js.map +0 -1
- package/dist/person/person-individual/dto/update.dto.d.ts +0 -6
- package/dist/person/person-individual/dto/update.dto.d.ts.map +0 -1
- package/dist/person/person-individual/dto/update.dto.js +0 -9
- package/dist/person/person-individual/dto/update.dto.js.map +0 -1
- package/dist/person/person-individual/person-individual.controller.d.ts +0 -23
- package/dist/person/person-individual/person-individual.controller.d.ts.map +0 -1
- package/dist/person/person-individual/person-individual.controller.js +0 -65
- package/dist/person/person-individual/person-individual.controller.js.map +0 -1
- package/dist/person/person-individual/person-individual.service.d.ts +0 -23
- package/dist/person/person-individual/person-individual.service.d.ts.map +0 -1
- package/dist/person/person-individual/person-individual.service.js +0 -49
- package/dist/person/person-individual/person-individual.service.js.map +0 -1
- package/dist/person/person-metadata/dto/create.dto.d.ts +0 -5
- package/dist/person/person-metadata/dto/create.dto.d.ts.map +0 -1
- package/dist/person/person-metadata/dto/create.dto.js +0 -22
- package/dist/person/person-metadata/dto/create.dto.js.map +0 -1
- package/dist/person/person-metadata/dto/update.dto.d.ts +0 -6
- package/dist/person/person-metadata/dto/update.dto.d.ts.map +0 -1
- package/dist/person/person-metadata/dto/update.dto.js +0 -9
- package/dist/person/person-metadata/dto/update.dto.js.map +0 -1
- package/dist/person/person-metadata/person-metadata.controller.d.ts +0 -36
- package/dist/person/person-metadata/person-metadata.controller.d.ts.map +0 -1
- package/dist/person/person-metadata/person-metadata.controller.js +0 -90
- package/dist/person/person-metadata/person-metadata.controller.js.map +0 -1
- package/dist/person/person-metadata/person-metadata.service.d.ts +0 -38
- package/dist/person/person-metadata/person-metadata.service.d.ts.map +0 -1
- package/dist/person/person-metadata/person-metadata.service.js +0 -72
- package/dist/person/person-metadata/person-metadata.service.js.map +0 -1
- package/dist/person/person-relation/dto/create.dto.d.ts +0 -5
- package/dist/person/person-relation/dto/create.dto.d.ts.map +0 -1
- package/dist/person/person-relation/dto/create.dto.js +0 -26
- package/dist/person/person-relation/dto/create.dto.js.map +0 -1
- package/dist/person/person-relation/dto/update.dto.d.ts +0 -6
- package/dist/person/person-relation/dto/update.dto.d.ts.map +0 -1
- package/dist/person/person-relation/dto/update.dto.js +0 -9
- package/dist/person/person-relation/dto/update.dto.js.map +0 -1
- package/dist/person/person-relation/person-relation.controller.d.ts +0 -51
- package/dist/person/person-relation/person-relation.controller.d.ts.map +0 -1
- package/dist/person/person-relation/person-relation.controller.js +0 -90
- package/dist/person/person-relation/person-relation.controller.js.map +0 -1
- package/dist/person/person-relation/person-relation.service.d.ts +0 -53
- package/dist/person/person-relation/person-relation.service.d.ts.map +0 -1
- package/dist/person/person-relation/person-relation.service.js +0 -80
- package/dist/person/person-relation/person-relation.service.js.map +0 -1
package/README.md
CHANGED
|
@@ -3,30 +3,30 @@
|
|
|
3
3
|
|
|
4
4
|
## 1. Visão geral do módulo
|
|
5
5
|
|
|
6
|
-
O módulo `@hed-hog/contact`
|
|
6
|
+
O módulo `@hed-hog/contact` gerencia informações relacionadas a contatos, documentos, pessoas e seus tipos, além das relações entre pessoas. Ele oferece funcionalidades completas de CRUD para tipos de contato, tipos de documento, pessoas e suas relações, com suporte a internacionalização (locales), paginação e controle de acesso baseado em roles.
|
|
7
7
|
|
|
8
8
|
## 2. Escopo e responsabilidades
|
|
9
9
|
|
|
10
10
|
- Gerenciar tipos de contato (`contact_type`).
|
|
11
11
|
- Gerenciar tipos de documento (`document_type`).
|
|
12
|
-
- Gerenciar pessoas (`person`), incluindo
|
|
13
|
-
- Gerenciar tipos de relação entre pessoas (`person_relation_type`).
|
|
14
|
-
-
|
|
15
|
-
- Suportar autenticação e autorização baseada em roles
|
|
12
|
+
- Gerenciar pessoas (`person`), incluindo contatos, documentos, endereços e metadados.
|
|
13
|
+
- Gerenciar tipos de relação entre pessoas (`person_relation_type`), que são fixos e imutáveis via API.
|
|
14
|
+
- Validar regras específicas de negócio, como unicidade de contatos primários e restrições para registro de empresas.
|
|
15
|
+
- Suportar autenticação e autorização baseada em roles (`admin`, `admin-contact`).
|
|
16
16
|
- Suportar internacionalização para mensagens e dados localizados.
|
|
17
|
-
- Integrar com serviços de paginação, banco de dados Prisma
|
|
17
|
+
- Integrar com serviços de paginação, banco de dados Prisma e envio de emails.
|
|
18
18
|
|
|
19
19
|
## 3. Endpoints
|
|
20
20
|
|
|
21
21
|
### Person Contact Type (`/person-contact-type`)
|
|
22
22
|
|
|
23
|
-
| Método | Path
|
|
24
|
-
|
|
25
|
-
| GET | `/person-contact-type`
|
|
26
|
-
| GET | `/person-contact-type/:id`
|
|
27
|
-
| POST | `/person-contact-type`
|
|
28
|
-
| PATCH | `/person-contact-type/:id`
|
|
29
|
-
| DELETE | `/person-contact-type`
|
|
23
|
+
| Método | Path | Autenticação | Descrição |
|
|
24
|
+
|--------|------------------------|-------------------------------------|----------------------------------|
|
|
25
|
+
| GET | `/person-contact-type` | Autenticado (roles: admin, admin-contact) | Lista tipos de contato com paginação e locale. |
|
|
26
|
+
| GET | `/person-contact-type/:id` | Autenticado (roles: admin, admin-contact) | Obtém tipo de contato por ID com locale. |
|
|
27
|
+
| POST | `/person-contact-type` | Autenticado (roles: admin, admin-contact) | Cria um novo tipo de contato. |
|
|
28
|
+
| PATCH | `/person-contact-type/:id` | Autenticado (roles: admin, admin-contact) | Atualiza um tipo de contato existente. |
|
|
29
|
+
| DELETE | `/person-contact-type` | Autenticado (roles: admin, admin-contact) | Exclui tipos de contato por IDs. |
|
|
30
30
|
|
|
31
31
|
**Parâmetros e corpo:**
|
|
32
32
|
|
|
@@ -39,7 +39,7 @@ O módulo `@hed-hog/contact` é responsável pela gestão de informações relac
|
|
|
39
39
|
**Resposta:**
|
|
40
40
|
|
|
41
41
|
- Listagem paginada ou objeto do tipo criado/atualizado.
|
|
42
|
-
- Erros:
|
|
42
|
+
- Erros:
|
|
43
43
|
- 400 Bad Request: dados inválidos, `locale` vazio, IDs para exclusão não informados.
|
|
44
44
|
- 404 Not Found: tipo de contato não encontrado.
|
|
45
45
|
|
|
@@ -47,13 +47,13 @@ O módulo `@hed-hog/contact` é responsável pela gestão de informações relac
|
|
|
47
47
|
|
|
48
48
|
### Person Document Type (`/person-document-type`)
|
|
49
49
|
|
|
50
|
-
| Método | Path
|
|
51
|
-
|
|
52
|
-
| GET | `/person-document-type`
|
|
53
|
-
| GET | `/person-document-type/:id`
|
|
54
|
-
| POST | `/person-document-type`
|
|
55
|
-
| PATCH | `/person-document-type/:id`
|
|
56
|
-
| DELETE | `/person-document-type`
|
|
50
|
+
| Método | Path | Autenticação | Descrição |
|
|
51
|
+
|--------|------------------------|-------------------------------------|----------------------------------|
|
|
52
|
+
| GET | `/person-document-type` | Autenticado (roles: admin, admin-contact) | Lista tipos de documento com paginação e locale. |
|
|
53
|
+
| GET | `/person-document-type/:id` | Autenticado (roles: admin, admin-contact) | Obtém tipo de documento por ID com locale. |
|
|
54
|
+
| POST | `/person-document-type` | Autenticado (roles: admin, admin-contact) | Cria um novo tipo de documento. |
|
|
55
|
+
| PATCH | `/person-document-type/:id` | Autenticado (roles: admin, admin-contact) | Atualiza um tipo de documento existente. |
|
|
56
|
+
| DELETE | `/person-document-type` | Autenticado (roles: admin, admin-contact) | Exclui tipos de documento por IDs. |
|
|
57
57
|
|
|
58
58
|
**Parâmetros e corpo:**
|
|
59
59
|
|
|
@@ -68,7 +68,7 @@ O módulo `@hed-hog/contact` é responsável pela gestão de informações relac
|
|
|
68
68
|
**Resposta:**
|
|
69
69
|
|
|
70
70
|
- Listagem paginada ou objeto do tipo criado/atualizado.
|
|
71
|
-
- Erros:
|
|
71
|
+
- Erros:
|
|
72
72
|
- 400 Bad Request: dados inválidos, `locale` vazio, IDs para exclusão não informados.
|
|
73
73
|
- 404 Not Found: tipo de documento não encontrado.
|
|
74
74
|
|
|
@@ -76,16 +76,16 @@ O módulo `@hed-hog/contact` é responsável pela gestão de informações relac
|
|
|
76
76
|
|
|
77
77
|
### Person (`/person`)
|
|
78
78
|
|
|
79
|
-
| Método | Path
|
|
80
|
-
|
|
81
|
-
| GET | `/person`
|
|
82
|
-
| GET | `/person/stats`
|
|
83
|
-
| GET | `/person/owner-options
|
|
84
|
-
| GET | `/person/:id`
|
|
85
|
-
| GET | `/person/avatar/:id`
|
|
86
|
-
| POST | `/person`
|
|
87
|
-
| PATCH | `/person/:id`
|
|
88
|
-
| DELETE | `/person`
|
|
79
|
+
| Método | Path | Autenticação | Descrição |
|
|
80
|
+
|--------|------------------------|-------------------------------------|----------------------------------|
|
|
81
|
+
| GET | `/person` | Autenticado (roles: admin, admin-contact) | Lista pessoas com filtros e paginação. |
|
|
82
|
+
| GET | `/person/stats` | Autenticado (roles: admin, admin-contact) | Estatísticas de pessoas. |
|
|
83
|
+
| GET | `/person/owner-options`| Autenticado (roles: admin, admin-contact) | Lista usuários possíveis para atribuição como responsáveis. |
|
|
84
|
+
| GET | `/person/:id` | Autenticado (roles: admin, admin-contact) | Obtém pessoa por ID com detalhes. |
|
|
85
|
+
| GET | `/person/avatar/:id` | Pública | Abre avatar público pelo ID do arquivo. |
|
|
86
|
+
| POST | `/person` | Autenticado (roles: admin, admin-contact) | Cria uma nova pessoa. |
|
|
87
|
+
| PATCH | `/person/:id` | Autenticado (roles: admin, admin-contact) | Atualiza pessoa existente. |
|
|
88
|
+
| DELETE | `/person` | Autenticado (roles: admin, admin-contact) | Exclui pessoas por IDs. |
|
|
89
89
|
|
|
90
90
|
**Parâmetros e corpo:**
|
|
91
91
|
|
|
@@ -112,13 +112,13 @@ O módulo `@hed-hog/contact` é responsável pela gestão de informações relac
|
|
|
112
112
|
|
|
113
113
|
### Person Relation Type (`/person-relation-type`)
|
|
114
114
|
|
|
115
|
-
| Método | Path
|
|
116
|
-
|
|
117
|
-
| GET | `/person-relation-type`
|
|
118
|
-
| GET | `/person-relation-type/:id`
|
|
119
|
-
| POST | `/person-relation-type`
|
|
120
|
-
| PATCH | `/person-relation-type/:id`
|
|
121
|
-
| DELETE | `/person-relation-type`
|
|
115
|
+
| Método | Path | Autenticação | Descrição |
|
|
116
|
+
|--------|------------------------|-------------------------------------|----------------------------------|
|
|
117
|
+
| GET | `/person-relation-type` | Autenticado (roles: admin, admin-contact) | Lista tipos fixos de relação entre pessoas. |
|
|
118
|
+
| GET | `/person-relation-type/:id` | Autenticado (roles: admin, admin-contact) | Obtém tipo de relação por ID. |
|
|
119
|
+
| POST | `/person-relation-type` | Autenticado (roles: admin, admin-contact) | **Não suportado** (tipos fixos). |
|
|
120
|
+
| PATCH | `/person-relation-type/:id` | Autenticado (roles: admin, admin-contact) | **Não suportado** (tipos fixos). |
|
|
121
|
+
| DELETE | `/person-relation-type` | Autenticado (roles: admin, admin-contact) | **Não suportado** (tipos fixos). |
|
|
122
122
|
|
|
123
123
|
**Observação:** Tipos de relação são fixos e não podem ser criados, atualizados ou deletados via API. Tentativas resultam em erro 400.
|
|
124
124
|
|
package/hedhog/data/menu.yaml
CHANGED
|
@@ -1,43 +1,163 @@
|
|
|
1
|
-
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
relations:
|
|
8
|
-
role:
|
|
9
|
-
- where:
|
|
10
|
-
slug: admin
|
|
11
|
-
- where:
|
|
12
|
-
slug: admin-contact
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
icon:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
- where:
|
|
27
|
-
slug: admin
|
|
28
|
-
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
1
|
+
- icon: users
|
|
2
|
+
name:
|
|
3
|
+
en: CRM
|
|
4
|
+
pt: CRM
|
|
5
|
+
slug: /contact
|
|
6
|
+
order: 40
|
|
7
|
+
relations:
|
|
8
|
+
role:
|
|
9
|
+
- where:
|
|
10
|
+
slug: admin
|
|
11
|
+
- where:
|
|
12
|
+
slug: admin-contact
|
|
13
|
+
|
|
14
|
+
- menu_id:
|
|
15
|
+
where:
|
|
16
|
+
slug: /contact
|
|
17
|
+
icon: layout-dashboard
|
|
18
|
+
url: /contact/dashboard
|
|
19
|
+
name:
|
|
20
|
+
en: Dashboard
|
|
21
|
+
pt: Dashboard
|
|
22
|
+
slug: /contact/dashboard
|
|
23
|
+
order: 41
|
|
24
|
+
relations:
|
|
25
|
+
role:
|
|
26
|
+
- where:
|
|
27
|
+
slug: admin
|
|
28
|
+
- where:
|
|
29
|
+
slug: admin-contact
|
|
30
|
+
|
|
31
|
+
- menu_id:
|
|
32
|
+
where:
|
|
33
|
+
slug: /contact
|
|
34
|
+
icon: rows-3
|
|
35
|
+
url: /contact/pipeline
|
|
36
|
+
name:
|
|
37
|
+
en: Pipeline
|
|
38
|
+
pt: Pipeline
|
|
39
|
+
slug: /contact/pipeline
|
|
40
|
+
order: 42
|
|
41
|
+
relations:
|
|
42
|
+
role:
|
|
43
|
+
- where:
|
|
44
|
+
slug: admin
|
|
45
|
+
- where:
|
|
46
|
+
slug: admin-contact
|
|
47
|
+
|
|
48
|
+
- menu_id:
|
|
49
|
+
where:
|
|
50
|
+
slug: /contact
|
|
51
|
+
icon: users
|
|
52
|
+
url: /contact/person
|
|
53
|
+
name:
|
|
54
|
+
en: Leads and Contacts
|
|
55
|
+
pt: Leads e Contatos
|
|
56
|
+
slug: /contact/person
|
|
57
|
+
order: 43
|
|
58
|
+
relations:
|
|
59
|
+
role:
|
|
60
|
+
- where:
|
|
61
|
+
slug: admin
|
|
62
|
+
- where:
|
|
63
|
+
slug: admin-contact
|
|
64
|
+
|
|
65
|
+
- menu_id:
|
|
66
|
+
where:
|
|
67
|
+
slug: /contact
|
|
68
|
+
icon: activity
|
|
69
|
+
url: /contact/activities
|
|
70
|
+
name:
|
|
71
|
+
en: Activities
|
|
72
|
+
pt: Atividades
|
|
73
|
+
slug: /contact/activities
|
|
74
|
+
order: 44
|
|
75
|
+
relations:
|
|
76
|
+
role:
|
|
77
|
+
- where:
|
|
78
|
+
slug: admin
|
|
79
|
+
- where:
|
|
80
|
+
slug: admin-contact
|
|
81
|
+
|
|
82
|
+
- menu_id:
|
|
83
|
+
where:
|
|
84
|
+
slug: /contact
|
|
85
|
+
icon: calendar-clock
|
|
86
|
+
url: /contact/follow-ups
|
|
87
|
+
name:
|
|
88
|
+
en: Follow-ups
|
|
89
|
+
pt: Follow-ups
|
|
90
|
+
slug: /contact/follow-ups
|
|
91
|
+
order: 45
|
|
92
|
+
relations:
|
|
93
|
+
role:
|
|
94
|
+
- where:
|
|
95
|
+
slug: admin
|
|
96
|
+
- where:
|
|
97
|
+
slug: admin-contact
|
|
98
|
+
|
|
99
|
+
- menu_id:
|
|
100
|
+
where:
|
|
101
|
+
slug: /contact
|
|
102
|
+
icon: building-2
|
|
103
|
+
url: /contact/accounts
|
|
104
|
+
name:
|
|
105
|
+
en: Accounts
|
|
106
|
+
pt: Contas
|
|
107
|
+
slug: /contact/accounts
|
|
108
|
+
order: 46
|
|
109
|
+
relations:
|
|
110
|
+
role:
|
|
111
|
+
- where:
|
|
112
|
+
slug: admin
|
|
113
|
+
- where:
|
|
114
|
+
slug: admin-contact
|
|
115
|
+
|
|
116
|
+
- menu_id:
|
|
117
|
+
where:
|
|
118
|
+
slug: /contact
|
|
119
|
+
icon: bar-chart-3
|
|
120
|
+
url: /contact/reports
|
|
121
|
+
name:
|
|
122
|
+
en: Reports
|
|
123
|
+
pt: Relatórios
|
|
124
|
+
slug: /contact/reports
|
|
125
|
+
order: 47
|
|
126
|
+
relations:
|
|
127
|
+
role:
|
|
128
|
+
- where:
|
|
129
|
+
slug: admin
|
|
130
|
+
- where:
|
|
131
|
+
slug: admin-contact
|
|
132
|
+
|
|
133
|
+
- menu_id:
|
|
134
|
+
where:
|
|
135
|
+
slug: /core/management
|
|
136
|
+
url: /contact/contact-type
|
|
137
|
+
icon: phone
|
|
138
|
+
name:
|
|
139
|
+
en: Contact Type
|
|
140
|
+
pt: Tipos de Contato
|
|
141
|
+
slug: /contact/contact-type
|
|
142
|
+
relations:
|
|
143
|
+
role:
|
|
144
|
+
- where:
|
|
145
|
+
slug: admin
|
|
146
|
+
- where:
|
|
147
|
+
slug: admin-contact
|
|
148
|
+
|
|
149
|
+
- menu_id:
|
|
150
|
+
where:
|
|
151
|
+
slug: /core/management
|
|
152
|
+
url: /contact/document-type
|
|
153
|
+
icon: file-text
|
|
154
|
+
name:
|
|
155
|
+
en: Document Type
|
|
156
|
+
pt: Tipos de Documento
|
|
157
|
+
slug: /contact/document-type
|
|
158
|
+
relations:
|
|
159
|
+
role:
|
|
160
|
+
- where:
|
|
161
|
+
slug: admin
|
|
162
|
+
- where:
|
|
163
|
+
slug: admin-contact
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
- slug: person-registration
|
|
2
|
-
icon: users
|
|
3
|
-
name:
|
|
4
|
-
en: Person Registration
|
|
5
|
-
pt: Cadastro de Pessoas
|
|
6
|
-
description:
|
|
7
|
-
en: Configure which registration types are allowed in the system.
|
|
8
|
-
pt: Configure quais tipos de cadastro sao permitidos no sistema.
|
|
9
|
-
relations:
|
|
10
|
-
setting:
|
|
11
|
-
- slug: contact-allow-company-registration
|
|
12
|
-
type: boolean
|
|
13
|
-
component: switch
|
|
14
|
-
name:
|
|
15
|
-
en: Allow Company Registration
|
|
16
|
-
pt: Permitir Cadastro de Empresas
|
|
17
|
-
description:
|
|
18
|
-
en: Enable company records. Disable to allow only individual records.
|
|
19
|
-
pt: Habilita cadastros de empresas. Desative para permitir apenas pessoas fisicas.
|
|
20
|
-
value: true
|
|
21
|
-
user_override: false
|
|
1
|
+
- slug: person-registration
|
|
2
|
+
icon: users
|
|
3
|
+
name:
|
|
4
|
+
en: Person Registration
|
|
5
|
+
pt: Cadastro de Pessoas
|
|
6
|
+
description:
|
|
7
|
+
en: Configure which registration types are allowed in the system.
|
|
8
|
+
pt: Configure quais tipos de cadastro sao permitidos no sistema.
|
|
9
|
+
relations:
|
|
10
|
+
setting:
|
|
11
|
+
- slug: contact-allow-company-registration
|
|
12
|
+
type: boolean
|
|
13
|
+
component: switch
|
|
14
|
+
name:
|
|
15
|
+
en: Allow Company Registration
|
|
16
|
+
pt: Permitir Cadastro de Empresas
|
|
17
|
+
description:
|
|
18
|
+
en: Enable company records. Disable to allow only individual records.
|
|
19
|
+
pt: Habilita cadastros de empresas. Desative para permitir apenas pessoas fisicas.
|
|
20
|
+
value: true
|
|
21
|
+
user_override: false
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { CrmNav } from './crm-nav';
|
|
4
|
+
import { Page, PageHeader } from '@/components/entity-list';
|
|
5
|
+
import { Badge } from '@/components/ui/badge';
|
|
6
|
+
import { Button } from '@/components/ui/button';
|
|
7
|
+
import {
|
|
8
|
+
Card,
|
|
9
|
+
CardContent,
|
|
10
|
+
CardDescription,
|
|
11
|
+
CardHeader,
|
|
12
|
+
CardTitle,
|
|
13
|
+
} from '@/components/ui/card';
|
|
14
|
+
import type { LucideIcon } from 'lucide-react';
|
|
15
|
+
import { ArrowRight, Sparkles } from 'lucide-react';
|
|
16
|
+
import Link from 'next/link';
|
|
17
|
+
import { useTranslations } from 'next-intl';
|
|
18
|
+
|
|
19
|
+
type CrmComingSoonProps = {
|
|
20
|
+
currentHref: string;
|
|
21
|
+
titleKey: string;
|
|
22
|
+
descriptionKey: string;
|
|
23
|
+
icon: LucideIcon;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export function CrmComingSoon({
|
|
27
|
+
currentHref,
|
|
28
|
+
titleKey,
|
|
29
|
+
descriptionKey,
|
|
30
|
+
icon: Icon,
|
|
31
|
+
}: CrmComingSoonProps) {
|
|
32
|
+
const t = useTranslations('contact.CrmMenu');
|
|
33
|
+
const common = useTranslations('contact.CrmFuturePage');
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<Page>
|
|
37
|
+
<PageHeader
|
|
38
|
+
breadcrumbs={[
|
|
39
|
+
{ label: common('breadcrumbs.home'), href: '/' },
|
|
40
|
+
{ label: common('breadcrumbs.crm'), href: '/contact/dashboard' },
|
|
41
|
+
{ label: t(`sections.${titleKey}.title`) },
|
|
42
|
+
]}
|
|
43
|
+
title={t(`sections.${titleKey}.title`)}
|
|
44
|
+
description={t(`sections.${descriptionKey}.description`)}
|
|
45
|
+
/>
|
|
46
|
+
|
|
47
|
+
<div className="min-w-0 space-y-6 overflow-x-hidden">
|
|
48
|
+
<CrmNav currentHref={currentHref} />
|
|
49
|
+
|
|
50
|
+
<Card className="overflow-hidden border-orange-200/70 bg-gradient-to-br from-orange-50 via-background to-amber-50 py-0">
|
|
51
|
+
<CardContent className="grid gap-6 px-6 py-8 lg:grid-cols-[minmax(0,1.2fr)_minmax(260px,0.8fr)]">
|
|
52
|
+
<div className="min-w-0 space-y-4">
|
|
53
|
+
<Badge className="w-fit rounded-full bg-orange-500/10 px-3 py-1 text-orange-700 hover:bg-orange-500/10">
|
|
54
|
+
<Sparkles className="mr-2 size-3.5" />
|
|
55
|
+
{common('badge')}
|
|
56
|
+
</Badge>
|
|
57
|
+
<div className="space-y-3">
|
|
58
|
+
<div className="flex items-center gap-3">
|
|
59
|
+
<div className="rounded-2xl bg-orange-500/10 p-3 text-orange-700">
|
|
60
|
+
<Icon className="size-5" />
|
|
61
|
+
</div>
|
|
62
|
+
<h2 className="text-3xl font-semibold tracking-tight">
|
|
63
|
+
{t(`sections.${titleKey}.title`)}
|
|
64
|
+
</h2>
|
|
65
|
+
</div>
|
|
66
|
+
<p className="max-w-2xl text-sm leading-6 text-muted-foreground">
|
|
67
|
+
{common('description')}
|
|
68
|
+
</p>
|
|
69
|
+
</div>
|
|
70
|
+
<div className="flex flex-wrap gap-3">
|
|
71
|
+
<Button asChild>
|
|
72
|
+
<Link href="/contact/dashboard">
|
|
73
|
+
{common('backToDashboard')}
|
|
74
|
+
</Link>
|
|
75
|
+
</Button>
|
|
76
|
+
<Button asChild variant="outline">
|
|
77
|
+
<Link href="/contact/pipeline">{common('seePipeline')}</Link>
|
|
78
|
+
</Button>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
<Card className="border-white/70 bg-white/80 shadow-sm">
|
|
83
|
+
<CardHeader>
|
|
84
|
+
<CardTitle>{common('nextStepTitle')}</CardTitle>
|
|
85
|
+
<CardDescription>
|
|
86
|
+
{common('nextStepDescription')}
|
|
87
|
+
</CardDescription>
|
|
88
|
+
</CardHeader>
|
|
89
|
+
<CardContent className="space-y-3">
|
|
90
|
+
{['stepOne', 'stepTwo', 'stepThree'].map((step) => (
|
|
91
|
+
<div
|
|
92
|
+
key={step}
|
|
93
|
+
className="flex items-start gap-3 rounded-2xl border border-border/70 bg-background px-4 py-3"
|
|
94
|
+
>
|
|
95
|
+
<div className="mt-0.5 rounded-full bg-orange-500/10 p-1.5 text-orange-700">
|
|
96
|
+
<ArrowRight className="size-3.5" />
|
|
97
|
+
</div>
|
|
98
|
+
<p className="text-sm text-muted-foreground">
|
|
99
|
+
{common(step)}
|
|
100
|
+
</p>
|
|
101
|
+
</div>
|
|
102
|
+
))}
|
|
103
|
+
</CardContent>
|
|
104
|
+
</Card>
|
|
105
|
+
</CardContent>
|
|
106
|
+
</Card>
|
|
107
|
+
</div>
|
|
108
|
+
</Page>
|
|
109
|
+
);
|
|
110
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Badge } from '@/components/ui/badge';
|
|
4
|
+
import { cn } from '@/lib/utils';
|
|
5
|
+
import Link from 'next/link';
|
|
6
|
+
import { useTranslations } from 'next-intl';
|
|
7
|
+
import { crmSections } from '../_lib/crm-sections';
|
|
8
|
+
|
|
9
|
+
type CrmNavProps = {
|
|
10
|
+
currentHref: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export function CrmNav({ currentHref }: CrmNavProps) {
|
|
14
|
+
const t = useTranslations('contact.CrmMenu');
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<div className="min-w-0">
|
|
18
|
+
<div className="flex gap-2 overflow-x-auto pb-2 md:pb-1 lg:grid lg:grid-cols-2 lg:overflow-visible xl:grid-cols-3 2xl:grid-cols-4">
|
|
19
|
+
{crmSections.map((section) => {
|
|
20
|
+
const active = currentHref === section.href;
|
|
21
|
+
const Icon = section.icon;
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<Link
|
|
25
|
+
key={section.href}
|
|
26
|
+
href={section.href}
|
|
27
|
+
className={cn(
|
|
28
|
+
'group flex w-[280px] max-w-[85vw] shrink-0 snap-start items-start gap-3 rounded-2xl border px-4 py-3 transition-all lg:min-w-0 lg:max-w-none lg:w-full',
|
|
29
|
+
active
|
|
30
|
+
? 'border-orange-300 bg-orange-50 text-orange-950 shadow-sm'
|
|
31
|
+
: 'border-border/70 bg-card hover:-translate-y-0.5 hover:border-orange-200 hover:bg-orange-50/40'
|
|
32
|
+
)}
|
|
33
|
+
>
|
|
34
|
+
<div
|
|
35
|
+
className={cn(
|
|
36
|
+
'mt-0.5 rounded-xl p-2 transition-colors',
|
|
37
|
+
active
|
|
38
|
+
? 'bg-orange-500 text-white'
|
|
39
|
+
: 'bg-muted text-muted-foreground group-hover:bg-orange-100 group-hover:text-orange-700'
|
|
40
|
+
)}
|
|
41
|
+
>
|
|
42
|
+
<Icon className="size-4" />
|
|
43
|
+
</div>
|
|
44
|
+
<div className="min-w-0 space-y-1">
|
|
45
|
+
<div className="flex min-w-0 items-center gap-2">
|
|
46
|
+
<span className="truncate text-sm font-semibold">
|
|
47
|
+
{t(`sections.${section.translationKey}.title`)}
|
|
48
|
+
</span>
|
|
49
|
+
{active ? (
|
|
50
|
+
<Badge className="rounded-full bg-orange-500 px-2 py-0 text-[10px] text-white hover:bg-orange-500">
|
|
51
|
+
{t('current')}
|
|
52
|
+
</Badge>
|
|
53
|
+
) : null}
|
|
54
|
+
{!section.implemented ? (
|
|
55
|
+
<Badge
|
|
56
|
+
variant="outline"
|
|
57
|
+
className="rounded-full px-2 py-0 text-[10px]"
|
|
58
|
+
>
|
|
59
|
+
{t('planned')}
|
|
60
|
+
</Badge>
|
|
61
|
+
) : null}
|
|
62
|
+
</div>
|
|
63
|
+
<p className="line-clamp-2 text-xs text-muted-foreground">
|
|
64
|
+
{t(`sections.${section.translationKey}.description`)}
|
|
65
|
+
</p>
|
|
66
|
+
</div>
|
|
67
|
+
</Link>
|
|
68
|
+
);
|
|
69
|
+
})}
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
);
|
|
73
|
+
}
|