@hed-hog/contact 0.0.295 → 0.0.296
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/dist/person/dto/reports-query.dto.d.ts +8 -0
- package/dist/person/dto/reports-query.dto.d.ts.map +1 -0
- package/dist/person/dto/reports-query.dto.js +33 -0
- package/dist/person/dto/reports-query.dto.js.map +1 -0
- package/dist/person/person.controller.d.ts +65 -8
- package/dist/person/person.controller.d.ts.map +1 -1
- package/dist/person/person.controller.js +26 -6
- package/dist/person/person.controller.js.map +1 -1
- package/dist/person/person.service.d.ts +61 -5
- package/dist/person/person.service.d.ts.map +1 -1
- package/dist/person/person.service.js +656 -298
- package/dist/person/person.service.js.map +1 -1
- package/dist/person-relation-type/person-relation-type.controller.d.ts +2 -2
- package/dist/person-relation-type/person-relation-type.service.d.ts +2 -2
- package/hedhog/data/menu.yaml +163 -163
- package/hedhog/data/route.yaml +68 -60
- package/hedhog/frontend/app/_lib/crm-sections.tsx.ejs +9 -9
- package/hedhog/frontend/app/accounts/_components/account-form-sheet.tsx.ejs +573 -573
- package/hedhog/frontend/app/accounts/_components/account-types.ts.ejs +9 -9
- package/hedhog/frontend/app/accounts/page.tsx.ejs +970 -970
- package/hedhog/frontend/app/activities/_components/activity-detail-sheet.tsx.ejs +240 -240
- package/hedhog/frontend/app/activities/_components/activity-types.ts.ejs +66 -66
- package/hedhog/frontend/app/activities/page.tsx.ejs +460 -460
- package/hedhog/frontend/app/dashboard/_components/dashboard-types.ts.ejs +70 -70
- package/hedhog/frontend/app/dashboard/page.tsx.ejs +639 -639
- package/hedhog/frontend/app/follow-ups/page.tsx.ejs +785 -785
- package/hedhog/frontend/app/person/_components/person-interaction-dialog.tsx.ejs +10 -12
- package/hedhog/frontend/app/reports/_components/report-types.ts.ejs +84 -0
- package/hedhog/frontend/app/reports/page.tsx.ejs +1196 -15
- package/hedhog/frontend/messages/en.json +242 -123
- package/hedhog/frontend/messages/pt.json +242 -123
- package/hedhog/table/crm_activity.yaml +68 -68
- package/hedhog/table/crm_stage_history.yaml +34 -0
- package/hedhog/table/person_company.yaml +27 -27
- package/package.json +9 -9
- package/src/person/dto/account.dto.ts +100 -100
- package/src/person/dto/activity.dto.ts +54 -54
- package/src/person/dto/dashboard-query.dto.ts +25 -25
- package/src/person/dto/followup-query.dto.ts +25 -25
- package/src/person/dto/reports-query.dto.ts +25 -0
- package/src/person/person.controller.ts +176 -159
- package/src/person/person.service.ts +4825 -4288
|
@@ -98,12 +98,11 @@ export function PersonInteractionDialog({
|
|
|
98
98
|
if (!person) return;
|
|
99
99
|
try {
|
|
100
100
|
setIsSubmitting(true);
|
|
101
|
-
await request({
|
|
102
|
-
url: `/person/${person.id}/interaction`,
|
|
103
|
-
method: 'POST',
|
|
104
|
-
data: values,
|
|
105
|
-
|
|
106
|
-
});
|
|
101
|
+
await request({
|
|
102
|
+
url: `/person/${person.id}/interaction`,
|
|
103
|
+
method: 'POST',
|
|
104
|
+
data: values,
|
|
105
|
+
});
|
|
107
106
|
toast.success(t('interactionSuccess'));
|
|
108
107
|
onOpenChange(false);
|
|
109
108
|
onSuccess();
|
|
@@ -118,12 +117,11 @@ export function PersonInteractionDialog({
|
|
|
118
117
|
if (!person) return;
|
|
119
118
|
try {
|
|
120
119
|
setIsSubmitting(true);
|
|
121
|
-
await request({
|
|
122
|
-
url: `/person/${person.id}/followup`,
|
|
123
|
-
method: 'POST',
|
|
124
|
-
data: values,
|
|
125
|
-
|
|
126
|
-
});
|
|
120
|
+
await request({
|
|
121
|
+
url: `/person/${person.id}/followup`,
|
|
122
|
+
method: 'POST',
|
|
123
|
+
data: values,
|
|
124
|
+
});
|
|
127
125
|
toast.success(t('followupSuccess'));
|
|
128
126
|
onOpenChange(false);
|
|
129
127
|
onSuccess();
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
PersonLifecycleStage,
|
|
5
|
+
PersonSource,
|
|
6
|
+
} from '../../person/_components/person-types';
|
|
7
|
+
|
|
8
|
+
export type ReportGroupBy = 'day' | 'week' | 'month' | 'year';
|
|
9
|
+
|
|
10
|
+
export type ReportSummary = {
|
|
11
|
+
new_leads: number;
|
|
12
|
+
qualified_moves: number;
|
|
13
|
+
customer_moves: number;
|
|
14
|
+
lost_moves: number;
|
|
15
|
+
interactions: number;
|
|
16
|
+
followups_completed: number;
|
|
17
|
+
conversion_rate: number;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type ReportTimelineItem = {
|
|
21
|
+
period: string;
|
|
22
|
+
label: string;
|
|
23
|
+
} & ReportSummary;
|
|
24
|
+
|
|
25
|
+
export type ReportBreakdownBucket<T extends string> = {
|
|
26
|
+
key: T;
|
|
27
|
+
total: number;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export type ReportOwnerPerformanceItem = {
|
|
31
|
+
owner_user_id: number;
|
|
32
|
+
owner_name: string;
|
|
33
|
+
interactions: number;
|
|
34
|
+
followups_completed: number;
|
|
35
|
+
customer_moves: number;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type ReportActivityType =
|
|
39
|
+
| 'call'
|
|
40
|
+
| 'email'
|
|
41
|
+
| 'meeting'
|
|
42
|
+
| 'whatsapp'
|
|
43
|
+
| 'task'
|
|
44
|
+
| 'note';
|
|
45
|
+
|
|
46
|
+
export type ReportResponse = {
|
|
47
|
+
summary: ReportSummary;
|
|
48
|
+
timeline: ReportTimelineItem[];
|
|
49
|
+
breakdowns: {
|
|
50
|
+
source: ReportBreakdownBucket<PersonSource>[];
|
|
51
|
+
current_stage: ReportBreakdownBucket<PersonLifecycleStage>[];
|
|
52
|
+
activity_type: ReportBreakdownBucket<ReportActivityType>[];
|
|
53
|
+
};
|
|
54
|
+
owners: ReportOwnerPerformanceItem[];
|
|
55
|
+
table: ReportTimelineItem[];
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const REPORT_STAGE_ORDER: PersonLifecycleStage[] = [
|
|
59
|
+
'new',
|
|
60
|
+
'contacted',
|
|
61
|
+
'qualified',
|
|
62
|
+
'proposal',
|
|
63
|
+
'negotiation',
|
|
64
|
+
'customer',
|
|
65
|
+
'lost',
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
export const REPORT_SOURCE_ORDER: PersonSource[] = [
|
|
69
|
+
'website',
|
|
70
|
+
'referral',
|
|
71
|
+
'social',
|
|
72
|
+
'inbound',
|
|
73
|
+
'outbound',
|
|
74
|
+
'other',
|
|
75
|
+
];
|
|
76
|
+
|
|
77
|
+
export const REPORT_ACTIVITY_ORDER: ReportActivityType[] = [
|
|
78
|
+
'call',
|
|
79
|
+
'email',
|
|
80
|
+
'meeting',
|
|
81
|
+
'whatsapp',
|
|
82
|
+
'task',
|
|
83
|
+
'note',
|
|
84
|
+
];
|