@greatapps/greatagents 0.1.2 → 0.1.3
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/package.json +1 -1
- package/scripts/conversations/create_table.sql +3 -3
- package/src/modules/conversations/index.js +1 -1
- package/src/modules/conversations/properties.js +4 -4
- package/src/modules/credentials/properties.js +2 -1
- package/scripts/leads_channels/create_table.sql +0 -41
- package/src/modules/leads_channels/index.js +0 -10
- package/src/modules/leads_channels/properties.js +0 -104
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@ CREATE TABLE IF NOT EXISTS conversations (
|
|
|
18
18
|
id_account INTEGER NOT NULL,
|
|
19
19
|
id_agent INTEGER REFERENCES agents(id) ON DELETE SET NULL,
|
|
20
20
|
id_channel INTEGER REFERENCES channels(id) ON DELETE SET NULL,
|
|
21
|
-
|
|
21
|
+
id_lead INTEGER REFERENCES leads(id) ON DELETE SET NULL,
|
|
22
22
|
id_assignee INTEGER,
|
|
23
23
|
last_message_at TIMESTAMP,
|
|
24
24
|
id_last_message INTEGER REFERENCES messages(id) ON DELETE SET NULL,
|
|
@@ -31,7 +31,7 @@ CREATE INDEX IF NOT EXISTS idx_conversations_deleted ON conversations(deleted);
|
|
|
31
31
|
CREATE INDEX IF NOT EXISTS idx_conversations_id_account ON conversations(id_account);
|
|
32
32
|
CREATE INDEX IF NOT EXISTS idx_conversations_id_agent ON conversations(id_agent);
|
|
33
33
|
CREATE INDEX IF NOT EXISTS idx_conversations_id_channel ON conversations(id_channel);
|
|
34
|
-
CREATE INDEX IF NOT EXISTS
|
|
34
|
+
CREATE INDEX IF NOT EXISTS idx_conversations_id_lead ON conversations(id_lead);
|
|
35
35
|
CREATE INDEX IF NOT EXISTS idx_conversations_id_assignee ON conversations(id_assignee);
|
|
36
36
|
CREATE INDEX IF NOT EXISTS idx_conversations_status ON conversations(status);
|
|
37
37
|
CREATE INDEX IF NOT EXISTS idx_conversations_last_message_at ON conversations(last_message_at);
|
|
@@ -47,7 +47,7 @@ COMMENT ON COLUMN conversations.datetime_del IS 'Data e hora da exclusão lógic
|
|
|
47
47
|
COMMENT ON COLUMN conversations.id_account IS 'Referência para a conta proprietária da conversa';
|
|
48
48
|
COMMENT ON COLUMN conversations.id_agent IS 'Referência para o agente responsável pela conversa';
|
|
49
49
|
COMMENT ON COLUMN conversations.id_channel IS 'Referência para o canal onde a conversa está acontecendo';
|
|
50
|
-
COMMENT ON COLUMN conversations.
|
|
50
|
+
COMMENT ON COLUMN conversations.id_lead IS 'Identificador do lead na conversa';
|
|
51
51
|
COMMENT ON COLUMN conversations.id_assignee IS 'Identificador do usuário humano responsável pela conversa';
|
|
52
52
|
COMMENT ON COLUMN conversations.last_message_at IS 'Data e hora da última mensagem na conversa';
|
|
53
53
|
COMMENT ON COLUMN conversations.id_last_message IS 'Identificador da última mensagem na conversa';
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
product: "greatagents",
|
|
5
5
|
name: "conversations",
|
|
6
6
|
cache: { ttlView: 30, ttlList: 0 },
|
|
7
|
-
params: ["id_account", "id_agent", "id_channel"
|
|
7
|
+
params: ["id_account", "id_agent", "id_channel" ],
|
|
8
8
|
properties: properties,
|
|
9
9
|
routes: {}
|
|
10
10
|
};
|
|
@@ -81,20 +81,20 @@ export const properties = {
|
|
|
81
81
|
component: "number"
|
|
82
82
|
}
|
|
83
83
|
},
|
|
84
|
-
|
|
84
|
+
id_lead: {
|
|
85
85
|
type: "number",
|
|
86
86
|
filterable: true,
|
|
87
87
|
index: true,
|
|
88
88
|
reference: {
|
|
89
|
-
module: "
|
|
89
|
+
module: "leads",
|
|
90
90
|
label: "id",
|
|
91
91
|
value: "id",
|
|
92
92
|
disabled: true
|
|
93
93
|
},
|
|
94
94
|
interface: {
|
|
95
95
|
label: {
|
|
96
|
-
"pt-br": "ID do
|
|
97
|
-
"en": "Lead
|
|
96
|
+
"pt-br": "ID do lead",
|
|
97
|
+
"en": "Lead ID"
|
|
98
98
|
},
|
|
99
99
|
component: "select"
|
|
100
100
|
}
|
|
@@ -77,7 +77,8 @@ export const properties = {
|
|
|
77
77
|
{ value: "evolution-api", label: { "pt-br": "WhatsApp (Evolution API)", "en": "WhatsApp (Evolution API)" } },
|
|
78
78
|
{ value: "telegram", label: { "pt-br": "Telegram", "en": "Telegram" } },
|
|
79
79
|
{ value: "facebook", label: { "pt-br": "Facebook", "en": "Facebook" } },
|
|
80
|
-
{ value: "instagram", label: { "pt-br": "Instagram", "en": "Instagram" } }
|
|
80
|
+
{ value: "instagram", label: { "pt-br": "Instagram", "en": "Instagram" } },
|
|
81
|
+
{ value: "tool", label: { "pt-br": "Tool", "en": "Tool" } },
|
|
81
82
|
],
|
|
82
83
|
interface: {
|
|
83
84
|
component: "select",
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
-- =====================================================
|
|
2
|
-
-- Script de criação da tabela LEADS_CHANNELS
|
|
3
|
-
-- =====================================================
|
|
4
|
-
-- Descrição: Tabela que armazena os canais de comunicação dos leads
|
|
5
|
-
-- Dependências: accounts, leads
|
|
6
|
-
-- =====================================================
|
|
7
|
-
|
|
8
|
-
-- Cria a tabela leads_channels
|
|
9
|
-
CREATE TABLE IF NOT EXISTS leads_channels (
|
|
10
|
-
-- Propriedades automáticas (padrão para todas as tabelas)
|
|
11
|
-
id SERIAL PRIMARY KEY,
|
|
12
|
-
deleted BOOLEAN DEFAULT false NOT NULL,
|
|
13
|
-
datetime_add TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
14
|
-
datetime_alt TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
15
|
-
datetime_del TIMESTAMP NULL,
|
|
16
|
-
|
|
17
|
-
-- Propriedades específicas da tabela leads_channels
|
|
18
|
-
id_account INTEGER NOT NULL,
|
|
19
|
-
id_lead INTEGER REFERENCES leads(id) ON DELETE CASCADE,
|
|
20
|
-
channel VARCHAR(50) NOT NULL,
|
|
21
|
-
handle VARCHAR(255)
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
-- Cria índices para otimização de consultas
|
|
25
|
-
CREATE INDEX IF NOT EXISTS idx_leads_channels_deleted ON leads_channels(deleted);
|
|
26
|
-
CREATE INDEX IF NOT EXISTS idx_leads_channels_id_account ON leads_channels(id_account);
|
|
27
|
-
CREATE INDEX IF NOT EXISTS idx_leads_channels_id_lead ON leads_channels(id_lead);
|
|
28
|
-
CREATE INDEX IF NOT EXISTS idx_leads_channels_channel ON leads_channels(channel);
|
|
29
|
-
CREATE INDEX IF NOT EXISTS idx_leads_channels_handle ON leads_channels(handle);
|
|
30
|
-
|
|
31
|
-
-- Adiciona comentários para documentação
|
|
32
|
-
COMMENT ON TABLE leads_channels IS 'Tabela que armazena os canais de comunicação dos leads (WhatsApp, Telegram, etc.)';
|
|
33
|
-
COMMENT ON COLUMN leads_channels.id IS 'Identificador único do canal do lead (chave primária)';
|
|
34
|
-
COMMENT ON COLUMN leads_channels.deleted IS 'Flag indicando se o registro foi excluído logicamente';
|
|
35
|
-
COMMENT ON COLUMN leads_channels.datetime_add IS 'Data e hora de criação do registro';
|
|
36
|
-
COMMENT ON COLUMN leads_channels.datetime_alt IS 'Data e hora da última alteração do registro';
|
|
37
|
-
COMMENT ON COLUMN leads_channels.datetime_del IS 'Data e hora da exclusão lógica do registro';
|
|
38
|
-
COMMENT ON COLUMN leads_channels.id_account IS 'Referência para a conta proprietária do canal do lead';
|
|
39
|
-
COMMENT ON COLUMN leads_channels.id_lead IS 'Referência para o lead proprietário do canal';
|
|
40
|
-
COMMENT ON COLUMN leads_channels.channel IS 'Tipo de canal de comunicação (web-chat, whatsapp, telegram, facebook, instagram)';
|
|
41
|
-
COMMENT ON COLUMN leads_channels.handle IS 'Identificador único do canal (número do WhatsApp, ID do Telegram, @ do Instagram, etc.)';
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
export const properties = {
|
|
2
|
-
id: {
|
|
3
|
-
type: "number",
|
|
4
|
-
filterable: true,
|
|
5
|
-
unique: true,
|
|
6
|
-
autoIncrement: true,
|
|
7
|
-
index: true
|
|
8
|
-
},
|
|
9
|
-
deleted: {
|
|
10
|
-
type: "boolean",
|
|
11
|
-
default: false,
|
|
12
|
-
filterable: true
|
|
13
|
-
},
|
|
14
|
-
datetime_add: {
|
|
15
|
-
type: "date",
|
|
16
|
-
filterable: true,
|
|
17
|
-
updatable: false
|
|
18
|
-
},
|
|
19
|
-
datetime_alt: {
|
|
20
|
-
type: "date",
|
|
21
|
-
filterable: true,
|
|
22
|
-
updatable: true
|
|
23
|
-
},
|
|
24
|
-
datetime_del: {
|
|
25
|
-
type: "date",
|
|
26
|
-
filterable: true
|
|
27
|
-
},
|
|
28
|
-
id_account: {
|
|
29
|
-
type: "number",
|
|
30
|
-
required: true,
|
|
31
|
-
updatable: false,
|
|
32
|
-
filterable: true,
|
|
33
|
-
reference: {
|
|
34
|
-
module: "accounts",
|
|
35
|
-
label: "name",
|
|
36
|
-
value: "id",
|
|
37
|
-
disabled: true
|
|
38
|
-
},
|
|
39
|
-
interface: {
|
|
40
|
-
label: {
|
|
41
|
-
"pt-br": "Conta",
|
|
42
|
-
"en": "Account"
|
|
43
|
-
},
|
|
44
|
-
component: "select",
|
|
45
|
-
disabled: true
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
id_lead: {
|
|
49
|
-
type: "number",
|
|
50
|
-
filterable: true,
|
|
51
|
-
index: true,
|
|
52
|
-
reference: {
|
|
53
|
-
module: "leads",
|
|
54
|
-
label: "full_name",
|
|
55
|
-
value: "id",
|
|
56
|
-
disabled: true
|
|
57
|
-
},
|
|
58
|
-
interface: {
|
|
59
|
-
label: {
|
|
60
|
-
"pt-br": "Lead",
|
|
61
|
-
"en": "Lead"
|
|
62
|
-
},
|
|
63
|
-
component: "number"
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
channel: {
|
|
67
|
-
type: "string",
|
|
68
|
-
required: true,
|
|
69
|
-
filterable: true,
|
|
70
|
-
default: 0,
|
|
71
|
-
options: [
|
|
72
|
-
{ value: "web-chat", label: { "pt-br": "Web Chat", "en": "Web Chat" } },
|
|
73
|
-
{ value: "whatsap", label: { "pt-br": "WhatsApp", "en": "WhatsApp" } },
|
|
74
|
-
{ value: "telegram", label: { "pt-br": "Telegram", "en": "Telegram" } },
|
|
75
|
-
{ value: "facebook", label: { "pt-br": "Facebook", "en": "Facebook" } },
|
|
76
|
-
{ value: "instagram", label: { "pt-br": "Instagram", "en": "Instagram" } }
|
|
77
|
-
],
|
|
78
|
-
interface: {
|
|
79
|
-
component: "select",
|
|
80
|
-
label: {
|
|
81
|
-
"pt-br": "Provedor",
|
|
82
|
-
"en": "Provider"
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
handle: {
|
|
87
|
-
type: "string",
|
|
88
|
-
filterable: true,
|
|
89
|
-
validation: {
|
|
90
|
-
maxLength: 255
|
|
91
|
-
},
|
|
92
|
-
interface: {
|
|
93
|
-
label: {
|
|
94
|
-
"pt-br": "Identificador do canal",
|
|
95
|
-
"en": "Channel identifier"
|
|
96
|
-
},
|
|
97
|
-
component: "string",
|
|
98
|
-
placeholder: {
|
|
99
|
-
"pt-br": "Identificador único do canal (Ex: número do WhatsApp, ID do Telegram, @ do Instagram, etc.)",
|
|
100
|
-
"en": "Unique identifier of the channel (e.g., WhatsApp number, Telegram ID, Instagram @, etc.)"
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
};
|