@voyantjs/crm 0.1.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.
Files changed (60) hide show
  1. package/LICENSE +109 -0
  2. package/README.md +47 -0
  3. package/dist/booking-extension.d.ts +123 -0
  4. package/dist/booking-extension.d.ts.map +1 -0
  5. package/dist/booking-extension.js +86 -0
  6. package/dist/index.d.ts +14 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +29 -0
  9. package/dist/routes/accounts.d.ts +1203 -0
  10. package/dist/routes/accounts.d.ts.map +1 -0
  11. package/dist/routes/accounts.js +226 -0
  12. package/dist/routes/activities.d.ts +299 -0
  13. package/dist/routes/activities.d.ts.map +1 -0
  14. package/dist/routes/activities.js +61 -0
  15. package/dist/routes/custom-fields.d.ts +256 -0
  16. package/dist/routes/custom-fields.d.ts.map +1 -0
  17. package/dist/routes/custom-fields.js +46 -0
  18. package/dist/routes/index.d.ts +2671 -0
  19. package/dist/routes/index.d.ts.map +1 -0
  20. package/dist/routes/index.js +14 -0
  21. package/dist/routes/opportunities.d.ts +387 -0
  22. package/dist/routes/opportunities.d.ts.map +1 -0
  23. package/dist/routes/opportunities.js +69 -0
  24. package/dist/routes/pipelines.d.ts +292 -0
  25. package/dist/routes/pipelines.d.ts.map +1 -0
  26. package/dist/routes/pipelines.js +58 -0
  27. package/dist/routes/quotes.d.ts +283 -0
  28. package/dist/routes/quotes.d.ts.map +1 -0
  29. package/dist/routes/quotes.js +51 -0
  30. package/dist/schema.d.ts +3478 -0
  31. package/dist/schema.d.ts.map +1 -0
  32. package/dist/schema.js +515 -0
  33. package/dist/service/accounts.d.ts +982 -0
  34. package/dist/service/accounts.d.ts.map +1 -0
  35. package/dist/service/accounts.js +509 -0
  36. package/dist/service/activities.d.ts +486 -0
  37. package/dist/service/activities.d.ts.map +1 -0
  38. package/dist/service/activities.js +114 -0
  39. package/dist/service/custom-fields.d.ts +118 -0
  40. package/dist/service/custom-fields.d.ts.map +1 -0
  41. package/dist/service/custom-fields.js +88 -0
  42. package/dist/service/helpers.d.ts +22 -0
  43. package/dist/service/helpers.d.ts.map +1 -0
  44. package/dist/service/helpers.js +39 -0
  45. package/dist/service/index.d.ts +3329 -0
  46. package/dist/service/index.d.ts.map +1 -0
  47. package/dist/service/index.js +14 -0
  48. package/dist/service/opportunities.d.ts +822 -0
  49. package/dist/service/opportunities.d.ts.map +1 -0
  50. package/dist/service/opportunities.js +117 -0
  51. package/dist/service/pipelines.d.ts +113 -0
  52. package/dist/service/pipelines.d.ts.map +1 -0
  53. package/dist/service/pipelines.js +68 -0
  54. package/dist/service/quotes.d.ts +494 -0
  55. package/dist/service/quotes.d.ts.map +1 -0
  56. package/dist/service/quotes.js +69 -0
  57. package/dist/validation.d.ts +860 -0
  58. package/dist/validation.d.ts.map +1 -0
  59. package/dist/validation.js +315 -0
  60. package/package.json +56 -0
@@ -0,0 +1,822 @@
1
+ import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
2
+ import type { z } from "zod";
3
+ import type { insertOpportunityParticipantSchema, insertOpportunityProductSchema, insertOpportunitySchema, opportunityListQuerySchema, updateOpportunityProductSchema, updateOpportunitySchema } from "../validation.js";
4
+ type OpportunityListQuery = z.infer<typeof opportunityListQuerySchema>;
5
+ type CreateOpportunityInput = z.infer<typeof insertOpportunitySchema>;
6
+ type UpdateOpportunityInput = z.infer<typeof updateOpportunitySchema>;
7
+ type CreateOpportunityParticipantInput = z.infer<typeof insertOpportunityParticipantSchema>;
8
+ type CreateOpportunityProductInput = z.infer<typeof insertOpportunityProductSchema>;
9
+ type UpdateOpportunityProductInput = z.infer<typeof updateOpportunityProductSchema>;
10
+ export declare const opportunitiesService: {
11
+ listOpportunities(db: PostgresJsDatabase, query: OpportunityListQuery): Promise<{
12
+ data: {
13
+ id: string;
14
+ title: string;
15
+ personId: string | null;
16
+ organizationId: string | null;
17
+ pipelineId: string;
18
+ stageId: string;
19
+ ownerId: string | null;
20
+ status: "archived" | "open" | "won" | "lost";
21
+ valueAmountCents: number | null;
22
+ valueCurrency: string | null;
23
+ expectedCloseDate: string | null;
24
+ source: string | null;
25
+ sourceRef: string | null;
26
+ lostReason: string | null;
27
+ tags: string[];
28
+ createdAt: Date;
29
+ updatedAt: Date;
30
+ stageChangedAt: Date;
31
+ closedAt: Date | null;
32
+ }[];
33
+ total: number;
34
+ limit: number;
35
+ offset: number;
36
+ }>;
37
+ getOpportunityById(db: PostgresJsDatabase, id: string): Promise<{
38
+ id: string;
39
+ title: string;
40
+ personId: string | null;
41
+ organizationId: string | null;
42
+ pipelineId: string;
43
+ stageId: string;
44
+ ownerId: string | null;
45
+ status: "archived" | "open" | "won" | "lost";
46
+ valueAmountCents: number | null;
47
+ valueCurrency: string | null;
48
+ expectedCloseDate: string | null;
49
+ source: string | null;
50
+ sourceRef: string | null;
51
+ lostReason: string | null;
52
+ tags: string[];
53
+ createdAt: Date;
54
+ updatedAt: Date;
55
+ stageChangedAt: Date;
56
+ closedAt: Date | null;
57
+ } | null>;
58
+ createOpportunity(db: PostgresJsDatabase, data: CreateOpportunityInput): Promise<{
59
+ createdAt: Date;
60
+ updatedAt: Date;
61
+ title: string;
62
+ id: string;
63
+ ownerId: string | null;
64
+ status: "archived" | "open" | "won" | "lost";
65
+ source: string | null;
66
+ sourceRef: string | null;
67
+ tags: string[];
68
+ organizationId: string | null;
69
+ pipelineId: string;
70
+ personId: string | null;
71
+ stageId: string;
72
+ valueAmountCents: number | null;
73
+ valueCurrency: string | null;
74
+ expectedCloseDate: string | null;
75
+ lostReason: string | null;
76
+ stageChangedAt: Date;
77
+ closedAt: Date | null;
78
+ } | undefined>;
79
+ updateOpportunity(db: PostgresJsDatabase, id: string, data: UpdateOpportunityInput): Promise<{
80
+ id: string;
81
+ title: string;
82
+ personId: string | null;
83
+ organizationId: string | null;
84
+ pipelineId: string;
85
+ stageId: string;
86
+ ownerId: string | null;
87
+ status: "archived" | "open" | "won" | "lost";
88
+ valueAmountCents: number | null;
89
+ valueCurrency: string | null;
90
+ expectedCloseDate: string | null;
91
+ source: string | null;
92
+ sourceRef: string | null;
93
+ lostReason: string | null;
94
+ tags: string[];
95
+ createdAt: Date;
96
+ updatedAt: Date;
97
+ stageChangedAt: Date;
98
+ closedAt: Date | null;
99
+ } | null>;
100
+ deleteOpportunity(db: PostgresJsDatabase, id: string): Promise<{
101
+ id: string;
102
+ } | null>;
103
+ listOpportunityParticipants(db: PostgresJsDatabase, opportunityId: string): Omit<import("drizzle-orm/pg-core").PgSelectBase<"opportunity_participants", {
104
+ id: import("drizzle-orm/pg-core").PgColumn<{
105
+ name: string;
106
+ tableName: "opportunity_participants";
107
+ dataType: "string";
108
+ columnType: "PgText";
109
+ data: string;
110
+ driverParam: string;
111
+ notNull: true;
112
+ hasDefault: true;
113
+ isPrimaryKey: true;
114
+ isAutoincrement: false;
115
+ hasRuntimeDefault: true;
116
+ enumValues: [string, ...string[]];
117
+ baseColumn: never;
118
+ identity: undefined;
119
+ generated: undefined;
120
+ }, {}, {}>;
121
+ opportunityId: import("drizzle-orm/pg-core").PgColumn<{
122
+ name: string;
123
+ tableName: "opportunity_participants";
124
+ dataType: "string";
125
+ columnType: "PgText";
126
+ data: string;
127
+ driverParam: string;
128
+ notNull: true;
129
+ hasDefault: false;
130
+ isPrimaryKey: false;
131
+ isAutoincrement: false;
132
+ hasRuntimeDefault: false;
133
+ enumValues: [string, ...string[]];
134
+ baseColumn: never;
135
+ identity: undefined;
136
+ generated: undefined;
137
+ }, {}, {}>;
138
+ personId: import("drizzle-orm/pg-core").PgColumn<{
139
+ name: string;
140
+ tableName: "opportunity_participants";
141
+ dataType: "string";
142
+ columnType: "PgText";
143
+ data: string;
144
+ driverParam: string;
145
+ notNull: true;
146
+ hasDefault: false;
147
+ isPrimaryKey: false;
148
+ isAutoincrement: false;
149
+ hasRuntimeDefault: false;
150
+ enumValues: [string, ...string[]];
151
+ baseColumn: never;
152
+ identity: undefined;
153
+ generated: undefined;
154
+ }, {}, {}>;
155
+ role: import("drizzle-orm/pg-core").PgColumn<{
156
+ name: "role";
157
+ tableName: "opportunity_participants";
158
+ dataType: "string";
159
+ columnType: "PgEnumColumn";
160
+ data: "other" | "traveler" | "booker" | "decision_maker" | "finance";
161
+ driverParam: string;
162
+ notNull: true;
163
+ hasDefault: true;
164
+ isPrimaryKey: false;
165
+ isAutoincrement: false;
166
+ hasRuntimeDefault: false;
167
+ enumValues: ["traveler", "booker", "decision_maker", "finance", "other"];
168
+ baseColumn: never;
169
+ identity: undefined;
170
+ generated: undefined;
171
+ }, {}, {}>;
172
+ isPrimary: import("drizzle-orm/pg-core").PgColumn<{
173
+ name: "is_primary";
174
+ tableName: "opportunity_participants";
175
+ dataType: "boolean";
176
+ columnType: "PgBoolean";
177
+ data: boolean;
178
+ driverParam: boolean;
179
+ notNull: true;
180
+ hasDefault: true;
181
+ isPrimaryKey: false;
182
+ isAutoincrement: false;
183
+ hasRuntimeDefault: false;
184
+ enumValues: undefined;
185
+ baseColumn: never;
186
+ identity: undefined;
187
+ generated: undefined;
188
+ }, {}, {}>;
189
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
190
+ name: "created_at";
191
+ tableName: "opportunity_participants";
192
+ dataType: "date";
193
+ columnType: "PgTimestamp";
194
+ data: Date;
195
+ driverParam: string;
196
+ notNull: true;
197
+ hasDefault: true;
198
+ isPrimaryKey: false;
199
+ isAutoincrement: false;
200
+ hasRuntimeDefault: false;
201
+ enumValues: undefined;
202
+ baseColumn: never;
203
+ identity: undefined;
204
+ generated: undefined;
205
+ }, {}, {}>;
206
+ }, "single", Record<"opportunity_participants", "not-null">, false, "where" | "orderBy", {
207
+ id: string;
208
+ opportunityId: string;
209
+ personId: string;
210
+ role: "other" | "traveler" | "booker" | "decision_maker" | "finance";
211
+ isPrimary: boolean;
212
+ createdAt: Date;
213
+ }[], {
214
+ id: import("drizzle-orm/pg-core").PgColumn<{
215
+ name: string;
216
+ tableName: "opportunity_participants";
217
+ dataType: "string";
218
+ columnType: "PgText";
219
+ data: string;
220
+ driverParam: string;
221
+ notNull: true;
222
+ hasDefault: true;
223
+ isPrimaryKey: true;
224
+ isAutoincrement: false;
225
+ hasRuntimeDefault: true;
226
+ enumValues: [string, ...string[]];
227
+ baseColumn: never;
228
+ identity: undefined;
229
+ generated: undefined;
230
+ }, {}, {}>;
231
+ opportunityId: import("drizzle-orm/pg-core").PgColumn<{
232
+ name: string;
233
+ tableName: "opportunity_participants";
234
+ dataType: "string";
235
+ columnType: "PgText";
236
+ data: string;
237
+ driverParam: string;
238
+ notNull: true;
239
+ hasDefault: false;
240
+ isPrimaryKey: false;
241
+ isAutoincrement: false;
242
+ hasRuntimeDefault: false;
243
+ enumValues: [string, ...string[]];
244
+ baseColumn: never;
245
+ identity: undefined;
246
+ generated: undefined;
247
+ }, {}, {}>;
248
+ personId: import("drizzle-orm/pg-core").PgColumn<{
249
+ name: string;
250
+ tableName: "opportunity_participants";
251
+ dataType: "string";
252
+ columnType: "PgText";
253
+ data: string;
254
+ driverParam: string;
255
+ notNull: true;
256
+ hasDefault: false;
257
+ isPrimaryKey: false;
258
+ isAutoincrement: false;
259
+ hasRuntimeDefault: false;
260
+ enumValues: [string, ...string[]];
261
+ baseColumn: never;
262
+ identity: undefined;
263
+ generated: undefined;
264
+ }, {}, {}>;
265
+ role: import("drizzle-orm/pg-core").PgColumn<{
266
+ name: "role";
267
+ tableName: "opportunity_participants";
268
+ dataType: "string";
269
+ columnType: "PgEnumColumn";
270
+ data: "other" | "traveler" | "booker" | "decision_maker" | "finance";
271
+ driverParam: string;
272
+ notNull: true;
273
+ hasDefault: true;
274
+ isPrimaryKey: false;
275
+ isAutoincrement: false;
276
+ hasRuntimeDefault: false;
277
+ enumValues: ["traveler", "booker", "decision_maker", "finance", "other"];
278
+ baseColumn: never;
279
+ identity: undefined;
280
+ generated: undefined;
281
+ }, {}, {}>;
282
+ isPrimary: import("drizzle-orm/pg-core").PgColumn<{
283
+ name: "is_primary";
284
+ tableName: "opportunity_participants";
285
+ dataType: "boolean";
286
+ columnType: "PgBoolean";
287
+ data: boolean;
288
+ driverParam: boolean;
289
+ notNull: true;
290
+ hasDefault: true;
291
+ isPrimaryKey: false;
292
+ isAutoincrement: false;
293
+ hasRuntimeDefault: false;
294
+ enumValues: undefined;
295
+ baseColumn: never;
296
+ identity: undefined;
297
+ generated: undefined;
298
+ }, {}, {}>;
299
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
300
+ name: "created_at";
301
+ tableName: "opportunity_participants";
302
+ dataType: "date";
303
+ columnType: "PgTimestamp";
304
+ data: Date;
305
+ driverParam: string;
306
+ notNull: true;
307
+ hasDefault: true;
308
+ isPrimaryKey: false;
309
+ isAutoincrement: false;
310
+ hasRuntimeDefault: false;
311
+ enumValues: undefined;
312
+ baseColumn: never;
313
+ identity: undefined;
314
+ generated: undefined;
315
+ }, {}, {}>;
316
+ }>, "where" | "orderBy">;
317
+ createOpportunityParticipant(db: PostgresJsDatabase, opportunityId: string, data: CreateOpportunityParticipantInput): Promise<{
318
+ opportunityId: string;
319
+ createdAt: Date;
320
+ isPrimary: boolean;
321
+ role: "other" | "traveler" | "booker" | "decision_maker" | "finance";
322
+ id: string;
323
+ personId: string;
324
+ } | undefined>;
325
+ deleteOpportunityParticipant(db: PostgresJsDatabase, id: string): Promise<{
326
+ id: string;
327
+ } | null>;
328
+ listOpportunityProducts(db: PostgresJsDatabase, opportunityId: string): Omit<import("drizzle-orm/pg-core").PgSelectBase<"opportunity_products", {
329
+ id: import("drizzle-orm/pg-core").PgColumn<{
330
+ name: string;
331
+ tableName: "opportunity_products";
332
+ dataType: "string";
333
+ columnType: "PgText";
334
+ data: string;
335
+ driverParam: string;
336
+ notNull: true;
337
+ hasDefault: true;
338
+ isPrimaryKey: true;
339
+ isAutoincrement: false;
340
+ hasRuntimeDefault: true;
341
+ enumValues: [string, ...string[]];
342
+ baseColumn: never;
343
+ identity: undefined;
344
+ generated: undefined;
345
+ }, {}, {}>;
346
+ opportunityId: import("drizzle-orm/pg-core").PgColumn<{
347
+ name: string;
348
+ tableName: "opportunity_products";
349
+ dataType: "string";
350
+ columnType: "PgText";
351
+ data: string;
352
+ driverParam: string;
353
+ notNull: true;
354
+ hasDefault: false;
355
+ isPrimaryKey: false;
356
+ isAutoincrement: false;
357
+ hasRuntimeDefault: false;
358
+ enumValues: [string, ...string[]];
359
+ baseColumn: never;
360
+ identity: undefined;
361
+ generated: undefined;
362
+ }, {}, {}>;
363
+ productId: import("drizzle-orm/pg-core").PgColumn<{
364
+ name: "product_id";
365
+ tableName: "opportunity_products";
366
+ dataType: "string";
367
+ columnType: "PgText";
368
+ data: string;
369
+ driverParam: string;
370
+ notNull: false;
371
+ hasDefault: false;
372
+ isPrimaryKey: false;
373
+ isAutoincrement: false;
374
+ hasRuntimeDefault: false;
375
+ enumValues: [string, ...string[]];
376
+ baseColumn: never;
377
+ identity: undefined;
378
+ generated: undefined;
379
+ }, {}, {}>;
380
+ supplierServiceId: import("drizzle-orm/pg-core").PgColumn<{
381
+ name: "supplier_service_id";
382
+ tableName: "opportunity_products";
383
+ dataType: "string";
384
+ columnType: "PgText";
385
+ data: string;
386
+ driverParam: string;
387
+ notNull: false;
388
+ hasDefault: false;
389
+ isPrimaryKey: false;
390
+ isAutoincrement: false;
391
+ hasRuntimeDefault: false;
392
+ enumValues: [string, ...string[]];
393
+ baseColumn: never;
394
+ identity: undefined;
395
+ generated: undefined;
396
+ }, {}, {}>;
397
+ nameSnapshot: import("drizzle-orm/pg-core").PgColumn<{
398
+ name: "name_snapshot";
399
+ tableName: "opportunity_products";
400
+ dataType: "string";
401
+ columnType: "PgText";
402
+ data: string;
403
+ driverParam: string;
404
+ notNull: true;
405
+ hasDefault: false;
406
+ isPrimaryKey: false;
407
+ isAutoincrement: false;
408
+ hasRuntimeDefault: false;
409
+ enumValues: [string, ...string[]];
410
+ baseColumn: never;
411
+ identity: undefined;
412
+ generated: undefined;
413
+ }, {}, {}>;
414
+ description: import("drizzle-orm/pg-core").PgColumn<{
415
+ name: "description";
416
+ tableName: "opportunity_products";
417
+ dataType: "string";
418
+ columnType: "PgText";
419
+ data: string;
420
+ driverParam: string;
421
+ notNull: false;
422
+ hasDefault: false;
423
+ isPrimaryKey: false;
424
+ isAutoincrement: false;
425
+ hasRuntimeDefault: false;
426
+ enumValues: [string, ...string[]];
427
+ baseColumn: never;
428
+ identity: undefined;
429
+ generated: undefined;
430
+ }, {}, {}>;
431
+ quantity: import("drizzle-orm/pg-core").PgColumn<{
432
+ name: "quantity";
433
+ tableName: "opportunity_products";
434
+ dataType: "number";
435
+ columnType: "PgInteger";
436
+ data: number;
437
+ driverParam: string | number;
438
+ notNull: true;
439
+ hasDefault: true;
440
+ isPrimaryKey: false;
441
+ isAutoincrement: false;
442
+ hasRuntimeDefault: false;
443
+ enumValues: undefined;
444
+ baseColumn: never;
445
+ identity: undefined;
446
+ generated: undefined;
447
+ }, {}, {}>;
448
+ unitPriceAmountCents: import("drizzle-orm/pg-core").PgColumn<{
449
+ name: "unit_price_amount_cents";
450
+ tableName: "opportunity_products";
451
+ dataType: "number";
452
+ columnType: "PgInteger";
453
+ data: number;
454
+ driverParam: string | number;
455
+ notNull: false;
456
+ hasDefault: false;
457
+ isPrimaryKey: false;
458
+ isAutoincrement: false;
459
+ hasRuntimeDefault: false;
460
+ enumValues: undefined;
461
+ baseColumn: never;
462
+ identity: undefined;
463
+ generated: undefined;
464
+ }, {}, {}>;
465
+ costAmountCents: import("drizzle-orm/pg-core").PgColumn<{
466
+ name: "cost_amount_cents";
467
+ tableName: "opportunity_products";
468
+ dataType: "number";
469
+ columnType: "PgInteger";
470
+ data: number;
471
+ driverParam: string | number;
472
+ notNull: false;
473
+ hasDefault: false;
474
+ isPrimaryKey: false;
475
+ isAutoincrement: false;
476
+ hasRuntimeDefault: false;
477
+ enumValues: undefined;
478
+ baseColumn: never;
479
+ identity: undefined;
480
+ generated: undefined;
481
+ }, {}, {}>;
482
+ currency: import("drizzle-orm/pg-core").PgColumn<{
483
+ name: "currency";
484
+ tableName: "opportunity_products";
485
+ dataType: "string";
486
+ columnType: "PgText";
487
+ data: string;
488
+ driverParam: string;
489
+ notNull: false;
490
+ hasDefault: false;
491
+ isPrimaryKey: false;
492
+ isAutoincrement: false;
493
+ hasRuntimeDefault: false;
494
+ enumValues: [string, ...string[]];
495
+ baseColumn: never;
496
+ identity: undefined;
497
+ generated: undefined;
498
+ }, {}, {}>;
499
+ discountAmountCents: import("drizzle-orm/pg-core").PgColumn<{
500
+ name: "discount_amount_cents";
501
+ tableName: "opportunity_products";
502
+ dataType: "number";
503
+ columnType: "PgInteger";
504
+ data: number;
505
+ driverParam: string | number;
506
+ notNull: false;
507
+ hasDefault: false;
508
+ isPrimaryKey: false;
509
+ isAutoincrement: false;
510
+ hasRuntimeDefault: false;
511
+ enumValues: undefined;
512
+ baseColumn: never;
513
+ identity: undefined;
514
+ generated: undefined;
515
+ }, {}, {}>;
516
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
517
+ name: "created_at";
518
+ tableName: "opportunity_products";
519
+ dataType: "date";
520
+ columnType: "PgTimestamp";
521
+ data: Date;
522
+ driverParam: string;
523
+ notNull: true;
524
+ hasDefault: true;
525
+ isPrimaryKey: false;
526
+ isAutoincrement: false;
527
+ hasRuntimeDefault: false;
528
+ enumValues: undefined;
529
+ baseColumn: never;
530
+ identity: undefined;
531
+ generated: undefined;
532
+ }, {}, {}>;
533
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
534
+ name: "updated_at";
535
+ tableName: "opportunity_products";
536
+ dataType: "date";
537
+ columnType: "PgTimestamp";
538
+ data: Date;
539
+ driverParam: string;
540
+ notNull: true;
541
+ hasDefault: true;
542
+ isPrimaryKey: false;
543
+ isAutoincrement: false;
544
+ hasRuntimeDefault: false;
545
+ enumValues: undefined;
546
+ baseColumn: never;
547
+ identity: undefined;
548
+ generated: undefined;
549
+ }, {}, {}>;
550
+ }, "single", Record<"opportunity_products", "not-null">, false, "where" | "orderBy", {
551
+ id: string;
552
+ opportunityId: string;
553
+ productId: string | null;
554
+ supplierServiceId: string | null;
555
+ nameSnapshot: string;
556
+ description: string | null;
557
+ quantity: number;
558
+ unitPriceAmountCents: number | null;
559
+ costAmountCents: number | null;
560
+ currency: string | null;
561
+ discountAmountCents: number | null;
562
+ createdAt: Date;
563
+ updatedAt: Date;
564
+ }[], {
565
+ id: import("drizzle-orm/pg-core").PgColumn<{
566
+ name: string;
567
+ tableName: "opportunity_products";
568
+ dataType: "string";
569
+ columnType: "PgText";
570
+ data: string;
571
+ driverParam: string;
572
+ notNull: true;
573
+ hasDefault: true;
574
+ isPrimaryKey: true;
575
+ isAutoincrement: false;
576
+ hasRuntimeDefault: true;
577
+ enumValues: [string, ...string[]];
578
+ baseColumn: never;
579
+ identity: undefined;
580
+ generated: undefined;
581
+ }, {}, {}>;
582
+ opportunityId: import("drizzle-orm/pg-core").PgColumn<{
583
+ name: string;
584
+ tableName: "opportunity_products";
585
+ dataType: "string";
586
+ columnType: "PgText";
587
+ data: string;
588
+ driverParam: string;
589
+ notNull: true;
590
+ hasDefault: false;
591
+ isPrimaryKey: false;
592
+ isAutoincrement: false;
593
+ hasRuntimeDefault: false;
594
+ enumValues: [string, ...string[]];
595
+ baseColumn: never;
596
+ identity: undefined;
597
+ generated: undefined;
598
+ }, {}, {}>;
599
+ productId: import("drizzle-orm/pg-core").PgColumn<{
600
+ name: "product_id";
601
+ tableName: "opportunity_products";
602
+ dataType: "string";
603
+ columnType: "PgText";
604
+ data: string;
605
+ driverParam: string;
606
+ notNull: false;
607
+ hasDefault: false;
608
+ isPrimaryKey: false;
609
+ isAutoincrement: false;
610
+ hasRuntimeDefault: false;
611
+ enumValues: [string, ...string[]];
612
+ baseColumn: never;
613
+ identity: undefined;
614
+ generated: undefined;
615
+ }, {}, {}>;
616
+ supplierServiceId: import("drizzle-orm/pg-core").PgColumn<{
617
+ name: "supplier_service_id";
618
+ tableName: "opportunity_products";
619
+ dataType: "string";
620
+ columnType: "PgText";
621
+ data: string;
622
+ driverParam: string;
623
+ notNull: false;
624
+ hasDefault: false;
625
+ isPrimaryKey: false;
626
+ isAutoincrement: false;
627
+ hasRuntimeDefault: false;
628
+ enumValues: [string, ...string[]];
629
+ baseColumn: never;
630
+ identity: undefined;
631
+ generated: undefined;
632
+ }, {}, {}>;
633
+ nameSnapshot: import("drizzle-orm/pg-core").PgColumn<{
634
+ name: "name_snapshot";
635
+ tableName: "opportunity_products";
636
+ dataType: "string";
637
+ columnType: "PgText";
638
+ data: string;
639
+ driverParam: string;
640
+ notNull: true;
641
+ hasDefault: false;
642
+ isPrimaryKey: false;
643
+ isAutoincrement: false;
644
+ hasRuntimeDefault: false;
645
+ enumValues: [string, ...string[]];
646
+ baseColumn: never;
647
+ identity: undefined;
648
+ generated: undefined;
649
+ }, {}, {}>;
650
+ description: import("drizzle-orm/pg-core").PgColumn<{
651
+ name: "description";
652
+ tableName: "opportunity_products";
653
+ dataType: "string";
654
+ columnType: "PgText";
655
+ data: string;
656
+ driverParam: string;
657
+ notNull: false;
658
+ hasDefault: false;
659
+ isPrimaryKey: false;
660
+ isAutoincrement: false;
661
+ hasRuntimeDefault: false;
662
+ enumValues: [string, ...string[]];
663
+ baseColumn: never;
664
+ identity: undefined;
665
+ generated: undefined;
666
+ }, {}, {}>;
667
+ quantity: import("drizzle-orm/pg-core").PgColumn<{
668
+ name: "quantity";
669
+ tableName: "opportunity_products";
670
+ dataType: "number";
671
+ columnType: "PgInteger";
672
+ data: number;
673
+ driverParam: string | number;
674
+ notNull: true;
675
+ hasDefault: true;
676
+ isPrimaryKey: false;
677
+ isAutoincrement: false;
678
+ hasRuntimeDefault: false;
679
+ enumValues: undefined;
680
+ baseColumn: never;
681
+ identity: undefined;
682
+ generated: undefined;
683
+ }, {}, {}>;
684
+ unitPriceAmountCents: import("drizzle-orm/pg-core").PgColumn<{
685
+ name: "unit_price_amount_cents";
686
+ tableName: "opportunity_products";
687
+ dataType: "number";
688
+ columnType: "PgInteger";
689
+ data: number;
690
+ driverParam: string | number;
691
+ notNull: false;
692
+ hasDefault: false;
693
+ isPrimaryKey: false;
694
+ isAutoincrement: false;
695
+ hasRuntimeDefault: false;
696
+ enumValues: undefined;
697
+ baseColumn: never;
698
+ identity: undefined;
699
+ generated: undefined;
700
+ }, {}, {}>;
701
+ costAmountCents: import("drizzle-orm/pg-core").PgColumn<{
702
+ name: "cost_amount_cents";
703
+ tableName: "opportunity_products";
704
+ dataType: "number";
705
+ columnType: "PgInteger";
706
+ data: number;
707
+ driverParam: string | number;
708
+ notNull: false;
709
+ hasDefault: false;
710
+ isPrimaryKey: false;
711
+ isAutoincrement: false;
712
+ hasRuntimeDefault: false;
713
+ enumValues: undefined;
714
+ baseColumn: never;
715
+ identity: undefined;
716
+ generated: undefined;
717
+ }, {}, {}>;
718
+ currency: import("drizzle-orm/pg-core").PgColumn<{
719
+ name: "currency";
720
+ tableName: "opportunity_products";
721
+ dataType: "string";
722
+ columnType: "PgText";
723
+ data: string;
724
+ driverParam: string;
725
+ notNull: false;
726
+ hasDefault: false;
727
+ isPrimaryKey: false;
728
+ isAutoincrement: false;
729
+ hasRuntimeDefault: false;
730
+ enumValues: [string, ...string[]];
731
+ baseColumn: never;
732
+ identity: undefined;
733
+ generated: undefined;
734
+ }, {}, {}>;
735
+ discountAmountCents: import("drizzle-orm/pg-core").PgColumn<{
736
+ name: "discount_amount_cents";
737
+ tableName: "opportunity_products";
738
+ dataType: "number";
739
+ columnType: "PgInteger";
740
+ data: number;
741
+ driverParam: string | number;
742
+ notNull: false;
743
+ hasDefault: false;
744
+ isPrimaryKey: false;
745
+ isAutoincrement: false;
746
+ hasRuntimeDefault: false;
747
+ enumValues: undefined;
748
+ baseColumn: never;
749
+ identity: undefined;
750
+ generated: undefined;
751
+ }, {}, {}>;
752
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
753
+ name: "created_at";
754
+ tableName: "opportunity_products";
755
+ dataType: "date";
756
+ columnType: "PgTimestamp";
757
+ data: Date;
758
+ driverParam: string;
759
+ notNull: true;
760
+ hasDefault: true;
761
+ isPrimaryKey: false;
762
+ isAutoincrement: false;
763
+ hasRuntimeDefault: false;
764
+ enumValues: undefined;
765
+ baseColumn: never;
766
+ identity: undefined;
767
+ generated: undefined;
768
+ }, {}, {}>;
769
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
770
+ name: "updated_at";
771
+ tableName: "opportunity_products";
772
+ dataType: "date";
773
+ columnType: "PgTimestamp";
774
+ data: Date;
775
+ driverParam: string;
776
+ notNull: true;
777
+ hasDefault: true;
778
+ isPrimaryKey: false;
779
+ isAutoincrement: false;
780
+ hasRuntimeDefault: false;
781
+ enumValues: undefined;
782
+ baseColumn: never;
783
+ identity: undefined;
784
+ generated: undefined;
785
+ }, {}, {}>;
786
+ }>, "where" | "orderBy">;
787
+ createOpportunityProduct(db: PostgresJsDatabase, opportunityId: string, data: CreateOpportunityProductInput): Promise<{
788
+ opportunityId: string;
789
+ createdAt: Date;
790
+ updatedAt: Date;
791
+ description: string | null;
792
+ id: string;
793
+ productId: string | null;
794
+ supplierServiceId: string | null;
795
+ nameSnapshot: string;
796
+ quantity: number;
797
+ unitPriceAmountCents: number | null;
798
+ costAmountCents: number | null;
799
+ currency: string | null;
800
+ discountAmountCents: number | null;
801
+ } | undefined>;
802
+ updateOpportunityProduct(db: PostgresJsDatabase, id: string, data: UpdateOpportunityProductInput): Promise<{
803
+ id: string;
804
+ opportunityId: string;
805
+ productId: string | null;
806
+ supplierServiceId: string | null;
807
+ nameSnapshot: string;
808
+ description: string | null;
809
+ quantity: number;
810
+ unitPriceAmountCents: number | null;
811
+ costAmountCents: number | null;
812
+ currency: string | null;
813
+ discountAmountCents: number | null;
814
+ createdAt: Date;
815
+ updatedAt: Date;
816
+ } | null>;
817
+ deleteOpportunityProduct(db: PostgresJsDatabase, id: string): Promise<{
818
+ id: string;
819
+ } | null>;
820
+ };
821
+ export {};
822
+ //# sourceMappingURL=opportunities.d.ts.map