@voyantjs/crm 0.106.0 → 0.107.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 (55) hide show
  1. package/README.md +3 -3
  2. package/dist/booking-extension.d.ts +7 -7
  3. package/dist/booking-extension.d.ts.map +1 -1
  4. package/dist/booking-extension.js +8 -5
  5. package/dist/index.d.ts +5 -3
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +3 -2
  8. package/dist/routes/activities.d.ts +2 -2
  9. package/dist/routes/custom-fields.d.ts +6 -6
  10. package/dist/routes/index.d.ts +518 -51
  11. package/dist/routes/index.d.ts.map +1 -1
  12. package/dist/routes/index.js +2 -2
  13. package/dist/routes/pipelines.d.ts +4 -4
  14. package/dist/routes/quote-versions.d.ts +746 -0
  15. package/dist/routes/quote-versions.d.ts.map +1 -0
  16. package/dist/routes/quote-versions.js +175 -0
  17. package/dist/routes/quotes.d.ts +161 -53
  18. package/dist/routes/quotes.d.ts.map +1 -1
  19. package/dist/routes/quotes.js +29 -11
  20. package/dist/schema-activities.d.ts +6 -6
  21. package/dist/schema-relations.d.ts +19 -18
  22. package/dist/schema-relations.d.ts.map +1 -1
  23. package/dist/schema-relations.js +38 -31
  24. package/dist/schema-sales.d.ts +206 -87
  25. package/dist/schema-sales.d.ts.map +1 -1
  26. package/dist/schema-sales.js +62 -50
  27. package/dist/schema-shared.d.ts +3 -3
  28. package/dist/schema-shared.d.ts.map +1 -1
  29. package/dist/schema-shared.js +5 -16
  30. package/dist/schema-signals.d.ts +1 -1
  31. package/dist/schema-signals.js +1 -1
  32. package/dist/service/accounts-merge.js +10 -10
  33. package/dist/service/accounts-people.js +1 -1
  34. package/dist/service/accounts-shared.d.ts +4 -1
  35. package/dist/service/accounts-shared.d.ts.map +1 -1
  36. package/dist/service/accounts-shared.js +20 -6
  37. package/dist/service/activities.d.ts +6 -6
  38. package/dist/service/custom-fields.d.ts +6 -6
  39. package/dist/service/index.d.ts +338 -139
  40. package/dist/service/index.d.ts.map +1 -1
  41. package/dist/service/index.js +2 -2
  42. package/dist/service/pipelines.d.ts +4 -4
  43. package/dist/service/quote-versions.d.ts +674 -0
  44. package/dist/service/quote-versions.d.ts.map +1 -0
  45. package/dist/service/quote-versions.js +399 -0
  46. package/dist/service/quotes.d.ts +426 -94
  47. package/dist/service/quotes.d.ts.map +1 -1
  48. package/dist/service/quotes.js +63 -22
  49. package/package.json +7 -7
  50. package/dist/routes/opportunities.d.ts +0 -387
  51. package/dist/routes/opportunities.d.ts.map +0 -1
  52. package/dist/routes/opportunities.js +0 -70
  53. package/dist/service/opportunities.d.ts +0 -822
  54. package/dist/service/opportunities.d.ts.map +0 -1
  55. package/dist/service/opportunities.js +0 -117
@@ -2313,11 +2313,11 @@ export declare const crmService: {
2313
2313
  listCustomFieldDefinitions(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, query: {
2314
2314
  limit: number;
2315
2315
  offset: number;
2316
- entityType?: "organization" | "person" | "opportunity" | "quote" | "activity" | undefined;
2316
+ entityType?: "organization" | "person" | "quote" | "activity" | undefined;
2317
2317
  }): Promise<{
2318
2318
  data: {
2319
2319
  id: string;
2320
- entityType: "organization" | "person" | "opportunity" | "quote" | "activity";
2320
+ entityType: "organization" | "person" | "quote" | "activity";
2321
2321
  key: string;
2322
2322
  label: string;
2323
2323
  fieldType: "boolean" | "json" | "date" | "text" | "set" | "enum" | "phone" | "varchar" | "double" | "monetary" | "address";
@@ -2336,7 +2336,7 @@ export declare const crmService: {
2336
2336
  }>;
2337
2337
  getCustomFieldDefinitionById(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string): Promise<{
2338
2338
  id: string;
2339
- entityType: "organization" | "person" | "opportunity" | "quote" | "activity";
2339
+ entityType: "organization" | "person" | "quote" | "activity";
2340
2340
  key: string;
2341
2341
  label: string;
2342
2342
  fieldType: "boolean" | "json" | "date" | "text" | "set" | "enum" | "phone" | "varchar" | "double" | "monetary" | "address";
@@ -2350,7 +2350,7 @@ export declare const crmService: {
2350
2350
  updatedAt: Date;
2351
2351
  } | null>;
2352
2352
  createCustomFieldDefinition(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, data: {
2353
- entityType: "organization" | "person" | "opportunity" | "quote" | "activity";
2353
+ entityType: "organization" | "person" | "quote" | "activity";
2354
2354
  key: string;
2355
2355
  label: string;
2356
2356
  fieldType: "boolean" | "json" | "date" | "text" | "set" | "enum" | "phone" | "varchar" | "double" | "monetary" | "address";
@@ -2369,14 +2369,14 @@ export declare const crmService: {
2369
2369
  createdAt: Date;
2370
2370
  key: string;
2371
2371
  updatedAt: Date;
2372
- entityType: "organization" | "person" | "opportunity" | "quote" | "activity";
2372
+ entityType: "organization" | "person" | "quote" | "activity";
2373
2373
  label: string;
2374
2374
  fieldType: "boolean" | "json" | "date" | "text" | "set" | "enum" | "phone" | "varchar" | "double" | "monetary" | "address";
2375
2375
  isRequired: boolean;
2376
2376
  isSearchable: boolean;
2377
2377
  } | undefined>;
2378
2378
  updateCustomFieldDefinition(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string, data: {
2379
- entityType?: "organization" | "person" | "opportunity" | "quote" | "activity" | undefined;
2379
+ entityType?: "organization" | "person" | "quote" | "activity" | undefined;
2380
2380
  key?: string | undefined;
2381
2381
  label?: string | undefined;
2382
2382
  fieldType?: "boolean" | "json" | "date" | "text" | "set" | "enum" | "phone" | "varchar" | "double" | "monetary" | "address" | undefined;
@@ -2388,7 +2388,7 @@ export declare const crmService: {
2388
2388
  }[] | null | undefined;
2389
2389
  }): Promise<{
2390
2390
  id: string;
2391
- entityType: "organization" | "person" | "opportunity" | "quote" | "activity";
2391
+ entityType: "organization" | "person" | "quote" | "activity";
2392
2392
  key: string;
2393
2393
  label: string;
2394
2394
  fieldType: "boolean" | "json" | "date" | "text" | "set" | "enum" | "phone" | "varchar" | "double" | "monetary" | "address";
@@ -2407,14 +2407,14 @@ export declare const crmService: {
2407
2407
  listCustomFieldValues(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, query: {
2408
2408
  limit: number;
2409
2409
  offset: number;
2410
- entityType?: "organization" | "person" | "opportunity" | "quote" | "activity" | undefined;
2410
+ entityType?: "organization" | "person" | "quote" | "activity" | undefined;
2411
2411
  entityId?: string | undefined;
2412
2412
  definitionId?: string | undefined;
2413
2413
  }): Promise<{
2414
2414
  data: {
2415
2415
  id: string;
2416
2416
  definitionId: string;
2417
- entityType: "organization" | "person" | "opportunity" | "quote" | "activity";
2417
+ entityType: "organization" | "person" | "quote" | "activity";
2418
2418
  entityId: string;
2419
2419
  textValue: string | null;
2420
2420
  numberValue: number | null;
@@ -2431,7 +2431,7 @@ export declare const crmService: {
2431
2431
  offset: number;
2432
2432
  }>;
2433
2433
  upsertCustomFieldValue(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, definitionId: string, data: {
2434
- entityType: "organization" | "person" | "opportunity" | "quote" | "activity";
2434
+ entityType: "organization" | "person" | "quote" | "activity";
2435
2435
  entityId: string;
2436
2436
  textValue?: string | null | undefined;
2437
2437
  numberValue?: number | null | undefined;
@@ -2444,7 +2444,7 @@ export declare const crmService: {
2444
2444
  id: string;
2445
2445
  createdAt: Date;
2446
2446
  updatedAt: Date;
2447
- entityType: "organization" | "person" | "opportunity" | "quote" | "activity";
2447
+ entityType: "organization" | "person" | "quote" | "activity";
2448
2448
  entityId: string;
2449
2449
  definitionId: string;
2450
2450
  textValue: string | null;
@@ -2464,7 +2464,7 @@ export declare const crmService: {
2464
2464
  ownerId?: string | undefined;
2465
2465
  status?: "cancelled" | "done" | "planned" | undefined;
2466
2466
  type?: "email" | "meeting" | "call" | "task" | "follow_up" | "note" | undefined;
2467
- entityType?: "organization" | "person" | "opportunity" | "quote" | "activity" | undefined;
2467
+ entityType?: "organization" | "person" | "quote" | "activity" | undefined;
2468
2468
  entityId?: string | undefined;
2469
2469
  search?: string | undefined;
2470
2470
  }): Promise<{
@@ -2585,14 +2585,14 @@ export declare const crmService: {
2585
2585
  tableName: "activity_links";
2586
2586
  dataType: "string";
2587
2587
  columnType: "PgEnumColumn";
2588
- data: "organization" | "person" | "opportunity" | "quote" | "activity";
2588
+ data: "organization" | "person" | "quote" | "activity";
2589
2589
  driverParam: string;
2590
2590
  notNull: true;
2591
2591
  hasDefault: false;
2592
2592
  isPrimaryKey: false;
2593
2593
  isAutoincrement: false;
2594
2594
  hasRuntimeDefault: false;
2595
- enumValues: ["organization", "person", "opportunity", "quote", "activity"];
2595
+ enumValues: ["organization", "person", "quote", "activity"];
2596
2596
  baseColumn: never;
2597
2597
  identity: undefined;
2598
2598
  generated: undefined;
@@ -2651,7 +2651,7 @@ export declare const crmService: {
2651
2651
  }, "single", Record<"activity_links", "not-null">, false, "where" | "orderBy", {
2652
2652
  id: string;
2653
2653
  activityId: string;
2654
- entityType: "organization" | "person" | "opportunity" | "quote" | "activity";
2654
+ entityType: "organization" | "person" | "quote" | "activity";
2655
2655
  entityId: string;
2656
2656
  role: "primary" | "related";
2657
2657
  createdAt: Date;
@@ -2695,14 +2695,14 @@ export declare const crmService: {
2695
2695
  tableName: "activity_links";
2696
2696
  dataType: "string";
2697
2697
  columnType: "PgEnumColumn";
2698
- data: "organization" | "person" | "opportunity" | "quote" | "activity";
2698
+ data: "organization" | "person" | "quote" | "activity";
2699
2699
  driverParam: string;
2700
2700
  notNull: true;
2701
2701
  hasDefault: false;
2702
2702
  isPrimaryKey: false;
2703
2703
  isAutoincrement: false;
2704
2704
  hasRuntimeDefault: false;
2705
- enumValues: ["organization", "person", "opportunity", "quote", "activity"];
2705
+ enumValues: ["organization", "person", "quote", "activity"];
2706
2706
  baseColumn: never;
2707
2707
  identity: undefined;
2708
2708
  generated: undefined;
@@ -2760,14 +2760,14 @@ export declare const crmService: {
2760
2760
  }, {}, {}>;
2761
2761
  }>, "where" | "orderBy">;
2762
2762
  createActivityLink(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, activityId: string, data: {
2763
- entityType: "organization" | "person" | "opportunity" | "quote" | "activity";
2763
+ entityType: "organization" | "person" | "quote" | "activity";
2764
2764
  entityId: string;
2765
2765
  role: "primary" | "related";
2766
2766
  }): Promise<{
2767
2767
  id: string;
2768
2768
  createdAt: Date;
2769
2769
  role: "primary" | "related";
2770
- entityType: "organization" | "person" | "opportunity" | "quote" | "activity";
2770
+ entityType: "organization" | "person" | "quote" | "activity";
2771
2771
  entityId: string;
2772
2772
  activityId: string;
2773
2773
  } | undefined>;
@@ -2966,22 +2966,28 @@ export declare const crmService: {
2966
2966
  deleteActivityParticipant(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string): Promise<{
2967
2967
  id: string;
2968
2968
  } | null>;
2969
- listQuotes(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, query: {
2969
+ listQuoteVersions(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, query: {
2970
2970
  limit: number;
2971
2971
  offset: number;
2972
- opportunityId?: string | undefined;
2973
- status?: "expired" | "archived" | "draft" | "sent" | "accepted" | "rejected" | undefined;
2972
+ quoteId?: string | undefined;
2973
+ status?: "expired" | "superseded" | "draft" | "sent" | "accepted" | "declined" | undefined;
2974
2974
  }): Promise<{
2975
2975
  data: {
2976
2976
  id: string;
2977
- opportunityId: string;
2978
- status: "expired" | "archived" | "draft" | "sent" | "accepted" | "rejected";
2977
+ quoteId: string;
2978
+ label: string | null;
2979
+ status: "expired" | "superseded" | "draft" | "sent" | "accepted" | "declined";
2980
+ supersedesId: string | null;
2981
+ tripSnapshotId: string | null;
2979
2982
  validUntil: string | null;
2980
2983
  currency: string;
2981
2984
  subtotalAmountCents: number;
2982
2985
  taxAmountCents: number;
2983
2986
  totalAmountCents: number;
2984
2987
  notes: string | null;
2988
+ sentAt: Date | null;
2989
+ viewedAt: Date | null;
2990
+ decidedAt: Date | null;
2985
2991
  createdAt: Date;
2986
2992
  updatedAt: Date;
2987
2993
  archivedAt: Date | null;
@@ -2990,73 +2996,260 @@ export declare const crmService: {
2990
2996
  limit: number;
2991
2997
  offset: number;
2992
2998
  }>;
2993
- getQuoteById(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string): Promise<{
2999
+ getQuoteVersionById(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string): Promise<{
2994
3000
  id: string;
2995
- opportunityId: string;
2996
- status: "expired" | "archived" | "draft" | "sent" | "accepted" | "rejected";
3001
+ quoteId: string;
3002
+ label: string | null;
3003
+ status: "expired" | "superseded" | "draft" | "sent" | "accepted" | "declined";
3004
+ supersedesId: string | null;
3005
+ tripSnapshotId: string | null;
2997
3006
  validUntil: string | null;
2998
3007
  currency: string;
2999
3008
  subtotalAmountCents: number;
3000
3009
  taxAmountCents: number;
3001
3010
  totalAmountCents: number;
3002
3011
  notes: string | null;
3012
+ sentAt: Date | null;
3013
+ viewedAt: Date | null;
3014
+ decidedAt: Date | null;
3003
3015
  createdAt: Date;
3004
3016
  updatedAt: Date;
3005
3017
  archivedAt: Date | null;
3006
3018
  } | null>;
3007
- createQuote(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, data: {
3008
- opportunityId: string;
3009
- status: "expired" | "archived" | "draft" | "sent" | "accepted" | "rejected";
3019
+ getQuoteVersionProposal(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string): Promise<import("./quote-versions.js").QuoteVersionProposalReadModel | null>;
3020
+ createQuoteVersion(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, data: {
3021
+ quoteId: string;
3022
+ status: "expired" | "superseded" | "draft" | "sent" | "accepted" | "declined";
3010
3023
  currency: string;
3011
3024
  subtotalAmountCents: number;
3012
3025
  taxAmountCents: number;
3013
3026
  totalAmountCents: number;
3027
+ label?: string | null | undefined;
3028
+ supersedesId?: string | null | undefined;
3029
+ tripSnapshotId?: string | null | undefined;
3014
3030
  validUntil?: string | null | undefined;
3015
3031
  notes?: string | null | undefined;
3032
+ sentAt?: string | null | undefined;
3033
+ viewedAt?: string | null | undefined;
3034
+ decidedAt?: string | null | undefined;
3016
3035
  }): Promise<{
3017
3036
  id: string;
3018
- status: "expired" | "archived" | "draft" | "sent" | "accepted" | "rejected";
3037
+ status: "expired" | "superseded" | "draft" | "sent" | "accepted" | "declined";
3019
3038
  createdAt: Date;
3039
+ decidedAt: Date | null;
3020
3040
  updatedAt: Date;
3021
3041
  currency: string;
3022
3042
  notes: string | null;
3023
- opportunityId: string;
3043
+ quoteId: string;
3044
+ label: string | null;
3024
3045
  archivedAt: Date | null;
3046
+ sentAt: Date | null;
3047
+ supersedesId: string | null;
3048
+ tripSnapshotId: string | null;
3025
3049
  validUntil: string | null;
3026
3050
  subtotalAmountCents: number;
3027
3051
  taxAmountCents: number;
3028
3052
  totalAmountCents: number;
3053
+ viewedAt: Date | null;
3029
3054
  } | undefined>;
3030
- updateQuote(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string, data: {
3031
- opportunityId?: string | undefined;
3032
- status?: "expired" | "archived" | "draft" | "sent" | "accepted" | "rejected" | undefined;
3055
+ updateQuoteVersion(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string, data: {
3056
+ quoteId?: string | undefined;
3057
+ label?: string | null | undefined;
3058
+ status?: "expired" | "superseded" | "draft" | "sent" | "accepted" | "declined" | undefined;
3059
+ supersedesId?: string | null | undefined;
3060
+ tripSnapshotId?: string | null | undefined;
3033
3061
  validUntil?: string | null | undefined;
3034
3062
  currency?: string | undefined;
3035
3063
  subtotalAmountCents?: number | undefined;
3036
3064
  taxAmountCents?: number | undefined;
3037
3065
  totalAmountCents?: number | undefined;
3038
3066
  notes?: string | null | undefined;
3067
+ sentAt?: string | null | undefined;
3068
+ viewedAt?: string | null | undefined;
3069
+ decidedAt?: string | null | undefined;
3039
3070
  }): Promise<{
3040
3071
  id: string;
3041
- opportunityId: string;
3042
- status: "expired" | "archived" | "draft" | "sent" | "accepted" | "rejected";
3072
+ quoteId: string;
3073
+ label: string | null;
3074
+ status: "expired" | "superseded" | "draft" | "sent" | "accepted" | "declined";
3075
+ supersedesId: string | null;
3076
+ tripSnapshotId: string | null;
3043
3077
  validUntil: string | null;
3044
3078
  currency: string;
3045
3079
  subtotalAmountCents: number;
3046
3080
  taxAmountCents: number;
3047
3081
  totalAmountCents: number;
3048
3082
  notes: string | null;
3083
+ sentAt: Date | null;
3084
+ viewedAt: Date | null;
3085
+ decidedAt: Date | null;
3049
3086
  createdAt: Date;
3050
3087
  updatedAt: Date;
3051
3088
  archivedAt: Date | null;
3052
3089
  } | null>;
3053
- deleteQuote(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string): Promise<{
3090
+ deleteQuoteVersion(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string): Promise<{
3091
+ id: string;
3092
+ } | null>;
3093
+ applyTripSnapshotToQuoteVersion(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string, data: {
3094
+ tripSnapshotId: string;
3095
+ currency: string;
3096
+ subtotalAmountCents: number;
3097
+ taxAmountCents: number;
3098
+ totalAmountCents: number;
3099
+ lines: {
3100
+ description: string;
3101
+ quantity: number;
3102
+ unitPriceAmountCents: number;
3103
+ totalAmountCents: number;
3104
+ currency: string;
3105
+ productId?: string | null | undefined;
3106
+ supplierServiceId?: string | null | undefined;
3107
+ componentId?: string | null | undefined;
3108
+ }[];
3109
+ }): Promise<{
3110
+ quoteVersion: {
3111
+ id: string;
3112
+ quoteId: string;
3113
+ label: string | null;
3114
+ status: "expired" | "superseded" | "draft" | "sent" | "accepted" | "declined";
3115
+ supersedesId: string | null;
3116
+ tripSnapshotId: string | null;
3117
+ validUntil: string | null;
3118
+ currency: string;
3119
+ subtotalAmountCents: number;
3120
+ taxAmountCents: number;
3121
+ totalAmountCents: number;
3122
+ notes: string | null;
3123
+ sentAt: Date | null;
3124
+ viewedAt: Date | null;
3125
+ decidedAt: Date | null;
3126
+ createdAt: Date;
3127
+ updatedAt: Date;
3128
+ archivedAt: Date | null;
3129
+ };
3130
+ lines: {
3131
+ id: string;
3132
+ description: string;
3133
+ createdAt: Date;
3134
+ updatedAt: Date;
3135
+ currency: string;
3136
+ quoteVersionId: string;
3137
+ productId: string | null;
3138
+ supplierServiceId: string | null;
3139
+ quantity: number;
3140
+ unitPriceAmountCents: number;
3141
+ totalAmountCents: number;
3142
+ }[];
3143
+ } | null>;
3144
+ sendQuoteVersion(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string, data?: {
3145
+ validUntil?: string | null | undefined;
3146
+ }): Promise<{
3054
3147
  id: string;
3148
+ quoteId: string;
3149
+ label: string | null;
3150
+ status: "expired" | "superseded" | "draft" | "sent" | "accepted" | "declined";
3151
+ supersedesId: string | null;
3152
+ tripSnapshotId: string | null;
3153
+ validUntil: string | null;
3154
+ currency: string;
3155
+ subtotalAmountCents: number;
3156
+ taxAmountCents: number;
3157
+ totalAmountCents: number;
3158
+ notes: string | null;
3159
+ sentAt: Date | null;
3160
+ viewedAt: Date | null;
3161
+ decidedAt: Date | null;
3162
+ createdAt: Date;
3163
+ updatedAt: Date;
3164
+ archivedAt: Date | null;
3055
3165
  } | null>;
3056
- listQuoteLines(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, quoteId: string): Omit<import("drizzle-orm/pg-core").PgSelectBase<"quote_lines", {
3166
+ markQuoteVersionViewed(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string): Promise<{
3167
+ id: string;
3168
+ quoteId: string;
3169
+ label: string | null;
3170
+ status: "expired" | "superseded" | "draft" | "sent" | "accepted" | "declined";
3171
+ supersedesId: string | null;
3172
+ tripSnapshotId: string | null;
3173
+ validUntil: string | null;
3174
+ currency: string;
3175
+ subtotalAmountCents: number;
3176
+ taxAmountCents: number;
3177
+ totalAmountCents: number;
3178
+ notes: string | null;
3179
+ sentAt: Date | null;
3180
+ viewedAt: Date | null;
3181
+ decidedAt: Date | null;
3182
+ createdAt: Date;
3183
+ updatedAt: Date;
3184
+ archivedAt: Date | null;
3185
+ } | null>;
3186
+ acceptQuoteVersion(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string, _data?: Record<string, never>): Promise<import("./quote-versions.js").AcceptQuoteVersionResult | null>;
3187
+ declineQuoteVersion(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string, _data?: Record<string, never>): Promise<{
3188
+ id: string;
3189
+ quoteId: string;
3190
+ label: string | null;
3191
+ status: "expired" | "superseded" | "draft" | "sent" | "accepted" | "declined";
3192
+ supersedesId: string | null;
3193
+ tripSnapshotId: string | null;
3194
+ validUntil: string | null;
3195
+ currency: string;
3196
+ subtotalAmountCents: number;
3197
+ taxAmountCents: number;
3198
+ totalAmountCents: number;
3199
+ notes: string | null;
3200
+ sentAt: Date | null;
3201
+ viewedAt: Date | null;
3202
+ decidedAt: Date | null;
3203
+ createdAt: Date;
3204
+ updatedAt: Date;
3205
+ archivedAt: Date | null;
3206
+ } | null>;
3207
+ expireQuoteVersionIfPastValidUntil(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string, nowValue?: Date | string): Promise<{
3208
+ id: string;
3209
+ quoteId: string;
3210
+ label: string | null;
3211
+ status: "expired" | "superseded" | "draft" | "sent" | "accepted" | "declined";
3212
+ supersedesId: string | null;
3213
+ tripSnapshotId: string | null;
3214
+ validUntil: string | null;
3215
+ currency: string;
3216
+ subtotalAmountCents: number;
3217
+ taxAmountCents: number;
3218
+ totalAmountCents: number;
3219
+ notes: string | null;
3220
+ sentAt: Date | null;
3221
+ viewedAt: Date | null;
3222
+ decidedAt: Date | null;
3223
+ createdAt: Date;
3224
+ updatedAt: Date;
3225
+ archivedAt: Date | null;
3226
+ } | null>;
3227
+ expireQuoteVersions(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, data?: {
3228
+ now?: string | undefined;
3229
+ }): Promise<{
3230
+ id: string;
3231
+ quoteId: string;
3232
+ label: string | null;
3233
+ status: "expired" | "superseded" | "draft" | "sent" | "accepted" | "declined";
3234
+ supersedesId: string | null;
3235
+ tripSnapshotId: string | null;
3236
+ validUntil: string | null;
3237
+ currency: string;
3238
+ subtotalAmountCents: number;
3239
+ taxAmountCents: number;
3240
+ totalAmountCents: number;
3241
+ notes: string | null;
3242
+ sentAt: Date | null;
3243
+ viewedAt: Date | null;
3244
+ decidedAt: Date | null;
3245
+ createdAt: Date;
3246
+ updatedAt: Date;
3247
+ archivedAt: Date | null;
3248
+ }[]>;
3249
+ listQuoteVersionLines(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, quoteVersionId: string): Omit<import("drizzle-orm/pg-core").PgSelectBase<"quote_version_lines", {
3057
3250
  id: import("drizzle-orm/pg-core").PgColumn<{
3058
3251
  name: string;
3059
- tableName: "quote_lines";
3252
+ tableName: "quote_version_lines";
3060
3253
  dataType: "string";
3061
3254
  columnType: "PgText";
3062
3255
  data: string;
@@ -3071,9 +3264,9 @@ export declare const crmService: {
3071
3264
  identity: undefined;
3072
3265
  generated: undefined;
3073
3266
  }, {}, {}>;
3074
- quoteId: import("drizzle-orm/pg-core").PgColumn<{
3267
+ quoteVersionId: import("drizzle-orm/pg-core").PgColumn<{
3075
3268
  name: string;
3076
- tableName: "quote_lines";
3269
+ tableName: "quote_version_lines";
3077
3270
  dataType: "string";
3078
3271
  columnType: "PgText";
3079
3272
  data: string;
@@ -3090,7 +3283,7 @@ export declare const crmService: {
3090
3283
  }, {}, {}>;
3091
3284
  productId: import("drizzle-orm/pg-core").PgColumn<{
3092
3285
  name: "product_id";
3093
- tableName: "quote_lines";
3286
+ tableName: "quote_version_lines";
3094
3287
  dataType: "string";
3095
3288
  columnType: "PgText";
3096
3289
  data: string;
@@ -3107,7 +3300,7 @@ export declare const crmService: {
3107
3300
  }, {}, {}>;
3108
3301
  supplierServiceId: import("drizzle-orm/pg-core").PgColumn<{
3109
3302
  name: "supplier_service_id";
3110
- tableName: "quote_lines";
3303
+ tableName: "quote_version_lines";
3111
3304
  dataType: "string";
3112
3305
  columnType: "PgText";
3113
3306
  data: string;
@@ -3124,7 +3317,7 @@ export declare const crmService: {
3124
3317
  }, {}, {}>;
3125
3318
  description: import("drizzle-orm/pg-core").PgColumn<{
3126
3319
  name: "description";
3127
- tableName: "quote_lines";
3320
+ tableName: "quote_version_lines";
3128
3321
  dataType: "string";
3129
3322
  columnType: "PgText";
3130
3323
  data: string;
@@ -3141,7 +3334,7 @@ export declare const crmService: {
3141
3334
  }, {}, {}>;
3142
3335
  quantity: import("drizzle-orm/pg-core").PgColumn<{
3143
3336
  name: "quantity";
3144
- tableName: "quote_lines";
3337
+ tableName: "quote_version_lines";
3145
3338
  dataType: "number";
3146
3339
  columnType: "PgInteger";
3147
3340
  data: number;
@@ -3158,7 +3351,7 @@ export declare const crmService: {
3158
3351
  }, {}, {}>;
3159
3352
  unitPriceAmountCents: import("drizzle-orm/pg-core").PgColumn<{
3160
3353
  name: "unit_price_amount_cents";
3161
- tableName: "quote_lines";
3354
+ tableName: "quote_version_lines";
3162
3355
  dataType: "number";
3163
3356
  columnType: "PgInteger";
3164
3357
  data: number;
@@ -3175,7 +3368,7 @@ export declare const crmService: {
3175
3368
  }, {}, {}>;
3176
3369
  totalAmountCents: import("drizzle-orm/pg-core").PgColumn<{
3177
3370
  name: "total_amount_cents";
3178
- tableName: "quote_lines";
3371
+ tableName: "quote_version_lines";
3179
3372
  dataType: "number";
3180
3373
  columnType: "PgInteger";
3181
3374
  data: number;
@@ -3192,7 +3385,7 @@ export declare const crmService: {
3192
3385
  }, {}, {}>;
3193
3386
  currency: import("drizzle-orm/pg-core").PgColumn<{
3194
3387
  name: "currency";
3195
- tableName: "quote_lines";
3388
+ tableName: "quote_version_lines";
3196
3389
  dataType: "string";
3197
3390
  columnType: "PgText";
3198
3391
  data: string;
@@ -3209,7 +3402,7 @@ export declare const crmService: {
3209
3402
  }, {}, {}>;
3210
3403
  createdAt: import("drizzle-orm/pg-core").PgColumn<{
3211
3404
  name: "created_at";
3212
- tableName: "quote_lines";
3405
+ tableName: "quote_version_lines";
3213
3406
  dataType: "date";
3214
3407
  columnType: "PgTimestamp";
3215
3408
  data: Date;
@@ -3226,7 +3419,7 @@ export declare const crmService: {
3226
3419
  }, {}, {}>;
3227
3420
  updatedAt: import("drizzle-orm/pg-core").PgColumn<{
3228
3421
  name: "updated_at";
3229
- tableName: "quote_lines";
3422
+ tableName: "quote_version_lines";
3230
3423
  dataType: "date";
3231
3424
  columnType: "PgTimestamp";
3232
3425
  data: Date;
@@ -3241,9 +3434,9 @@ export declare const crmService: {
3241
3434
  identity: undefined;
3242
3435
  generated: undefined;
3243
3436
  }, {}, {}>;
3244
- }, "single", Record<"quote_lines", "not-null">, false, "where" | "orderBy", {
3437
+ }, "single", Record<"quote_version_lines", "not-null">, false, "where" | "orderBy", {
3245
3438
  id: string;
3246
- quoteId: string;
3439
+ quoteVersionId: string;
3247
3440
  productId: string | null;
3248
3441
  supplierServiceId: string | null;
3249
3442
  description: string;
@@ -3256,7 +3449,7 @@ export declare const crmService: {
3256
3449
  }[], {
3257
3450
  id: import("drizzle-orm/pg-core").PgColumn<{
3258
3451
  name: string;
3259
- tableName: "quote_lines";
3452
+ tableName: "quote_version_lines";
3260
3453
  dataType: "string";
3261
3454
  columnType: "PgText";
3262
3455
  data: string;
@@ -3271,9 +3464,9 @@ export declare const crmService: {
3271
3464
  identity: undefined;
3272
3465
  generated: undefined;
3273
3466
  }, {}, {}>;
3274
- quoteId: import("drizzle-orm/pg-core").PgColumn<{
3467
+ quoteVersionId: import("drizzle-orm/pg-core").PgColumn<{
3275
3468
  name: string;
3276
- tableName: "quote_lines";
3469
+ tableName: "quote_version_lines";
3277
3470
  dataType: "string";
3278
3471
  columnType: "PgText";
3279
3472
  data: string;
@@ -3290,7 +3483,7 @@ export declare const crmService: {
3290
3483
  }, {}, {}>;
3291
3484
  productId: import("drizzle-orm/pg-core").PgColumn<{
3292
3485
  name: "product_id";
3293
- tableName: "quote_lines";
3486
+ tableName: "quote_version_lines";
3294
3487
  dataType: "string";
3295
3488
  columnType: "PgText";
3296
3489
  data: string;
@@ -3307,7 +3500,7 @@ export declare const crmService: {
3307
3500
  }, {}, {}>;
3308
3501
  supplierServiceId: import("drizzle-orm/pg-core").PgColumn<{
3309
3502
  name: "supplier_service_id";
3310
- tableName: "quote_lines";
3503
+ tableName: "quote_version_lines";
3311
3504
  dataType: "string";
3312
3505
  columnType: "PgText";
3313
3506
  data: string;
@@ -3324,7 +3517,7 @@ export declare const crmService: {
3324
3517
  }, {}, {}>;
3325
3518
  description: import("drizzle-orm/pg-core").PgColumn<{
3326
3519
  name: "description";
3327
- tableName: "quote_lines";
3520
+ tableName: "quote_version_lines";
3328
3521
  dataType: "string";
3329
3522
  columnType: "PgText";
3330
3523
  data: string;
@@ -3341,7 +3534,7 @@ export declare const crmService: {
3341
3534
  }, {}, {}>;
3342
3535
  quantity: import("drizzle-orm/pg-core").PgColumn<{
3343
3536
  name: "quantity";
3344
- tableName: "quote_lines";
3537
+ tableName: "quote_version_lines";
3345
3538
  dataType: "number";
3346
3539
  columnType: "PgInteger";
3347
3540
  data: number;
@@ -3358,7 +3551,7 @@ export declare const crmService: {
3358
3551
  }, {}, {}>;
3359
3552
  unitPriceAmountCents: import("drizzle-orm/pg-core").PgColumn<{
3360
3553
  name: "unit_price_amount_cents";
3361
- tableName: "quote_lines";
3554
+ tableName: "quote_version_lines";
3362
3555
  dataType: "number";
3363
3556
  columnType: "PgInteger";
3364
3557
  data: number;
@@ -3375,7 +3568,7 @@ export declare const crmService: {
3375
3568
  }, {}, {}>;
3376
3569
  totalAmountCents: import("drizzle-orm/pg-core").PgColumn<{
3377
3570
  name: "total_amount_cents";
3378
- tableName: "quote_lines";
3571
+ tableName: "quote_version_lines";
3379
3572
  dataType: "number";
3380
3573
  columnType: "PgInteger";
3381
3574
  data: number;
@@ -3392,7 +3585,7 @@ export declare const crmService: {
3392
3585
  }, {}, {}>;
3393
3586
  currency: import("drizzle-orm/pg-core").PgColumn<{
3394
3587
  name: "currency";
3395
- tableName: "quote_lines";
3588
+ tableName: "quote_version_lines";
3396
3589
  dataType: "string";
3397
3590
  columnType: "PgText";
3398
3591
  data: string;
@@ -3409,7 +3602,7 @@ export declare const crmService: {
3409
3602
  }, {}, {}>;
3410
3603
  createdAt: import("drizzle-orm/pg-core").PgColumn<{
3411
3604
  name: "created_at";
3412
- tableName: "quote_lines";
3605
+ tableName: "quote_version_lines";
3413
3606
  dataType: "date";
3414
3607
  columnType: "PgTimestamp";
3415
3608
  data: Date;
@@ -3426,7 +3619,7 @@ export declare const crmService: {
3426
3619
  }, {}, {}>;
3427
3620
  updatedAt: import("drizzle-orm/pg-core").PgColumn<{
3428
3621
  name: "updated_at";
3429
- tableName: "quote_lines";
3622
+ tableName: "quote_version_lines";
3430
3623
  dataType: "date";
3431
3624
  columnType: "PgTimestamp";
3432
3625
  data: Date;
@@ -3442,7 +3635,7 @@ export declare const crmService: {
3442
3635
  generated: undefined;
3443
3636
  }, {}, {}>;
3444
3637
  }>, "where" | "orderBy">;
3445
- createQuoteLine(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, quoteId: string, data: {
3638
+ createQuoteVersionLine(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, quoteVersionId: string, data: {
3446
3639
  description: string;
3447
3640
  quantity: number;
3448
3641
  unitPriceAmountCents: number;
@@ -3456,14 +3649,14 @@ export declare const crmService: {
3456
3649
  createdAt: Date;
3457
3650
  updatedAt: Date;
3458
3651
  currency: string;
3459
- quoteId: string;
3652
+ quoteVersionId: string;
3460
3653
  productId: string | null;
3461
3654
  supplierServiceId: string | null;
3462
3655
  quantity: number;
3463
3656
  unitPriceAmountCents: number;
3464
3657
  totalAmountCents: number;
3465
- } | undefined>;
3466
- updateQuoteLine(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string, data: {
3658
+ } | null | undefined>;
3659
+ updateQuoteVersionLine(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string, data: {
3467
3660
  productId?: string | null | undefined;
3468
3661
  supplierServiceId?: string | null | undefined;
3469
3662
  description?: string | undefined;
@@ -3473,7 +3666,7 @@ export declare const crmService: {
3473
3666
  currency?: string | undefined;
3474
3667
  }): Promise<{
3475
3668
  id: string;
3476
- quoteId: string;
3669
+ quoteVersionId: string;
3477
3670
  productId: string | null;
3478
3671
  supplierServiceId: string | null;
3479
3672
  description: string;
@@ -3484,10 +3677,10 @@ export declare const crmService: {
3484
3677
  createdAt: Date;
3485
3678
  updatedAt: Date;
3486
3679
  } | null>;
3487
- deleteQuoteLine(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string): Promise<{
3680
+ deleteQuoteVersionLine(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string): Promise<{
3488
3681
  id: string;
3489
3682
  } | null>;
3490
- listOpportunities(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, query: {
3683
+ listQuotes(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, query: {
3491
3684
  limit: number;
3492
3685
  offset: number;
3493
3686
  personId?: string | undefined;
@@ -3507,6 +3700,7 @@ export declare const crmService: {
3507
3700
  stageId: string;
3508
3701
  ownerId: string | null;
3509
3702
  status: "lost" | "archived" | "open" | "won";
3703
+ acceptedVersionId: string | null;
3510
3704
  valueAmountCents: number | null;
3511
3705
  valueCurrency: string | null;
3512
3706
  expectedCloseDate: string | null;
@@ -3523,7 +3717,7 @@ export declare const crmService: {
3523
3717
  limit: number;
3524
3718
  offset: number;
3525
3719
  }>;
3526
- getOpportunityById(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string): Promise<{
3720
+ getQuoteById(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string): Promise<{
3527
3721
  id: string;
3528
3722
  title: string;
3529
3723
  personId: string | null;
@@ -3532,6 +3726,7 @@ export declare const crmService: {
3532
3726
  stageId: string;
3533
3727
  ownerId: string | null;
3534
3728
  status: "lost" | "archived" | "open" | "won";
3729
+ acceptedVersionId: string | null;
3535
3730
  valueAmountCents: number | null;
3536
3731
  valueCurrency: string | null;
3537
3732
  expectedCloseDate: string | null;
@@ -3544,7 +3739,7 @@ export declare const crmService: {
3544
3739
  stageChangedAt: Date;
3545
3740
  closedAt: Date | null;
3546
3741
  } | null>;
3547
- createOpportunity(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, data: {
3742
+ createQuote(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, data: {
3548
3743
  title: string;
3549
3744
  pipelineId: string;
3550
3745
  stageId: string;
@@ -3553,6 +3748,7 @@ export declare const crmService: {
3553
3748
  personId?: string | null | undefined;
3554
3749
  organizationId?: string | null | undefined;
3555
3750
  ownerId?: string | null | undefined;
3751
+ acceptedVersionId?: string | null | undefined;
3556
3752
  valueAmountCents?: number | null | undefined;
3557
3753
  valueCurrency?: string | null | undefined;
3558
3754
  expectedCloseDate?: string | null | undefined;
@@ -3573,6 +3769,7 @@ export declare const crmService: {
3573
3769
  personId: string | null;
3574
3770
  pipelineId: string;
3575
3771
  stageId: string;
3772
+ acceptedVersionId: string | null;
3576
3773
  valueAmountCents: number | null;
3577
3774
  valueCurrency: string | null;
3578
3775
  expectedCloseDate: string | null;
@@ -3580,7 +3777,7 @@ export declare const crmService: {
3580
3777
  stageChangedAt: Date;
3581
3778
  closedAt: Date | null;
3582
3779
  } | undefined>;
3583
- updateOpportunity(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string, data: {
3780
+ updateQuote(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string, data: {
3584
3781
  title?: string | undefined;
3585
3782
  personId?: string | null | undefined;
3586
3783
  organizationId?: string | null | undefined;
@@ -3588,6 +3785,7 @@ export declare const crmService: {
3588
3785
  stageId?: string | undefined;
3589
3786
  ownerId?: string | null | undefined;
3590
3787
  status?: "lost" | "archived" | "open" | "won" | undefined;
3788
+ acceptedVersionId?: string | null | undefined;
3591
3789
  valueAmountCents?: number | null | undefined;
3592
3790
  valueCurrency?: string | null | undefined;
3593
3791
  expectedCloseDate?: string | null | undefined;
@@ -3604,6 +3802,7 @@ export declare const crmService: {
3604
3802
  stageId: string;
3605
3803
  ownerId: string | null;
3606
3804
  status: "lost" | "archived" | "open" | "won";
3805
+ acceptedVersionId: string | null;
3607
3806
  valueAmountCents: number | null;
3608
3807
  valueCurrency: string | null;
3609
3808
  expectedCloseDate: string | null;
@@ -3616,13 +3815,13 @@ export declare const crmService: {
3616
3815
  stageChangedAt: Date;
3617
3816
  closedAt: Date | null;
3618
3817
  } | null>;
3619
- deleteOpportunity(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string): Promise<{
3818
+ deleteQuote(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string): Promise<{
3620
3819
  id: string;
3621
3820
  } | null>;
3622
- listOpportunityParticipants(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, opportunityId: string): Omit<import("drizzle-orm/pg-core").PgSelectBase<"opportunity_participants", {
3821
+ listQuoteParticipants(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, quoteId: string): Omit<import("drizzle-orm/pg-core").PgSelectBase<"quote_participants", {
3623
3822
  id: import("drizzle-orm/pg-core").PgColumn<{
3624
3823
  name: string;
3625
- tableName: "opportunity_participants";
3824
+ tableName: "quote_participants";
3626
3825
  dataType: "string";
3627
3826
  columnType: "PgText";
3628
3827
  data: string;
@@ -3637,9 +3836,9 @@ export declare const crmService: {
3637
3836
  identity: undefined;
3638
3837
  generated: undefined;
3639
3838
  }, {}, {}>;
3640
- opportunityId: import("drizzle-orm/pg-core").PgColumn<{
3839
+ quoteId: import("drizzle-orm/pg-core").PgColumn<{
3641
3840
  name: string;
3642
- tableName: "opportunity_participants";
3841
+ tableName: "quote_participants";
3643
3842
  dataType: "string";
3644
3843
  columnType: "PgText";
3645
3844
  data: string;
@@ -3656,7 +3855,7 @@ export declare const crmService: {
3656
3855
  }, {}, {}>;
3657
3856
  personId: import("drizzle-orm/pg-core").PgColumn<{
3658
3857
  name: string;
3659
- tableName: "opportunity_participants";
3858
+ tableName: "quote_participants";
3660
3859
  dataType: "string";
3661
3860
  columnType: "PgText";
3662
3861
  data: string;
@@ -3673,7 +3872,7 @@ export declare const crmService: {
3673
3872
  }, {}, {}>;
3674
3873
  role: import("drizzle-orm/pg-core").PgColumn<{
3675
3874
  name: "role";
3676
- tableName: "opportunity_participants";
3875
+ tableName: "quote_participants";
3677
3876
  dataType: "string";
3678
3877
  columnType: "PgEnumColumn";
3679
3878
  data: "other" | "finance" | "traveler" | "booker" | "decision_maker";
@@ -3690,7 +3889,7 @@ export declare const crmService: {
3690
3889
  }, {}, {}>;
3691
3890
  isPrimary: import("drizzle-orm/pg-core").PgColumn<{
3692
3891
  name: "is_primary";
3693
- tableName: "opportunity_participants";
3892
+ tableName: "quote_participants";
3694
3893
  dataType: "boolean";
3695
3894
  columnType: "PgBoolean";
3696
3895
  data: boolean;
@@ -3707,7 +3906,7 @@ export declare const crmService: {
3707
3906
  }, {}, {}>;
3708
3907
  createdAt: import("drizzle-orm/pg-core").PgColumn<{
3709
3908
  name: "created_at";
3710
- tableName: "opportunity_participants";
3909
+ tableName: "quote_participants";
3711
3910
  dataType: "date";
3712
3911
  columnType: "PgTimestamp";
3713
3912
  data: Date;
@@ -3722,9 +3921,9 @@ export declare const crmService: {
3722
3921
  identity: undefined;
3723
3922
  generated: undefined;
3724
3923
  }, {}, {}>;
3725
- }, "single", Record<"opportunity_participants", "not-null">, false, "where" | "orderBy", {
3924
+ }, "single", Record<"quote_participants", "not-null">, false, "where" | "orderBy", {
3726
3925
  id: string;
3727
- opportunityId: string;
3926
+ quoteId: string;
3728
3927
  personId: string;
3729
3928
  role: "other" | "finance" | "traveler" | "booker" | "decision_maker";
3730
3929
  isPrimary: boolean;
@@ -3732,7 +3931,7 @@ export declare const crmService: {
3732
3931
  }[], {
3733
3932
  id: import("drizzle-orm/pg-core").PgColumn<{
3734
3933
  name: string;
3735
- tableName: "opportunity_participants";
3934
+ tableName: "quote_participants";
3736
3935
  dataType: "string";
3737
3936
  columnType: "PgText";
3738
3937
  data: string;
@@ -3747,9 +3946,9 @@ export declare const crmService: {
3747
3946
  identity: undefined;
3748
3947
  generated: undefined;
3749
3948
  }, {}, {}>;
3750
- opportunityId: import("drizzle-orm/pg-core").PgColumn<{
3949
+ quoteId: import("drizzle-orm/pg-core").PgColumn<{
3751
3950
  name: string;
3752
- tableName: "opportunity_participants";
3951
+ tableName: "quote_participants";
3753
3952
  dataType: "string";
3754
3953
  columnType: "PgText";
3755
3954
  data: string;
@@ -3766,7 +3965,7 @@ export declare const crmService: {
3766
3965
  }, {}, {}>;
3767
3966
  personId: import("drizzle-orm/pg-core").PgColumn<{
3768
3967
  name: string;
3769
- tableName: "opportunity_participants";
3968
+ tableName: "quote_participants";
3770
3969
  dataType: "string";
3771
3970
  columnType: "PgText";
3772
3971
  data: string;
@@ -3783,7 +3982,7 @@ export declare const crmService: {
3783
3982
  }, {}, {}>;
3784
3983
  role: import("drizzle-orm/pg-core").PgColumn<{
3785
3984
  name: "role";
3786
- tableName: "opportunity_participants";
3985
+ tableName: "quote_participants";
3787
3986
  dataType: "string";
3788
3987
  columnType: "PgEnumColumn";
3789
3988
  data: "other" | "finance" | "traveler" | "booker" | "decision_maker";
@@ -3800,7 +3999,7 @@ export declare const crmService: {
3800
3999
  }, {}, {}>;
3801
4000
  isPrimary: import("drizzle-orm/pg-core").PgColumn<{
3802
4001
  name: "is_primary";
3803
- tableName: "opportunity_participants";
4002
+ tableName: "quote_participants";
3804
4003
  dataType: "boolean";
3805
4004
  columnType: "PgBoolean";
3806
4005
  data: boolean;
@@ -3817,7 +4016,7 @@ export declare const crmService: {
3817
4016
  }, {}, {}>;
3818
4017
  createdAt: import("drizzle-orm/pg-core").PgColumn<{
3819
4018
  name: "created_at";
3820
- tableName: "opportunity_participants";
4019
+ tableName: "quote_participants";
3821
4020
  dataType: "date";
3822
4021
  columnType: "PgTimestamp";
3823
4022
  data: Date;
@@ -3833,7 +4032,7 @@ export declare const crmService: {
3833
4032
  generated: undefined;
3834
4033
  }, {}, {}>;
3835
4034
  }>, "where" | "orderBy">;
3836
- createOpportunityParticipant(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, opportunityId: string, data: {
4035
+ createQuoteParticipant(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, quoteId: string, data: {
3837
4036
  personId: string;
3838
4037
  role: "other" | "finance" | "traveler" | "booker" | "decision_maker";
3839
4038
  isPrimary: boolean;
@@ -3841,17 +4040,17 @@ export declare const crmService: {
3841
4040
  id: string;
3842
4041
  createdAt: Date;
3843
4042
  role: "other" | "finance" | "traveler" | "booker" | "decision_maker";
3844
- opportunityId: string;
4043
+ quoteId: string;
3845
4044
  isPrimary: boolean;
3846
4045
  personId: string;
3847
4046
  } | undefined>;
3848
- deleteOpportunityParticipant(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string): Promise<{
4047
+ deleteQuoteParticipant(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string): Promise<{
3849
4048
  id: string;
3850
4049
  } | null>;
3851
- listOpportunityProducts(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, opportunityId: string): Omit<import("drizzle-orm/pg-core").PgSelectBase<"opportunity_products", {
4050
+ listQuoteProducts(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, quoteId: string): Omit<import("drizzle-orm/pg-core").PgSelectBase<"quote_products", {
3852
4051
  id: import("drizzle-orm/pg-core").PgColumn<{
3853
4052
  name: string;
3854
- tableName: "opportunity_products";
4053
+ tableName: "quote_products";
3855
4054
  dataType: "string";
3856
4055
  columnType: "PgText";
3857
4056
  data: string;
@@ -3866,9 +4065,9 @@ export declare const crmService: {
3866
4065
  identity: undefined;
3867
4066
  generated: undefined;
3868
4067
  }, {}, {}>;
3869
- opportunityId: import("drizzle-orm/pg-core").PgColumn<{
4068
+ quoteId: import("drizzle-orm/pg-core").PgColumn<{
3870
4069
  name: string;
3871
- tableName: "opportunity_products";
4070
+ tableName: "quote_products";
3872
4071
  dataType: "string";
3873
4072
  columnType: "PgText";
3874
4073
  data: string;
@@ -3885,7 +4084,7 @@ export declare const crmService: {
3885
4084
  }, {}, {}>;
3886
4085
  productId: import("drizzle-orm/pg-core").PgColumn<{
3887
4086
  name: "product_id";
3888
- tableName: "opportunity_products";
4087
+ tableName: "quote_products";
3889
4088
  dataType: "string";
3890
4089
  columnType: "PgText";
3891
4090
  data: string;
@@ -3902,7 +4101,7 @@ export declare const crmService: {
3902
4101
  }, {}, {}>;
3903
4102
  supplierServiceId: import("drizzle-orm/pg-core").PgColumn<{
3904
4103
  name: "supplier_service_id";
3905
- tableName: "opportunity_products";
4104
+ tableName: "quote_products";
3906
4105
  dataType: "string";
3907
4106
  columnType: "PgText";
3908
4107
  data: string;
@@ -3919,7 +4118,7 @@ export declare const crmService: {
3919
4118
  }, {}, {}>;
3920
4119
  nameSnapshot: import("drizzle-orm/pg-core").PgColumn<{
3921
4120
  name: "name_snapshot";
3922
- tableName: "opportunity_products";
4121
+ tableName: "quote_products";
3923
4122
  dataType: "string";
3924
4123
  columnType: "PgText";
3925
4124
  data: string;
@@ -3936,7 +4135,7 @@ export declare const crmService: {
3936
4135
  }, {}, {}>;
3937
4136
  description: import("drizzle-orm/pg-core").PgColumn<{
3938
4137
  name: "description";
3939
- tableName: "opportunity_products";
4138
+ tableName: "quote_products";
3940
4139
  dataType: "string";
3941
4140
  columnType: "PgText";
3942
4141
  data: string;
@@ -3953,7 +4152,7 @@ export declare const crmService: {
3953
4152
  }, {}, {}>;
3954
4153
  quantity: import("drizzle-orm/pg-core").PgColumn<{
3955
4154
  name: "quantity";
3956
- tableName: "opportunity_products";
4155
+ tableName: "quote_products";
3957
4156
  dataType: "number";
3958
4157
  columnType: "PgInteger";
3959
4158
  data: number;
@@ -3970,7 +4169,7 @@ export declare const crmService: {
3970
4169
  }, {}, {}>;
3971
4170
  unitPriceAmountCents: import("drizzle-orm/pg-core").PgColumn<{
3972
4171
  name: "unit_price_amount_cents";
3973
- tableName: "opportunity_products";
4172
+ tableName: "quote_products";
3974
4173
  dataType: "number";
3975
4174
  columnType: "PgInteger";
3976
4175
  data: number;
@@ -3987,7 +4186,7 @@ export declare const crmService: {
3987
4186
  }, {}, {}>;
3988
4187
  costAmountCents: import("drizzle-orm/pg-core").PgColumn<{
3989
4188
  name: "cost_amount_cents";
3990
- tableName: "opportunity_products";
4189
+ tableName: "quote_products";
3991
4190
  dataType: "number";
3992
4191
  columnType: "PgInteger";
3993
4192
  data: number;
@@ -4004,7 +4203,7 @@ export declare const crmService: {
4004
4203
  }, {}, {}>;
4005
4204
  currency: import("drizzle-orm/pg-core").PgColumn<{
4006
4205
  name: "currency";
4007
- tableName: "opportunity_products";
4206
+ tableName: "quote_products";
4008
4207
  dataType: "string";
4009
4208
  columnType: "PgText";
4010
4209
  data: string;
@@ -4021,7 +4220,7 @@ export declare const crmService: {
4021
4220
  }, {}, {}>;
4022
4221
  discountAmountCents: import("drizzle-orm/pg-core").PgColumn<{
4023
4222
  name: "discount_amount_cents";
4024
- tableName: "opportunity_products";
4223
+ tableName: "quote_products";
4025
4224
  dataType: "number";
4026
4225
  columnType: "PgInteger";
4027
4226
  data: number;
@@ -4038,7 +4237,7 @@ export declare const crmService: {
4038
4237
  }, {}, {}>;
4039
4238
  createdAt: import("drizzle-orm/pg-core").PgColumn<{
4040
4239
  name: "created_at";
4041
- tableName: "opportunity_products";
4240
+ tableName: "quote_products";
4042
4241
  dataType: "date";
4043
4242
  columnType: "PgTimestamp";
4044
4243
  data: Date;
@@ -4055,7 +4254,7 @@ export declare const crmService: {
4055
4254
  }, {}, {}>;
4056
4255
  updatedAt: import("drizzle-orm/pg-core").PgColumn<{
4057
4256
  name: "updated_at";
4058
- tableName: "opportunity_products";
4257
+ tableName: "quote_products";
4059
4258
  dataType: "date";
4060
4259
  columnType: "PgTimestamp";
4061
4260
  data: Date;
@@ -4070,9 +4269,9 @@ export declare const crmService: {
4070
4269
  identity: undefined;
4071
4270
  generated: undefined;
4072
4271
  }, {}, {}>;
4073
- }, "single", Record<"opportunity_products", "not-null">, false, "where" | "orderBy", {
4272
+ }, "single", Record<"quote_products", "not-null">, false, "where" | "orderBy", {
4074
4273
  id: string;
4075
- opportunityId: string;
4274
+ quoteId: string;
4076
4275
  productId: string | null;
4077
4276
  supplierServiceId: string | null;
4078
4277
  nameSnapshot: string;
@@ -4087,7 +4286,7 @@ export declare const crmService: {
4087
4286
  }[], {
4088
4287
  id: import("drizzle-orm/pg-core").PgColumn<{
4089
4288
  name: string;
4090
- tableName: "opportunity_products";
4289
+ tableName: "quote_products";
4091
4290
  dataType: "string";
4092
4291
  columnType: "PgText";
4093
4292
  data: string;
@@ -4102,9 +4301,9 @@ export declare const crmService: {
4102
4301
  identity: undefined;
4103
4302
  generated: undefined;
4104
4303
  }, {}, {}>;
4105
- opportunityId: import("drizzle-orm/pg-core").PgColumn<{
4304
+ quoteId: import("drizzle-orm/pg-core").PgColumn<{
4106
4305
  name: string;
4107
- tableName: "opportunity_products";
4306
+ tableName: "quote_products";
4108
4307
  dataType: "string";
4109
4308
  columnType: "PgText";
4110
4309
  data: string;
@@ -4121,7 +4320,7 @@ export declare const crmService: {
4121
4320
  }, {}, {}>;
4122
4321
  productId: import("drizzle-orm/pg-core").PgColumn<{
4123
4322
  name: "product_id";
4124
- tableName: "opportunity_products";
4323
+ tableName: "quote_products";
4125
4324
  dataType: "string";
4126
4325
  columnType: "PgText";
4127
4326
  data: string;
@@ -4138,7 +4337,7 @@ export declare const crmService: {
4138
4337
  }, {}, {}>;
4139
4338
  supplierServiceId: import("drizzle-orm/pg-core").PgColumn<{
4140
4339
  name: "supplier_service_id";
4141
- tableName: "opportunity_products";
4340
+ tableName: "quote_products";
4142
4341
  dataType: "string";
4143
4342
  columnType: "PgText";
4144
4343
  data: string;
@@ -4155,7 +4354,7 @@ export declare const crmService: {
4155
4354
  }, {}, {}>;
4156
4355
  nameSnapshot: import("drizzle-orm/pg-core").PgColumn<{
4157
4356
  name: "name_snapshot";
4158
- tableName: "opportunity_products";
4357
+ tableName: "quote_products";
4159
4358
  dataType: "string";
4160
4359
  columnType: "PgText";
4161
4360
  data: string;
@@ -4172,7 +4371,7 @@ export declare const crmService: {
4172
4371
  }, {}, {}>;
4173
4372
  description: import("drizzle-orm/pg-core").PgColumn<{
4174
4373
  name: "description";
4175
- tableName: "opportunity_products";
4374
+ tableName: "quote_products";
4176
4375
  dataType: "string";
4177
4376
  columnType: "PgText";
4178
4377
  data: string;
@@ -4189,7 +4388,7 @@ export declare const crmService: {
4189
4388
  }, {}, {}>;
4190
4389
  quantity: import("drizzle-orm/pg-core").PgColumn<{
4191
4390
  name: "quantity";
4192
- tableName: "opportunity_products";
4391
+ tableName: "quote_products";
4193
4392
  dataType: "number";
4194
4393
  columnType: "PgInteger";
4195
4394
  data: number;
@@ -4206,7 +4405,7 @@ export declare const crmService: {
4206
4405
  }, {}, {}>;
4207
4406
  unitPriceAmountCents: import("drizzle-orm/pg-core").PgColumn<{
4208
4407
  name: "unit_price_amount_cents";
4209
- tableName: "opportunity_products";
4408
+ tableName: "quote_products";
4210
4409
  dataType: "number";
4211
4410
  columnType: "PgInteger";
4212
4411
  data: number;
@@ -4223,7 +4422,7 @@ export declare const crmService: {
4223
4422
  }, {}, {}>;
4224
4423
  costAmountCents: import("drizzle-orm/pg-core").PgColumn<{
4225
4424
  name: "cost_amount_cents";
4226
- tableName: "opportunity_products";
4425
+ tableName: "quote_products";
4227
4426
  dataType: "number";
4228
4427
  columnType: "PgInteger";
4229
4428
  data: number;
@@ -4240,7 +4439,7 @@ export declare const crmService: {
4240
4439
  }, {}, {}>;
4241
4440
  currency: import("drizzle-orm/pg-core").PgColumn<{
4242
4441
  name: "currency";
4243
- tableName: "opportunity_products";
4442
+ tableName: "quote_products";
4244
4443
  dataType: "string";
4245
4444
  columnType: "PgText";
4246
4445
  data: string;
@@ -4257,7 +4456,7 @@ export declare const crmService: {
4257
4456
  }, {}, {}>;
4258
4457
  discountAmountCents: import("drizzle-orm/pg-core").PgColumn<{
4259
4458
  name: "discount_amount_cents";
4260
- tableName: "opportunity_products";
4459
+ tableName: "quote_products";
4261
4460
  dataType: "number";
4262
4461
  columnType: "PgInteger";
4263
4462
  data: number;
@@ -4274,7 +4473,7 @@ export declare const crmService: {
4274
4473
  }, {}, {}>;
4275
4474
  createdAt: import("drizzle-orm/pg-core").PgColumn<{
4276
4475
  name: "created_at";
4277
- tableName: "opportunity_products";
4476
+ tableName: "quote_products";
4278
4477
  dataType: "date";
4279
4478
  columnType: "PgTimestamp";
4280
4479
  data: Date;
@@ -4291,7 +4490,7 @@ export declare const crmService: {
4291
4490
  }, {}, {}>;
4292
4491
  updatedAt: import("drizzle-orm/pg-core").PgColumn<{
4293
4492
  name: "updated_at";
4294
- tableName: "opportunity_products";
4493
+ tableName: "quote_products";
4295
4494
  dataType: "date";
4296
4495
  columnType: "PgTimestamp";
4297
4496
  data: Date;
@@ -4307,7 +4506,7 @@ export declare const crmService: {
4307
4506
  generated: undefined;
4308
4507
  }, {}, {}>;
4309
4508
  }>, "where" | "orderBy">;
4310
- createOpportunityProduct(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, opportunityId: string, data: {
4509
+ createQuoteProduct(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, quoteId: string, data: {
4311
4510
  nameSnapshot: string;
4312
4511
  quantity: number;
4313
4512
  productId?: string | null | undefined;
@@ -4323,7 +4522,7 @@ export declare const crmService: {
4323
4522
  createdAt: Date;
4324
4523
  updatedAt: Date;
4325
4524
  currency: string | null;
4326
- opportunityId: string;
4525
+ quoteId: string;
4327
4526
  productId: string | null;
4328
4527
  supplierServiceId: string | null;
4329
4528
  nameSnapshot: string;
@@ -4332,7 +4531,7 @@ export declare const crmService: {
4332
4531
  costAmountCents: number | null;
4333
4532
  discountAmountCents: number | null;
4334
4533
  } | undefined>;
4335
- updateOpportunityProduct(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string, data: {
4534
+ updateQuoteProduct(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string, data: {
4336
4535
  productId?: string | null | undefined;
4337
4536
  supplierServiceId?: string | null | undefined;
4338
4537
  nameSnapshot?: string | undefined;
@@ -4344,7 +4543,7 @@ export declare const crmService: {
4344
4543
  discountAmountCents?: number | null | undefined;
4345
4544
  }): Promise<{
4346
4545
  id: string;
4347
- opportunityId: string;
4546
+ quoteId: string;
4348
4547
  productId: string | null;
4349
4548
  supplierServiceId: string | null;
4350
4549
  nameSnapshot: string;
@@ -4357,17 +4556,17 @@ export declare const crmService: {
4357
4556
  createdAt: Date;
4358
4557
  updatedAt: Date;
4359
4558
  } | null>;
4360
- deleteOpportunityProduct(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string): Promise<{
4559
+ deleteQuoteProduct(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string): Promise<{
4361
4560
  id: string;
4362
4561
  } | null>;
4363
4562
  listPipelines(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, query: {
4364
4563
  limit: number;
4365
4564
  offset: number;
4366
- entityType?: "organization" | "person" | "opportunity" | "quote" | "activity" | undefined;
4565
+ entityType?: "organization" | "person" | "quote" | "activity" | undefined;
4367
4566
  }): Promise<{
4368
4567
  data: {
4369
4568
  id: string;
4370
- entityType: "organization" | "person" | "opportunity" | "quote" | "activity";
4569
+ entityType: "organization" | "person" | "quote" | "activity";
4371
4570
  name: string;
4372
4571
  isDefault: boolean;
4373
4572
  sortOrder: number;
@@ -4380,7 +4579,7 @@ export declare const crmService: {
4380
4579
  }>;
4381
4580
  getPipelineById(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string): Promise<{
4382
4581
  id: string;
4383
- entityType: "organization" | "person" | "opportunity" | "quote" | "activity";
4582
+ entityType: "organization" | "person" | "quote" | "activity";
4384
4583
  name: string;
4385
4584
  isDefault: boolean;
4386
4585
  sortOrder: number;
@@ -4388,7 +4587,7 @@ export declare const crmService: {
4388
4587
  updatedAt: Date;
4389
4588
  } | null>;
4390
4589
  createPipeline(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, data: {
4391
- entityType: "organization" | "person" | "opportunity" | "quote" | "activity";
4590
+ entityType: "organization" | "person" | "quote" | "activity";
4392
4591
  name: string;
4393
4592
  isDefault: boolean;
4394
4593
  sortOrder: number;
@@ -4397,18 +4596,18 @@ export declare const crmService: {
4397
4596
  id: string;
4398
4597
  createdAt: Date;
4399
4598
  updatedAt: Date;
4400
- entityType: "organization" | "person" | "opportunity" | "quote" | "activity";
4599
+ entityType: "organization" | "person" | "quote" | "activity";
4401
4600
  isDefault: boolean;
4402
4601
  sortOrder: number;
4403
4602
  } | undefined>;
4404
4603
  updatePipeline(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string, data: {
4405
- entityType?: "organization" | "person" | "opportunity" | "quote" | "activity" | undefined;
4604
+ entityType?: "organization" | "person" | "quote" | "activity" | undefined;
4406
4605
  name?: string | undefined;
4407
4606
  isDefault?: boolean | undefined;
4408
4607
  sortOrder?: number | undefined;
4409
4608
  }): Promise<{
4410
4609
  id: string;
4411
- entityType: "organization" | "person" | "opportunity" | "quote" | "activity";
4610
+ entityType: "organization" | "person" | "quote" | "activity";
4412
4611
  name: string;
4413
4612
  isDefault: boolean;
4414
4613
  sortOrder: number;