@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.
Files changed (46) hide show
  1. package/dist/person/dto/account.dto.d.ts +28 -0
  2. package/dist/person/dto/account.dto.d.ts.map +1 -0
  3. package/dist/person/dto/account.dto.js +123 -0
  4. package/dist/person/dto/account.dto.js.map +1 -0
  5. package/dist/person/dto/activity.dto.d.ts +15 -0
  6. package/dist/person/dto/activity.dto.d.ts.map +1 -0
  7. package/dist/person/dto/activity.dto.js +65 -0
  8. package/dist/person/dto/activity.dto.js.map +1 -0
  9. package/dist/person/dto/dashboard-query.dto.d.ts +9 -0
  10. package/dist/person/dto/dashboard-query.dto.d.ts.map +1 -0
  11. package/dist/person/dto/dashboard-query.dto.js +40 -0
  12. package/dist/person/dto/dashboard-query.dto.js.map +1 -0
  13. package/dist/person/dto/followup-query.dto.d.ts +10 -0
  14. package/dist/person/dto/followup-query.dto.d.ts.map +1 -0
  15. package/dist/person/dto/followup-query.dto.js +45 -0
  16. package/dist/person/dto/followup-query.dto.js.map +1 -0
  17. package/dist/person/person.controller.d.ts +204 -0
  18. package/dist/person/person.controller.d.ts.map +1 -1
  19. package/dist/person/person.controller.js +138 -0
  20. package/dist/person/person.controller.js.map +1 -1
  21. package/dist/person/person.service.d.ts +234 -0
  22. package/dist/person/person.service.d.ts.map +1 -1
  23. package/dist/person/person.service.js +1367 -0
  24. package/dist/person/person.service.js.map +1 -1
  25. package/hedhog/data/menu.yaml +163 -163
  26. package/hedhog/data/route.yaml +41 -0
  27. package/hedhog/frontend/app/accounts/_components/account-form-sheet.tsx.ejs +210 -114
  28. package/hedhog/frontend/app/accounts/_components/account-types.ts.ejs +3 -0
  29. package/hedhog/frontend/app/accounts/page.tsx.ejs +323 -245
  30. package/hedhog/frontend/app/activities/_components/activity-detail-sheet.tsx.ejs +240 -0
  31. package/hedhog/frontend/app/activities/_components/activity-types.ts.ejs +66 -0
  32. package/hedhog/frontend/app/activities/page.tsx.ejs +165 -517
  33. package/hedhog/frontend/app/dashboard/_components/dashboard-types.ts.ejs +70 -0
  34. package/hedhog/frontend/app/dashboard/page.tsx.ejs +504 -356
  35. package/hedhog/frontend/app/follow-ups/page.tsx.ejs +242 -153
  36. package/hedhog/frontend/messages/en.json +91 -6
  37. package/hedhog/frontend/messages/pt.json +91 -6
  38. package/hedhog/table/crm_activity.yaml +68 -0
  39. package/hedhog/table/person_company.yaml +22 -0
  40. package/package.json +5 -5
  41. package/src/person/dto/account.dto.ts +100 -0
  42. package/src/person/dto/activity.dto.ts +54 -0
  43. package/src/person/dto/dashboard-query.dto.ts +25 -0
  44. package/src/person/dto/followup-query.dto.ts +25 -0
  45. package/src/person/person.controller.ts +116 -0
  46. 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
+ ];