@elevasis/core 0.14.0 → 0.15.1
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/index.d.ts +60 -0
- package/dist/index.js +198 -1
- package/dist/organization-model/index.d.ts +60 -0
- package/dist/organization-model/index.js +198 -1
- package/dist/test-utils/index.d.ts +399 -363
- package/dist/test-utils/index.js +198 -1
- package/package.json +3 -3
- package/src/_gen/__tests__/__snapshots__/contracts.md.snap +444 -309
- package/src/business/acquisition/activity-events.ts +12 -3
- package/src/business/acquisition/api-schemas.test.ts +315 -4
- package/src/business/acquisition/api-schemas.ts +140 -17
- package/src/business/acquisition/build-templates.ts +44 -0
- package/src/business/acquisition/crm-next-action.test.ts +262 -0
- package/src/business/acquisition/crm-next-action.ts +220 -0
- package/src/business/acquisition/crm-priority.test.ts +216 -0
- package/src/business/acquisition/crm-priority.ts +349 -0
- package/src/business/acquisition/crm-state-actions.test.ts +12 -21
- package/src/business/acquisition/deal-ownership.test.ts +351 -0
- package/src/business/acquisition/deal-ownership.ts +120 -0
- package/src/business/acquisition/derive-actions.test.ts +101 -37
- package/src/business/acquisition/derive-actions.ts +49 -24
- package/src/business/acquisition/index.ts +163 -149
- package/src/business/acquisition/types.ts +48 -4
- package/src/execution/engine/index.ts +4 -3
- package/src/execution/engine/tools/lead-service-types.ts +68 -51
- package/src/execution/engine/tools/platform/acquisition/list-tools.ts +6 -5
- package/src/execution/engine/tools/platform/acquisition/types.ts +3 -1
- package/src/execution/engine/tools/registry.ts +4 -3
- package/src/execution/engine/tools/tool-maps.ts +821 -816
- package/src/organization-model/domains/prospecting.ts +204 -1
- package/src/organization-model/domains/sales.test.ts +218 -0
- package/src/organization-model/domains/sales.ts +558 -366
- package/src/organization-model/types.ts +2 -2
- package/src/platform/constants/versions.ts +1 -1
- package/src/reference/_generated/contracts.md +444 -309
- package/src/supabase/database.types.ts +2978 -2958
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod'
|
|
2
|
-
import
|
|
2
|
+
import {
|
|
3
|
+
CRM_DISCOVERY_BOOKING_CANCELLED_STATE,
|
|
4
|
+
CRM_DISCOVERY_LINK_SENT_STATE,
|
|
5
|
+
CRM_DISCOVERY_NUDGING_STATE,
|
|
6
|
+
CRM_DISCOVERY_REPLIED_STATE
|
|
7
|
+
} from '@repo/core/organization-model'
|
|
8
|
+
import { getDealOwnership, type DealOwnership } from './deal-ownership'
|
|
9
|
+
import type { AcqDealRow } from './types'
|
|
3
10
|
|
|
4
11
|
export interface Action {
|
|
5
12
|
key: string
|
|
@@ -7,13 +14,18 @@ export interface Action {
|
|
|
7
14
|
payloadSchema?: z.ZodTypeAny
|
|
8
15
|
}
|
|
9
16
|
|
|
10
|
-
export interface ActionDef {
|
|
11
|
-
key: string
|
|
12
|
-
label: string
|
|
13
|
-
isAvailableFor: (deal: AcqDealRow) => boolean
|
|
14
|
-
workflowId: string
|
|
15
|
-
payloadSchema?: z.ZodTypeAny
|
|
16
|
-
}
|
|
17
|
+
export interface ActionDef {
|
|
18
|
+
key: string
|
|
19
|
+
label: string
|
|
20
|
+
isAvailableFor: (deal: AcqDealRow) => boolean
|
|
21
|
+
workflowId: string
|
|
22
|
+
payloadSchema?: z.ZodTypeAny
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
type DealActionInput = AcqDealRow & {
|
|
26
|
+
ownership?: DealOwnership
|
|
27
|
+
nextAction?: string | null
|
|
28
|
+
}
|
|
17
29
|
|
|
18
30
|
export const SendReplyActionPayloadSchema = z
|
|
19
31
|
.object({
|
|
@@ -55,20 +67,22 @@ export const DEFAULT_CRM_ACTIONS: ActionDef[] = [
|
|
|
55
67
|
workflowId: 'move_to_nurturing-workflow'
|
|
56
68
|
},
|
|
57
69
|
{
|
|
58
|
-
key: 'send_reply',
|
|
59
|
-
label: 'Send Reply',
|
|
60
|
-
isAvailableFor: (deal) =>
|
|
61
|
-
deal.stage_key === 'interested' &&
|
|
62
|
-
(deal
|
|
63
|
-
|
|
64
|
-
deal.state_key ===
|
|
70
|
+
key: 'send_reply',
|
|
71
|
+
label: 'Send Reply',
|
|
72
|
+
isAvailableFor: (deal) =>
|
|
73
|
+
deal.stage_key === 'interested' &&
|
|
74
|
+
isOurReplyAction(deal) &&
|
|
75
|
+
(deal.state_key === CRM_DISCOVERY_REPLIED_STATE.stateKey ||
|
|
76
|
+
deal.state_key === CRM_DISCOVERY_LINK_SENT_STATE.stateKey ||
|
|
77
|
+
deal.state_key === CRM_DISCOVERY_NUDGING_STATE.stateKey),
|
|
65
78
|
workflowId: 'crm-send-reply-workflow',
|
|
66
79
|
payloadSchema: SendReplyActionPayloadSchema
|
|
67
80
|
},
|
|
68
81
|
{
|
|
69
82
|
key: 'send_link',
|
|
70
83
|
label: 'Send Booking Link',
|
|
71
|
-
isAvailableFor: (deal) =>
|
|
84
|
+
isAvailableFor: (deal) =>
|
|
85
|
+
deal.stage_key === 'interested' && deal.state_key === CRM_DISCOVERY_REPLIED_STATE.stateKey,
|
|
72
86
|
workflowId: 'crm-send-booking-link-workflow'
|
|
73
87
|
},
|
|
74
88
|
{
|
|
@@ -76,13 +90,15 @@ export const DEFAULT_CRM_ACTIONS: ActionDef[] = [
|
|
|
76
90
|
label: 'Send Nudge',
|
|
77
91
|
isAvailableFor: (deal) =>
|
|
78
92
|
deal.stage_key === 'interested' &&
|
|
79
|
-
(deal.state_key ===
|
|
93
|
+
(deal.state_key === CRM_DISCOVERY_LINK_SENT_STATE.stateKey ||
|
|
94
|
+
deal.state_key === CRM_DISCOVERY_NUDGING_STATE.stateKey),
|
|
80
95
|
workflowId: 'crm-send-nudge-workflow'
|
|
81
96
|
},
|
|
82
97
|
{
|
|
83
98
|
key: 'mark_no_show',
|
|
84
99
|
label: 'Mark No-Show',
|
|
85
|
-
isAvailableFor: (deal) =>
|
|
100
|
+
isAvailableFor: (deal) =>
|
|
101
|
+
deal.stage_key === 'interested' && deal.state_key === CRM_DISCOVERY_NUDGING_STATE.stateKey,
|
|
86
102
|
// Mirrors the auto-timeout precedent in operations/sales/crm/pipeline/timeout-actions.ts:
|
|
87
103
|
// both manual-click and timeout move the deal to closed_lost. The action_taken activity
|
|
88
104
|
// event captures operator intent and distinguishes the manual variant from the timed one.
|
|
@@ -91,13 +107,22 @@ export const DEFAULT_CRM_ACTIONS: ActionDef[] = [
|
|
|
91
107
|
{
|
|
92
108
|
key: 'rebook',
|
|
93
109
|
label: 'Rebook',
|
|
94
|
-
isAvailableFor: (deal) =>
|
|
110
|
+
isAvailableFor: (deal) =>
|
|
111
|
+
deal.stage_key === 'interested' && deal.state_key === CRM_DISCOVERY_BOOKING_CANCELLED_STATE.stateKey,
|
|
95
112
|
workflowId: 'crm-rebook-workflow'
|
|
96
113
|
}
|
|
97
114
|
]
|
|
98
115
|
|
|
99
|
-
export function deriveActions(deal:
|
|
100
|
-
return actions
|
|
101
|
-
.filter((a) => a.isAvailableFor(deal))
|
|
102
|
-
.map(({ key, label, payloadSchema }) => ({ key, label, payloadSchema }))
|
|
103
|
-
}
|
|
116
|
+
export function deriveActions(deal: DealActionInput, actions: ActionDef[] = DEFAULT_CRM_ACTIONS): Action[] {
|
|
117
|
+
return actions
|
|
118
|
+
.filter((a) => a.isAvailableFor(deal))
|
|
119
|
+
.map(({ key, label, payloadSchema }) => ({ key, label, payloadSchema }))
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function isOurReplyAction(deal: DealActionInput): boolean {
|
|
123
|
+
if (Object.prototype.hasOwnProperty.call(deal, 'nextAction')) {
|
|
124
|
+
return deal.nextAction === 'send_reply'
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return (deal.ownership ?? getDealOwnership(deal)) === 'us'
|
|
128
|
+
}
|
|
@@ -1,149 +1,163 @@
|
|
|
1
|
-
export * from './types'
|
|
2
|
-
export * from './activity-events'
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
type
|
|
95
|
-
type
|
|
96
|
-
type
|
|
97
|
-
type
|
|
98
|
-
type
|
|
99
|
-
type
|
|
100
|
-
type
|
|
101
|
-
type
|
|
102
|
-
type
|
|
103
|
-
type
|
|
104
|
-
type
|
|
105
|
-
type
|
|
106
|
-
type
|
|
107
|
-
type
|
|
108
|
-
type
|
|
109
|
-
type
|
|
110
|
-
type
|
|
111
|
-
type
|
|
112
|
-
type
|
|
113
|
-
type
|
|
114
|
-
type
|
|
115
|
-
type
|
|
116
|
-
type
|
|
117
|
-
type
|
|
118
|
-
type
|
|
119
|
-
type
|
|
120
|
-
type
|
|
121
|
-
type
|
|
122
|
-
type
|
|
123
|
-
type
|
|
124
|
-
type
|
|
125
|
-
type
|
|
126
|
-
type
|
|
127
|
-
type
|
|
128
|
-
type
|
|
129
|
-
type
|
|
130
|
-
type
|
|
131
|
-
type
|
|
132
|
-
type
|
|
133
|
-
type
|
|
134
|
-
type
|
|
135
|
-
type
|
|
136
|
-
type
|
|
137
|
-
type
|
|
138
|
-
type
|
|
139
|
-
type
|
|
140
|
-
type
|
|
141
|
-
type
|
|
142
|
-
type
|
|
143
|
-
type
|
|
144
|
-
type
|
|
145
|
-
type
|
|
146
|
-
type
|
|
147
|
-
type
|
|
148
|
-
type
|
|
149
|
-
|
|
1
|
+
export * from './types'
|
|
2
|
+
export * from './activity-events'
|
|
3
|
+
export * from './build-templates'
|
|
4
|
+
export * from './derive-actions'
|
|
5
|
+
export * from './crm-priority'
|
|
6
|
+
export * from './crm-next-action'
|
|
7
|
+
export * from './deal-ownership'
|
|
8
|
+
export * from './stateful'
|
|
9
|
+
// Export api-schemas selectively to avoid re-exporting names already defined in types.ts
|
|
10
|
+
// (DealStage, AcqDealTaskKind are declared as union types there; api-schemas re-infers them from Zod)
|
|
11
|
+
export {
|
|
12
|
+
AcqCompanyStatusSchema,
|
|
13
|
+
AcqContactStatusSchema,
|
|
14
|
+
AcqEmailValidSchema,
|
|
15
|
+
CompanyIdParamsSchema,
|
|
16
|
+
ContactIdParamsSchema,
|
|
17
|
+
ListCompaniesQuerySchema,
|
|
18
|
+
ListContactsQuerySchema,
|
|
19
|
+
CreateCompanyRequestSchema,
|
|
20
|
+
UpdateCompanyRequestSchema,
|
|
21
|
+
CreateContactRequestSchema,
|
|
22
|
+
UpdateContactRequestSchema,
|
|
23
|
+
AcqCompanyResponseSchema,
|
|
24
|
+
AcqCompanyListResponseSchema,
|
|
25
|
+
AcqContactResponseSchema,
|
|
26
|
+
AcqContactListResponseSchema,
|
|
27
|
+
AcqCompanySchemas,
|
|
28
|
+
AcqContactSchemas,
|
|
29
|
+
DealStageSchema,
|
|
30
|
+
AcqDealTaskKindSchema,
|
|
31
|
+
DealIdParamsSchema,
|
|
32
|
+
DealTaskIdParamsSchema,
|
|
33
|
+
ListDealsQuerySchema,
|
|
34
|
+
ListDealTasksDueQuerySchema,
|
|
35
|
+
CreateDealNoteRequestSchema,
|
|
36
|
+
CreateDealTaskRequestSchema,
|
|
37
|
+
TransitionItemRequestSchema,
|
|
38
|
+
TransitionDealStateRequestSchema,
|
|
39
|
+
ExecuteActionParamsSchema,
|
|
40
|
+
ExecuteActionRequestSchema,
|
|
41
|
+
DealContactSummarySchema,
|
|
42
|
+
DealPrioritySchema,
|
|
43
|
+
DealListItemSchema,
|
|
44
|
+
DealListResponseSchema,
|
|
45
|
+
DealDetailResponseSchema,
|
|
46
|
+
DealNoteResponseSchema,
|
|
47
|
+
DealNoteListResponseSchema,
|
|
48
|
+
DealTaskResponseSchema,
|
|
49
|
+
DealTaskListResponseSchema,
|
|
50
|
+
DealSchemas,
|
|
51
|
+
ListStatusSchema,
|
|
52
|
+
ScrapingConfigSchema,
|
|
53
|
+
IcpRubricSchema,
|
|
54
|
+
PipelineStageSchema,
|
|
55
|
+
PipelineConfigSchema,
|
|
56
|
+
BuildPlanSnapshotStepSchema,
|
|
57
|
+
BuildPlanSnapshotSchema,
|
|
58
|
+
AcqListMetadataSchema,
|
|
59
|
+
ProspectingBuildTemplateIdSchema,
|
|
60
|
+
ProcessingStageStatusSchema,
|
|
61
|
+
ListStageCountsSchema,
|
|
62
|
+
ListTelemetrySchema,
|
|
63
|
+
ListIdParamsSchema,
|
|
64
|
+
CreateListRequestSchema,
|
|
65
|
+
UpdateListRequestSchema,
|
|
66
|
+
UpdateListStatusRequestSchema,
|
|
67
|
+
UpdateListConfigRequestSchema,
|
|
68
|
+
AddCompaniesToListRequestSchema,
|
|
69
|
+
RemoveCompaniesFromListRequestSchema,
|
|
70
|
+
AddContactsToListRequestSchema,
|
|
71
|
+
RecordListExecutionRequestSchema,
|
|
72
|
+
AcqListResponseSchema,
|
|
73
|
+
AcqListListResponseSchema,
|
|
74
|
+
ListTelemetryResponseSchema,
|
|
75
|
+
ListTelemetryListResponseSchema,
|
|
76
|
+
ListExecutionSummarySchema,
|
|
77
|
+
ListExecutionsResponseSchema,
|
|
78
|
+
ListStageProgressSchema,
|
|
79
|
+
ListProgressResponseSchema,
|
|
80
|
+
AcqListSchemas,
|
|
81
|
+
AcqSubstrateSchemas,
|
|
82
|
+
AcqArtifactOwnerKindSchema,
|
|
83
|
+
ListArtifactsQuerySchema,
|
|
84
|
+
CreateArtifactRequestSchema,
|
|
85
|
+
AcqArtifactResponseSchema,
|
|
86
|
+
AcqArtifactListResponseSchema,
|
|
87
|
+
ListMembersQuerySchema,
|
|
88
|
+
MemberIdParamsSchema,
|
|
89
|
+
AcqListMemberContactSummarySchema,
|
|
90
|
+
AcqListMemberResponseSchema,
|
|
91
|
+
AcqListMembersResponseSchema,
|
|
92
|
+
ListCompanyIdParamsSchema,
|
|
93
|
+
AcqListCompanyResponseSchema,
|
|
94
|
+
type AcqArtifactOwnerKind,
|
|
95
|
+
type ListArtifactsQuery,
|
|
96
|
+
type CreateArtifactRequest,
|
|
97
|
+
type AcqArtifactResponse,
|
|
98
|
+
type AcqArtifactListResponse,
|
|
99
|
+
type ListMembersQuery,
|
|
100
|
+
type MemberIdParams,
|
|
101
|
+
type AcqListMemberContactSummary,
|
|
102
|
+
type AcqListMemberResponse,
|
|
103
|
+
type AcqListMembersResponse,
|
|
104
|
+
type ListCompanyIdParams,
|
|
105
|
+
type AcqListCompanyResponse,
|
|
106
|
+
type CompanyIdParams,
|
|
107
|
+
type ContactIdParams,
|
|
108
|
+
type ListCompaniesQuery,
|
|
109
|
+
type ListContactsQuery,
|
|
110
|
+
type CreateCompanyRequest,
|
|
111
|
+
type UpdateCompanyRequest,
|
|
112
|
+
type CreateContactRequest,
|
|
113
|
+
type UpdateContactRequest,
|
|
114
|
+
type AcqCompanyResponse,
|
|
115
|
+
type AcqCompanyListResponse,
|
|
116
|
+
type AcqContactResponse,
|
|
117
|
+
type AcqContactListResponse,
|
|
118
|
+
type AcqCompanyStatus,
|
|
119
|
+
type AcqContactStatus,
|
|
120
|
+
type AcqEmailValid,
|
|
121
|
+
type DealIdParams,
|
|
122
|
+
type DealTaskIdParams,
|
|
123
|
+
type ListDealsQuery,
|
|
124
|
+
type ListDealTasksDueQuery,
|
|
125
|
+
type CreateDealNoteRequest,
|
|
126
|
+
type CreateDealTaskRequest,
|
|
127
|
+
type TransitionItemRequest,
|
|
128
|
+
type TransitionDealStateRequest,
|
|
129
|
+
type ExecuteActionParams,
|
|
130
|
+
type ExecuteActionRequest,
|
|
131
|
+
type DealPriorityResponse,
|
|
132
|
+
type DealListResponse,
|
|
133
|
+
type DealDetailResponse,
|
|
134
|
+
type DealNoteResponse,
|
|
135
|
+
type DealNoteListResponse,
|
|
136
|
+
type DealTaskResponse,
|
|
137
|
+
type DealTaskListResponse,
|
|
138
|
+
type ListStatus,
|
|
139
|
+
type ScrapingConfig,
|
|
140
|
+
type IcpRubric,
|
|
141
|
+
type PipelineStage,
|
|
142
|
+
type PipelineConfig,
|
|
143
|
+
type ProcessingStageStatus,
|
|
144
|
+
type ListStageCountsInput,
|
|
145
|
+
type ListTelemetryInput,
|
|
146
|
+
type ListIdParams,
|
|
147
|
+
type CreateListRequest,
|
|
148
|
+
type UpdateListRequest,
|
|
149
|
+
type UpdateListStatusRequest,
|
|
150
|
+
type UpdateListConfigRequest,
|
|
151
|
+
type AddCompaniesToListRequest,
|
|
152
|
+
type RemoveCompaniesFromListRequest,
|
|
153
|
+
type AddContactsToListRequest,
|
|
154
|
+
type RecordListExecutionRequest,
|
|
155
|
+
type AcqListResponse,
|
|
156
|
+
type AcqListListResponse,
|
|
157
|
+
type ListTelemetryResponse,
|
|
158
|
+
type ListTelemetryListResponse,
|
|
159
|
+
type ListExecutionSummaryInput,
|
|
160
|
+
type ListExecutionsResponse,
|
|
161
|
+
type ListStageProgress,
|
|
162
|
+
type ListProgress
|
|
163
|
+
} from './api-schemas'
|
|
@@ -186,6 +186,34 @@ export interface PipelineConfig {
|
|
|
186
186
|
stages: PipelineStage[]
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
+
export type BuildPlanSnapshotPrimaryEntity = 'company' | 'contact'
|
|
190
|
+
export type BuildPlanSnapshotOutput = 'company' | 'contact' | 'export'
|
|
191
|
+
export type BuildPlanSnapshotDependencyMode = 'per-record-eligibility'
|
|
192
|
+
|
|
193
|
+
export interface BuildPlanSnapshotStep {
|
|
194
|
+
id: string
|
|
195
|
+
label: string
|
|
196
|
+
description?: string
|
|
197
|
+
primaryEntity: BuildPlanSnapshotPrimaryEntity
|
|
198
|
+
outputs: BuildPlanSnapshotOutput[]
|
|
199
|
+
stageKey: string
|
|
200
|
+
dependsOn?: string[]
|
|
201
|
+
dependencyMode: BuildPlanSnapshotDependencyMode
|
|
202
|
+
capabilityKey: string
|
|
203
|
+
defaultBatchSize: number
|
|
204
|
+
maxBatchSize: number
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export interface BuildPlanSnapshot {
|
|
208
|
+
templateId: string
|
|
209
|
+
templateLabel: string
|
|
210
|
+
steps: BuildPlanSnapshotStep[]
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export interface AcqListMetadata extends Record<string, unknown> {
|
|
214
|
+
buildPlanSnapshot?: BuildPlanSnapshot
|
|
215
|
+
}
|
|
216
|
+
|
|
189
217
|
export interface AcqList {
|
|
190
218
|
id: string
|
|
191
219
|
organizationId: string
|
|
@@ -197,7 +225,7 @@ export interface AcqList {
|
|
|
197
225
|
scrapingConfig: ScrapingConfig
|
|
198
226
|
icp: IcpRubric
|
|
199
227
|
pipelineConfig: PipelineConfig
|
|
200
|
-
metadata:
|
|
228
|
+
metadata: AcqListMetadata
|
|
201
229
|
launchedAt: Date | null
|
|
202
230
|
completedAt: Date | null
|
|
203
231
|
createdAt: Date
|
|
@@ -272,6 +300,18 @@ export interface AcqContact {
|
|
|
272
300
|
|
|
273
301
|
export type DealStage = 'interested' | 'proposal' | 'closing' | 'closed_won' | 'closed_lost' | 'nurturing'
|
|
274
302
|
|
|
303
|
+
export type DealPriorityBucketKey = 'needs_response' | 'follow_up_due' | 'waiting' | 'stale' | 'closed_low'
|
|
304
|
+
|
|
305
|
+
export interface DealPriority {
|
|
306
|
+
bucketKey: DealPriorityBucketKey
|
|
307
|
+
rank: number
|
|
308
|
+
label: string
|
|
309
|
+
color: string
|
|
310
|
+
reason: string
|
|
311
|
+
latestActivityAt: string | null
|
|
312
|
+
nextActionAt: string | null
|
|
313
|
+
}
|
|
314
|
+
|
|
275
315
|
export interface KanbanStageConfig {
|
|
276
316
|
color: string // Mantine color token (e.g. 'blue', 'teal')
|
|
277
317
|
label?: string // Optional display label override
|
|
@@ -309,9 +349,12 @@ export interface DealFilters {
|
|
|
309
349
|
}
|
|
310
350
|
|
|
311
351
|
/** Deal list item with joined contact and company data */
|
|
312
|
-
export interface DealListItem extends AcqDealRow {
|
|
313
|
-
|
|
314
|
-
|
|
352
|
+
export interface DealListItem extends AcqDealRow {
|
|
353
|
+
priority: DealPriority
|
|
354
|
+
ownership: 'us' | 'them' | null
|
|
355
|
+
nextAction: string | null
|
|
356
|
+
contact: DealContact | null
|
|
357
|
+
}
|
|
315
358
|
|
|
316
359
|
export type DealDetail = DealListItem
|
|
317
360
|
|
|
@@ -343,6 +386,7 @@ export interface AcqDealTask {
|
|
|
343
386
|
/**
|
|
344
387
|
* Live-scan aggregate telemetry for a single list, computed on demand from
|
|
345
388
|
* the list junction tables and current contact deliverability state.
|
|
389
|
+
* `stageCounts` are attempted counts from list-row processing_state.
|
|
346
390
|
*/
|
|
347
391
|
export interface ListTelemetry {
|
|
348
392
|
listId: string
|
|
@@ -297,9 +297,10 @@ export {
|
|
|
297
297
|
type UpdateProposalDataParams,
|
|
298
298
|
type MarkProposalSentParams,
|
|
299
299
|
type MarkProposalReviewedParams,
|
|
300
|
-
type UpdateCloseLostReasonParams,
|
|
301
|
-
type UpdateFeesParams,
|
|
302
|
-
type
|
|
300
|
+
type UpdateCloseLostReasonParams,
|
|
301
|
+
type UpdateFeesParams,
|
|
302
|
+
type CacheInstantlyThreadIdsParams,
|
|
303
|
+
type TransitionItemParams,
|
|
303
304
|
type SetContactNurtureParams,
|
|
304
305
|
type CancelSchedulesAndHitlByEmailParams,
|
|
305
306
|
type CancelHitlByDealIdParams,
|