@hed-hog/contact 0.0.293 → 0.0.295
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/account.dto.d.ts +28 -0
- package/dist/person/dto/account.dto.d.ts.map +1 -0
- package/dist/person/dto/account.dto.js +123 -0
- package/dist/person/dto/account.dto.js.map +1 -0
- package/dist/person/dto/activity.dto.d.ts +15 -0
- package/dist/person/dto/activity.dto.d.ts.map +1 -0
- package/dist/person/dto/activity.dto.js +65 -0
- package/dist/person/dto/activity.dto.js.map +1 -0
- package/dist/person/dto/dashboard-query.dto.d.ts +9 -0
- package/dist/person/dto/dashboard-query.dto.d.ts.map +1 -0
- package/dist/person/dto/dashboard-query.dto.js +40 -0
- package/dist/person/dto/dashboard-query.dto.js.map +1 -0
- package/dist/person/dto/followup-query.dto.d.ts +10 -0
- package/dist/person/dto/followup-query.dto.d.ts.map +1 -0
- package/dist/person/dto/followup-query.dto.js +45 -0
- package/dist/person/dto/followup-query.dto.js.map +1 -0
- package/dist/person/person.controller.d.ts +204 -0
- package/dist/person/person.controller.d.ts.map +1 -1
- package/dist/person/person.controller.js +138 -0
- package/dist/person/person.controller.js.map +1 -1
- package/dist/person/person.service.d.ts +234 -0
- package/dist/person/person.service.d.ts.map +1 -1
- package/dist/person/person.service.js +1367 -0
- package/dist/person/person.service.js.map +1 -1
- package/hedhog/data/menu.yaml +163 -163
- package/hedhog/data/route.yaml +41 -0
- package/hedhog/frontend/app/accounts/_components/account-form-sheet.tsx.ejs +210 -114
- package/hedhog/frontend/app/accounts/_components/account-types.ts.ejs +3 -0
- package/hedhog/frontend/app/accounts/page.tsx.ejs +323 -245
- package/hedhog/frontend/app/activities/_components/activity-detail-sheet.tsx.ejs +240 -0
- package/hedhog/frontend/app/activities/_components/activity-types.ts.ejs +66 -0
- package/hedhog/frontend/app/activities/page.tsx.ejs +165 -517
- package/hedhog/frontend/app/dashboard/_components/dashboard-types.ts.ejs +70 -0
- package/hedhog/frontend/app/dashboard/page.tsx.ejs +504 -356
- package/hedhog/frontend/app/follow-ups/page.tsx.ejs +242 -153
- package/hedhog/frontend/messages/en.json +91 -6
- package/hedhog/frontend/messages/pt.json +91 -6
- package/hedhog/table/crm_activity.yaml +68 -0
- package/hedhog/table/person_company.yaml +22 -0
- package/package.json +5 -5
- package/src/person/dto/account.dto.ts +100 -0
- package/src/person/dto/activity.dto.ts +54 -0
- package/src/person/dto/dashboard-query.dto.ts +25 -0
- package/src/person/dto/followup-query.dto.ts +25 -0
- package/src/person/person.controller.ts +116 -0
- package/src/person/person.service.ts +2139 -77
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import type { PersonLifecycleStage, PersonSource, UserOption } from '../../person/_components/person-types';
|
|
4
|
+
|
|
5
|
+
export type DashboardPeriod = '7d' | '30d' | '90d' | 'custom';
|
|
6
|
+
|
|
7
|
+
export type DashboardBucket<T extends string> = {
|
|
8
|
+
key: T;
|
|
9
|
+
total: number;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type DashboardOwnerPerformanceItem = {
|
|
13
|
+
owner_user_id: number;
|
|
14
|
+
owner_name: string;
|
|
15
|
+
leads: number;
|
|
16
|
+
customers: number;
|
|
17
|
+
pipeline_value: number;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type DashboardListItem = {
|
|
21
|
+
id: number;
|
|
22
|
+
name: string;
|
|
23
|
+
trade_name?: string | null;
|
|
24
|
+
owner_user?: UserOption | null;
|
|
25
|
+
source: PersonSource;
|
|
26
|
+
lifecycle_stage: PersonLifecycleStage;
|
|
27
|
+
next_action_at?: string;
|
|
28
|
+
created_at?: string;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type DashboardResponse = {
|
|
32
|
+
kpis: {
|
|
33
|
+
total_leads: number;
|
|
34
|
+
qualified: number;
|
|
35
|
+
proposal: number;
|
|
36
|
+
customers: number;
|
|
37
|
+
lost: number;
|
|
38
|
+
unassigned: number;
|
|
39
|
+
overdue: number;
|
|
40
|
+
next_actions: number;
|
|
41
|
+
};
|
|
42
|
+
charts: {
|
|
43
|
+
stage: DashboardBucket<PersonLifecycleStage>[];
|
|
44
|
+
source: DashboardBucket<PersonSource>[];
|
|
45
|
+
owner_performance: DashboardOwnerPerformanceItem[];
|
|
46
|
+
};
|
|
47
|
+
lists: {
|
|
48
|
+
next_actions: DashboardListItem[];
|
|
49
|
+
unattended: DashboardListItem[];
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const CRM_DASHBOARD_STAGE_ORDER: PersonLifecycleStage[] = [
|
|
54
|
+
'new',
|
|
55
|
+
'contacted',
|
|
56
|
+
'qualified',
|
|
57
|
+
'proposal',
|
|
58
|
+
'negotiation',
|
|
59
|
+
'customer',
|
|
60
|
+
'lost',
|
|
61
|
+
];
|
|
62
|
+
|
|
63
|
+
export const CRM_DASHBOARD_SOURCE_ORDER: PersonSource[] = [
|
|
64
|
+
'website',
|
|
65
|
+
'referral',
|
|
66
|
+
'social',
|
|
67
|
+
'inbound',
|
|
68
|
+
'outbound',
|
|
69
|
+
'other',
|
|
70
|
+
];
|