@hed-hog/contact 0.0.296 → 0.0.298

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.
@@ -98,11 +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
- });
101
+ await request({
102
+ url: `/person/${person.id}/interaction`,
103
+ method: 'POST',
104
+ data: values,
105
+ });
106
106
  toast.success(t('interactionSuccess'));
107
107
  onOpenChange(false);
108
108
  onSuccess();
@@ -117,11 +117,11 @@ export function PersonInteractionDialog({
117
117
  if (!person) return;
118
118
  try {
119
119
  setIsSubmitting(true);
120
- await request({
121
- url: `/person/${person.id}/followup`,
122
- method: 'POST',
123
- data: values,
124
- });
120
+ await request({
121
+ url: `/person/${person.id}/followup`,
122
+ method: 'POST',
123
+ data: values,
124
+ });
125
125
  toast.success(t('followupSuccess'));
126
126
  onOpenChange(false);
127
127
  onSuccess();
@@ -1,84 +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
- ];
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
+ ];