@endora-commerce/contracts 0.103.0 → 0.104.0
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/admin-actions.d.ts +5 -0
- package/dist/admin-actions.d.ts.map +1 -1
- package/dist/admin-actions.js +5 -0
- package/dist/admin-actions.js.map +1 -1
- package/dist/admin-contributions.d.ts +41 -0
- package/dist/admin-contributions.d.ts.map +1 -1
- package/dist/admin-contributions.js +58 -0
- package/dist/admin-contributions.js.map +1 -1
- package/dist/admin-notifications.d.ts +37 -0
- package/dist/admin-notifications.d.ts.map +1 -1
- package/dist/assets-library.d.ts +8 -0
- package/dist/assets-library.d.ts.map +1 -1
- package/dist/assets-library.js +2 -0
- package/dist/assets-library.js.map +1 -1
- package/dist/auth.d.ts +17 -1
- package/dist/auth.d.ts.map +1 -1
- package/dist/carts.d.ts +26 -1
- package/dist/carts.d.ts.map +1 -1
- package/dist/catalog.d.ts +64 -3
- package/dist/catalog.d.ts.map +1 -1
- package/dist/catalog.js +92 -0
- package/dist/catalog.js.map +1 -1
- package/dist/common.d.ts +17 -0
- package/dist/common.d.ts.map +1 -1
- package/dist/common.js +22 -0
- package/dist/common.js.map +1 -1
- package/dist/crm.d.ts +2903 -0
- package/dist/crm.d.ts.map +1 -0
- package/dist/crm.js +1191 -0
- package/dist/crm.js.map +1 -0
- package/dist/custom-fields.d.ts +4 -0
- package/dist/custom-fields.d.ts.map +1 -1
- package/dist/custom-fields.js +4 -0
- package/dist/custom-fields.js.map +1 -1
- package/dist/errors.d.ts +29 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +32 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/languages.d.ts +39 -4
- package/dist/languages.d.ts.map +1 -1
- package/dist/modules.d.ts +3 -0
- package/dist/modules.d.ts.map +1 -1
- package/dist/orders.d.ts +15 -0
- package/dist/orders.d.ts.map +1 -1
- package/dist/orders.js +7 -1
- package/dist/orders.js.map +1 -1
- package/dist/pim-connector.d.ts +1 -1
- package/dist/product-feeds.d.ts +15 -15
- package/dist/quote-requests.d.ts +20 -0
- package/dist/quote-requests.d.ts.map +1 -1
- package/dist/quote-requests.js +9 -1
- package/dist/quote-requests.js.map +1 -1
- package/dist/storefront-cache-tags.d.ts +65 -0
- package/dist/storefront-cache-tags.d.ts.map +1 -0
- package/dist/storefront-cache-tags.js +47 -0
- package/dist/storefront-cache-tags.js.map +1 -0
- package/dist/webhooks.d.ts +40 -0
- package/dist/webhooks.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/crm.d.ts
ADDED
|
@@ -0,0 +1,2903 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* CRM — Sales Opportunities (`specs/143-crm-sales-opportunities/`).
|
|
4
|
+
*
|
|
5
|
+
* Every request, response, event and port shape of the `crm` module, written
|
|
6
|
+
* before the first route (Constitution II). The normative prose is
|
|
7
|
+
* `specs/143-crm-sales-opportunities/contracts/admin-api.md` and
|
|
8
|
+
* `contracts/events-and-ports.md`; this file is what the backend validates
|
|
9
|
+
* with and what the admin types its calls from.
|
|
10
|
+
*
|
|
11
|
+
* Base path of the HTTP API: `/api/v1/admin/crm`. There is no storefront or
|
|
12
|
+
* customer route.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* A status code — stable, snake_case, immutable after create. The grammar is
|
|
16
|
+
* what lets a templated event name be built without escaping.
|
|
17
|
+
*/
|
|
18
|
+
export declare const opportunityStatusCodeSchema: z.ZodString;
|
|
19
|
+
/** What a status means for the Opportunity: still worked, or closed as won / lost. */
|
|
20
|
+
export declare const opportunityStatusKindSchema: z.ZodEnum<{
|
|
21
|
+
open: "open";
|
|
22
|
+
won: "won";
|
|
23
|
+
lost: "lost";
|
|
24
|
+
}>;
|
|
25
|
+
export type OpportunityStatusKind = z.infer<typeof opportunityStatusKindSchema>;
|
|
26
|
+
export declare const opportunityClosedKindSchema: z.ZodEnum<{
|
|
27
|
+
won: "won";
|
|
28
|
+
lost: "lost";
|
|
29
|
+
}>;
|
|
30
|
+
export type OpportunityClosedKind = z.infer<typeof opportunityClosedKindSchema>;
|
|
31
|
+
export declare const opportunityValueModeSchema: z.ZodEnum<{
|
|
32
|
+
manual: "manual";
|
|
33
|
+
computed: "computed";
|
|
34
|
+
}>;
|
|
35
|
+
export type OpportunityValueMode = z.infer<typeof opportunityValueModeSchema>;
|
|
36
|
+
export declare const opportunitySourceSchema: z.ZodEnum<{
|
|
37
|
+
order: "order";
|
|
38
|
+
quote_request: "quote_request";
|
|
39
|
+
manual: "manual";
|
|
40
|
+
}>;
|
|
41
|
+
export type OpportunitySource = z.infer<typeof opportunitySourceSchema>;
|
|
42
|
+
export declare const opportunityDocumentKindSchema: z.ZodEnum<{
|
|
43
|
+
order: "order";
|
|
44
|
+
quote_request: "quote_request";
|
|
45
|
+
}>;
|
|
46
|
+
export type OpportunityDocumentKind = z.infer<typeof opportunityDocumentKindSchema>;
|
|
47
|
+
export declare const opportunityLinkSourceSchema: z.ZodEnum<{
|
|
48
|
+
manual: "manual";
|
|
49
|
+
auto: "auto";
|
|
50
|
+
created_from_opportunity: "created_from_opportunity";
|
|
51
|
+
quote_conversion: "quote_conversion";
|
|
52
|
+
}>;
|
|
53
|
+
export type OpportunityLinkSource = z.infer<typeof opportunityLinkSourceSchema>;
|
|
54
|
+
export declare const orderStatusMappingDirectionSchema: z.ZodEnum<{
|
|
55
|
+
opportunity_to_order: "opportunity_to_order";
|
|
56
|
+
order_to_opportunity: "order_to_opportunity";
|
|
57
|
+
}>;
|
|
58
|
+
export type OrderStatusMappingDirection = z.infer<typeof orderStatusMappingDirectionSchema>;
|
|
59
|
+
/**
|
|
60
|
+
* What became of one attempt to carry a status across the Opportunity ↔ Order
|
|
61
|
+
* link. The first six are `OrderTransitionOutcome`'s answers, recorded
|
|
62
|
+
* verbatim; `failed` is a call that did not return one, `skipped` is the
|
|
63
|
+
* reverse direction declining to move the Opportunity, and `pending` is a row
|
|
64
|
+
* written before the call that has not been resolved yet.
|
|
65
|
+
*/
|
|
66
|
+
export declare const propagationOutcomeKindSchema: z.ZodEnum<{
|
|
67
|
+
pending: "pending";
|
|
68
|
+
failed: "failed";
|
|
69
|
+
skipped: "skipped";
|
|
70
|
+
not_found: "not_found";
|
|
71
|
+
applied: "applied";
|
|
72
|
+
already_there: "already_there";
|
|
73
|
+
unknown_status: "unknown_status";
|
|
74
|
+
not_permitted: "not_permitted";
|
|
75
|
+
vetoed: "vetoed";
|
|
76
|
+
}>;
|
|
77
|
+
export type PropagationOutcomeKind = z.infer<typeof propagationOutcomeKindSchema>;
|
|
78
|
+
export declare const opportunityCommentKindSchema: z.ZodEnum<{
|
|
79
|
+
message: "message";
|
|
80
|
+
note: "note";
|
|
81
|
+
}>;
|
|
82
|
+
export type OpportunityCommentKind = z.infer<typeof opportunityCommentKindSchema>;
|
|
83
|
+
/**
|
|
84
|
+
* What a free text can refer to. `admin_user` is a person — a user of the Admin
|
|
85
|
+
* UI, under the name the platform has for one everywhere else (the bell's
|
|
86
|
+
* audience, `assignedAdminUserId`); `user` alone would also read as a customer.
|
|
87
|
+
*/
|
|
88
|
+
export declare const opportunityReferenceTypeSchema: z.ZodEnum<{
|
|
89
|
+
order: "order";
|
|
90
|
+
admin_user: "admin_user";
|
|
91
|
+
product: "product";
|
|
92
|
+
}>;
|
|
93
|
+
export type OpportunityReferenceType = z.infer<typeof opportunityReferenceTypeSchema>;
|
|
94
|
+
/** The six `QuoteRequestStatus` values — a fixed union, unlike Order statuses. */
|
|
95
|
+
export declare const QUOTE_REQUEST_STATUS_VALUES: readonly ["Created from admin", "Pending", "Canceled", "Approved", "Completed", "Expired"];
|
|
96
|
+
export interface OpportunityReferenceToken {
|
|
97
|
+
type: OpportunityReferenceType;
|
|
98
|
+
id: string;
|
|
99
|
+
}
|
|
100
|
+
export declare function formatOpportunityReferenceToken(type: OpportunityReferenceType, id: string): string;
|
|
101
|
+
/** Every well-formed token in `text`, in first-appearance order, each target once. */
|
|
102
|
+
export declare function extractOpportunityReferenceTokens(text: string): OpportunityReferenceToken[];
|
|
103
|
+
/** A stretch of plain text, or one well-formed token, in the order they appear. */
|
|
104
|
+
export type OpportunityReferenceTextPart = {
|
|
105
|
+
kind: 'text';
|
|
106
|
+
text: string;
|
|
107
|
+
} | ({
|
|
108
|
+
kind: 'reference';
|
|
109
|
+
} & OpportunityReferenceToken);
|
|
110
|
+
/**
|
|
111
|
+
* `text` cut at its well-formed tokens, for a screen that shows each token as
|
|
112
|
+
* a link: the parts, joined back, are the text. A malformed token stays text.
|
|
113
|
+
*/
|
|
114
|
+
export declare function splitOpportunityReferenceText(text: string): OpportunityReferenceTextPart[];
|
|
115
|
+
/** The people a text mentions, each once, in first-appearance order. */
|
|
116
|
+
export declare function mentionedAdminUserIds(text: string | null | undefined): string[];
|
|
117
|
+
/**
|
|
118
|
+
* A resolved reference, returned beside every free-text field. A target the
|
|
119
|
+
* reader may not see, or that is gone, is `available: false` with no label.
|
|
120
|
+
* A person has a `label` — their name — and never a `url`: the screen of an
|
|
121
|
+
* administrator is `admin_users`', behind a permission of its own.
|
|
122
|
+
*/
|
|
123
|
+
export declare const OpportunityReferenceSchema: z.ZodObject<{
|
|
124
|
+
type: z.ZodEnum<{
|
|
125
|
+
order: "order";
|
|
126
|
+
admin_user: "admin_user";
|
|
127
|
+
product: "product";
|
|
128
|
+
}>;
|
|
129
|
+
id: z.ZodString;
|
|
130
|
+
available: z.ZodBoolean;
|
|
131
|
+
label: z.ZodNullable<z.ZodString>;
|
|
132
|
+
url: z.ZodNullable<z.ZodString>;
|
|
133
|
+
}, z.core.$strip>;
|
|
134
|
+
export type OpportunityReference = z.infer<typeof OpportunityReferenceSchema>;
|
|
135
|
+
export declare const opportunityStateSchema: z.ZodEnum<{
|
|
136
|
+
open: "open";
|
|
137
|
+
won: "won";
|
|
138
|
+
lost: "lost";
|
|
139
|
+
}>;
|
|
140
|
+
export declare const opportunitySortSchema: z.ZodEnum<{
|
|
141
|
+
number: "number";
|
|
142
|
+
value: "value";
|
|
143
|
+
createdAt: "createdAt";
|
|
144
|
+
updatedAt: "updatedAt";
|
|
145
|
+
expectedCloseDate: "expectedCloseDate";
|
|
146
|
+
}>;
|
|
147
|
+
/** How many fields a board card shows at most, the title besides. */
|
|
148
|
+
export declare const OPPORTUNITY_BOARD_CARD_MAX_FIELDS = 6;
|
|
149
|
+
/** The fields every Opportunity has that a board card can show, in the order they are offered. */
|
|
150
|
+
export declare const OPPORTUNITY_BOARD_BUILTIN_FIELD_KEYS: readonly ["number", "organization", "contact", "assignee", "value", "salesChannel", "tags", "expectedCloseDate", "source", "createdAt", "updatedAt", "closedAt", "linkedOrders", "linkedQuoteRequests"];
|
|
151
|
+
export type OpportunityBoardBuiltinFieldKey = (typeof OPPORTUNITY_BOARD_BUILTIN_FIELD_KEYS)[number];
|
|
152
|
+
/** `builtin:<key>` or `custom:<definition key>`. */
|
|
153
|
+
export declare const opportunityBoardFieldRefSchema: z.ZodString;
|
|
154
|
+
export declare function opportunityBoardBuiltinFieldRef(key: OpportunityBoardBuiltinFieldKey): string;
|
|
155
|
+
export declare function opportunityBoardCustomFieldRef(definitionKey: string): string;
|
|
156
|
+
/** The card as it was before it could be configured — what an untouched instance shows. */
|
|
157
|
+
export declare const OPPORTUNITY_BOARD_DEFAULT_CARD_FIELDS: readonly string[];
|
|
158
|
+
/** What a field is to a renderer and to a filter. */
|
|
159
|
+
export declare const opportunityBoardFieldKindSchema: z.ZodEnum<{
|
|
160
|
+
number: "number";
|
|
161
|
+
boolean: "boolean";
|
|
162
|
+
date: "date";
|
|
163
|
+
text: "text";
|
|
164
|
+
select: "select";
|
|
165
|
+
tags: "tags";
|
|
166
|
+
contact: "contact";
|
|
167
|
+
multiselect: "multiselect";
|
|
168
|
+
organization: "organization";
|
|
169
|
+
salesChannel: "salesChannel";
|
|
170
|
+
assignee: "assignee";
|
|
171
|
+
money: "money";
|
|
172
|
+
}>;
|
|
173
|
+
export type OpportunityBoardFieldKind = z.infer<typeof opportunityBoardFieldKindSchema>;
|
|
174
|
+
export declare const OpportunityBoardCardFieldSchema: z.ZodObject<{
|
|
175
|
+
ref: z.ZodString;
|
|
176
|
+
source: z.ZodEnum<{
|
|
177
|
+
custom: "custom";
|
|
178
|
+
builtin: "builtin";
|
|
179
|
+
}>;
|
|
180
|
+
key: z.ZodString;
|
|
181
|
+
kind: z.ZodEnum<{
|
|
182
|
+
number: "number";
|
|
183
|
+
boolean: "boolean";
|
|
184
|
+
date: "date";
|
|
185
|
+
text: "text";
|
|
186
|
+
select: "select";
|
|
187
|
+
tags: "tags";
|
|
188
|
+
contact: "contact";
|
|
189
|
+
multiselect: "multiselect";
|
|
190
|
+
organization: "organization";
|
|
191
|
+
salesChannel: "salesChannel";
|
|
192
|
+
assignee: "assignee";
|
|
193
|
+
money: "money";
|
|
194
|
+
}>;
|
|
195
|
+
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
196
|
+
labelDefault: z.ZodNullable<z.ZodString>;
|
|
197
|
+
options: z.ZodArray<z.ZodObject<{
|
|
198
|
+
value: z.ZodString;
|
|
199
|
+
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
200
|
+
labelDefault: z.ZodString;
|
|
201
|
+
}, z.core.$strip>>;
|
|
202
|
+
}, z.core.$strip>;
|
|
203
|
+
export type OpportunityBoardCardField = z.infer<typeof OpportunityBoardCardFieldSchema>;
|
|
204
|
+
export declare const SetOpportunityBoardCardFieldsRequestSchema: z.ZodObject<{
|
|
205
|
+
fields: z.ZodArray<z.ZodString>;
|
|
206
|
+
}, z.core.$strict>;
|
|
207
|
+
export type SetOpportunityBoardCardFieldsRequest = z.infer<typeof SetOpportunityBoardCardFieldsRequestSchema>;
|
|
208
|
+
export declare const OpportunityBoardCardConfigSchema: z.ZodObject<{
|
|
209
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
210
|
+
ref: z.ZodString;
|
|
211
|
+
source: z.ZodEnum<{
|
|
212
|
+
custom: "custom";
|
|
213
|
+
builtin: "builtin";
|
|
214
|
+
}>;
|
|
215
|
+
key: z.ZodString;
|
|
216
|
+
kind: z.ZodEnum<{
|
|
217
|
+
number: "number";
|
|
218
|
+
boolean: "boolean";
|
|
219
|
+
date: "date";
|
|
220
|
+
text: "text";
|
|
221
|
+
select: "select";
|
|
222
|
+
tags: "tags";
|
|
223
|
+
contact: "contact";
|
|
224
|
+
multiselect: "multiselect";
|
|
225
|
+
organization: "organization";
|
|
226
|
+
salesChannel: "salesChannel";
|
|
227
|
+
assignee: "assignee";
|
|
228
|
+
money: "money";
|
|
229
|
+
}>;
|
|
230
|
+
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
231
|
+
labelDefault: z.ZodNullable<z.ZodString>;
|
|
232
|
+
options: z.ZodArray<z.ZodObject<{
|
|
233
|
+
value: z.ZodString;
|
|
234
|
+
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
235
|
+
labelDefault: z.ZodString;
|
|
236
|
+
}, z.core.$strip>>;
|
|
237
|
+
}, z.core.$strip>>;
|
|
238
|
+
available: z.ZodArray<z.ZodObject<{
|
|
239
|
+
ref: z.ZodString;
|
|
240
|
+
source: z.ZodEnum<{
|
|
241
|
+
custom: "custom";
|
|
242
|
+
builtin: "builtin";
|
|
243
|
+
}>;
|
|
244
|
+
key: z.ZodString;
|
|
245
|
+
kind: z.ZodEnum<{
|
|
246
|
+
number: "number";
|
|
247
|
+
boolean: "boolean";
|
|
248
|
+
date: "date";
|
|
249
|
+
text: "text";
|
|
250
|
+
select: "select";
|
|
251
|
+
tags: "tags";
|
|
252
|
+
contact: "contact";
|
|
253
|
+
multiselect: "multiselect";
|
|
254
|
+
organization: "organization";
|
|
255
|
+
salesChannel: "salesChannel";
|
|
256
|
+
assignee: "assignee";
|
|
257
|
+
money: "money";
|
|
258
|
+
}>;
|
|
259
|
+
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
260
|
+
labelDefault: z.ZodNullable<z.ZodString>;
|
|
261
|
+
options: z.ZodArray<z.ZodObject<{
|
|
262
|
+
value: z.ZodString;
|
|
263
|
+
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
264
|
+
labelDefault: z.ZodString;
|
|
265
|
+
}, z.core.$strip>>;
|
|
266
|
+
}, z.core.$strip>>;
|
|
267
|
+
maxFields: z.ZodNumber;
|
|
268
|
+
}, z.core.$strip>;
|
|
269
|
+
export type OpportunityBoardCardConfig = z.infer<typeof OpportunityBoardCardConfigSchema>;
|
|
270
|
+
export declare const OpportunityBoardCardConfigResponseSchema: z.ZodObject<{
|
|
271
|
+
data: z.ZodObject<{
|
|
272
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
273
|
+
ref: z.ZodString;
|
|
274
|
+
source: z.ZodEnum<{
|
|
275
|
+
custom: "custom";
|
|
276
|
+
builtin: "builtin";
|
|
277
|
+
}>;
|
|
278
|
+
key: z.ZodString;
|
|
279
|
+
kind: z.ZodEnum<{
|
|
280
|
+
number: "number";
|
|
281
|
+
boolean: "boolean";
|
|
282
|
+
date: "date";
|
|
283
|
+
text: "text";
|
|
284
|
+
select: "select";
|
|
285
|
+
tags: "tags";
|
|
286
|
+
contact: "contact";
|
|
287
|
+
multiselect: "multiselect";
|
|
288
|
+
organization: "organization";
|
|
289
|
+
salesChannel: "salesChannel";
|
|
290
|
+
assignee: "assignee";
|
|
291
|
+
money: "money";
|
|
292
|
+
}>;
|
|
293
|
+
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
294
|
+
labelDefault: z.ZodNullable<z.ZodString>;
|
|
295
|
+
options: z.ZodArray<z.ZodObject<{
|
|
296
|
+
value: z.ZodString;
|
|
297
|
+
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
298
|
+
labelDefault: z.ZodString;
|
|
299
|
+
}, z.core.$strip>>;
|
|
300
|
+
}, z.core.$strip>>;
|
|
301
|
+
available: z.ZodArray<z.ZodObject<{
|
|
302
|
+
ref: z.ZodString;
|
|
303
|
+
source: z.ZodEnum<{
|
|
304
|
+
custom: "custom";
|
|
305
|
+
builtin: "builtin";
|
|
306
|
+
}>;
|
|
307
|
+
key: z.ZodString;
|
|
308
|
+
kind: z.ZodEnum<{
|
|
309
|
+
number: "number";
|
|
310
|
+
boolean: "boolean";
|
|
311
|
+
date: "date";
|
|
312
|
+
text: "text";
|
|
313
|
+
select: "select";
|
|
314
|
+
tags: "tags";
|
|
315
|
+
contact: "contact";
|
|
316
|
+
multiselect: "multiselect";
|
|
317
|
+
organization: "organization";
|
|
318
|
+
salesChannel: "salesChannel";
|
|
319
|
+
assignee: "assignee";
|
|
320
|
+
money: "money";
|
|
321
|
+
}>;
|
|
322
|
+
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
323
|
+
labelDefault: z.ZodNullable<z.ZodString>;
|
|
324
|
+
options: z.ZodArray<z.ZodObject<{
|
|
325
|
+
value: z.ZodString;
|
|
326
|
+
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
327
|
+
labelDefault: z.ZodString;
|
|
328
|
+
}, z.core.$strip>>;
|
|
329
|
+
}, z.core.$strip>>;
|
|
330
|
+
maxFields: z.ZodNumber;
|
|
331
|
+
}, z.core.$strip>;
|
|
332
|
+
}, z.core.$strip>;
|
|
333
|
+
/**
|
|
334
|
+
* One field's filter: the operators of every kind in one object. Which of them
|
|
335
|
+
* apply is the field's kind to say; the others are ignored by the server.
|
|
336
|
+
*/
|
|
337
|
+
export declare const OpportunityFieldFilterSchema: z.ZodObject<{
|
|
338
|
+
contains: z.ZodOptional<z.ZodString>;
|
|
339
|
+
in: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
340
|
+
is: z.ZodOptional<z.ZodBoolean>;
|
|
341
|
+
min: z.ZodOptional<z.ZodString>;
|
|
342
|
+
max: z.ZodOptional<z.ZodString>;
|
|
343
|
+
from: z.ZodOptional<z.ZodString>;
|
|
344
|
+
to: z.ZodOptional<z.ZodString>;
|
|
345
|
+
}, z.core.$strict>;
|
|
346
|
+
export type OpportunityFieldFilter = z.infer<typeof OpportunityFieldFilterSchema>;
|
|
347
|
+
export declare const OpportunityFieldFiltersSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
348
|
+
contains: z.ZodOptional<z.ZodString>;
|
|
349
|
+
in: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
350
|
+
is: z.ZodOptional<z.ZodBoolean>;
|
|
351
|
+
min: z.ZodOptional<z.ZodString>;
|
|
352
|
+
max: z.ZodOptional<z.ZodString>;
|
|
353
|
+
from: z.ZodOptional<z.ZodString>;
|
|
354
|
+
to: z.ZodOptional<z.ZodString>;
|
|
355
|
+
}, z.core.$strict>>;
|
|
356
|
+
export type OpportunityFieldFilters = z.infer<typeof OpportunityFieldFiltersSchema>;
|
|
357
|
+
export declare const OpportunityListQuerySchema: z.ZodObject<{
|
|
358
|
+
cardValues: z.ZodPipe<z.ZodOptional<z.ZodEnum<{
|
|
359
|
+
true: "true";
|
|
360
|
+
false: "false";
|
|
361
|
+
}>>, z.ZodTransform<true | undefined, "true" | "false" | undefined>>;
|
|
362
|
+
statusCode: z.ZodPipe<z.ZodTransform<any[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
363
|
+
state: z.ZodOptional<z.ZodEnum<{
|
|
364
|
+
open: "open";
|
|
365
|
+
won: "won";
|
|
366
|
+
lost: "lost";
|
|
367
|
+
}>>;
|
|
368
|
+
sort: z.ZodOptional<z.ZodEnum<{
|
|
369
|
+
number: "number";
|
|
370
|
+
value: "value";
|
|
371
|
+
createdAt: "createdAt";
|
|
372
|
+
updatedAt: "updatedAt";
|
|
373
|
+
expectedCloseDate: "expectedCloseDate";
|
|
374
|
+
}>>;
|
|
375
|
+
order: z.ZodOptional<z.ZodEnum<{
|
|
376
|
+
asc: "asc";
|
|
377
|
+
desc: "desc";
|
|
378
|
+
}>>;
|
|
379
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
380
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
381
|
+
q: z.ZodOptional<z.ZodString>;
|
|
382
|
+
organizationId: z.ZodOptional<z.ZodString>;
|
|
383
|
+
assignedAdminUserId: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"me">, z.ZodLiteral<"unassigned">, z.ZodString]>>;
|
|
384
|
+
salesChannelId: z.ZodOptional<z.ZodString>;
|
|
385
|
+
tagId: z.ZodPipe<z.ZodTransform<any[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
386
|
+
createdFrom: z.ZodOptional<z.ZodString>;
|
|
387
|
+
createdTo: z.ZodOptional<z.ZodString>;
|
|
388
|
+
fieldFilters: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<Record<string, {
|
|
389
|
+
contains?: string | undefined;
|
|
390
|
+
in?: string[] | undefined;
|
|
391
|
+
is?: boolean | undefined;
|
|
392
|
+
min?: string | undefined;
|
|
393
|
+
max?: string | undefined;
|
|
394
|
+
from?: string | undefined;
|
|
395
|
+
to?: string | undefined;
|
|
396
|
+
}> | undefined, string | undefined>>;
|
|
397
|
+
}, z.core.$strip>;
|
|
398
|
+
export type OpportunityListQuery = z.infer<typeof OpportunityListQuerySchema>;
|
|
399
|
+
export declare const CreateOpportunityRequestSchema: z.ZodObject<{
|
|
400
|
+
title: z.ZodString;
|
|
401
|
+
organizationId: z.ZodString;
|
|
402
|
+
currency: z.ZodString;
|
|
403
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
404
|
+
customerAccountId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
405
|
+
salesChannelId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
406
|
+
assignedAdminUserId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
407
|
+
valueMode: z.ZodOptional<z.ZodEnum<{
|
|
408
|
+
manual: "manual";
|
|
409
|
+
computed: "computed";
|
|
410
|
+
}>>;
|
|
411
|
+
manualValue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
412
|
+
expectedCloseDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
413
|
+
tagIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
414
|
+
customFieldValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
415
|
+
}, z.core.$strip>;
|
|
416
|
+
export type CreateOpportunityRequest = z.infer<typeof CreateOpportunityRequestSchema>;
|
|
417
|
+
/**
|
|
418
|
+
* Every create field except the two immutable ones. Strict, so a body naming
|
|
419
|
+
* `organizationId` or `currency` is refused instead of silently ignored.
|
|
420
|
+
*/
|
|
421
|
+
export declare const UpdateOpportunityRequestSchema: z.ZodObject<{
|
|
422
|
+
description: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
423
|
+
title: z.ZodOptional<z.ZodString>;
|
|
424
|
+
salesChannelId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
425
|
+
customerAccountId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
426
|
+
tagIds: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
427
|
+
customFieldValues: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
428
|
+
assignedAdminUserId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
429
|
+
expectedCloseDate: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
430
|
+
valueMode: z.ZodOptional<z.ZodOptional<z.ZodEnum<{
|
|
431
|
+
manual: "manual";
|
|
432
|
+
computed: "computed";
|
|
433
|
+
}>>>;
|
|
434
|
+
manualValue: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
435
|
+
}, z.core.$strict>;
|
|
436
|
+
export type UpdateOpportunityRequest = z.infer<typeof UpdateOpportunityRequestSchema>;
|
|
437
|
+
export declare const OpportunityStatusRefSchema: z.ZodObject<{
|
|
438
|
+
code: z.ZodString;
|
|
439
|
+
name: z.ZodString;
|
|
440
|
+
color: z.ZodString;
|
|
441
|
+
kind: z.ZodEnum<{
|
|
442
|
+
open: "open";
|
|
443
|
+
won: "won";
|
|
444
|
+
lost: "lost";
|
|
445
|
+
}>;
|
|
446
|
+
}, z.core.$strip>;
|
|
447
|
+
export type OpportunityStatusRef = z.infer<typeof OpportunityStatusRefSchema>;
|
|
448
|
+
export declare const OpportunityTagRefSchema: z.ZodObject<{
|
|
449
|
+
id: z.ZodString;
|
|
450
|
+
name: z.ZodString;
|
|
451
|
+
color: z.ZodString;
|
|
452
|
+
}, z.core.$strip>;
|
|
453
|
+
export type OpportunityTagRef = z.infer<typeof OpportunityTagRefSchema>;
|
|
454
|
+
export declare const OpportunitySummarySchema: z.ZodObject<{
|
|
455
|
+
id: z.ZodString;
|
|
456
|
+
number: z.ZodString;
|
|
457
|
+
title: z.ZodString;
|
|
458
|
+
organization: z.ZodObject<{
|
|
459
|
+
id: z.ZodString;
|
|
460
|
+
name: z.ZodString;
|
|
461
|
+
}, z.core.$strip>;
|
|
462
|
+
status: z.ZodObject<{
|
|
463
|
+
code: z.ZodString;
|
|
464
|
+
name: z.ZodString;
|
|
465
|
+
color: z.ZodString;
|
|
466
|
+
kind: z.ZodEnum<{
|
|
467
|
+
open: "open";
|
|
468
|
+
won: "won";
|
|
469
|
+
lost: "lost";
|
|
470
|
+
}>;
|
|
471
|
+
}, z.core.$strip>;
|
|
472
|
+
assignee: z.ZodNullable<z.ZodObject<{
|
|
473
|
+
id: z.ZodString;
|
|
474
|
+
name: z.ZodString;
|
|
475
|
+
active: z.ZodBoolean;
|
|
476
|
+
}, z.core.$strip>>;
|
|
477
|
+
value: z.ZodNullable<z.ZodString>;
|
|
478
|
+
valueMode: z.ZodEnum<{
|
|
479
|
+
manual: "manual";
|
|
480
|
+
computed: "computed";
|
|
481
|
+
}>;
|
|
482
|
+
currency: z.ZodString;
|
|
483
|
+
salesChannelId: z.ZodNullable<z.ZodString>;
|
|
484
|
+
expectedCloseDate: z.ZodNullable<z.ZodString>;
|
|
485
|
+
tags: z.ZodArray<z.ZodObject<{
|
|
486
|
+
id: z.ZodString;
|
|
487
|
+
name: z.ZodString;
|
|
488
|
+
color: z.ZodString;
|
|
489
|
+
}, z.core.$strip>>;
|
|
490
|
+
closedAt: z.ZodNullable<z.ZodString>;
|
|
491
|
+
closedKind: z.ZodNullable<z.ZodEnum<{
|
|
492
|
+
won: "won";
|
|
493
|
+
lost: "lost";
|
|
494
|
+
}>>;
|
|
495
|
+
createdAt: z.ZodString;
|
|
496
|
+
updatedAt: z.ZodString;
|
|
497
|
+
cardValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
498
|
+
}, z.core.$strip>;
|
|
499
|
+
export type OpportunitySummary = z.infer<typeof OpportunitySummarySchema>;
|
|
500
|
+
export declare const CreateOpportunityLinkRequestSchema: z.ZodObject<{
|
|
501
|
+
documentKind: z.ZodEnum<{
|
|
502
|
+
order: "order";
|
|
503
|
+
quote_request: "quote_request";
|
|
504
|
+
}>;
|
|
505
|
+
documentId: z.ZodString;
|
|
506
|
+
syncStatus: z.ZodOptional<z.ZodBoolean>;
|
|
507
|
+
}, z.core.$strip>;
|
|
508
|
+
export type CreateOpportunityLinkRequest = z.infer<typeof CreateOpportunityLinkRequestSchema>;
|
|
509
|
+
export declare const UpdateOpportunityLinkRequestSchema: z.ZodObject<{
|
|
510
|
+
syncStatus: z.ZodBoolean;
|
|
511
|
+
}, z.core.$strip>;
|
|
512
|
+
export type UpdateOpportunityLinkRequest = z.infer<typeof UpdateOpportunityLinkRequestSchema>;
|
|
513
|
+
/**
|
|
514
|
+
* A linked document. `number`, `status`, `total` and `currency` are present
|
|
515
|
+
* only when `available` — a document the reader may not see, or whose owning
|
|
516
|
+
* module is switched off, renders as unavailable.
|
|
517
|
+
*/
|
|
518
|
+
export declare const OpportunityLinkSchema: z.ZodObject<{
|
|
519
|
+
id: z.ZodString;
|
|
520
|
+
documentKind: z.ZodEnum<{
|
|
521
|
+
order: "order";
|
|
522
|
+
quote_request: "quote_request";
|
|
523
|
+
}>;
|
|
524
|
+
documentId: z.ZodString;
|
|
525
|
+
available: z.ZodBoolean;
|
|
526
|
+
number: z.ZodOptional<z.ZodString>;
|
|
527
|
+
status: z.ZodOptional<z.ZodString>;
|
|
528
|
+
total: z.ZodOptional<z.ZodString>;
|
|
529
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
530
|
+
syncStatus: z.ZodBoolean;
|
|
531
|
+
linkSource: z.ZodEnum<{
|
|
532
|
+
manual: "manual";
|
|
533
|
+
auto: "auto";
|
|
534
|
+
created_from_opportunity: "created_from_opportunity";
|
|
535
|
+
quote_conversion: "quote_conversion";
|
|
536
|
+
}>;
|
|
537
|
+
createdAt: z.ZodString;
|
|
538
|
+
}, z.core.$strip>;
|
|
539
|
+
export type OpportunityLink = z.infer<typeof OpportunityLinkSchema>;
|
|
540
|
+
export declare const TransitionOpportunityRequestSchema: z.ZodObject<{
|
|
541
|
+
to: z.ZodString;
|
|
542
|
+
reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
543
|
+
}, z.core.$strip>;
|
|
544
|
+
export type TransitionOpportunityRequest = z.infer<typeof TransitionOpportunityRequestSchema>;
|
|
545
|
+
export declare const PropagationOutcomeSchema: z.ZodObject<{
|
|
546
|
+
id: z.ZodString;
|
|
547
|
+
orderId: z.ZodString;
|
|
548
|
+
orderNumber: z.ZodNullable<z.ZodString>;
|
|
549
|
+
direction: z.ZodEnum<{
|
|
550
|
+
opportunity_to_order: "opportunity_to_order";
|
|
551
|
+
order_to_opportunity: "order_to_opportunity";
|
|
552
|
+
}>;
|
|
553
|
+
orderStatusCode: z.ZodString;
|
|
554
|
+
outcome: z.ZodEnum<{
|
|
555
|
+
failed: "failed";
|
|
556
|
+
skipped: "skipped";
|
|
557
|
+
not_found: "not_found";
|
|
558
|
+
applied: "applied";
|
|
559
|
+
already_there: "already_there";
|
|
560
|
+
unknown_status: "unknown_status";
|
|
561
|
+
not_permitted: "not_permitted";
|
|
562
|
+
vetoed: "vetoed";
|
|
563
|
+
}>;
|
|
564
|
+
detail: z.ZodNullable<z.ZodString>;
|
|
565
|
+
createdAt: z.ZodString;
|
|
566
|
+
}, z.core.$strip>;
|
|
567
|
+
export type PropagationOutcome = z.infer<typeof PropagationOutcomeSchema>;
|
|
568
|
+
export declare const OpportunityExcludedDocumentSchema: z.ZodObject<{
|
|
569
|
+
kind: z.ZodEnum<{
|
|
570
|
+
order: "order";
|
|
571
|
+
quote_request: "quote_request";
|
|
572
|
+
}>;
|
|
573
|
+
id: z.ZodString;
|
|
574
|
+
reason: z.ZodString;
|
|
575
|
+
}, z.core.$strip>;
|
|
576
|
+
export type OpportunityExcludedDocument = z.infer<typeof OpportunityExcludedDocumentSchema>;
|
|
577
|
+
export declare const OpportunityDetailSchema: z.ZodObject<{
|
|
578
|
+
id: z.ZodString;
|
|
579
|
+
number: z.ZodString;
|
|
580
|
+
title: z.ZodString;
|
|
581
|
+
organization: z.ZodObject<{
|
|
582
|
+
id: z.ZodString;
|
|
583
|
+
name: z.ZodString;
|
|
584
|
+
}, z.core.$strip>;
|
|
585
|
+
status: z.ZodObject<{
|
|
586
|
+
code: z.ZodString;
|
|
587
|
+
name: z.ZodString;
|
|
588
|
+
color: z.ZodString;
|
|
589
|
+
kind: z.ZodEnum<{
|
|
590
|
+
open: "open";
|
|
591
|
+
won: "won";
|
|
592
|
+
lost: "lost";
|
|
593
|
+
}>;
|
|
594
|
+
}, z.core.$strip>;
|
|
595
|
+
assignee: z.ZodNullable<z.ZodObject<{
|
|
596
|
+
id: z.ZodString;
|
|
597
|
+
name: z.ZodString;
|
|
598
|
+
active: z.ZodBoolean;
|
|
599
|
+
}, z.core.$strip>>;
|
|
600
|
+
value: z.ZodNullable<z.ZodString>;
|
|
601
|
+
valueMode: z.ZodEnum<{
|
|
602
|
+
manual: "manual";
|
|
603
|
+
computed: "computed";
|
|
604
|
+
}>;
|
|
605
|
+
currency: z.ZodString;
|
|
606
|
+
salesChannelId: z.ZodNullable<z.ZodString>;
|
|
607
|
+
expectedCloseDate: z.ZodNullable<z.ZodString>;
|
|
608
|
+
tags: z.ZodArray<z.ZodObject<{
|
|
609
|
+
id: z.ZodString;
|
|
610
|
+
name: z.ZodString;
|
|
611
|
+
color: z.ZodString;
|
|
612
|
+
}, z.core.$strip>>;
|
|
613
|
+
closedAt: z.ZodNullable<z.ZodString>;
|
|
614
|
+
closedKind: z.ZodNullable<z.ZodEnum<{
|
|
615
|
+
won: "won";
|
|
616
|
+
lost: "lost";
|
|
617
|
+
}>>;
|
|
618
|
+
createdAt: z.ZodString;
|
|
619
|
+
updatedAt: z.ZodString;
|
|
620
|
+
cardValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
621
|
+
description: z.ZodNullable<z.ZodString>;
|
|
622
|
+
references: z.ZodArray<z.ZodObject<{
|
|
623
|
+
type: z.ZodEnum<{
|
|
624
|
+
order: "order";
|
|
625
|
+
admin_user: "admin_user";
|
|
626
|
+
product: "product";
|
|
627
|
+
}>;
|
|
628
|
+
id: z.ZodString;
|
|
629
|
+
available: z.ZodBoolean;
|
|
630
|
+
label: z.ZodNullable<z.ZodString>;
|
|
631
|
+
url: z.ZodNullable<z.ZodString>;
|
|
632
|
+
}, z.core.$strip>>;
|
|
633
|
+
customerAccount: z.ZodNullable<z.ZodObject<{
|
|
634
|
+
id: z.ZodString;
|
|
635
|
+
name: z.ZodString;
|
|
636
|
+
email: z.ZodString;
|
|
637
|
+
}, z.core.$strip>>;
|
|
638
|
+
manualValue: z.ZodNullable<z.ZodString>;
|
|
639
|
+
computedValue: z.ZodString;
|
|
640
|
+
excludedDocuments: z.ZodArray<z.ZodObject<{
|
|
641
|
+
kind: z.ZodEnum<{
|
|
642
|
+
order: "order";
|
|
643
|
+
quote_request: "quote_request";
|
|
644
|
+
}>;
|
|
645
|
+
id: z.ZodString;
|
|
646
|
+
reason: z.ZodString;
|
|
647
|
+
}, z.core.$strip>>;
|
|
648
|
+
source: z.ZodEnum<{
|
|
649
|
+
order: "order";
|
|
650
|
+
quote_request: "quote_request";
|
|
651
|
+
manual: "manual";
|
|
652
|
+
}>;
|
|
653
|
+
version: z.ZodNumber;
|
|
654
|
+
allowedTransitions: z.ZodArray<z.ZodObject<{
|
|
655
|
+
code: z.ZodString;
|
|
656
|
+
name: z.ZodString;
|
|
657
|
+
color: z.ZodString;
|
|
658
|
+
kind: z.ZodEnum<{
|
|
659
|
+
open: "open";
|
|
660
|
+
won: "won";
|
|
661
|
+
lost: "lost";
|
|
662
|
+
}>;
|
|
663
|
+
}, z.core.$strip>>;
|
|
664
|
+
links: z.ZodArray<z.ZodObject<{
|
|
665
|
+
id: z.ZodString;
|
|
666
|
+
documentKind: z.ZodEnum<{
|
|
667
|
+
order: "order";
|
|
668
|
+
quote_request: "quote_request";
|
|
669
|
+
}>;
|
|
670
|
+
documentId: z.ZodString;
|
|
671
|
+
available: z.ZodBoolean;
|
|
672
|
+
number: z.ZodOptional<z.ZodString>;
|
|
673
|
+
status: z.ZodOptional<z.ZodString>;
|
|
674
|
+
total: z.ZodOptional<z.ZodString>;
|
|
675
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
676
|
+
syncStatus: z.ZodBoolean;
|
|
677
|
+
linkSource: z.ZodEnum<{
|
|
678
|
+
manual: "manual";
|
|
679
|
+
auto: "auto";
|
|
680
|
+
created_from_opportunity: "created_from_opportunity";
|
|
681
|
+
quote_conversion: "quote_conversion";
|
|
682
|
+
}>;
|
|
683
|
+
createdAt: z.ZodString;
|
|
684
|
+
}, z.core.$strip>>;
|
|
685
|
+
unresolvedPropagations: z.ZodArray<z.ZodObject<{
|
|
686
|
+
id: z.ZodString;
|
|
687
|
+
orderId: z.ZodString;
|
|
688
|
+
orderNumber: z.ZodNullable<z.ZodString>;
|
|
689
|
+
direction: z.ZodEnum<{
|
|
690
|
+
opportunity_to_order: "opportunity_to_order";
|
|
691
|
+
order_to_opportunity: "order_to_opportunity";
|
|
692
|
+
}>;
|
|
693
|
+
orderStatusCode: z.ZodString;
|
|
694
|
+
outcome: z.ZodEnum<{
|
|
695
|
+
failed: "failed";
|
|
696
|
+
skipped: "skipped";
|
|
697
|
+
not_found: "not_found";
|
|
698
|
+
applied: "applied";
|
|
699
|
+
already_there: "already_there";
|
|
700
|
+
unknown_status: "unknown_status";
|
|
701
|
+
not_permitted: "not_permitted";
|
|
702
|
+
vetoed: "vetoed";
|
|
703
|
+
}>;
|
|
704
|
+
detail: z.ZodNullable<z.ZodString>;
|
|
705
|
+
createdAt: z.ZodString;
|
|
706
|
+
}, z.core.$strip>>;
|
|
707
|
+
customFieldValues: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
708
|
+
upcomingEventCount: z.ZodNumber;
|
|
709
|
+
}, z.core.$strip>;
|
|
710
|
+
export type OpportunityDetail = z.infer<typeof OpportunityDetailSchema>;
|
|
711
|
+
export declare const OpportunityTransitionResultSchema: z.ZodObject<{
|
|
712
|
+
opportunity: z.ZodObject<{
|
|
713
|
+
id: z.ZodString;
|
|
714
|
+
number: z.ZodString;
|
|
715
|
+
title: z.ZodString;
|
|
716
|
+
organization: z.ZodObject<{
|
|
717
|
+
id: z.ZodString;
|
|
718
|
+
name: z.ZodString;
|
|
719
|
+
}, z.core.$strip>;
|
|
720
|
+
status: z.ZodObject<{
|
|
721
|
+
code: z.ZodString;
|
|
722
|
+
name: z.ZodString;
|
|
723
|
+
color: z.ZodString;
|
|
724
|
+
kind: z.ZodEnum<{
|
|
725
|
+
open: "open";
|
|
726
|
+
won: "won";
|
|
727
|
+
lost: "lost";
|
|
728
|
+
}>;
|
|
729
|
+
}, z.core.$strip>;
|
|
730
|
+
assignee: z.ZodNullable<z.ZodObject<{
|
|
731
|
+
id: z.ZodString;
|
|
732
|
+
name: z.ZodString;
|
|
733
|
+
active: z.ZodBoolean;
|
|
734
|
+
}, z.core.$strip>>;
|
|
735
|
+
value: z.ZodNullable<z.ZodString>;
|
|
736
|
+
valueMode: z.ZodEnum<{
|
|
737
|
+
manual: "manual";
|
|
738
|
+
computed: "computed";
|
|
739
|
+
}>;
|
|
740
|
+
currency: z.ZodString;
|
|
741
|
+
salesChannelId: z.ZodNullable<z.ZodString>;
|
|
742
|
+
expectedCloseDate: z.ZodNullable<z.ZodString>;
|
|
743
|
+
tags: z.ZodArray<z.ZodObject<{
|
|
744
|
+
id: z.ZodString;
|
|
745
|
+
name: z.ZodString;
|
|
746
|
+
color: z.ZodString;
|
|
747
|
+
}, z.core.$strip>>;
|
|
748
|
+
closedAt: z.ZodNullable<z.ZodString>;
|
|
749
|
+
closedKind: z.ZodNullable<z.ZodEnum<{
|
|
750
|
+
won: "won";
|
|
751
|
+
lost: "lost";
|
|
752
|
+
}>>;
|
|
753
|
+
createdAt: z.ZodString;
|
|
754
|
+
updatedAt: z.ZodString;
|
|
755
|
+
cardValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
756
|
+
description: z.ZodNullable<z.ZodString>;
|
|
757
|
+
references: z.ZodArray<z.ZodObject<{
|
|
758
|
+
type: z.ZodEnum<{
|
|
759
|
+
order: "order";
|
|
760
|
+
admin_user: "admin_user";
|
|
761
|
+
product: "product";
|
|
762
|
+
}>;
|
|
763
|
+
id: z.ZodString;
|
|
764
|
+
available: z.ZodBoolean;
|
|
765
|
+
label: z.ZodNullable<z.ZodString>;
|
|
766
|
+
url: z.ZodNullable<z.ZodString>;
|
|
767
|
+
}, z.core.$strip>>;
|
|
768
|
+
customerAccount: z.ZodNullable<z.ZodObject<{
|
|
769
|
+
id: z.ZodString;
|
|
770
|
+
name: z.ZodString;
|
|
771
|
+
email: z.ZodString;
|
|
772
|
+
}, z.core.$strip>>;
|
|
773
|
+
manualValue: z.ZodNullable<z.ZodString>;
|
|
774
|
+
computedValue: z.ZodString;
|
|
775
|
+
excludedDocuments: z.ZodArray<z.ZodObject<{
|
|
776
|
+
kind: z.ZodEnum<{
|
|
777
|
+
order: "order";
|
|
778
|
+
quote_request: "quote_request";
|
|
779
|
+
}>;
|
|
780
|
+
id: z.ZodString;
|
|
781
|
+
reason: z.ZodString;
|
|
782
|
+
}, z.core.$strip>>;
|
|
783
|
+
source: z.ZodEnum<{
|
|
784
|
+
order: "order";
|
|
785
|
+
quote_request: "quote_request";
|
|
786
|
+
manual: "manual";
|
|
787
|
+
}>;
|
|
788
|
+
version: z.ZodNumber;
|
|
789
|
+
allowedTransitions: z.ZodArray<z.ZodObject<{
|
|
790
|
+
code: z.ZodString;
|
|
791
|
+
name: z.ZodString;
|
|
792
|
+
color: z.ZodString;
|
|
793
|
+
kind: z.ZodEnum<{
|
|
794
|
+
open: "open";
|
|
795
|
+
won: "won";
|
|
796
|
+
lost: "lost";
|
|
797
|
+
}>;
|
|
798
|
+
}, z.core.$strip>>;
|
|
799
|
+
links: z.ZodArray<z.ZodObject<{
|
|
800
|
+
id: z.ZodString;
|
|
801
|
+
documentKind: z.ZodEnum<{
|
|
802
|
+
order: "order";
|
|
803
|
+
quote_request: "quote_request";
|
|
804
|
+
}>;
|
|
805
|
+
documentId: z.ZodString;
|
|
806
|
+
available: z.ZodBoolean;
|
|
807
|
+
number: z.ZodOptional<z.ZodString>;
|
|
808
|
+
status: z.ZodOptional<z.ZodString>;
|
|
809
|
+
total: z.ZodOptional<z.ZodString>;
|
|
810
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
811
|
+
syncStatus: z.ZodBoolean;
|
|
812
|
+
linkSource: z.ZodEnum<{
|
|
813
|
+
manual: "manual";
|
|
814
|
+
auto: "auto";
|
|
815
|
+
created_from_opportunity: "created_from_opportunity";
|
|
816
|
+
quote_conversion: "quote_conversion";
|
|
817
|
+
}>;
|
|
818
|
+
createdAt: z.ZodString;
|
|
819
|
+
}, z.core.$strip>>;
|
|
820
|
+
unresolvedPropagations: z.ZodArray<z.ZodObject<{
|
|
821
|
+
id: z.ZodString;
|
|
822
|
+
orderId: z.ZodString;
|
|
823
|
+
orderNumber: z.ZodNullable<z.ZodString>;
|
|
824
|
+
direction: z.ZodEnum<{
|
|
825
|
+
opportunity_to_order: "opportunity_to_order";
|
|
826
|
+
order_to_opportunity: "order_to_opportunity";
|
|
827
|
+
}>;
|
|
828
|
+
orderStatusCode: z.ZodString;
|
|
829
|
+
outcome: z.ZodEnum<{
|
|
830
|
+
failed: "failed";
|
|
831
|
+
skipped: "skipped";
|
|
832
|
+
not_found: "not_found";
|
|
833
|
+
applied: "applied";
|
|
834
|
+
already_there: "already_there";
|
|
835
|
+
unknown_status: "unknown_status";
|
|
836
|
+
not_permitted: "not_permitted";
|
|
837
|
+
vetoed: "vetoed";
|
|
838
|
+
}>;
|
|
839
|
+
detail: z.ZodNullable<z.ZodString>;
|
|
840
|
+
createdAt: z.ZodString;
|
|
841
|
+
}, z.core.$strip>>;
|
|
842
|
+
customFieldValues: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
843
|
+
upcomingEventCount: z.ZodNumber;
|
|
844
|
+
}, z.core.$strip>;
|
|
845
|
+
from: z.ZodString;
|
|
846
|
+
to: z.ZodString;
|
|
847
|
+
propagation: z.ZodArray<z.ZodObject<{
|
|
848
|
+
id: z.ZodString;
|
|
849
|
+
orderId: z.ZodString;
|
|
850
|
+
orderNumber: z.ZodNullable<z.ZodString>;
|
|
851
|
+
direction: z.ZodEnum<{
|
|
852
|
+
opportunity_to_order: "opportunity_to_order";
|
|
853
|
+
order_to_opportunity: "order_to_opportunity";
|
|
854
|
+
}>;
|
|
855
|
+
orderStatusCode: z.ZodString;
|
|
856
|
+
outcome: z.ZodEnum<{
|
|
857
|
+
failed: "failed";
|
|
858
|
+
skipped: "skipped";
|
|
859
|
+
not_found: "not_found";
|
|
860
|
+
applied: "applied";
|
|
861
|
+
already_there: "already_there";
|
|
862
|
+
unknown_status: "unknown_status";
|
|
863
|
+
not_permitted: "not_permitted";
|
|
864
|
+
vetoed: "vetoed";
|
|
865
|
+
}>;
|
|
866
|
+
detail: z.ZodNullable<z.ZodString>;
|
|
867
|
+
createdAt: z.ZodString;
|
|
868
|
+
}, z.core.$strip>>;
|
|
869
|
+
}, z.core.$strip>;
|
|
870
|
+
export type OpportunityTransitionResult = z.infer<typeof OpportunityTransitionResultSchema>;
|
|
871
|
+
export declare const OpportunityListResponseSchema: z.ZodObject<{
|
|
872
|
+
data: z.ZodArray<z.ZodObject<{
|
|
873
|
+
id: z.ZodString;
|
|
874
|
+
number: z.ZodString;
|
|
875
|
+
title: z.ZodString;
|
|
876
|
+
organization: z.ZodObject<{
|
|
877
|
+
id: z.ZodString;
|
|
878
|
+
name: z.ZodString;
|
|
879
|
+
}, z.core.$strip>;
|
|
880
|
+
status: z.ZodObject<{
|
|
881
|
+
code: z.ZodString;
|
|
882
|
+
name: z.ZodString;
|
|
883
|
+
color: z.ZodString;
|
|
884
|
+
kind: z.ZodEnum<{
|
|
885
|
+
open: "open";
|
|
886
|
+
won: "won";
|
|
887
|
+
lost: "lost";
|
|
888
|
+
}>;
|
|
889
|
+
}, z.core.$strip>;
|
|
890
|
+
assignee: z.ZodNullable<z.ZodObject<{
|
|
891
|
+
id: z.ZodString;
|
|
892
|
+
name: z.ZodString;
|
|
893
|
+
active: z.ZodBoolean;
|
|
894
|
+
}, z.core.$strip>>;
|
|
895
|
+
value: z.ZodNullable<z.ZodString>;
|
|
896
|
+
valueMode: z.ZodEnum<{
|
|
897
|
+
manual: "manual";
|
|
898
|
+
computed: "computed";
|
|
899
|
+
}>;
|
|
900
|
+
currency: z.ZodString;
|
|
901
|
+
salesChannelId: z.ZodNullable<z.ZodString>;
|
|
902
|
+
expectedCloseDate: z.ZodNullable<z.ZodString>;
|
|
903
|
+
tags: z.ZodArray<z.ZodObject<{
|
|
904
|
+
id: z.ZodString;
|
|
905
|
+
name: z.ZodString;
|
|
906
|
+
color: z.ZodString;
|
|
907
|
+
}, z.core.$strip>>;
|
|
908
|
+
closedAt: z.ZodNullable<z.ZodString>;
|
|
909
|
+
closedKind: z.ZodNullable<z.ZodEnum<{
|
|
910
|
+
won: "won";
|
|
911
|
+
lost: "lost";
|
|
912
|
+
}>>;
|
|
913
|
+
createdAt: z.ZodString;
|
|
914
|
+
updatedAt: z.ZodString;
|
|
915
|
+
cardValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
916
|
+
}, z.core.$strip>>;
|
|
917
|
+
pagination: z.ZodObject<{
|
|
918
|
+
cursor: z.ZodNullable<z.ZodString>;
|
|
919
|
+
hasMore: z.ZodBoolean;
|
|
920
|
+
limit: z.ZodNumber;
|
|
921
|
+
}, z.core.$strip>;
|
|
922
|
+
}, z.core.$strip>;
|
|
923
|
+
export declare const OpportunityOfDocumentResponseSchema: z.ZodObject<{
|
|
924
|
+
data: z.ZodNullable<z.ZodObject<{
|
|
925
|
+
id: z.ZodString;
|
|
926
|
+
number: z.ZodString;
|
|
927
|
+
title: z.ZodString;
|
|
928
|
+
organization: z.ZodObject<{
|
|
929
|
+
id: z.ZodString;
|
|
930
|
+
name: z.ZodString;
|
|
931
|
+
}, z.core.$strip>;
|
|
932
|
+
status: z.ZodObject<{
|
|
933
|
+
code: z.ZodString;
|
|
934
|
+
name: z.ZodString;
|
|
935
|
+
color: z.ZodString;
|
|
936
|
+
kind: z.ZodEnum<{
|
|
937
|
+
open: "open";
|
|
938
|
+
won: "won";
|
|
939
|
+
lost: "lost";
|
|
940
|
+
}>;
|
|
941
|
+
}, z.core.$strip>;
|
|
942
|
+
assignee: z.ZodNullable<z.ZodObject<{
|
|
943
|
+
id: z.ZodString;
|
|
944
|
+
name: z.ZodString;
|
|
945
|
+
active: z.ZodBoolean;
|
|
946
|
+
}, z.core.$strip>>;
|
|
947
|
+
value: z.ZodNullable<z.ZodString>;
|
|
948
|
+
valueMode: z.ZodEnum<{
|
|
949
|
+
manual: "manual";
|
|
950
|
+
computed: "computed";
|
|
951
|
+
}>;
|
|
952
|
+
currency: z.ZodString;
|
|
953
|
+
salesChannelId: z.ZodNullable<z.ZodString>;
|
|
954
|
+
expectedCloseDate: z.ZodNullable<z.ZodString>;
|
|
955
|
+
tags: z.ZodArray<z.ZodObject<{
|
|
956
|
+
id: z.ZodString;
|
|
957
|
+
name: z.ZodString;
|
|
958
|
+
color: z.ZodString;
|
|
959
|
+
}, z.core.$strip>>;
|
|
960
|
+
closedAt: z.ZodNullable<z.ZodString>;
|
|
961
|
+
closedKind: z.ZodNullable<z.ZodEnum<{
|
|
962
|
+
won: "won";
|
|
963
|
+
lost: "lost";
|
|
964
|
+
}>>;
|
|
965
|
+
createdAt: z.ZodString;
|
|
966
|
+
updatedAt: z.ZodString;
|
|
967
|
+
cardValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
968
|
+
}, z.core.$strip>>;
|
|
969
|
+
}, z.core.$strip>;
|
|
970
|
+
export declare const OpportunityDetailResponseSchema: z.ZodObject<{
|
|
971
|
+
data: z.ZodObject<{
|
|
972
|
+
id: z.ZodString;
|
|
973
|
+
number: z.ZodString;
|
|
974
|
+
title: z.ZodString;
|
|
975
|
+
organization: z.ZodObject<{
|
|
976
|
+
id: z.ZodString;
|
|
977
|
+
name: z.ZodString;
|
|
978
|
+
}, z.core.$strip>;
|
|
979
|
+
status: z.ZodObject<{
|
|
980
|
+
code: z.ZodString;
|
|
981
|
+
name: z.ZodString;
|
|
982
|
+
color: z.ZodString;
|
|
983
|
+
kind: z.ZodEnum<{
|
|
984
|
+
open: "open";
|
|
985
|
+
won: "won";
|
|
986
|
+
lost: "lost";
|
|
987
|
+
}>;
|
|
988
|
+
}, z.core.$strip>;
|
|
989
|
+
assignee: z.ZodNullable<z.ZodObject<{
|
|
990
|
+
id: z.ZodString;
|
|
991
|
+
name: z.ZodString;
|
|
992
|
+
active: z.ZodBoolean;
|
|
993
|
+
}, z.core.$strip>>;
|
|
994
|
+
value: z.ZodNullable<z.ZodString>;
|
|
995
|
+
valueMode: z.ZodEnum<{
|
|
996
|
+
manual: "manual";
|
|
997
|
+
computed: "computed";
|
|
998
|
+
}>;
|
|
999
|
+
currency: z.ZodString;
|
|
1000
|
+
salesChannelId: z.ZodNullable<z.ZodString>;
|
|
1001
|
+
expectedCloseDate: z.ZodNullable<z.ZodString>;
|
|
1002
|
+
tags: z.ZodArray<z.ZodObject<{
|
|
1003
|
+
id: z.ZodString;
|
|
1004
|
+
name: z.ZodString;
|
|
1005
|
+
color: z.ZodString;
|
|
1006
|
+
}, z.core.$strip>>;
|
|
1007
|
+
closedAt: z.ZodNullable<z.ZodString>;
|
|
1008
|
+
closedKind: z.ZodNullable<z.ZodEnum<{
|
|
1009
|
+
won: "won";
|
|
1010
|
+
lost: "lost";
|
|
1011
|
+
}>>;
|
|
1012
|
+
createdAt: z.ZodString;
|
|
1013
|
+
updatedAt: z.ZodString;
|
|
1014
|
+
cardValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1015
|
+
description: z.ZodNullable<z.ZodString>;
|
|
1016
|
+
references: z.ZodArray<z.ZodObject<{
|
|
1017
|
+
type: z.ZodEnum<{
|
|
1018
|
+
order: "order";
|
|
1019
|
+
admin_user: "admin_user";
|
|
1020
|
+
product: "product";
|
|
1021
|
+
}>;
|
|
1022
|
+
id: z.ZodString;
|
|
1023
|
+
available: z.ZodBoolean;
|
|
1024
|
+
label: z.ZodNullable<z.ZodString>;
|
|
1025
|
+
url: z.ZodNullable<z.ZodString>;
|
|
1026
|
+
}, z.core.$strip>>;
|
|
1027
|
+
customerAccount: z.ZodNullable<z.ZodObject<{
|
|
1028
|
+
id: z.ZodString;
|
|
1029
|
+
name: z.ZodString;
|
|
1030
|
+
email: z.ZodString;
|
|
1031
|
+
}, z.core.$strip>>;
|
|
1032
|
+
manualValue: z.ZodNullable<z.ZodString>;
|
|
1033
|
+
computedValue: z.ZodString;
|
|
1034
|
+
excludedDocuments: z.ZodArray<z.ZodObject<{
|
|
1035
|
+
kind: z.ZodEnum<{
|
|
1036
|
+
order: "order";
|
|
1037
|
+
quote_request: "quote_request";
|
|
1038
|
+
}>;
|
|
1039
|
+
id: z.ZodString;
|
|
1040
|
+
reason: z.ZodString;
|
|
1041
|
+
}, z.core.$strip>>;
|
|
1042
|
+
source: z.ZodEnum<{
|
|
1043
|
+
order: "order";
|
|
1044
|
+
quote_request: "quote_request";
|
|
1045
|
+
manual: "manual";
|
|
1046
|
+
}>;
|
|
1047
|
+
version: z.ZodNumber;
|
|
1048
|
+
allowedTransitions: z.ZodArray<z.ZodObject<{
|
|
1049
|
+
code: z.ZodString;
|
|
1050
|
+
name: z.ZodString;
|
|
1051
|
+
color: z.ZodString;
|
|
1052
|
+
kind: z.ZodEnum<{
|
|
1053
|
+
open: "open";
|
|
1054
|
+
won: "won";
|
|
1055
|
+
lost: "lost";
|
|
1056
|
+
}>;
|
|
1057
|
+
}, z.core.$strip>>;
|
|
1058
|
+
links: z.ZodArray<z.ZodObject<{
|
|
1059
|
+
id: z.ZodString;
|
|
1060
|
+
documentKind: z.ZodEnum<{
|
|
1061
|
+
order: "order";
|
|
1062
|
+
quote_request: "quote_request";
|
|
1063
|
+
}>;
|
|
1064
|
+
documentId: z.ZodString;
|
|
1065
|
+
available: z.ZodBoolean;
|
|
1066
|
+
number: z.ZodOptional<z.ZodString>;
|
|
1067
|
+
status: z.ZodOptional<z.ZodString>;
|
|
1068
|
+
total: z.ZodOptional<z.ZodString>;
|
|
1069
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
1070
|
+
syncStatus: z.ZodBoolean;
|
|
1071
|
+
linkSource: z.ZodEnum<{
|
|
1072
|
+
manual: "manual";
|
|
1073
|
+
auto: "auto";
|
|
1074
|
+
created_from_opportunity: "created_from_opportunity";
|
|
1075
|
+
quote_conversion: "quote_conversion";
|
|
1076
|
+
}>;
|
|
1077
|
+
createdAt: z.ZodString;
|
|
1078
|
+
}, z.core.$strip>>;
|
|
1079
|
+
unresolvedPropagations: z.ZodArray<z.ZodObject<{
|
|
1080
|
+
id: z.ZodString;
|
|
1081
|
+
orderId: z.ZodString;
|
|
1082
|
+
orderNumber: z.ZodNullable<z.ZodString>;
|
|
1083
|
+
direction: z.ZodEnum<{
|
|
1084
|
+
opportunity_to_order: "opportunity_to_order";
|
|
1085
|
+
order_to_opportunity: "order_to_opportunity";
|
|
1086
|
+
}>;
|
|
1087
|
+
orderStatusCode: z.ZodString;
|
|
1088
|
+
outcome: z.ZodEnum<{
|
|
1089
|
+
failed: "failed";
|
|
1090
|
+
skipped: "skipped";
|
|
1091
|
+
not_found: "not_found";
|
|
1092
|
+
applied: "applied";
|
|
1093
|
+
already_there: "already_there";
|
|
1094
|
+
unknown_status: "unknown_status";
|
|
1095
|
+
not_permitted: "not_permitted";
|
|
1096
|
+
vetoed: "vetoed";
|
|
1097
|
+
}>;
|
|
1098
|
+
detail: z.ZodNullable<z.ZodString>;
|
|
1099
|
+
createdAt: z.ZodString;
|
|
1100
|
+
}, z.core.$strip>>;
|
|
1101
|
+
customFieldValues: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1102
|
+
upcomingEventCount: z.ZodNumber;
|
|
1103
|
+
}, z.core.$strip>;
|
|
1104
|
+
}, z.core.$strip>;
|
|
1105
|
+
export declare const OpportunityLinkResponseSchema: z.ZodObject<{
|
|
1106
|
+
data: z.ZodObject<{
|
|
1107
|
+
id: z.ZodString;
|
|
1108
|
+
documentKind: z.ZodEnum<{
|
|
1109
|
+
order: "order";
|
|
1110
|
+
quote_request: "quote_request";
|
|
1111
|
+
}>;
|
|
1112
|
+
documentId: z.ZodString;
|
|
1113
|
+
available: z.ZodBoolean;
|
|
1114
|
+
number: z.ZodOptional<z.ZodString>;
|
|
1115
|
+
status: z.ZodOptional<z.ZodString>;
|
|
1116
|
+
total: z.ZodOptional<z.ZodString>;
|
|
1117
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
1118
|
+
syncStatus: z.ZodBoolean;
|
|
1119
|
+
linkSource: z.ZodEnum<{
|
|
1120
|
+
manual: "manual";
|
|
1121
|
+
auto: "auto";
|
|
1122
|
+
created_from_opportunity: "created_from_opportunity";
|
|
1123
|
+
quote_conversion: "quote_conversion";
|
|
1124
|
+
}>;
|
|
1125
|
+
createdAt: z.ZodString;
|
|
1126
|
+
}, z.core.$strip>;
|
|
1127
|
+
}, z.core.$strip>;
|
|
1128
|
+
export declare const OpportunityTransitionResponseSchema: z.ZodObject<{
|
|
1129
|
+
data: z.ZodObject<{
|
|
1130
|
+
opportunity: z.ZodObject<{
|
|
1131
|
+
id: z.ZodString;
|
|
1132
|
+
number: z.ZodString;
|
|
1133
|
+
title: z.ZodString;
|
|
1134
|
+
organization: z.ZodObject<{
|
|
1135
|
+
id: z.ZodString;
|
|
1136
|
+
name: z.ZodString;
|
|
1137
|
+
}, z.core.$strip>;
|
|
1138
|
+
status: z.ZodObject<{
|
|
1139
|
+
code: z.ZodString;
|
|
1140
|
+
name: z.ZodString;
|
|
1141
|
+
color: z.ZodString;
|
|
1142
|
+
kind: z.ZodEnum<{
|
|
1143
|
+
open: "open";
|
|
1144
|
+
won: "won";
|
|
1145
|
+
lost: "lost";
|
|
1146
|
+
}>;
|
|
1147
|
+
}, z.core.$strip>;
|
|
1148
|
+
assignee: z.ZodNullable<z.ZodObject<{
|
|
1149
|
+
id: z.ZodString;
|
|
1150
|
+
name: z.ZodString;
|
|
1151
|
+
active: z.ZodBoolean;
|
|
1152
|
+
}, z.core.$strip>>;
|
|
1153
|
+
value: z.ZodNullable<z.ZodString>;
|
|
1154
|
+
valueMode: z.ZodEnum<{
|
|
1155
|
+
manual: "manual";
|
|
1156
|
+
computed: "computed";
|
|
1157
|
+
}>;
|
|
1158
|
+
currency: z.ZodString;
|
|
1159
|
+
salesChannelId: z.ZodNullable<z.ZodString>;
|
|
1160
|
+
expectedCloseDate: z.ZodNullable<z.ZodString>;
|
|
1161
|
+
tags: z.ZodArray<z.ZodObject<{
|
|
1162
|
+
id: z.ZodString;
|
|
1163
|
+
name: z.ZodString;
|
|
1164
|
+
color: z.ZodString;
|
|
1165
|
+
}, z.core.$strip>>;
|
|
1166
|
+
closedAt: z.ZodNullable<z.ZodString>;
|
|
1167
|
+
closedKind: z.ZodNullable<z.ZodEnum<{
|
|
1168
|
+
won: "won";
|
|
1169
|
+
lost: "lost";
|
|
1170
|
+
}>>;
|
|
1171
|
+
createdAt: z.ZodString;
|
|
1172
|
+
updatedAt: z.ZodString;
|
|
1173
|
+
cardValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1174
|
+
description: z.ZodNullable<z.ZodString>;
|
|
1175
|
+
references: z.ZodArray<z.ZodObject<{
|
|
1176
|
+
type: z.ZodEnum<{
|
|
1177
|
+
order: "order";
|
|
1178
|
+
admin_user: "admin_user";
|
|
1179
|
+
product: "product";
|
|
1180
|
+
}>;
|
|
1181
|
+
id: z.ZodString;
|
|
1182
|
+
available: z.ZodBoolean;
|
|
1183
|
+
label: z.ZodNullable<z.ZodString>;
|
|
1184
|
+
url: z.ZodNullable<z.ZodString>;
|
|
1185
|
+
}, z.core.$strip>>;
|
|
1186
|
+
customerAccount: z.ZodNullable<z.ZodObject<{
|
|
1187
|
+
id: z.ZodString;
|
|
1188
|
+
name: z.ZodString;
|
|
1189
|
+
email: z.ZodString;
|
|
1190
|
+
}, z.core.$strip>>;
|
|
1191
|
+
manualValue: z.ZodNullable<z.ZodString>;
|
|
1192
|
+
computedValue: z.ZodString;
|
|
1193
|
+
excludedDocuments: z.ZodArray<z.ZodObject<{
|
|
1194
|
+
kind: z.ZodEnum<{
|
|
1195
|
+
order: "order";
|
|
1196
|
+
quote_request: "quote_request";
|
|
1197
|
+
}>;
|
|
1198
|
+
id: z.ZodString;
|
|
1199
|
+
reason: z.ZodString;
|
|
1200
|
+
}, z.core.$strip>>;
|
|
1201
|
+
source: z.ZodEnum<{
|
|
1202
|
+
order: "order";
|
|
1203
|
+
quote_request: "quote_request";
|
|
1204
|
+
manual: "manual";
|
|
1205
|
+
}>;
|
|
1206
|
+
version: z.ZodNumber;
|
|
1207
|
+
allowedTransitions: z.ZodArray<z.ZodObject<{
|
|
1208
|
+
code: z.ZodString;
|
|
1209
|
+
name: z.ZodString;
|
|
1210
|
+
color: z.ZodString;
|
|
1211
|
+
kind: z.ZodEnum<{
|
|
1212
|
+
open: "open";
|
|
1213
|
+
won: "won";
|
|
1214
|
+
lost: "lost";
|
|
1215
|
+
}>;
|
|
1216
|
+
}, z.core.$strip>>;
|
|
1217
|
+
links: z.ZodArray<z.ZodObject<{
|
|
1218
|
+
id: z.ZodString;
|
|
1219
|
+
documentKind: z.ZodEnum<{
|
|
1220
|
+
order: "order";
|
|
1221
|
+
quote_request: "quote_request";
|
|
1222
|
+
}>;
|
|
1223
|
+
documentId: z.ZodString;
|
|
1224
|
+
available: z.ZodBoolean;
|
|
1225
|
+
number: z.ZodOptional<z.ZodString>;
|
|
1226
|
+
status: z.ZodOptional<z.ZodString>;
|
|
1227
|
+
total: z.ZodOptional<z.ZodString>;
|
|
1228
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
1229
|
+
syncStatus: z.ZodBoolean;
|
|
1230
|
+
linkSource: z.ZodEnum<{
|
|
1231
|
+
manual: "manual";
|
|
1232
|
+
auto: "auto";
|
|
1233
|
+
created_from_opportunity: "created_from_opportunity";
|
|
1234
|
+
quote_conversion: "quote_conversion";
|
|
1235
|
+
}>;
|
|
1236
|
+
createdAt: z.ZodString;
|
|
1237
|
+
}, z.core.$strip>>;
|
|
1238
|
+
unresolvedPropagations: z.ZodArray<z.ZodObject<{
|
|
1239
|
+
id: z.ZodString;
|
|
1240
|
+
orderId: z.ZodString;
|
|
1241
|
+
orderNumber: z.ZodNullable<z.ZodString>;
|
|
1242
|
+
direction: z.ZodEnum<{
|
|
1243
|
+
opportunity_to_order: "opportunity_to_order";
|
|
1244
|
+
order_to_opportunity: "order_to_opportunity";
|
|
1245
|
+
}>;
|
|
1246
|
+
orderStatusCode: z.ZodString;
|
|
1247
|
+
outcome: z.ZodEnum<{
|
|
1248
|
+
failed: "failed";
|
|
1249
|
+
skipped: "skipped";
|
|
1250
|
+
not_found: "not_found";
|
|
1251
|
+
applied: "applied";
|
|
1252
|
+
already_there: "already_there";
|
|
1253
|
+
unknown_status: "unknown_status";
|
|
1254
|
+
not_permitted: "not_permitted";
|
|
1255
|
+
vetoed: "vetoed";
|
|
1256
|
+
}>;
|
|
1257
|
+
detail: z.ZodNullable<z.ZodString>;
|
|
1258
|
+
createdAt: z.ZodString;
|
|
1259
|
+
}, z.core.$strip>>;
|
|
1260
|
+
customFieldValues: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1261
|
+
upcomingEventCount: z.ZodNumber;
|
|
1262
|
+
}, z.core.$strip>;
|
|
1263
|
+
from: z.ZodString;
|
|
1264
|
+
to: z.ZodString;
|
|
1265
|
+
propagation: z.ZodArray<z.ZodObject<{
|
|
1266
|
+
id: z.ZodString;
|
|
1267
|
+
orderId: z.ZodString;
|
|
1268
|
+
orderNumber: z.ZodNullable<z.ZodString>;
|
|
1269
|
+
direction: z.ZodEnum<{
|
|
1270
|
+
opportunity_to_order: "opportunity_to_order";
|
|
1271
|
+
order_to_opportunity: "order_to_opportunity";
|
|
1272
|
+
}>;
|
|
1273
|
+
orderStatusCode: z.ZodString;
|
|
1274
|
+
outcome: z.ZodEnum<{
|
|
1275
|
+
failed: "failed";
|
|
1276
|
+
skipped: "skipped";
|
|
1277
|
+
not_found: "not_found";
|
|
1278
|
+
applied: "applied";
|
|
1279
|
+
already_there: "already_there";
|
|
1280
|
+
unknown_status: "unknown_status";
|
|
1281
|
+
not_permitted: "not_permitted";
|
|
1282
|
+
vetoed: "vetoed";
|
|
1283
|
+
}>;
|
|
1284
|
+
detail: z.ZodNullable<z.ZodString>;
|
|
1285
|
+
createdAt: z.ZodString;
|
|
1286
|
+
}, z.core.$strip>>;
|
|
1287
|
+
}, z.core.$strip>;
|
|
1288
|
+
}, z.core.$strip>;
|
|
1289
|
+
export declare const PropagationOutcomeResponseSchema: z.ZodObject<{
|
|
1290
|
+
data: z.ZodObject<{
|
|
1291
|
+
id: z.ZodString;
|
|
1292
|
+
orderId: z.ZodString;
|
|
1293
|
+
orderNumber: z.ZodNullable<z.ZodString>;
|
|
1294
|
+
direction: z.ZodEnum<{
|
|
1295
|
+
opportunity_to_order: "opportunity_to_order";
|
|
1296
|
+
order_to_opportunity: "order_to_opportunity";
|
|
1297
|
+
}>;
|
|
1298
|
+
orderStatusCode: z.ZodString;
|
|
1299
|
+
outcome: z.ZodEnum<{
|
|
1300
|
+
failed: "failed";
|
|
1301
|
+
skipped: "skipped";
|
|
1302
|
+
not_found: "not_found";
|
|
1303
|
+
applied: "applied";
|
|
1304
|
+
already_there: "already_there";
|
|
1305
|
+
unknown_status: "unknown_status";
|
|
1306
|
+
not_permitted: "not_permitted";
|
|
1307
|
+
vetoed: "vetoed";
|
|
1308
|
+
}>;
|
|
1309
|
+
detail: z.ZodNullable<z.ZodString>;
|
|
1310
|
+
createdAt: z.ZodString;
|
|
1311
|
+
}, z.core.$strip>;
|
|
1312
|
+
}, z.core.$strip>;
|
|
1313
|
+
export declare const CreateOpportunityStatusRequestSchema: z.ZodObject<{
|
|
1314
|
+
code: z.ZodString;
|
|
1315
|
+
name: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1316
|
+
defaultName: z.ZodString;
|
|
1317
|
+
kind: z.ZodEnum<{
|
|
1318
|
+
open: "open";
|
|
1319
|
+
won: "won";
|
|
1320
|
+
lost: "lost";
|
|
1321
|
+
}>;
|
|
1322
|
+
isInitial: z.ZodOptional<z.ZodBoolean>;
|
|
1323
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
1324
|
+
color: z.ZodOptional<z.ZodString>;
|
|
1325
|
+
}, z.core.$strip>;
|
|
1326
|
+
export type CreateOpportunityStatusRequest = z.infer<typeof CreateOpportunityStatusRequestSchema>;
|
|
1327
|
+
/** `code` is immutable; strict, so a body naming it is refused. */
|
|
1328
|
+
export declare const UpdateOpportunityStatusRequestSchema: z.ZodObject<{
|
|
1329
|
+
weight: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
1330
|
+
name: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
1331
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
1332
|
+
open: "open";
|
|
1333
|
+
won: "won";
|
|
1334
|
+
lost: "lost";
|
|
1335
|
+
}>>;
|
|
1336
|
+
color: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
1337
|
+
defaultName: z.ZodOptional<z.ZodString>;
|
|
1338
|
+
isInitial: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
1339
|
+
}, z.core.$strict>;
|
|
1340
|
+
export type UpdateOpportunityStatusRequest = z.infer<typeof UpdateOpportunityStatusRequestSchema>;
|
|
1341
|
+
export declare const OpportunityTransitionEdgeSchema: z.ZodObject<{
|
|
1342
|
+
fromStatusCode: z.ZodString;
|
|
1343
|
+
toStatusCode: z.ZodString;
|
|
1344
|
+
}, z.core.$strip>;
|
|
1345
|
+
export type OpportunityTransitionEdge = z.infer<typeof OpportunityTransitionEdgeSchema>;
|
|
1346
|
+
export declare const SetOpportunityTransitionsRequestSchema: z.ZodObject<{
|
|
1347
|
+
add: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1348
|
+
fromStatusCode: z.ZodString;
|
|
1349
|
+
toStatusCode: z.ZodString;
|
|
1350
|
+
}, z.core.$strip>>>;
|
|
1351
|
+
remove: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1352
|
+
fromStatusCode: z.ZodString;
|
|
1353
|
+
toStatusCode: z.ZodString;
|
|
1354
|
+
}, z.core.$strip>>>;
|
|
1355
|
+
}, z.core.$strip>;
|
|
1356
|
+
export type SetOpportunityTransitionsRequest = z.infer<typeof SetOpportunityTransitionsRequestSchema>;
|
|
1357
|
+
export declare const OrderStatusMappingSchema: z.ZodObject<{
|
|
1358
|
+
direction: z.ZodEnum<{
|
|
1359
|
+
opportunity_to_order: "opportunity_to_order";
|
|
1360
|
+
order_to_opportunity: "order_to_opportunity";
|
|
1361
|
+
}>;
|
|
1362
|
+
opportunityStatusCode: z.ZodString;
|
|
1363
|
+
orderStatusCode: z.ZodString;
|
|
1364
|
+
requireAllOrders: z.ZodOptional<z.ZodBoolean>;
|
|
1365
|
+
}, z.core.$strip>;
|
|
1366
|
+
export type OrderStatusMapping = z.infer<typeof OrderStatusMappingSchema>;
|
|
1367
|
+
/** Replaces the whole set. */
|
|
1368
|
+
export declare const SetOrderStatusMappingsRequestSchema: z.ZodObject<{
|
|
1369
|
+
mappings: z.ZodArray<z.ZodObject<{
|
|
1370
|
+
direction: z.ZodEnum<{
|
|
1371
|
+
opportunity_to_order: "opportunity_to_order";
|
|
1372
|
+
order_to_opportunity: "order_to_opportunity";
|
|
1373
|
+
}>;
|
|
1374
|
+
opportunityStatusCode: z.ZodString;
|
|
1375
|
+
orderStatusCode: z.ZodString;
|
|
1376
|
+
requireAllOrders: z.ZodOptional<z.ZodBoolean>;
|
|
1377
|
+
}, z.core.$strip>>;
|
|
1378
|
+
}, z.core.$strip>;
|
|
1379
|
+
export type SetOrderStatusMappingsRequest = z.infer<typeof SetOrderStatusMappingsRequestSchema>;
|
|
1380
|
+
export declare const SetValueCountingStatusesRequestSchema: z.ZodObject<{
|
|
1381
|
+
order: z.ZodArray<z.ZodString>;
|
|
1382
|
+
quoteRequest: z.ZodArray<z.ZodEnum<{
|
|
1383
|
+
"Created from admin": "Created from admin";
|
|
1384
|
+
Pending: "Pending";
|
|
1385
|
+
Canceled: "Canceled";
|
|
1386
|
+
Approved: "Approved";
|
|
1387
|
+
Completed: "Completed";
|
|
1388
|
+
Expired: "Expired";
|
|
1389
|
+
}>>;
|
|
1390
|
+
}, z.core.$strip>;
|
|
1391
|
+
export type SetValueCountingStatusesRequest = z.infer<typeof SetValueCountingStatusesRequestSchema>;
|
|
1392
|
+
export declare const OpportunityWorkflowStatusSchema: z.ZodObject<{
|
|
1393
|
+
code: z.ZodString;
|
|
1394
|
+
name: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
1395
|
+
defaultName: z.ZodString;
|
|
1396
|
+
kind: z.ZodEnum<{
|
|
1397
|
+
open: "open";
|
|
1398
|
+
won: "won";
|
|
1399
|
+
lost: "lost";
|
|
1400
|
+
}>;
|
|
1401
|
+
isInitial: z.ZodBoolean;
|
|
1402
|
+
weight: z.ZodNumber;
|
|
1403
|
+
color: z.ZodString;
|
|
1404
|
+
inUseCount: z.ZodNumber;
|
|
1405
|
+
}, z.core.$strip>;
|
|
1406
|
+
export type OpportunityWorkflowStatus = z.infer<typeof OpportunityWorkflowStatusSchema>;
|
|
1407
|
+
export declare const OpportunityWorkflowSchema: z.ZodObject<{
|
|
1408
|
+
statuses: z.ZodArray<z.ZodObject<{
|
|
1409
|
+
code: z.ZodString;
|
|
1410
|
+
name: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
1411
|
+
defaultName: z.ZodString;
|
|
1412
|
+
kind: z.ZodEnum<{
|
|
1413
|
+
open: "open";
|
|
1414
|
+
won: "won";
|
|
1415
|
+
lost: "lost";
|
|
1416
|
+
}>;
|
|
1417
|
+
isInitial: z.ZodBoolean;
|
|
1418
|
+
weight: z.ZodNumber;
|
|
1419
|
+
color: z.ZodString;
|
|
1420
|
+
inUseCount: z.ZodNumber;
|
|
1421
|
+
}, z.core.$strip>>;
|
|
1422
|
+
transitions: z.ZodArray<z.ZodObject<{
|
|
1423
|
+
fromStatusCode: z.ZodString;
|
|
1424
|
+
toStatusCode: z.ZodString;
|
|
1425
|
+
}, z.core.$strip>>;
|
|
1426
|
+
orderStatusMappings: z.ZodArray<z.ZodObject<{
|
|
1427
|
+
direction: z.ZodEnum<{
|
|
1428
|
+
opportunity_to_order: "opportunity_to_order";
|
|
1429
|
+
order_to_opportunity: "order_to_opportunity";
|
|
1430
|
+
}>;
|
|
1431
|
+
opportunityStatusCode: z.ZodString;
|
|
1432
|
+
orderStatusCode: z.ZodString;
|
|
1433
|
+
requireAllOrders: z.ZodBoolean;
|
|
1434
|
+
orderStatusKnown: z.ZodBoolean;
|
|
1435
|
+
}, z.core.$strip>>;
|
|
1436
|
+
valueCountingStatuses: z.ZodObject<{
|
|
1437
|
+
order: z.ZodArray<z.ZodString>;
|
|
1438
|
+
quoteRequest: z.ZodArray<z.ZodString>;
|
|
1439
|
+
}, z.core.$strip>;
|
|
1440
|
+
}, z.core.$strip>;
|
|
1441
|
+
export type OpportunityWorkflow = z.infer<typeof OpportunityWorkflowSchema>;
|
|
1442
|
+
export declare const OpportunityWorkflowResponseSchema: z.ZodObject<{
|
|
1443
|
+
data: z.ZodObject<{
|
|
1444
|
+
statuses: z.ZodArray<z.ZodObject<{
|
|
1445
|
+
code: z.ZodString;
|
|
1446
|
+
name: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
1447
|
+
defaultName: z.ZodString;
|
|
1448
|
+
kind: z.ZodEnum<{
|
|
1449
|
+
open: "open";
|
|
1450
|
+
won: "won";
|
|
1451
|
+
lost: "lost";
|
|
1452
|
+
}>;
|
|
1453
|
+
isInitial: z.ZodBoolean;
|
|
1454
|
+
weight: z.ZodNumber;
|
|
1455
|
+
color: z.ZodString;
|
|
1456
|
+
inUseCount: z.ZodNumber;
|
|
1457
|
+
}, z.core.$strip>>;
|
|
1458
|
+
transitions: z.ZodArray<z.ZodObject<{
|
|
1459
|
+
fromStatusCode: z.ZodString;
|
|
1460
|
+
toStatusCode: z.ZodString;
|
|
1461
|
+
}, z.core.$strip>>;
|
|
1462
|
+
orderStatusMappings: z.ZodArray<z.ZodObject<{
|
|
1463
|
+
direction: z.ZodEnum<{
|
|
1464
|
+
opportunity_to_order: "opportunity_to_order";
|
|
1465
|
+
order_to_opportunity: "order_to_opportunity";
|
|
1466
|
+
}>;
|
|
1467
|
+
opportunityStatusCode: z.ZodString;
|
|
1468
|
+
orderStatusCode: z.ZodString;
|
|
1469
|
+
requireAllOrders: z.ZodBoolean;
|
|
1470
|
+
orderStatusKnown: z.ZodBoolean;
|
|
1471
|
+
}, z.core.$strip>>;
|
|
1472
|
+
valueCountingStatuses: z.ZodObject<{
|
|
1473
|
+
order: z.ZodArray<z.ZodString>;
|
|
1474
|
+
quoteRequest: z.ZodArray<z.ZodString>;
|
|
1475
|
+
}, z.core.$strip>;
|
|
1476
|
+
}, z.core.$strip>;
|
|
1477
|
+
}, z.core.$strip>;
|
|
1478
|
+
export declare const AssignOpportunityRequestSchema: z.ZodObject<{
|
|
1479
|
+
adminUserId: z.ZodNullable<z.ZodString>;
|
|
1480
|
+
}, z.core.$strip>;
|
|
1481
|
+
export type AssignOpportunityRequest = z.infer<typeof AssignOpportunityRequestSchema>;
|
|
1482
|
+
export declare const OpportunityCommentListQuerySchema: z.ZodObject<{
|
|
1483
|
+
kind: z.ZodEnum<{
|
|
1484
|
+
message: "message";
|
|
1485
|
+
note: "note";
|
|
1486
|
+
}>;
|
|
1487
|
+
}, z.core.$strip>;
|
|
1488
|
+
export type OpportunityCommentListQuery = z.infer<typeof OpportunityCommentListQuerySchema>;
|
|
1489
|
+
export declare const CreateOpportunityCommentRequestSchema: z.ZodObject<{
|
|
1490
|
+
kind: z.ZodEnum<{
|
|
1491
|
+
message: "message";
|
|
1492
|
+
note: "note";
|
|
1493
|
+
}>;
|
|
1494
|
+
body: z.ZodString;
|
|
1495
|
+
}, z.core.$strip>;
|
|
1496
|
+
export type CreateOpportunityCommentRequest = z.infer<typeof CreateOpportunityCommentRequestSchema>;
|
|
1497
|
+
export declare const UpdateOpportunityCommentRequestSchema: z.ZodObject<{
|
|
1498
|
+
body: z.ZodString;
|
|
1499
|
+
}, z.core.$strip>;
|
|
1500
|
+
export type UpdateOpportunityCommentRequest = z.infer<typeof UpdateOpportunityCommentRequestSchema>;
|
|
1501
|
+
export declare const OpportunityCommentSchema: z.ZodObject<{
|
|
1502
|
+
id: z.ZodString;
|
|
1503
|
+
kind: z.ZodEnum<{
|
|
1504
|
+
message: "message";
|
|
1505
|
+
note: "note";
|
|
1506
|
+
}>;
|
|
1507
|
+
author: z.ZodObject<{
|
|
1508
|
+
id: z.ZodString;
|
|
1509
|
+
name: z.ZodString;
|
|
1510
|
+
}, z.core.$strip>;
|
|
1511
|
+
body: z.ZodString;
|
|
1512
|
+
references: z.ZodArray<z.ZodObject<{
|
|
1513
|
+
type: z.ZodEnum<{
|
|
1514
|
+
order: "order";
|
|
1515
|
+
admin_user: "admin_user";
|
|
1516
|
+
product: "product";
|
|
1517
|
+
}>;
|
|
1518
|
+
id: z.ZodString;
|
|
1519
|
+
available: z.ZodBoolean;
|
|
1520
|
+
label: z.ZodNullable<z.ZodString>;
|
|
1521
|
+
url: z.ZodNullable<z.ZodString>;
|
|
1522
|
+
}, z.core.$strip>>;
|
|
1523
|
+
editedAt: z.ZodNullable<z.ZodString>;
|
|
1524
|
+
createdAt: z.ZodString;
|
|
1525
|
+
}, z.core.$strip>;
|
|
1526
|
+
export type OpportunityComment = z.infer<typeof OpportunityCommentSchema>;
|
|
1527
|
+
export declare const OpportunityCommentResponseSchema: z.ZodObject<{
|
|
1528
|
+
data: z.ZodObject<{
|
|
1529
|
+
id: z.ZodString;
|
|
1530
|
+
kind: z.ZodEnum<{
|
|
1531
|
+
message: "message";
|
|
1532
|
+
note: "note";
|
|
1533
|
+
}>;
|
|
1534
|
+
author: z.ZodObject<{
|
|
1535
|
+
id: z.ZodString;
|
|
1536
|
+
name: z.ZodString;
|
|
1537
|
+
}, z.core.$strip>;
|
|
1538
|
+
body: z.ZodString;
|
|
1539
|
+
references: z.ZodArray<z.ZodObject<{
|
|
1540
|
+
type: z.ZodEnum<{
|
|
1541
|
+
order: "order";
|
|
1542
|
+
admin_user: "admin_user";
|
|
1543
|
+
product: "product";
|
|
1544
|
+
}>;
|
|
1545
|
+
id: z.ZodString;
|
|
1546
|
+
available: z.ZodBoolean;
|
|
1547
|
+
label: z.ZodNullable<z.ZodString>;
|
|
1548
|
+
url: z.ZodNullable<z.ZodString>;
|
|
1549
|
+
}, z.core.$strip>>;
|
|
1550
|
+
editedAt: z.ZodNullable<z.ZodString>;
|
|
1551
|
+
createdAt: z.ZodString;
|
|
1552
|
+
}, z.core.$strip>;
|
|
1553
|
+
}, z.core.$strip>;
|
|
1554
|
+
export declare const OpportunityCommentListResponseSchema: z.ZodObject<{
|
|
1555
|
+
data: z.ZodArray<z.ZodObject<{
|
|
1556
|
+
id: z.ZodString;
|
|
1557
|
+
kind: z.ZodEnum<{
|
|
1558
|
+
message: "message";
|
|
1559
|
+
note: "note";
|
|
1560
|
+
}>;
|
|
1561
|
+
author: z.ZodObject<{
|
|
1562
|
+
id: z.ZodString;
|
|
1563
|
+
name: z.ZodString;
|
|
1564
|
+
}, z.core.$strip>;
|
|
1565
|
+
body: z.ZodString;
|
|
1566
|
+
references: z.ZodArray<z.ZodObject<{
|
|
1567
|
+
type: z.ZodEnum<{
|
|
1568
|
+
order: "order";
|
|
1569
|
+
admin_user: "admin_user";
|
|
1570
|
+
product: "product";
|
|
1571
|
+
}>;
|
|
1572
|
+
id: z.ZodString;
|
|
1573
|
+
available: z.ZodBoolean;
|
|
1574
|
+
label: z.ZodNullable<z.ZodString>;
|
|
1575
|
+
url: z.ZodNullable<z.ZodString>;
|
|
1576
|
+
}, z.core.$strip>>;
|
|
1577
|
+
editedAt: z.ZodNullable<z.ZodString>;
|
|
1578
|
+
createdAt: z.ZodString;
|
|
1579
|
+
}, z.core.$strip>>;
|
|
1580
|
+
}, z.core.$strip>;
|
|
1581
|
+
export declare const CreateOpportunityAttachmentRequestSchema: z.ZodObject<{
|
|
1582
|
+
assetId: z.ZodString;
|
|
1583
|
+
}, z.core.$strip>;
|
|
1584
|
+
export type CreateOpportunityAttachmentRequest = z.infer<typeof CreateOpportunityAttachmentRequestSchema>;
|
|
1585
|
+
export declare const OpportunityAttachmentSchema: z.ZodObject<{
|
|
1586
|
+
id: z.ZodString;
|
|
1587
|
+
assetId: z.ZodString;
|
|
1588
|
+
fileName: z.ZodString;
|
|
1589
|
+
mimeType: z.ZodString;
|
|
1590
|
+
sizeBytes: z.ZodNumber;
|
|
1591
|
+
url: z.ZodNullable<z.ZodString>;
|
|
1592
|
+
uploadedBy: z.ZodObject<{
|
|
1593
|
+
id: z.ZodString;
|
|
1594
|
+
name: z.ZodString;
|
|
1595
|
+
}, z.core.$strip>;
|
|
1596
|
+
createdAt: z.ZodString;
|
|
1597
|
+
}, z.core.$strip>;
|
|
1598
|
+
export type OpportunityAttachment = z.infer<typeof OpportunityAttachmentSchema>;
|
|
1599
|
+
export declare const OpportunityAttachmentResponseSchema: z.ZodObject<{
|
|
1600
|
+
data: z.ZodObject<{
|
|
1601
|
+
id: z.ZodString;
|
|
1602
|
+
assetId: z.ZodString;
|
|
1603
|
+
fileName: z.ZodString;
|
|
1604
|
+
mimeType: z.ZodString;
|
|
1605
|
+
sizeBytes: z.ZodNumber;
|
|
1606
|
+
url: z.ZodNullable<z.ZodString>;
|
|
1607
|
+
uploadedBy: z.ZodObject<{
|
|
1608
|
+
id: z.ZodString;
|
|
1609
|
+
name: z.ZodString;
|
|
1610
|
+
}, z.core.$strip>;
|
|
1611
|
+
createdAt: z.ZodString;
|
|
1612
|
+
}, z.core.$strip>;
|
|
1613
|
+
}, z.core.$strip>;
|
|
1614
|
+
export declare const OpportunityAttachmentListResponseSchema: z.ZodObject<{
|
|
1615
|
+
data: z.ZodArray<z.ZodObject<{
|
|
1616
|
+
id: z.ZodString;
|
|
1617
|
+
assetId: z.ZodString;
|
|
1618
|
+
fileName: z.ZodString;
|
|
1619
|
+
mimeType: z.ZodString;
|
|
1620
|
+
sizeBytes: z.ZodNumber;
|
|
1621
|
+
url: z.ZodNullable<z.ZodString>;
|
|
1622
|
+
uploadedBy: z.ZodObject<{
|
|
1623
|
+
id: z.ZodString;
|
|
1624
|
+
name: z.ZodString;
|
|
1625
|
+
}, z.core.$strip>;
|
|
1626
|
+
createdAt: z.ZodString;
|
|
1627
|
+
}, z.core.$strip>>;
|
|
1628
|
+
}, z.core.$strip>;
|
|
1629
|
+
/**
|
|
1630
|
+
* §7a — the largest file `POST /opportunities/:id/attachments/upload` reads,
|
|
1631
|
+
* in bytes (25 MB). The route holds the whole file in memory before the media
|
|
1632
|
+
* library decides anything about it, so this is the bound on what one request
|
|
1633
|
+
* may make the process allocate; what a file may otherwise *be* — its type, a
|
|
1634
|
+
* smaller size limit — is the media library's upload policy, applied as it is
|
|
1635
|
+
* for any other upload. The screen reads it to refuse a larger file before
|
|
1636
|
+
* sending it. Above it: 413 `CRM_ATTACHMENT_TOO_LARGE`.
|
|
1637
|
+
*/
|
|
1638
|
+
export declare const OPPORTUNITY_ATTACHMENT_MAX_BYTES: number;
|
|
1639
|
+
export declare const CreateOpportunityTagRequestSchema: z.ZodObject<{
|
|
1640
|
+
name: z.ZodString;
|
|
1641
|
+
color: z.ZodOptional<z.ZodString>;
|
|
1642
|
+
}, z.core.$strip>;
|
|
1643
|
+
export type CreateOpportunityTagRequest = z.infer<typeof CreateOpportunityTagRequestSchema>;
|
|
1644
|
+
export declare const UpdateOpportunityTagRequestSchema: z.ZodObject<{
|
|
1645
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1646
|
+
color: z.ZodOptional<z.ZodString>;
|
|
1647
|
+
}, z.core.$strip>;
|
|
1648
|
+
export type UpdateOpportunityTagRequest = z.infer<typeof UpdateOpportunityTagRequestSchema>;
|
|
1649
|
+
/** Replaces the Opportunity's whole tag set. */
|
|
1650
|
+
export declare const SetOpportunityTagsRequestSchema: z.ZodObject<{
|
|
1651
|
+
tagIds: z.ZodArray<z.ZodString>;
|
|
1652
|
+
}, z.core.$strip>;
|
|
1653
|
+
export type SetOpportunityTagsRequest = z.infer<typeof SetOpportunityTagsRequestSchema>;
|
|
1654
|
+
export declare const OpportunityTagSchema: z.ZodObject<{
|
|
1655
|
+
id: z.ZodString;
|
|
1656
|
+
name: z.ZodString;
|
|
1657
|
+
color: z.ZodString;
|
|
1658
|
+
usageCount: z.ZodNumber;
|
|
1659
|
+
}, z.core.$strip>;
|
|
1660
|
+
export type OpportunityTag = z.infer<typeof OpportunityTagSchema>;
|
|
1661
|
+
export declare const OpportunityTagResponseSchema: z.ZodObject<{
|
|
1662
|
+
data: z.ZodObject<{
|
|
1663
|
+
id: z.ZodString;
|
|
1664
|
+
name: z.ZodString;
|
|
1665
|
+
color: z.ZodString;
|
|
1666
|
+
usageCount: z.ZodNumber;
|
|
1667
|
+
}, z.core.$strip>;
|
|
1668
|
+
}, z.core.$strip>;
|
|
1669
|
+
export declare const OpportunityTagListResponseSchema: z.ZodObject<{
|
|
1670
|
+
data: z.ZodArray<z.ZodObject<{
|
|
1671
|
+
id: z.ZodString;
|
|
1672
|
+
name: z.ZodString;
|
|
1673
|
+
color: z.ZodString;
|
|
1674
|
+
usageCount: z.ZodNumber;
|
|
1675
|
+
}, z.core.$strip>>;
|
|
1676
|
+
}, z.core.$strip>;
|
|
1677
|
+
/** The list filters minus `statusCode` / `state` — the columns *are* the statuses. */
|
|
1678
|
+
export declare const OpportunityBoardQuerySchema: z.ZodObject<{
|
|
1679
|
+
perColumn: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
1680
|
+
q: z.ZodOptional<z.ZodString>;
|
|
1681
|
+
organizationId: z.ZodOptional<z.ZodString>;
|
|
1682
|
+
assignedAdminUserId: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"me">, z.ZodLiteral<"unassigned">, z.ZodString]>>;
|
|
1683
|
+
salesChannelId: z.ZodOptional<z.ZodString>;
|
|
1684
|
+
tagId: z.ZodPipe<z.ZodTransform<any[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
1685
|
+
createdFrom: z.ZodOptional<z.ZodString>;
|
|
1686
|
+
createdTo: z.ZodOptional<z.ZodString>;
|
|
1687
|
+
fieldFilters: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<Record<string, {
|
|
1688
|
+
contains?: string | undefined;
|
|
1689
|
+
in?: string[] | undefined;
|
|
1690
|
+
is?: boolean | undefined;
|
|
1691
|
+
min?: string | undefined;
|
|
1692
|
+
max?: string | undefined;
|
|
1693
|
+
from?: string | undefined;
|
|
1694
|
+
to?: string | undefined;
|
|
1695
|
+
}> | undefined, string | undefined>>;
|
|
1696
|
+
}, z.core.$strip>;
|
|
1697
|
+
export type OpportunityBoardQuery = z.infer<typeof OpportunityBoardQuerySchema>;
|
|
1698
|
+
export declare const OpportunityCurrencyTotalSchema: z.ZodObject<{
|
|
1699
|
+
currency: z.ZodString;
|
|
1700
|
+
total: z.ZodString;
|
|
1701
|
+
}, z.core.$strip>;
|
|
1702
|
+
export type OpportunityCurrencyTotal = z.infer<typeof OpportunityCurrencyTotalSchema>;
|
|
1703
|
+
export declare const OpportunityBoardColumnSchema: z.ZodObject<{
|
|
1704
|
+
status: z.ZodObject<{
|
|
1705
|
+
code: z.ZodString;
|
|
1706
|
+
name: z.ZodString;
|
|
1707
|
+
color: z.ZodString;
|
|
1708
|
+
kind: z.ZodEnum<{
|
|
1709
|
+
open: "open";
|
|
1710
|
+
won: "won";
|
|
1711
|
+
lost: "lost";
|
|
1712
|
+
}>;
|
|
1713
|
+
}, z.core.$strip>;
|
|
1714
|
+
count: z.ZodNumber;
|
|
1715
|
+
valueTotals: z.ZodArray<z.ZodObject<{
|
|
1716
|
+
currency: z.ZodString;
|
|
1717
|
+
total: z.ZodString;
|
|
1718
|
+
}, z.core.$strip>>;
|
|
1719
|
+
items: z.ZodArray<z.ZodObject<{
|
|
1720
|
+
id: z.ZodString;
|
|
1721
|
+
number: z.ZodString;
|
|
1722
|
+
title: z.ZodString;
|
|
1723
|
+
organization: z.ZodObject<{
|
|
1724
|
+
id: z.ZodString;
|
|
1725
|
+
name: z.ZodString;
|
|
1726
|
+
}, z.core.$strip>;
|
|
1727
|
+
status: z.ZodObject<{
|
|
1728
|
+
code: z.ZodString;
|
|
1729
|
+
name: z.ZodString;
|
|
1730
|
+
color: z.ZodString;
|
|
1731
|
+
kind: z.ZodEnum<{
|
|
1732
|
+
open: "open";
|
|
1733
|
+
won: "won";
|
|
1734
|
+
lost: "lost";
|
|
1735
|
+
}>;
|
|
1736
|
+
}, z.core.$strip>;
|
|
1737
|
+
assignee: z.ZodNullable<z.ZodObject<{
|
|
1738
|
+
id: z.ZodString;
|
|
1739
|
+
name: z.ZodString;
|
|
1740
|
+
active: z.ZodBoolean;
|
|
1741
|
+
}, z.core.$strip>>;
|
|
1742
|
+
value: z.ZodNullable<z.ZodString>;
|
|
1743
|
+
valueMode: z.ZodEnum<{
|
|
1744
|
+
manual: "manual";
|
|
1745
|
+
computed: "computed";
|
|
1746
|
+
}>;
|
|
1747
|
+
currency: z.ZodString;
|
|
1748
|
+
salesChannelId: z.ZodNullable<z.ZodString>;
|
|
1749
|
+
expectedCloseDate: z.ZodNullable<z.ZodString>;
|
|
1750
|
+
tags: z.ZodArray<z.ZodObject<{
|
|
1751
|
+
id: z.ZodString;
|
|
1752
|
+
name: z.ZodString;
|
|
1753
|
+
color: z.ZodString;
|
|
1754
|
+
}, z.core.$strip>>;
|
|
1755
|
+
closedAt: z.ZodNullable<z.ZodString>;
|
|
1756
|
+
closedKind: z.ZodNullable<z.ZodEnum<{
|
|
1757
|
+
won: "won";
|
|
1758
|
+
lost: "lost";
|
|
1759
|
+
}>>;
|
|
1760
|
+
createdAt: z.ZodString;
|
|
1761
|
+
updatedAt: z.ZodString;
|
|
1762
|
+
cardValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1763
|
+
}, z.core.$strip>>;
|
|
1764
|
+
hasMore: z.ZodBoolean;
|
|
1765
|
+
}, z.core.$strip>;
|
|
1766
|
+
export type OpportunityBoardColumn = z.infer<typeof OpportunityBoardColumnSchema>;
|
|
1767
|
+
export declare const OpportunityBoardSchema: z.ZodObject<{
|
|
1768
|
+
columns: z.ZodArray<z.ZodObject<{
|
|
1769
|
+
status: z.ZodObject<{
|
|
1770
|
+
code: z.ZodString;
|
|
1771
|
+
name: z.ZodString;
|
|
1772
|
+
color: z.ZodString;
|
|
1773
|
+
kind: z.ZodEnum<{
|
|
1774
|
+
open: "open";
|
|
1775
|
+
won: "won";
|
|
1776
|
+
lost: "lost";
|
|
1777
|
+
}>;
|
|
1778
|
+
}, z.core.$strip>;
|
|
1779
|
+
count: z.ZodNumber;
|
|
1780
|
+
valueTotals: z.ZodArray<z.ZodObject<{
|
|
1781
|
+
currency: z.ZodString;
|
|
1782
|
+
total: z.ZodString;
|
|
1783
|
+
}, z.core.$strip>>;
|
|
1784
|
+
items: z.ZodArray<z.ZodObject<{
|
|
1785
|
+
id: z.ZodString;
|
|
1786
|
+
number: z.ZodString;
|
|
1787
|
+
title: z.ZodString;
|
|
1788
|
+
organization: z.ZodObject<{
|
|
1789
|
+
id: z.ZodString;
|
|
1790
|
+
name: z.ZodString;
|
|
1791
|
+
}, z.core.$strip>;
|
|
1792
|
+
status: z.ZodObject<{
|
|
1793
|
+
code: z.ZodString;
|
|
1794
|
+
name: z.ZodString;
|
|
1795
|
+
color: z.ZodString;
|
|
1796
|
+
kind: z.ZodEnum<{
|
|
1797
|
+
open: "open";
|
|
1798
|
+
won: "won";
|
|
1799
|
+
lost: "lost";
|
|
1800
|
+
}>;
|
|
1801
|
+
}, z.core.$strip>;
|
|
1802
|
+
assignee: z.ZodNullable<z.ZodObject<{
|
|
1803
|
+
id: z.ZodString;
|
|
1804
|
+
name: z.ZodString;
|
|
1805
|
+
active: z.ZodBoolean;
|
|
1806
|
+
}, z.core.$strip>>;
|
|
1807
|
+
value: z.ZodNullable<z.ZodString>;
|
|
1808
|
+
valueMode: z.ZodEnum<{
|
|
1809
|
+
manual: "manual";
|
|
1810
|
+
computed: "computed";
|
|
1811
|
+
}>;
|
|
1812
|
+
currency: z.ZodString;
|
|
1813
|
+
salesChannelId: z.ZodNullable<z.ZodString>;
|
|
1814
|
+
expectedCloseDate: z.ZodNullable<z.ZodString>;
|
|
1815
|
+
tags: z.ZodArray<z.ZodObject<{
|
|
1816
|
+
id: z.ZodString;
|
|
1817
|
+
name: z.ZodString;
|
|
1818
|
+
color: z.ZodString;
|
|
1819
|
+
}, z.core.$strip>>;
|
|
1820
|
+
closedAt: z.ZodNullable<z.ZodString>;
|
|
1821
|
+
closedKind: z.ZodNullable<z.ZodEnum<{
|
|
1822
|
+
won: "won";
|
|
1823
|
+
lost: "lost";
|
|
1824
|
+
}>>;
|
|
1825
|
+
createdAt: z.ZodString;
|
|
1826
|
+
updatedAt: z.ZodString;
|
|
1827
|
+
cardValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1828
|
+
}, z.core.$strip>>;
|
|
1829
|
+
hasMore: z.ZodBoolean;
|
|
1830
|
+
}, z.core.$strip>>;
|
|
1831
|
+
cardFields: z.ZodArray<z.ZodObject<{
|
|
1832
|
+
ref: z.ZodString;
|
|
1833
|
+
source: z.ZodEnum<{
|
|
1834
|
+
custom: "custom";
|
|
1835
|
+
builtin: "builtin";
|
|
1836
|
+
}>;
|
|
1837
|
+
key: z.ZodString;
|
|
1838
|
+
kind: z.ZodEnum<{
|
|
1839
|
+
number: "number";
|
|
1840
|
+
boolean: "boolean";
|
|
1841
|
+
date: "date";
|
|
1842
|
+
text: "text";
|
|
1843
|
+
select: "select";
|
|
1844
|
+
tags: "tags";
|
|
1845
|
+
contact: "contact";
|
|
1846
|
+
multiselect: "multiselect";
|
|
1847
|
+
organization: "organization";
|
|
1848
|
+
salesChannel: "salesChannel";
|
|
1849
|
+
assignee: "assignee";
|
|
1850
|
+
money: "money";
|
|
1851
|
+
}>;
|
|
1852
|
+
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
1853
|
+
labelDefault: z.ZodNullable<z.ZodString>;
|
|
1854
|
+
options: z.ZodArray<z.ZodObject<{
|
|
1855
|
+
value: z.ZodString;
|
|
1856
|
+
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
1857
|
+
labelDefault: z.ZodString;
|
|
1858
|
+
}, z.core.$strip>>;
|
|
1859
|
+
}, z.core.$strip>>;
|
|
1860
|
+
}, z.core.$strip>;
|
|
1861
|
+
export type OpportunityBoard = z.infer<typeof OpportunityBoardSchema>;
|
|
1862
|
+
export declare const OpportunityBoardResponseSchema: z.ZodObject<{
|
|
1863
|
+
data: z.ZodObject<{
|
|
1864
|
+
columns: z.ZodArray<z.ZodObject<{
|
|
1865
|
+
status: z.ZodObject<{
|
|
1866
|
+
code: z.ZodString;
|
|
1867
|
+
name: z.ZodString;
|
|
1868
|
+
color: z.ZodString;
|
|
1869
|
+
kind: z.ZodEnum<{
|
|
1870
|
+
open: "open";
|
|
1871
|
+
won: "won";
|
|
1872
|
+
lost: "lost";
|
|
1873
|
+
}>;
|
|
1874
|
+
}, z.core.$strip>;
|
|
1875
|
+
count: z.ZodNumber;
|
|
1876
|
+
valueTotals: z.ZodArray<z.ZodObject<{
|
|
1877
|
+
currency: z.ZodString;
|
|
1878
|
+
total: z.ZodString;
|
|
1879
|
+
}, z.core.$strip>>;
|
|
1880
|
+
items: z.ZodArray<z.ZodObject<{
|
|
1881
|
+
id: z.ZodString;
|
|
1882
|
+
number: z.ZodString;
|
|
1883
|
+
title: z.ZodString;
|
|
1884
|
+
organization: z.ZodObject<{
|
|
1885
|
+
id: z.ZodString;
|
|
1886
|
+
name: z.ZodString;
|
|
1887
|
+
}, z.core.$strip>;
|
|
1888
|
+
status: z.ZodObject<{
|
|
1889
|
+
code: z.ZodString;
|
|
1890
|
+
name: z.ZodString;
|
|
1891
|
+
color: z.ZodString;
|
|
1892
|
+
kind: z.ZodEnum<{
|
|
1893
|
+
open: "open";
|
|
1894
|
+
won: "won";
|
|
1895
|
+
lost: "lost";
|
|
1896
|
+
}>;
|
|
1897
|
+
}, z.core.$strip>;
|
|
1898
|
+
assignee: z.ZodNullable<z.ZodObject<{
|
|
1899
|
+
id: z.ZodString;
|
|
1900
|
+
name: z.ZodString;
|
|
1901
|
+
active: z.ZodBoolean;
|
|
1902
|
+
}, z.core.$strip>>;
|
|
1903
|
+
value: z.ZodNullable<z.ZodString>;
|
|
1904
|
+
valueMode: z.ZodEnum<{
|
|
1905
|
+
manual: "manual";
|
|
1906
|
+
computed: "computed";
|
|
1907
|
+
}>;
|
|
1908
|
+
currency: z.ZodString;
|
|
1909
|
+
salesChannelId: z.ZodNullable<z.ZodString>;
|
|
1910
|
+
expectedCloseDate: z.ZodNullable<z.ZodString>;
|
|
1911
|
+
tags: z.ZodArray<z.ZodObject<{
|
|
1912
|
+
id: z.ZodString;
|
|
1913
|
+
name: z.ZodString;
|
|
1914
|
+
color: z.ZodString;
|
|
1915
|
+
}, z.core.$strip>>;
|
|
1916
|
+
closedAt: z.ZodNullable<z.ZodString>;
|
|
1917
|
+
closedKind: z.ZodNullable<z.ZodEnum<{
|
|
1918
|
+
won: "won";
|
|
1919
|
+
lost: "lost";
|
|
1920
|
+
}>>;
|
|
1921
|
+
createdAt: z.ZodString;
|
|
1922
|
+
updatedAt: z.ZodString;
|
|
1923
|
+
cardValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1924
|
+
}, z.core.$strip>>;
|
|
1925
|
+
hasMore: z.ZodBoolean;
|
|
1926
|
+
}, z.core.$strip>>;
|
|
1927
|
+
cardFields: z.ZodArray<z.ZodObject<{
|
|
1928
|
+
ref: z.ZodString;
|
|
1929
|
+
source: z.ZodEnum<{
|
|
1930
|
+
custom: "custom";
|
|
1931
|
+
builtin: "builtin";
|
|
1932
|
+
}>;
|
|
1933
|
+
key: z.ZodString;
|
|
1934
|
+
kind: z.ZodEnum<{
|
|
1935
|
+
number: "number";
|
|
1936
|
+
boolean: "boolean";
|
|
1937
|
+
date: "date";
|
|
1938
|
+
text: "text";
|
|
1939
|
+
select: "select";
|
|
1940
|
+
tags: "tags";
|
|
1941
|
+
contact: "contact";
|
|
1942
|
+
multiselect: "multiselect";
|
|
1943
|
+
organization: "organization";
|
|
1944
|
+
salesChannel: "salesChannel";
|
|
1945
|
+
assignee: "assignee";
|
|
1946
|
+
money: "money";
|
|
1947
|
+
}>;
|
|
1948
|
+
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
1949
|
+
labelDefault: z.ZodNullable<z.ZodString>;
|
|
1950
|
+
options: z.ZodArray<z.ZodObject<{
|
|
1951
|
+
value: z.ZodString;
|
|
1952
|
+
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
1953
|
+
labelDefault: z.ZodString;
|
|
1954
|
+
}, z.core.$strip>>;
|
|
1955
|
+
}, z.core.$strip>>;
|
|
1956
|
+
}, z.core.$strip>;
|
|
1957
|
+
}, z.core.$strip>;
|
|
1958
|
+
/** `id` asks for one Organization by id (the label of a preselection); `q` searches by name. */
|
|
1959
|
+
export declare const OpportunityOrganizationLookupQuerySchema: z.ZodObject<{
|
|
1960
|
+
q: z.ZodOptional<z.ZodString>;
|
|
1961
|
+
id: z.ZodOptional<z.ZodString>;
|
|
1962
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
1963
|
+
}, z.core.$strip>;
|
|
1964
|
+
export type OpportunityOrganizationLookupQuery = z.infer<typeof OpportunityOrganizationLookupQuerySchema>;
|
|
1965
|
+
export declare const OpportunityOrganizationOptionSchema: z.ZodObject<{
|
|
1966
|
+
id: z.ZodString;
|
|
1967
|
+
name: z.ZodString;
|
|
1968
|
+
}, z.core.$strip>;
|
|
1969
|
+
export type OpportunityOrganizationOption = z.infer<typeof OpportunityOrganizationOptionSchema>;
|
|
1970
|
+
export declare const OpportunityOrganizationLookupResponseSchema: z.ZodObject<{
|
|
1971
|
+
data: z.ZodArray<z.ZodObject<{
|
|
1972
|
+
id: z.ZodString;
|
|
1973
|
+
name: z.ZodString;
|
|
1974
|
+
}, z.core.$strip>>;
|
|
1975
|
+
}, z.core.$strip>;
|
|
1976
|
+
/** `name` is per language, as the channel stores it; the screen resolves it. */
|
|
1977
|
+
export declare const OpportunitySalesChannelOptionSchema: z.ZodObject<{
|
|
1978
|
+
id: z.ZodString;
|
|
1979
|
+
code: z.ZodString;
|
|
1980
|
+
name: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
1981
|
+
active: z.ZodBoolean;
|
|
1982
|
+
systemDefault: z.ZodBoolean;
|
|
1983
|
+
defaultCurrency: z.ZodString;
|
|
1984
|
+
currencies: z.ZodArray<z.ZodString>;
|
|
1985
|
+
}, z.core.$strip>;
|
|
1986
|
+
export type OpportunitySalesChannelOption = z.infer<typeof OpportunitySalesChannelOptionSchema>;
|
|
1987
|
+
export declare const OpportunitySalesChannelLookupResponseSchema: z.ZodObject<{
|
|
1988
|
+
data: z.ZodArray<z.ZodObject<{
|
|
1989
|
+
id: z.ZodString;
|
|
1990
|
+
code: z.ZodString;
|
|
1991
|
+
name: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
1992
|
+
active: z.ZodBoolean;
|
|
1993
|
+
systemDefault: z.ZodBoolean;
|
|
1994
|
+
defaultCurrency: z.ZodString;
|
|
1995
|
+
currencies: z.ZodArray<z.ZodString>;
|
|
1996
|
+
}, z.core.$strip>>;
|
|
1997
|
+
}, z.core.$strip>;
|
|
1998
|
+
export declare const OpportunityAssigneeLookupQuerySchema: z.ZodObject<{
|
|
1999
|
+
q: z.ZodOptional<z.ZodString>;
|
|
2000
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
2001
|
+
}, z.core.$strip>;
|
|
2002
|
+
export type OpportunityAssigneeLookupQuery = z.infer<typeof OpportunityAssigneeLookupQuerySchema>;
|
|
2003
|
+
/** An administrator who may be assigned — active ones only, by name. */
|
|
2004
|
+
export declare const OpportunityAssigneeOptionSchema: z.ZodObject<{
|
|
2005
|
+
id: z.ZodString;
|
|
2006
|
+
name: z.ZodString;
|
|
2007
|
+
}, z.core.$strip>;
|
|
2008
|
+
export type OpportunityAssigneeOption = z.infer<typeof OpportunityAssigneeOptionSchema>;
|
|
2009
|
+
export declare const OpportunityAssigneeLookupResponseSchema: z.ZodObject<{
|
|
2010
|
+
data: z.ZodArray<z.ZodObject<{
|
|
2011
|
+
id: z.ZodString;
|
|
2012
|
+
name: z.ZodString;
|
|
2013
|
+
}, z.core.$strip>>;
|
|
2014
|
+
}, z.core.$strip>;
|
|
2015
|
+
/**
|
|
2016
|
+
* Who may be mentioned in a text (User Story 18). With `organizationId` — the
|
|
2017
|
+
* Opportunity's — only people who may see that Organization are offered.
|
|
2018
|
+
*/
|
|
2019
|
+
export declare const OpportunityMentionLookupQuerySchema: z.ZodObject<{
|
|
2020
|
+
q: z.ZodOptional<z.ZodString>;
|
|
2021
|
+
organizationId: z.ZodOptional<z.ZodString>;
|
|
2022
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
2023
|
+
}, z.core.$strip>;
|
|
2024
|
+
export type OpportunityMentionLookupQuery = z.infer<typeof OpportunityMentionLookupQuerySchema>;
|
|
2025
|
+
/** A person to mention: a name to choose by — no e-mail address, no role. */
|
|
2026
|
+
export declare const OpportunityMentionOptionSchema: z.ZodObject<{
|
|
2027
|
+
id: z.ZodString;
|
|
2028
|
+
name: z.ZodString;
|
|
2029
|
+
}, z.core.$strip>;
|
|
2030
|
+
export type OpportunityMentionOption = z.infer<typeof OpportunityMentionOptionSchema>;
|
|
2031
|
+
export declare const OpportunityMentionLookupResponseSchema: z.ZodObject<{
|
|
2032
|
+
data: z.ZodArray<z.ZodObject<{
|
|
2033
|
+
id: z.ZodString;
|
|
2034
|
+
name: z.ZodString;
|
|
2035
|
+
}, z.core.$strip>>;
|
|
2036
|
+
}, z.core.$strip>;
|
|
2037
|
+
export declare const OpportunityContactLookupQuerySchema: z.ZodObject<{
|
|
2038
|
+
organizationId: z.ZodString;
|
|
2039
|
+
q: z.ZodOptional<z.ZodString>;
|
|
2040
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
2041
|
+
}, z.core.$strip>;
|
|
2042
|
+
export type OpportunityContactLookupQuery = z.infer<typeof OpportunityContactLookupQuerySchema>;
|
|
2043
|
+
/** A member of the Organization who may be the Opportunity's contact person. */
|
|
2044
|
+
export declare const OpportunityContactOptionSchema: z.ZodObject<{
|
|
2045
|
+
id: z.ZodString;
|
|
2046
|
+
name: z.ZodString;
|
|
2047
|
+
email: z.ZodString;
|
|
2048
|
+
}, z.core.$strip>;
|
|
2049
|
+
export type OpportunityContactOption = z.infer<typeof OpportunityContactOptionSchema>;
|
|
2050
|
+
export declare const OpportunityContactLookupResponseSchema: z.ZodObject<{
|
|
2051
|
+
data: z.ZodArray<z.ZodObject<{
|
|
2052
|
+
id: z.ZodString;
|
|
2053
|
+
name: z.ZodString;
|
|
2054
|
+
email: z.ZodString;
|
|
2055
|
+
}, z.core.$strip>>;
|
|
2056
|
+
}, z.core.$strip>;
|
|
2057
|
+
/**
|
|
2058
|
+
* The Quote Requests of one Organization that can still be linked — the open
|
|
2059
|
+
* ones, plus the one whose number is typed in full. Gated by CRM's own code:
|
|
2060
|
+
* the quote desk's list is behind `rfqs:handle`, the right to handle quotes,
|
|
2061
|
+
* which linking one to an Opportunity does not need (research N-H2).
|
|
2062
|
+
*/
|
|
2063
|
+
export declare const OpportunityQuoteRequestLookupQuerySchema: z.ZodObject<{
|
|
2064
|
+
organizationId: z.ZodString;
|
|
2065
|
+
q: z.ZodOptional<z.ZodString>;
|
|
2066
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
2067
|
+
}, z.core.$strip>;
|
|
2068
|
+
export type OpportunityQuoteRequestLookupQuery = z.infer<typeof OpportunityQuoteRequestLookupQuerySchema>;
|
|
2069
|
+
export declare const OpportunityQuoteRequestOptionSchema: z.ZodObject<{
|
|
2070
|
+
id: z.ZodString;
|
|
2071
|
+
number: z.ZodString;
|
|
2072
|
+
status: z.ZodString;
|
|
2073
|
+
}, z.core.$strip>;
|
|
2074
|
+
export type OpportunityQuoteRequestOption = z.infer<typeof OpportunityQuoteRequestOptionSchema>;
|
|
2075
|
+
export declare const OpportunityQuoteRequestLookupResponseSchema: z.ZodObject<{
|
|
2076
|
+
data: z.ZodArray<z.ZodObject<{
|
|
2077
|
+
id: z.ZodString;
|
|
2078
|
+
number: z.ZodString;
|
|
2079
|
+
status: z.ZodString;
|
|
2080
|
+
}, z.core.$strip>>;
|
|
2081
|
+
}, z.core.$strip>;
|
|
2082
|
+
export declare const OpportunityHistoryQuerySchema: z.ZodObject<{
|
|
2083
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
2084
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
2085
|
+
}, z.core.$strip>;
|
|
2086
|
+
export type OpportunityHistoryQuery = z.infer<typeof OpportunityHistoryQuerySchema>;
|
|
2087
|
+
export declare const OpportunityHistoryEntrySchema: z.ZodObject<{
|
|
2088
|
+
id: z.ZodString;
|
|
2089
|
+
actedAt: z.ZodString;
|
|
2090
|
+
action: z.ZodString;
|
|
2091
|
+
actor: z.ZodObject<{
|
|
2092
|
+
kind: z.ZodString;
|
|
2093
|
+
id: z.ZodNullable<z.ZodString>;
|
|
2094
|
+
name: z.ZodNullable<z.ZodString>;
|
|
2095
|
+
}, z.core.$strip>;
|
|
2096
|
+
before: z.ZodNullable<z.ZodUnknown>;
|
|
2097
|
+
after: z.ZodNullable<z.ZodUnknown>;
|
|
2098
|
+
references: z.ZodArray<z.ZodObject<{
|
|
2099
|
+
type: z.ZodEnum<{
|
|
2100
|
+
order: "order";
|
|
2101
|
+
admin_user: "admin_user";
|
|
2102
|
+
product: "product";
|
|
2103
|
+
}>;
|
|
2104
|
+
id: z.ZodString;
|
|
2105
|
+
available: z.ZodBoolean;
|
|
2106
|
+
label: z.ZodNullable<z.ZodString>;
|
|
2107
|
+
url: z.ZodNullable<z.ZodString>;
|
|
2108
|
+
}, z.core.$strip>>;
|
|
2109
|
+
}, z.core.$strip>;
|
|
2110
|
+
export type OpportunityHistoryEntry = z.infer<typeof OpportunityHistoryEntrySchema>;
|
|
2111
|
+
/**
|
|
2112
|
+
* `truncated` is beside `pagination` and not part of it: `hasMore` goes on
|
|
2113
|
+
* meaning "there is a next page to ask for". It is `true` on the last page a
|
|
2114
|
+
* history can serve when the Opportunity has earlier entries beyond it — the
|
|
2115
|
+
* history reaches a fixed way back — and `false` on every other page.
|
|
2116
|
+
*/
|
|
2117
|
+
export declare const OpportunityHistoryResponseSchema: z.ZodObject<{
|
|
2118
|
+
data: z.ZodArray<z.ZodObject<{
|
|
2119
|
+
id: z.ZodString;
|
|
2120
|
+
actedAt: z.ZodString;
|
|
2121
|
+
action: z.ZodString;
|
|
2122
|
+
actor: z.ZodObject<{
|
|
2123
|
+
kind: z.ZodString;
|
|
2124
|
+
id: z.ZodNullable<z.ZodString>;
|
|
2125
|
+
name: z.ZodNullable<z.ZodString>;
|
|
2126
|
+
}, z.core.$strip>;
|
|
2127
|
+
before: z.ZodNullable<z.ZodUnknown>;
|
|
2128
|
+
after: z.ZodNullable<z.ZodUnknown>;
|
|
2129
|
+
references: z.ZodArray<z.ZodObject<{
|
|
2130
|
+
type: z.ZodEnum<{
|
|
2131
|
+
order: "order";
|
|
2132
|
+
admin_user: "admin_user";
|
|
2133
|
+
product: "product";
|
|
2134
|
+
}>;
|
|
2135
|
+
id: z.ZodString;
|
|
2136
|
+
available: z.ZodBoolean;
|
|
2137
|
+
label: z.ZodNullable<z.ZodString>;
|
|
2138
|
+
url: z.ZodNullable<z.ZodString>;
|
|
2139
|
+
}, z.core.$strip>>;
|
|
2140
|
+
}, z.core.$strip>>;
|
|
2141
|
+
pagination: z.ZodObject<{
|
|
2142
|
+
cursor: z.ZodNullable<z.ZodString>;
|
|
2143
|
+
hasMore: z.ZodBoolean;
|
|
2144
|
+
limit: z.ZodNumber;
|
|
2145
|
+
}, z.core.$strip>;
|
|
2146
|
+
truncated: z.ZodBoolean;
|
|
2147
|
+
}, z.core.$strip>;
|
|
2148
|
+
export type OpportunityHistoryResponse = z.infer<typeof OpportunityHistoryResponseSchema>;
|
|
2149
|
+
export declare const OpportunityAnalyticsQuerySchema: z.ZodObject<{
|
|
2150
|
+
from: z.ZodString;
|
|
2151
|
+
to: z.ZodString;
|
|
2152
|
+
salesChannelId: z.ZodOptional<z.ZodString>;
|
|
2153
|
+
assignedAdminUserId: z.ZodOptional<z.ZodString>;
|
|
2154
|
+
}, z.core.$strip>;
|
|
2155
|
+
export type OpportunityAnalyticsQuery = z.infer<typeof OpportunityAnalyticsQuerySchema>;
|
|
2156
|
+
export declare const OpportunityTimeInStatusQuerySchema: z.ZodObject<{
|
|
2157
|
+
statusCode: z.ZodPipe<z.ZodTransform<any[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
2158
|
+
from: z.ZodString;
|
|
2159
|
+
to: z.ZodString;
|
|
2160
|
+
salesChannelId: z.ZodOptional<z.ZodString>;
|
|
2161
|
+
assignedAdminUserId: z.ZodOptional<z.ZodString>;
|
|
2162
|
+
}, z.core.$strip>;
|
|
2163
|
+
export type OpportunityTimeInStatusQuery = z.infer<typeof OpportunityTimeInStatusQuerySchema>;
|
|
2164
|
+
export declare const TopOpportunitiesQuerySchema: z.ZodObject<{
|
|
2165
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
2166
|
+
basis: z.ZodDefault<z.ZodEnum<{
|
|
2167
|
+
created: "created";
|
|
2168
|
+
closed: "closed";
|
|
2169
|
+
}>>;
|
|
2170
|
+
from: z.ZodString;
|
|
2171
|
+
to: z.ZodString;
|
|
2172
|
+
salesChannelId: z.ZodOptional<z.ZodString>;
|
|
2173
|
+
assignedAdminUserId: z.ZodOptional<z.ZodString>;
|
|
2174
|
+
}, z.core.$strip>;
|
|
2175
|
+
export type TopOpportunitiesQuery = z.infer<typeof TopOpportunitiesQuerySchema>;
|
|
2176
|
+
export declare const OpportunityHandlingTimeSchema: z.ZodObject<{
|
|
2177
|
+
averageSeconds: z.ZodNullable<z.ZodNumber>;
|
|
2178
|
+
closedCount: z.ZodNumber;
|
|
2179
|
+
byOutcome: z.ZodObject<{
|
|
2180
|
+
won: z.ZodObject<{
|
|
2181
|
+
averageSeconds: z.ZodNullable<z.ZodNumber>;
|
|
2182
|
+
closedCount: z.ZodNumber;
|
|
2183
|
+
}, z.core.$strip>;
|
|
2184
|
+
lost: z.ZodObject<{
|
|
2185
|
+
averageSeconds: z.ZodNullable<z.ZodNumber>;
|
|
2186
|
+
closedCount: z.ZodNumber;
|
|
2187
|
+
}, z.core.$strip>;
|
|
2188
|
+
}, z.core.$strip>;
|
|
2189
|
+
}, z.core.$strip>;
|
|
2190
|
+
export type OpportunityHandlingTime = z.infer<typeof OpportunityHandlingTimeSchema>;
|
|
2191
|
+
export declare const OpportunityTimeInStatusRowSchema: z.ZodObject<{
|
|
2192
|
+
statusCode: z.ZodString;
|
|
2193
|
+
averageSeconds: z.ZodNullable<z.ZodNumber>;
|
|
2194
|
+
sampleCount: z.ZodNumber;
|
|
2195
|
+
}, z.core.$strip>;
|
|
2196
|
+
export type OpportunityTimeInStatusRow = z.infer<typeof OpportunityTimeInStatusRowSchema>;
|
|
2197
|
+
export declare const OpportunityRepEffectivenessRowSchema: z.ZodObject<{
|
|
2198
|
+
month: z.ZodString;
|
|
2199
|
+
adminUser: z.ZodObject<{
|
|
2200
|
+
id: z.ZodString;
|
|
2201
|
+
name: z.ZodString;
|
|
2202
|
+
}, z.core.$strip>;
|
|
2203
|
+
wonCount: z.ZodNumber;
|
|
2204
|
+
wonValue: z.ZodArray<z.ZodObject<{
|
|
2205
|
+
currency: z.ZodString;
|
|
2206
|
+
total: z.ZodString;
|
|
2207
|
+
}, z.core.$strip>>;
|
|
2208
|
+
}, z.core.$strip>;
|
|
2209
|
+
export type OpportunityRepEffectivenessRow = z.infer<typeof OpportunityRepEffectivenessRowSchema>;
|
|
2210
|
+
export declare const OpportunityAverageValueRowSchema: z.ZodObject<{
|
|
2211
|
+
currency: z.ZodString;
|
|
2212
|
+
average: z.ZodString;
|
|
2213
|
+
count: z.ZodNumber;
|
|
2214
|
+
}, z.core.$strip>;
|
|
2215
|
+
export type OpportunityAverageValueRow = z.infer<typeof OpportunityAverageValueRowSchema>;
|
|
2216
|
+
export declare const OpportunityHandlingTimeResponseSchema: z.ZodObject<{
|
|
2217
|
+
data: z.ZodObject<{
|
|
2218
|
+
averageSeconds: z.ZodNullable<z.ZodNumber>;
|
|
2219
|
+
closedCount: z.ZodNumber;
|
|
2220
|
+
byOutcome: z.ZodObject<{
|
|
2221
|
+
won: z.ZodObject<{
|
|
2222
|
+
averageSeconds: z.ZodNullable<z.ZodNumber>;
|
|
2223
|
+
closedCount: z.ZodNumber;
|
|
2224
|
+
}, z.core.$strip>;
|
|
2225
|
+
lost: z.ZodObject<{
|
|
2226
|
+
averageSeconds: z.ZodNullable<z.ZodNumber>;
|
|
2227
|
+
closedCount: z.ZodNumber;
|
|
2228
|
+
}, z.core.$strip>;
|
|
2229
|
+
}, z.core.$strip>;
|
|
2230
|
+
}, z.core.$strip>;
|
|
2231
|
+
}, z.core.$strip>;
|
|
2232
|
+
export declare const OpportunityTimeInStatusResponseSchema: z.ZodObject<{
|
|
2233
|
+
data: z.ZodArray<z.ZodObject<{
|
|
2234
|
+
statusCode: z.ZodString;
|
|
2235
|
+
averageSeconds: z.ZodNullable<z.ZodNumber>;
|
|
2236
|
+
sampleCount: z.ZodNumber;
|
|
2237
|
+
}, z.core.$strip>>;
|
|
2238
|
+
}, z.core.$strip>;
|
|
2239
|
+
export declare const OpportunityRepEffectivenessResponseSchema: z.ZodObject<{
|
|
2240
|
+
data: z.ZodArray<z.ZodObject<{
|
|
2241
|
+
month: z.ZodString;
|
|
2242
|
+
adminUser: z.ZodObject<{
|
|
2243
|
+
id: z.ZodString;
|
|
2244
|
+
name: z.ZodString;
|
|
2245
|
+
}, z.core.$strip>;
|
|
2246
|
+
wonCount: z.ZodNumber;
|
|
2247
|
+
wonValue: z.ZodArray<z.ZodObject<{
|
|
2248
|
+
currency: z.ZodString;
|
|
2249
|
+
total: z.ZodString;
|
|
2250
|
+
}, z.core.$strip>>;
|
|
2251
|
+
}, z.core.$strip>>;
|
|
2252
|
+
}, z.core.$strip>;
|
|
2253
|
+
export declare const TopOpportunitiesResponseSchema: z.ZodObject<{
|
|
2254
|
+
data: z.ZodArray<z.ZodObject<{
|
|
2255
|
+
id: z.ZodString;
|
|
2256
|
+
number: z.ZodString;
|
|
2257
|
+
title: z.ZodString;
|
|
2258
|
+
organization: z.ZodObject<{
|
|
2259
|
+
id: z.ZodString;
|
|
2260
|
+
name: z.ZodString;
|
|
2261
|
+
}, z.core.$strip>;
|
|
2262
|
+
status: z.ZodObject<{
|
|
2263
|
+
code: z.ZodString;
|
|
2264
|
+
name: z.ZodString;
|
|
2265
|
+
color: z.ZodString;
|
|
2266
|
+
kind: z.ZodEnum<{
|
|
2267
|
+
open: "open";
|
|
2268
|
+
won: "won";
|
|
2269
|
+
lost: "lost";
|
|
2270
|
+
}>;
|
|
2271
|
+
}, z.core.$strip>;
|
|
2272
|
+
assignee: z.ZodNullable<z.ZodObject<{
|
|
2273
|
+
id: z.ZodString;
|
|
2274
|
+
name: z.ZodString;
|
|
2275
|
+
active: z.ZodBoolean;
|
|
2276
|
+
}, z.core.$strip>>;
|
|
2277
|
+
value: z.ZodNullable<z.ZodString>;
|
|
2278
|
+
valueMode: z.ZodEnum<{
|
|
2279
|
+
manual: "manual";
|
|
2280
|
+
computed: "computed";
|
|
2281
|
+
}>;
|
|
2282
|
+
currency: z.ZodString;
|
|
2283
|
+
salesChannelId: z.ZodNullable<z.ZodString>;
|
|
2284
|
+
expectedCloseDate: z.ZodNullable<z.ZodString>;
|
|
2285
|
+
tags: z.ZodArray<z.ZodObject<{
|
|
2286
|
+
id: z.ZodString;
|
|
2287
|
+
name: z.ZodString;
|
|
2288
|
+
color: z.ZodString;
|
|
2289
|
+
}, z.core.$strip>>;
|
|
2290
|
+
closedAt: z.ZodNullable<z.ZodString>;
|
|
2291
|
+
closedKind: z.ZodNullable<z.ZodEnum<{
|
|
2292
|
+
won: "won";
|
|
2293
|
+
lost: "lost";
|
|
2294
|
+
}>>;
|
|
2295
|
+
createdAt: z.ZodString;
|
|
2296
|
+
updatedAt: z.ZodString;
|
|
2297
|
+
cardValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2298
|
+
}, z.core.$strip>>;
|
|
2299
|
+
}, z.core.$strip>;
|
|
2300
|
+
export declare const OpportunityAverageValueResponseSchema: z.ZodObject<{
|
|
2301
|
+
data: z.ZodArray<z.ZodObject<{
|
|
2302
|
+
currency: z.ZodString;
|
|
2303
|
+
average: z.ZodString;
|
|
2304
|
+
count: z.ZodNumber;
|
|
2305
|
+
}, z.core.$strip>>;
|
|
2306
|
+
}, z.core.$strip>;
|
|
2307
|
+
/**
|
|
2308
|
+
* The longest an Event may be. An Event is one calendar day in its own zone,
|
|
2309
|
+
* and the day a clock goes back is 25 hours long — so this is the bound that
|
|
2310
|
+
* needs no zone data, and "one local day" is the service's to refuse.
|
|
2311
|
+
*/
|
|
2312
|
+
export declare const OPPORTUNITY_EVENT_MAX_SPAN_HOURS = 25;
|
|
2313
|
+
/**
|
|
2314
|
+
* The widest range a Calendar read may ask for: the six-week month grid (42
|
|
2315
|
+
* days), a day each side for an all-day Event of a far zone, and one.
|
|
2316
|
+
*/
|
|
2317
|
+
export declare const CALENDAR_EVENTS_MAX_RANGE_DAYS = 45;
|
|
2318
|
+
/** A Calendar read answers this many Events at most, and says when it cut. */
|
|
2319
|
+
export declare const CALENDAR_EVENTS_MAX_RESULTS = 500;
|
|
2320
|
+
/**
|
|
2321
|
+
* Why a well-formed Event is refused — `details.rule` of a 422
|
|
2322
|
+
* `VALIDATION_FAILED`, beside `details.field`. The first is also refused by
|
|
2323
|
+
* the schema when both instants arrive in one body (400); the service repeats
|
|
2324
|
+
* it for an edit that names one of them.
|
|
2325
|
+
*/
|
|
2326
|
+
export declare const opportunityEventRuleSchema: z.ZodEnum<{
|
|
2327
|
+
ends_before_start: "ends_before_start";
|
|
2328
|
+
spans_days: "spans_days";
|
|
2329
|
+
not_whole_day: "not_whole_day";
|
|
2330
|
+
unknown_time_zone: "unknown_time_zone";
|
|
2331
|
+
reminder_in_past: "reminder_in_past";
|
|
2332
|
+
}>;
|
|
2333
|
+
export type OpportunityEventRule = z.infer<typeof opportunityEventRuleSchema>;
|
|
2334
|
+
/**
|
|
2335
|
+
* What became of an Event's reminder, folded for a reader: `paused` is
|
|
2336
|
+
* `scheduled` on a closed Opportunity and is derived on read, and a reminder
|
|
2337
|
+
* being sent right now is reported as `scheduled`.
|
|
2338
|
+
*/
|
|
2339
|
+
export declare const opportunityEventReminderStateSchema: z.ZodEnum<{
|
|
2340
|
+
no_recipient: "no_recipient";
|
|
2341
|
+
sent: "sent";
|
|
2342
|
+
scheduled: "scheduled";
|
|
2343
|
+
paused: "paused";
|
|
2344
|
+
missed: "missed";
|
|
2345
|
+
undeliverable: "undeliverable";
|
|
2346
|
+
interrupted: "interrupted";
|
|
2347
|
+
}>;
|
|
2348
|
+
export type OpportunityEventReminderState = z.infer<typeof opportunityEventReminderStateSchema>;
|
|
2349
|
+
export declare const opportunityEventReminderChannelSchema: z.ZodEnum<{
|
|
2350
|
+
email: "email";
|
|
2351
|
+
bell: "bell";
|
|
2352
|
+
}>;
|
|
2353
|
+
export type OpportunityEventReminderChannel = z.infer<typeof opportunityEventReminderChannelSchema>;
|
|
2354
|
+
export declare const calendarScopeSchema: z.ZodEnum<{
|
|
2355
|
+
all: "all";
|
|
2356
|
+
mine: "mine";
|
|
2357
|
+
}>;
|
|
2358
|
+
export type CalendarScope = z.infer<typeof calendarScopeSchema>;
|
|
2359
|
+
export declare const CreateOpportunityEventRequestSchema: z.ZodObject<{
|
|
2360
|
+
name: z.ZodString;
|
|
2361
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2362
|
+
allDay: z.ZodBoolean;
|
|
2363
|
+
startsAt: z.ZodString;
|
|
2364
|
+
endsAt: z.ZodString;
|
|
2365
|
+
timeZone: z.ZodString;
|
|
2366
|
+
remindAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2367
|
+
}, z.core.$strip>;
|
|
2368
|
+
export type CreateOpportunityEventRequest = z.infer<typeof CreateOpportunityEventRequestSchema>;
|
|
2369
|
+
/**
|
|
2370
|
+
* Every member of the create, all optional; strict, so a body naming anything
|
|
2371
|
+
* else is refused instead of ignored. The rules are applied by the service to
|
|
2372
|
+
* the Event **as it would be after the change**; `remindAt: null` removes the
|
|
2373
|
+
* reminder and a different `remindAt` arms it again.
|
|
2374
|
+
*/
|
|
2375
|
+
export declare const UpdateOpportunityEventRequestSchema: z.ZodObject<{
|
|
2376
|
+
name: z.ZodOptional<z.ZodString>;
|
|
2377
|
+
description: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
2378
|
+
allDay: z.ZodOptional<z.ZodBoolean>;
|
|
2379
|
+
startsAt: z.ZodOptional<z.ZodString>;
|
|
2380
|
+
endsAt: z.ZodOptional<z.ZodString>;
|
|
2381
|
+
timeZone: z.ZodOptional<z.ZodString>;
|
|
2382
|
+
remindAt: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
2383
|
+
}, z.core.$strict>;
|
|
2384
|
+
export type UpdateOpportunityEventRequest = z.infer<typeof UpdateOpportunityEventRequestSchema>;
|
|
2385
|
+
export declare const OpportunityEventReminderSchema: z.ZodObject<{
|
|
2386
|
+
at: z.ZodString;
|
|
2387
|
+
state: z.ZodEnum<{
|
|
2388
|
+
no_recipient: "no_recipient";
|
|
2389
|
+
sent: "sent";
|
|
2390
|
+
scheduled: "scheduled";
|
|
2391
|
+
paused: "paused";
|
|
2392
|
+
missed: "missed";
|
|
2393
|
+
undeliverable: "undeliverable";
|
|
2394
|
+
interrupted: "interrupted";
|
|
2395
|
+
}>;
|
|
2396
|
+
handledAt: z.ZodNullable<z.ZodString>;
|
|
2397
|
+
channels: z.ZodArray<z.ZodEnum<{
|
|
2398
|
+
email: "email";
|
|
2399
|
+
bell: "bell";
|
|
2400
|
+
}>>;
|
|
2401
|
+
}, z.core.$strip>;
|
|
2402
|
+
export type OpportunityEventReminder = z.infer<typeof OpportunityEventReminderSchema>;
|
|
2403
|
+
export declare const OpportunityEventSchema: z.ZodObject<{
|
|
2404
|
+
id: z.ZodString;
|
|
2405
|
+
opportunityId: z.ZodString;
|
|
2406
|
+
name: z.ZodString;
|
|
2407
|
+
description: z.ZodNullable<z.ZodString>;
|
|
2408
|
+
allDay: z.ZodBoolean;
|
|
2409
|
+
startsAt: z.ZodString;
|
|
2410
|
+
endsAt: z.ZodString;
|
|
2411
|
+
timeZone: z.ZodString;
|
|
2412
|
+
allDayDate: z.ZodNullable<z.ZodString>;
|
|
2413
|
+
reminder: z.ZodNullable<z.ZodObject<{
|
|
2414
|
+
at: z.ZodString;
|
|
2415
|
+
state: z.ZodEnum<{
|
|
2416
|
+
no_recipient: "no_recipient";
|
|
2417
|
+
sent: "sent";
|
|
2418
|
+
scheduled: "scheduled";
|
|
2419
|
+
paused: "paused";
|
|
2420
|
+
missed: "missed";
|
|
2421
|
+
undeliverable: "undeliverable";
|
|
2422
|
+
interrupted: "interrupted";
|
|
2423
|
+
}>;
|
|
2424
|
+
handledAt: z.ZodNullable<z.ZodString>;
|
|
2425
|
+
channels: z.ZodArray<z.ZodEnum<{
|
|
2426
|
+
email: "email";
|
|
2427
|
+
bell: "bell";
|
|
2428
|
+
}>>;
|
|
2429
|
+
}, z.core.$strip>>;
|
|
2430
|
+
createdBy: z.ZodNullable<z.ZodObject<{
|
|
2431
|
+
id: z.ZodString;
|
|
2432
|
+
name: z.ZodString;
|
|
2433
|
+
}, z.core.$strip>>;
|
|
2434
|
+
createdAt: z.ZodString;
|
|
2435
|
+
updatedAt: z.ZodString;
|
|
2436
|
+
}, z.core.$strip>;
|
|
2437
|
+
export type OpportunityEvent = z.infer<typeof OpportunityEventSchema>;
|
|
2438
|
+
export declare const OpportunityEventResponseSchema: z.ZodObject<{
|
|
2439
|
+
data: z.ZodObject<{
|
|
2440
|
+
id: z.ZodString;
|
|
2441
|
+
opportunityId: z.ZodString;
|
|
2442
|
+
name: z.ZodString;
|
|
2443
|
+
description: z.ZodNullable<z.ZodString>;
|
|
2444
|
+
allDay: z.ZodBoolean;
|
|
2445
|
+
startsAt: z.ZodString;
|
|
2446
|
+
endsAt: z.ZodString;
|
|
2447
|
+
timeZone: z.ZodString;
|
|
2448
|
+
allDayDate: z.ZodNullable<z.ZodString>;
|
|
2449
|
+
reminder: z.ZodNullable<z.ZodObject<{
|
|
2450
|
+
at: z.ZodString;
|
|
2451
|
+
state: z.ZodEnum<{
|
|
2452
|
+
no_recipient: "no_recipient";
|
|
2453
|
+
sent: "sent";
|
|
2454
|
+
scheduled: "scheduled";
|
|
2455
|
+
paused: "paused";
|
|
2456
|
+
missed: "missed";
|
|
2457
|
+
undeliverable: "undeliverable";
|
|
2458
|
+
interrupted: "interrupted";
|
|
2459
|
+
}>;
|
|
2460
|
+
handledAt: z.ZodNullable<z.ZodString>;
|
|
2461
|
+
channels: z.ZodArray<z.ZodEnum<{
|
|
2462
|
+
email: "email";
|
|
2463
|
+
bell: "bell";
|
|
2464
|
+
}>>;
|
|
2465
|
+
}, z.core.$strip>>;
|
|
2466
|
+
createdBy: z.ZodNullable<z.ZodObject<{
|
|
2467
|
+
id: z.ZodString;
|
|
2468
|
+
name: z.ZodString;
|
|
2469
|
+
}, z.core.$strip>>;
|
|
2470
|
+
createdAt: z.ZodString;
|
|
2471
|
+
updatedAt: z.ZodString;
|
|
2472
|
+
}, z.core.$strip>;
|
|
2473
|
+
}, z.core.$strip>;
|
|
2474
|
+
export declare const OpportunityEventListResponseSchema: z.ZodObject<{
|
|
2475
|
+
data: z.ZodArray<z.ZodObject<{
|
|
2476
|
+
id: z.ZodString;
|
|
2477
|
+
opportunityId: z.ZodString;
|
|
2478
|
+
name: z.ZodString;
|
|
2479
|
+
description: z.ZodNullable<z.ZodString>;
|
|
2480
|
+
allDay: z.ZodBoolean;
|
|
2481
|
+
startsAt: z.ZodString;
|
|
2482
|
+
endsAt: z.ZodString;
|
|
2483
|
+
timeZone: z.ZodString;
|
|
2484
|
+
allDayDate: z.ZodNullable<z.ZodString>;
|
|
2485
|
+
reminder: z.ZodNullable<z.ZodObject<{
|
|
2486
|
+
at: z.ZodString;
|
|
2487
|
+
state: z.ZodEnum<{
|
|
2488
|
+
no_recipient: "no_recipient";
|
|
2489
|
+
sent: "sent";
|
|
2490
|
+
scheduled: "scheduled";
|
|
2491
|
+
paused: "paused";
|
|
2492
|
+
missed: "missed";
|
|
2493
|
+
undeliverable: "undeliverable";
|
|
2494
|
+
interrupted: "interrupted";
|
|
2495
|
+
}>;
|
|
2496
|
+
handledAt: z.ZodNullable<z.ZodString>;
|
|
2497
|
+
channels: z.ZodArray<z.ZodEnum<{
|
|
2498
|
+
email: "email";
|
|
2499
|
+
bell: "bell";
|
|
2500
|
+
}>>;
|
|
2501
|
+
}, z.core.$strip>>;
|
|
2502
|
+
createdBy: z.ZodNullable<z.ZodObject<{
|
|
2503
|
+
id: z.ZodString;
|
|
2504
|
+
name: z.ZodString;
|
|
2505
|
+
}, z.core.$strip>>;
|
|
2506
|
+
createdAt: z.ZodString;
|
|
2507
|
+
updatedAt: z.ZodString;
|
|
2508
|
+
}, z.core.$strip>>;
|
|
2509
|
+
}, z.core.$strip>;
|
|
2510
|
+
/**
|
|
2511
|
+
* `GET /calendar/events`. `from` is inclusive and `to` exclusive; an Event is
|
|
2512
|
+
* in the answer when it overlaps the range. `scope` absent = the caller's
|
|
2513
|
+
* default, and the server decides what is honoured: `all` asked by a caller
|
|
2514
|
+
* confined to some Organizations is answered as `mine`, not refused.
|
|
2515
|
+
*
|
|
2516
|
+
* Write the instants in UTC (`Date#toISOString`): a `+` of an offset in a
|
|
2517
|
+
* query string that is not percent-encoded arrives as a space.
|
|
2518
|
+
*/
|
|
2519
|
+
export declare const CalendarEventsQuerySchema: z.ZodObject<{
|
|
2520
|
+
from: z.ZodString;
|
|
2521
|
+
to: z.ZodString;
|
|
2522
|
+
scope: z.ZodOptional<z.ZodEnum<{
|
|
2523
|
+
all: "all";
|
|
2524
|
+
mine: "mine";
|
|
2525
|
+
}>>;
|
|
2526
|
+
}, z.core.$strip>;
|
|
2527
|
+
export type CalendarEventsQuery = z.infer<typeof CalendarEventsQuerySchema>;
|
|
2528
|
+
/** What a calendar draws and nothing more — deliberately no description. */
|
|
2529
|
+
export declare const CalendarEventSchema: z.ZodObject<{
|
|
2530
|
+
id: z.ZodString;
|
|
2531
|
+
name: z.ZodString;
|
|
2532
|
+
allDay: z.ZodBoolean;
|
|
2533
|
+
startsAt: z.ZodString;
|
|
2534
|
+
endsAt: z.ZodString;
|
|
2535
|
+
allDayDate: z.ZodNullable<z.ZodString>;
|
|
2536
|
+
hasReminder: z.ZodBoolean;
|
|
2537
|
+
opportunity: z.ZodObject<{
|
|
2538
|
+
id: z.ZodString;
|
|
2539
|
+
number: z.ZodString;
|
|
2540
|
+
title: z.ZodString;
|
|
2541
|
+
assignee: z.ZodNullable<z.ZodObject<{
|
|
2542
|
+
id: z.ZodString;
|
|
2543
|
+
name: z.ZodString;
|
|
2544
|
+
}, z.core.$strip>>;
|
|
2545
|
+
}, z.core.$strip>;
|
|
2546
|
+
}, z.core.$strip>;
|
|
2547
|
+
export type CalendarEvent = z.infer<typeof CalendarEventSchema>;
|
|
2548
|
+
/**
|
|
2549
|
+
* `scope` is the one applied and `scopes` the ones this caller may ask for;
|
|
2550
|
+
* `truncated` says more than `CALENDAR_EVENTS_MAX_RESULTS` Events matched and
|
|
2551
|
+
* the first by `startsAt`, then `id`, were returned.
|
|
2552
|
+
*/
|
|
2553
|
+
export declare const CalendarEventsMetaSchema: z.ZodObject<{
|
|
2554
|
+
scope: z.ZodEnum<{
|
|
2555
|
+
all: "all";
|
|
2556
|
+
mine: "mine";
|
|
2557
|
+
}>;
|
|
2558
|
+
scopes: z.ZodArray<z.ZodEnum<{
|
|
2559
|
+
all: "all";
|
|
2560
|
+
mine: "mine";
|
|
2561
|
+
}>>;
|
|
2562
|
+
truncated: z.ZodBoolean;
|
|
2563
|
+
}, z.core.$strip>;
|
|
2564
|
+
export type CalendarEventsMeta = z.infer<typeof CalendarEventsMetaSchema>;
|
|
2565
|
+
export declare const CalendarEventsResponseSchema: z.ZodObject<{
|
|
2566
|
+
data: z.ZodArray<z.ZodObject<{
|
|
2567
|
+
id: z.ZodString;
|
|
2568
|
+
name: z.ZodString;
|
|
2569
|
+
allDay: z.ZodBoolean;
|
|
2570
|
+
startsAt: z.ZodString;
|
|
2571
|
+
endsAt: z.ZodString;
|
|
2572
|
+
allDayDate: z.ZodNullable<z.ZodString>;
|
|
2573
|
+
hasReminder: z.ZodBoolean;
|
|
2574
|
+
opportunity: z.ZodObject<{
|
|
2575
|
+
id: z.ZodString;
|
|
2576
|
+
number: z.ZodString;
|
|
2577
|
+
title: z.ZodString;
|
|
2578
|
+
assignee: z.ZodNullable<z.ZodObject<{
|
|
2579
|
+
id: z.ZodString;
|
|
2580
|
+
name: z.ZodString;
|
|
2581
|
+
}, z.core.$strip>>;
|
|
2582
|
+
}, z.core.$strip>;
|
|
2583
|
+
}, z.core.$strip>>;
|
|
2584
|
+
meta: z.ZodObject<{
|
|
2585
|
+
scope: z.ZodEnum<{
|
|
2586
|
+
all: "all";
|
|
2587
|
+
mine: "mine";
|
|
2588
|
+
}>;
|
|
2589
|
+
scopes: z.ZodArray<z.ZodEnum<{
|
|
2590
|
+
all: "all";
|
|
2591
|
+
mine: "mine";
|
|
2592
|
+
}>>;
|
|
2593
|
+
truncated: z.ZodBoolean;
|
|
2594
|
+
}, z.core.$strip>;
|
|
2595
|
+
}, z.core.$strip>;
|
|
2596
|
+
export type CalendarEventsResponse = z.infer<typeof CalendarEventsResponseSchema>;
|
|
2597
|
+
/**
|
|
2598
|
+
* The `eventId` / `occurredAt` envelope every in-process event carries. Spelled
|
|
2599
|
+
* structurally because this package may not import the platform's `EventBase`;
|
|
2600
|
+
* the two are the same shape.
|
|
2601
|
+
*/
|
|
2602
|
+
interface CrmEventEnvelope {
|
|
2603
|
+
eventId: string;
|
|
2604
|
+
occurredAt: string;
|
|
2605
|
+
}
|
|
2606
|
+
export type OpportunityStatusEventKind = 'fromToBefore' | 'fromBefore' | 'fromToAfter' | 'toAfter';
|
|
2607
|
+
/**
|
|
2608
|
+
* The concrete name of one of the four templated status events. Statuses are
|
|
2609
|
+
* configured at runtime, so the names are not known at compile time — this is
|
|
2610
|
+
* the one place the scheme is written, for the emitter and every subscriber.
|
|
2611
|
+
*/
|
|
2612
|
+
export declare function opportunityStatusEventName(kind: OpportunityStatusEventKind, p: {
|
|
2613
|
+
from?: string;
|
|
2614
|
+
to?: string;
|
|
2615
|
+
}): string;
|
|
2616
|
+
/** The fixed event names CRM emits. */
|
|
2617
|
+
export declare const CRM_EVENTS: {
|
|
2618
|
+
readonly STATUS_CHANGED: "crm.opportunity.status_changed.v1";
|
|
2619
|
+
readonly CREATED: "crm.opportunity.created.v1";
|
|
2620
|
+
readonly CLOSED: "crm.opportunity.closed.v1";
|
|
2621
|
+
readonly ASSIGNED: "crm.opportunity.assigned.v1";
|
|
2622
|
+
readonly DOCUMENT_LINKED: "crm.opportunity.document_linked.v1";
|
|
2623
|
+
};
|
|
2624
|
+
export interface OpportunityStatusActor {
|
|
2625
|
+
kind: 'admin' | 'system';
|
|
2626
|
+
adminUserId?: string;
|
|
2627
|
+
}
|
|
2628
|
+
export type OpportunityTransitionCause = 'manual' | 'order_status' | 'system';
|
|
2629
|
+
/** Payload of the four templated status events, and what a guard is handed. */
|
|
2630
|
+
export interface OpportunityStatusEvent extends CrmEventEnvelope {
|
|
2631
|
+
opportunityId: string;
|
|
2632
|
+
organizationId: string;
|
|
2633
|
+
salesChannelId: string | null;
|
|
2634
|
+
from: string;
|
|
2635
|
+
to: string;
|
|
2636
|
+
fromKind: OpportunityStatusKind;
|
|
2637
|
+
toKind: OpportunityStatusKind;
|
|
2638
|
+
actor: OpportunityStatusActor;
|
|
2639
|
+
cause: OpportunityTransitionCause;
|
|
2640
|
+
causeOrderId?: string;
|
|
2641
|
+
reason: string | null;
|
|
2642
|
+
}
|
|
2643
|
+
/** Payload of `crm.opportunity.status_changed.v1`. */
|
|
2644
|
+
export declare const OpportunityStatusChangedEventV1Schema: z.ZodObject<{
|
|
2645
|
+
opportunityId: z.ZodString;
|
|
2646
|
+
number: z.ZodString;
|
|
2647
|
+
organizationId: z.ZodString;
|
|
2648
|
+
salesChannelId: z.ZodNullable<z.ZodString>;
|
|
2649
|
+
from: z.ZodString;
|
|
2650
|
+
to: z.ZodString;
|
|
2651
|
+
fromKind: z.ZodEnum<{
|
|
2652
|
+
open: "open";
|
|
2653
|
+
won: "won";
|
|
2654
|
+
lost: "lost";
|
|
2655
|
+
}>;
|
|
2656
|
+
toKind: z.ZodEnum<{
|
|
2657
|
+
open: "open";
|
|
2658
|
+
won: "won";
|
|
2659
|
+
lost: "lost";
|
|
2660
|
+
}>;
|
|
2661
|
+
actor: z.ZodObject<{
|
|
2662
|
+
kind: z.ZodEnum<{
|
|
2663
|
+
admin: "admin";
|
|
2664
|
+
system: "system";
|
|
2665
|
+
}>;
|
|
2666
|
+
adminUserId: z.ZodOptional<z.ZodString>;
|
|
2667
|
+
}, z.core.$strict>;
|
|
2668
|
+
cause: z.ZodEnum<{
|
|
2669
|
+
system: "system";
|
|
2670
|
+
manual: "manual";
|
|
2671
|
+
order_status: "order_status";
|
|
2672
|
+
}>;
|
|
2673
|
+
causeOrderId: z.ZodOptional<z.ZodString>;
|
|
2674
|
+
reason: z.ZodNullable<z.ZodString>;
|
|
2675
|
+
eventId: z.ZodString;
|
|
2676
|
+
occurredAt: z.ZodString;
|
|
2677
|
+
}, z.core.$strict>;
|
|
2678
|
+
export type OpportunityStatusChangedEvent = z.infer<typeof OpportunityStatusChangedEventV1Schema>;
|
|
2679
|
+
/** Payload of `crm.opportunity.created.v1`. */
|
|
2680
|
+
export declare const OpportunityCreatedEventV1Schema: z.ZodObject<{
|
|
2681
|
+
opportunityId: z.ZodString;
|
|
2682
|
+
number: z.ZodString;
|
|
2683
|
+
organizationId: z.ZodString;
|
|
2684
|
+
source: z.ZodEnum<{
|
|
2685
|
+
order: "order";
|
|
2686
|
+
quote_request: "quote_request";
|
|
2687
|
+
manual: "manual";
|
|
2688
|
+
}>;
|
|
2689
|
+
eventId: z.ZodString;
|
|
2690
|
+
occurredAt: z.ZodString;
|
|
2691
|
+
}, z.core.$strict>;
|
|
2692
|
+
export type OpportunityCreatedEvent = z.infer<typeof OpportunityCreatedEventV1Schema>;
|
|
2693
|
+
/**
|
|
2694
|
+
* Payload of `crm.opportunity.closed.v1` — one event for won and lost, told
|
|
2695
|
+
* apart by `outcome`.
|
|
2696
|
+
*/
|
|
2697
|
+
export declare const OpportunityClosedEventV1Schema: z.ZodObject<{
|
|
2698
|
+
opportunityId: z.ZodString;
|
|
2699
|
+
organizationId: z.ZodString;
|
|
2700
|
+
outcome: z.ZodEnum<{
|
|
2701
|
+
won: "won";
|
|
2702
|
+
lost: "lost";
|
|
2703
|
+
}>;
|
|
2704
|
+
value: z.ZodNullable<z.ZodString>;
|
|
2705
|
+
currency: z.ZodString;
|
|
2706
|
+
eventId: z.ZodString;
|
|
2707
|
+
occurredAt: z.ZodString;
|
|
2708
|
+
}, z.core.$strict>;
|
|
2709
|
+
export type OpportunityClosedEvent = z.infer<typeof OpportunityClosedEventV1Schema>;
|
|
2710
|
+
/** The event types CRM offers to outbound webhooks, in the order they are offered. */
|
|
2711
|
+
export declare const CRM_WEBHOOK_EVENT_TYPES: readonly ["crm.opportunity.status_changed.v1", "crm.opportunity.created.v1", "crm.opportunity.closed.v1"];
|
|
2712
|
+
/** The strict schema of each offered event's payload, by event type. */
|
|
2713
|
+
export declare const CRM_WEBHOOK_EVENT_SCHEMAS: {
|
|
2714
|
+
readonly "crm.opportunity.status_changed.v1": z.ZodObject<{
|
|
2715
|
+
opportunityId: z.ZodString;
|
|
2716
|
+
number: z.ZodString;
|
|
2717
|
+
organizationId: z.ZodString;
|
|
2718
|
+
salesChannelId: z.ZodNullable<z.ZodString>;
|
|
2719
|
+
from: z.ZodString;
|
|
2720
|
+
to: z.ZodString;
|
|
2721
|
+
fromKind: z.ZodEnum<{
|
|
2722
|
+
open: "open";
|
|
2723
|
+
won: "won";
|
|
2724
|
+
lost: "lost";
|
|
2725
|
+
}>;
|
|
2726
|
+
toKind: z.ZodEnum<{
|
|
2727
|
+
open: "open";
|
|
2728
|
+
won: "won";
|
|
2729
|
+
lost: "lost";
|
|
2730
|
+
}>;
|
|
2731
|
+
actor: z.ZodObject<{
|
|
2732
|
+
kind: z.ZodEnum<{
|
|
2733
|
+
admin: "admin";
|
|
2734
|
+
system: "system";
|
|
2735
|
+
}>;
|
|
2736
|
+
adminUserId: z.ZodOptional<z.ZodString>;
|
|
2737
|
+
}, z.core.$strict>;
|
|
2738
|
+
cause: z.ZodEnum<{
|
|
2739
|
+
system: "system";
|
|
2740
|
+
manual: "manual";
|
|
2741
|
+
order_status: "order_status";
|
|
2742
|
+
}>;
|
|
2743
|
+
causeOrderId: z.ZodOptional<z.ZodString>;
|
|
2744
|
+
reason: z.ZodNullable<z.ZodString>;
|
|
2745
|
+
eventId: z.ZodString;
|
|
2746
|
+
occurredAt: z.ZodString;
|
|
2747
|
+
}, z.core.$strict>;
|
|
2748
|
+
readonly "crm.opportunity.created.v1": z.ZodObject<{
|
|
2749
|
+
opportunityId: z.ZodString;
|
|
2750
|
+
number: z.ZodString;
|
|
2751
|
+
organizationId: z.ZodString;
|
|
2752
|
+
source: z.ZodEnum<{
|
|
2753
|
+
order: "order";
|
|
2754
|
+
quote_request: "quote_request";
|
|
2755
|
+
manual: "manual";
|
|
2756
|
+
}>;
|
|
2757
|
+
eventId: z.ZodString;
|
|
2758
|
+
occurredAt: z.ZodString;
|
|
2759
|
+
}, z.core.$strict>;
|
|
2760
|
+
readonly "crm.opportunity.closed.v1": z.ZodObject<{
|
|
2761
|
+
opportunityId: z.ZodString;
|
|
2762
|
+
organizationId: z.ZodString;
|
|
2763
|
+
outcome: z.ZodEnum<{
|
|
2764
|
+
won: "won";
|
|
2765
|
+
lost: "lost";
|
|
2766
|
+
}>;
|
|
2767
|
+
value: z.ZodNullable<z.ZodString>;
|
|
2768
|
+
currency: z.ZodString;
|
|
2769
|
+
eventId: z.ZodString;
|
|
2770
|
+
occurredAt: z.ZodString;
|
|
2771
|
+
}, z.core.$strict>;
|
|
2772
|
+
};
|
|
2773
|
+
/** Payload of `crm.opportunity.assigned.v1`. */
|
|
2774
|
+
export interface OpportunityAssignedEvent extends CrmEventEnvelope {
|
|
2775
|
+
opportunityId: string;
|
|
2776
|
+
organizationId: string;
|
|
2777
|
+
assignedAdminUserId: string | null;
|
|
2778
|
+
previousAdminUserId: string | null;
|
|
2779
|
+
}
|
|
2780
|
+
/** Payload of `crm.opportunity.document_linked.v1`. */
|
|
2781
|
+
export interface OpportunityDocumentLinkedEvent extends CrmEventEnvelope {
|
|
2782
|
+
opportunityId: string;
|
|
2783
|
+
organizationId: string;
|
|
2784
|
+
documentKind: OpportunityDocumentKind;
|
|
2785
|
+
documentId: string;
|
|
2786
|
+
linkSource: OpportunityLinkSource;
|
|
2787
|
+
}
|
|
2788
|
+
/** Thrown by a guard to refuse a transition; the message is what the Sales Rep reads. */
|
|
2789
|
+
export declare class OpportunityTransitionVetoError extends Error {
|
|
2790
|
+
readonly from: string;
|
|
2791
|
+
readonly to: string;
|
|
2792
|
+
constructor(message: string, from: string, to: string);
|
|
2793
|
+
}
|
|
2794
|
+
export interface OpportunityTransitionGuard {
|
|
2795
|
+
/** The contributing module — required; an absent owner's guard is skipped. */
|
|
2796
|
+
readonly ownerModuleId: string;
|
|
2797
|
+
/** Omit a field to match any status. `{}` matches every transition. */
|
|
2798
|
+
readonly match: {
|
|
2799
|
+
readonly from?: string;
|
|
2800
|
+
readonly to?: string;
|
|
2801
|
+
};
|
|
2802
|
+
/** Throw `OpportunityTransitionVetoError` to refuse. Anything else thrown is a 500. */
|
|
2803
|
+
guard(event: OpportunityStatusEvent): void | Promise<void>;
|
|
2804
|
+
}
|
|
2805
|
+
/**
|
|
2806
|
+
* Container name: `opportunityTransitionGuardRegistry`. Owner: `crm`.
|
|
2807
|
+
*
|
|
2808
|
+
* The registry a module pushes an {@link OpportunityTransitionGuard} into.
|
|
2809
|
+
*
|
|
2810
|
+
* A **contribution seam**: registered ungated (a plain `ctx.di.register`),
|
|
2811
|
+
* pushed into from a contribution-only boot hook, declared by the contributor
|
|
2812
|
+
* as a `contributes-to` edge. A boot hook that resolved a gated port would stop
|
|
2813
|
+
* the backend from starting whenever CRM was switched off.
|
|
2814
|
+
*
|
|
2815
|
+
* **Owner off:** no transition can happen, so no guard runs.
|
|
2816
|
+
*
|
|
2817
|
+
* **Enumeration policy: skipped while the contributing module is absent.** CRM
|
|
2818
|
+
* skips a guard whose `ownerModuleId` is not effectively present at dispatch —
|
|
2819
|
+
* a switched-off module does not veto.
|
|
2820
|
+
*/
|
|
2821
|
+
export interface OpportunityTransitionGuardRegistryPort {
|
|
2822
|
+
register(guard: OpportunityTransitionGuard): void;
|
|
2823
|
+
/** Contributing modules, in registration order — for diagnostics and composition tests. */
|
|
2824
|
+
owners(): readonly string[];
|
|
2825
|
+
}
|
|
2826
|
+
/** An Opportunity as it crosses a module boundary — a plain shape, never the entity. */
|
|
2827
|
+
export interface OpportunityRecord {
|
|
2828
|
+
id: string;
|
|
2829
|
+
number: string;
|
|
2830
|
+
title: string;
|
|
2831
|
+
organizationId: string;
|
|
2832
|
+
customerAccountId: string | null;
|
|
2833
|
+
salesChannelId: string | null;
|
|
2834
|
+
statusCode: string;
|
|
2835
|
+
statusKind: OpportunityStatusKind;
|
|
2836
|
+
assignedAdminUserId: string | null;
|
|
2837
|
+
value: string | null;
|
|
2838
|
+
valueMode: OpportunityValueMode;
|
|
2839
|
+
currency: string;
|
|
2840
|
+
closedAt: Date | null;
|
|
2841
|
+
createdAt: Date;
|
|
2842
|
+
updatedAt: Date;
|
|
2843
|
+
}
|
|
2844
|
+
/**
|
|
2845
|
+
* Container name: `opportunityReadPort`. Owner: `crm`.
|
|
2846
|
+
*
|
|
2847
|
+
* Reading Opportunities from another module.
|
|
2848
|
+
*
|
|
2849
|
+
* Reads run under the **caller's** ambient tenant context.
|
|
2850
|
+
*
|
|
2851
|
+
* **Owner off:** the seam fails closed — resolving this port throws
|
|
2852
|
+
* `ModuleDisabledError` and the call answers 503 `MODULE_DISABLED`.
|
|
2853
|
+
*/
|
|
2854
|
+
export interface OpportunityReadPort {
|
|
2855
|
+
findById(id: string): Promise<OpportunityRecord | null>;
|
|
2856
|
+
findByDocument(kind: OpportunityDocumentKind, documentId: string): Promise<OpportunityRecord | null>;
|
|
2857
|
+
listOpenForOrganization(organizationId: string): Promise<OpportunityRecord[]>;
|
|
2858
|
+
}
|
|
2859
|
+
/** Why a requested transition did not happen. */
|
|
2860
|
+
export declare const OPPORTUNITY_TRANSITION_REFUSALS: readonly ["not_found", "unknown_status", "not_permitted", "vetoed"];
|
|
2861
|
+
export type OpportunityTransitionRefusal = (typeof OPPORTUNITY_TRANSITION_REFUSALS)[number];
|
|
2862
|
+
/**
|
|
2863
|
+
* What became of a requested transition — deliberately the shape of
|
|
2864
|
+
* `OrderTransitionOutcome`. `already_there` is not a refusal: the Opportunity
|
|
2865
|
+
* is where the caller wanted it and nothing was recorded.
|
|
2866
|
+
*/
|
|
2867
|
+
export type OpportunityTransitionOutcome = {
|
|
2868
|
+
applied: true;
|
|
2869
|
+
from: string;
|
|
2870
|
+
to: string;
|
|
2871
|
+
} | {
|
|
2872
|
+
applied: false;
|
|
2873
|
+
reason: 'already_there';
|
|
2874
|
+
from: string;
|
|
2875
|
+
} | {
|
|
2876
|
+
applied: false;
|
|
2877
|
+
reason: OpportunityTransitionRefusal;
|
|
2878
|
+
from: string | null;
|
|
2879
|
+
detail: string;
|
|
2880
|
+
};
|
|
2881
|
+
/**
|
|
2882
|
+
* Container name: `opportunityTransitionPort`. Owner: `crm`.
|
|
2883
|
+
*
|
|
2884
|
+
* Moving an Opportunity from another module.
|
|
2885
|
+
*
|
|
2886
|
+
* **Call this after your own commit, never inside your transaction** — the
|
|
2887
|
+
* implementation obtains its own EntityManager. A refusal is a value, not an
|
|
2888
|
+
* exception.
|
|
2889
|
+
*
|
|
2890
|
+
* **Owner off:** the seam fails closed — resolving this port throws
|
|
2891
|
+
* `ModuleDisabledError` and the call answers 503 `MODULE_DISABLED`. A consumer
|
|
2892
|
+
* must not wrap the call in a bare `catch`.
|
|
2893
|
+
*/
|
|
2894
|
+
export interface OpportunityTransitionPort {
|
|
2895
|
+
applyStatus(input: {
|
|
2896
|
+
opportunityId: string;
|
|
2897
|
+
to: string;
|
|
2898
|
+
actor: OpportunityStatusActor;
|
|
2899
|
+
reason?: string | null;
|
|
2900
|
+
}): Promise<OpportunityTransitionOutcome>;
|
|
2901
|
+
}
|
|
2902
|
+
export {};
|
|
2903
|
+
//# sourceMappingURL=crm.d.ts.map
|