@voyantjs/availability 0.2.0 → 0.3.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.
@@ -0,0 +1,407 @@
1
+ import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
2
+ import type { AvailabilityPickupPointListQuery, AvailabilitySlotPickupListQuery, CreateAvailabilityPickupPointInput, CreateAvailabilitySlotPickupInput, CreateCustomPickupAreaInput, CreateLocationPickupTimeInput, CreatePickupGroupInput, CreatePickupLocationInput, CreateProductMeetingConfigInput, CustomPickupAreaListQuery, LocationPickupTimeListQuery, PickupGroupListQuery, PickupLocationListQuery, ProductMeetingConfigListQuery, UpdateAvailabilityPickupPointInput, UpdateAvailabilitySlotPickupInput, UpdateCustomPickupAreaInput, UpdateLocationPickupTimeInput, UpdatePickupGroupInput, UpdatePickupLocationInput, UpdateProductMeetingConfigInput } from "./service-shared.js";
3
+ export declare function listPickupPoints(db: PostgresJsDatabase, query: AvailabilityPickupPointListQuery): Promise<{
4
+ data: {
5
+ id: string;
6
+ productId: string;
7
+ facilityId: string | null;
8
+ name: string;
9
+ description: string | null;
10
+ locationText: string | null;
11
+ active: boolean;
12
+ createdAt: Date;
13
+ updatedAt: Date;
14
+ }[];
15
+ total: number;
16
+ limit: number;
17
+ offset: number;
18
+ }>;
19
+ export declare function getPickupPointById(db: PostgresJsDatabase, id: string): Promise<{
20
+ id: string;
21
+ productId: string;
22
+ facilityId: string | null;
23
+ name: string;
24
+ description: string | null;
25
+ locationText: string | null;
26
+ active: boolean;
27
+ createdAt: Date;
28
+ updatedAt: Date;
29
+ } | null>;
30
+ export declare function createPickupPoint(db: PostgresJsDatabase, data: CreateAvailabilityPickupPointInput): Promise<{
31
+ id: string;
32
+ name: string;
33
+ productId: string;
34
+ facilityId: string | null;
35
+ active: boolean;
36
+ createdAt: Date;
37
+ updatedAt: Date;
38
+ description: string | null;
39
+ locationText: string | null;
40
+ } | undefined>;
41
+ export declare function updatePickupPoint(db: PostgresJsDatabase, id: string, data: UpdateAvailabilityPickupPointInput): Promise<{
42
+ id: string;
43
+ productId: string;
44
+ facilityId: string | null;
45
+ name: string;
46
+ description: string | null;
47
+ locationText: string | null;
48
+ active: boolean;
49
+ createdAt: Date;
50
+ updatedAt: Date;
51
+ } | null>;
52
+ export declare function deletePickupPoint(db: PostgresJsDatabase, id: string): Promise<{
53
+ id: string;
54
+ } | null>;
55
+ export declare function listSlotPickups(db: PostgresJsDatabase, query: AvailabilitySlotPickupListQuery): Promise<{
56
+ data: {
57
+ id: string;
58
+ slotId: string;
59
+ pickupPointId: string;
60
+ initialCapacity: number | null;
61
+ remainingCapacity: number | null;
62
+ createdAt: Date;
63
+ updatedAt: Date;
64
+ }[];
65
+ total: number;
66
+ limit: number;
67
+ offset: number;
68
+ }>;
69
+ export declare function getSlotPickupById(db: PostgresJsDatabase, id: string): Promise<{
70
+ id: string;
71
+ slotId: string;
72
+ pickupPointId: string;
73
+ initialCapacity: number | null;
74
+ remainingCapacity: number | null;
75
+ createdAt: Date;
76
+ updatedAt: Date;
77
+ } | null>;
78
+ export declare function createSlotPickup(db: PostgresJsDatabase, data: CreateAvailabilitySlotPickupInput): Promise<{
79
+ id: string;
80
+ createdAt: Date;
81
+ updatedAt: Date;
82
+ slotId: string;
83
+ pickupPointId: string;
84
+ initialCapacity: number | null;
85
+ remainingCapacity: number | null;
86
+ } | undefined>;
87
+ export declare function updateSlotPickup(db: PostgresJsDatabase, id: string, data: UpdateAvailabilitySlotPickupInput): Promise<{
88
+ id: string;
89
+ slotId: string;
90
+ pickupPointId: string;
91
+ initialCapacity: number | null;
92
+ remainingCapacity: number | null;
93
+ createdAt: Date;
94
+ updatedAt: Date;
95
+ } | null>;
96
+ export declare function deleteSlotPickup(db: PostgresJsDatabase, id: string): Promise<{
97
+ id: string;
98
+ } | null>;
99
+ export declare function listMeetingConfigs(db: PostgresJsDatabase, query: ProductMeetingConfigListQuery): Promise<{
100
+ data: {
101
+ id: string;
102
+ productId: string;
103
+ optionId: string | null;
104
+ facilityId: string | null;
105
+ mode: "meeting_only" | "pickup_only" | "meet_or_pickup";
106
+ allowCustomPickup: boolean;
107
+ allowCustomDropoff: boolean;
108
+ requiresPickupSelection: boolean;
109
+ requiresDropoffSelection: boolean;
110
+ usePickupAllotment: boolean;
111
+ meetingInstructions: string | null;
112
+ pickupInstructions: string | null;
113
+ dropoffInstructions: string | null;
114
+ active: boolean;
115
+ createdAt: Date;
116
+ updatedAt: Date;
117
+ }[];
118
+ total: number;
119
+ limit: number;
120
+ offset: number;
121
+ }>;
122
+ export declare function getMeetingConfigById(db: PostgresJsDatabase, id: string): Promise<{
123
+ id: string;
124
+ productId: string;
125
+ optionId: string | null;
126
+ facilityId: string | null;
127
+ mode: "meeting_only" | "pickup_only" | "meet_or_pickup";
128
+ allowCustomPickup: boolean;
129
+ allowCustomDropoff: boolean;
130
+ requiresPickupSelection: boolean;
131
+ requiresDropoffSelection: boolean;
132
+ usePickupAllotment: boolean;
133
+ meetingInstructions: string | null;
134
+ pickupInstructions: string | null;
135
+ dropoffInstructions: string | null;
136
+ active: boolean;
137
+ createdAt: Date;
138
+ updatedAt: Date;
139
+ } | null>;
140
+ export declare function createMeetingConfig(db: PostgresJsDatabase, data: CreateProductMeetingConfigInput): Promise<{
141
+ id: string;
142
+ productId: string;
143
+ optionId: string | null;
144
+ facilityId: string | null;
145
+ active: boolean;
146
+ mode: "meeting_only" | "pickup_only" | "meet_or_pickup";
147
+ createdAt: Date;
148
+ updatedAt: Date;
149
+ allowCustomPickup: boolean;
150
+ allowCustomDropoff: boolean;
151
+ requiresPickupSelection: boolean;
152
+ requiresDropoffSelection: boolean;
153
+ usePickupAllotment: boolean;
154
+ meetingInstructions: string | null;
155
+ pickupInstructions: string | null;
156
+ dropoffInstructions: string | null;
157
+ } | undefined>;
158
+ export declare function updateMeetingConfig(db: PostgresJsDatabase, id: string, data: UpdateProductMeetingConfigInput): Promise<{
159
+ id: string;
160
+ productId: string;
161
+ optionId: string | null;
162
+ facilityId: string | null;
163
+ mode: "meeting_only" | "pickup_only" | "meet_or_pickup";
164
+ allowCustomPickup: boolean;
165
+ allowCustomDropoff: boolean;
166
+ requiresPickupSelection: boolean;
167
+ requiresDropoffSelection: boolean;
168
+ usePickupAllotment: boolean;
169
+ meetingInstructions: string | null;
170
+ pickupInstructions: string | null;
171
+ dropoffInstructions: string | null;
172
+ active: boolean;
173
+ createdAt: Date;
174
+ updatedAt: Date;
175
+ } | null>;
176
+ export declare function deleteMeetingConfig(db: PostgresJsDatabase, id: string): Promise<{
177
+ id: string;
178
+ } | null>;
179
+ export declare function listPickupGroups(db: PostgresJsDatabase, query: PickupGroupListQuery): Promise<{
180
+ data: {
181
+ id: string;
182
+ meetingConfigId: string;
183
+ kind: "pickup" | "dropoff" | "meeting";
184
+ name: string;
185
+ description: string | null;
186
+ active: boolean;
187
+ sortOrder: number;
188
+ createdAt: Date;
189
+ updatedAt: Date;
190
+ }[];
191
+ total: number;
192
+ limit: number;
193
+ offset: number;
194
+ }>;
195
+ export declare function getPickupGroupById(db: PostgresJsDatabase, id: string): Promise<{
196
+ id: string;
197
+ meetingConfigId: string;
198
+ kind: "pickup" | "dropoff" | "meeting";
199
+ name: string;
200
+ description: string | null;
201
+ active: boolean;
202
+ sortOrder: number;
203
+ createdAt: Date;
204
+ updatedAt: Date;
205
+ } | null>;
206
+ export declare function createPickupGroup(db: PostgresJsDatabase, data: CreatePickupGroupInput): Promise<{
207
+ id: string;
208
+ name: string;
209
+ active: boolean;
210
+ createdAt: Date;
211
+ updatedAt: Date;
212
+ sortOrder: number;
213
+ description: string | null;
214
+ meetingConfigId: string;
215
+ kind: "pickup" | "dropoff" | "meeting";
216
+ } | undefined>;
217
+ export declare function updatePickupGroup(db: PostgresJsDatabase, id: string, data: UpdatePickupGroupInput): Promise<{
218
+ id: string;
219
+ meetingConfigId: string;
220
+ kind: "pickup" | "dropoff" | "meeting";
221
+ name: string;
222
+ description: string | null;
223
+ active: boolean;
224
+ sortOrder: number;
225
+ createdAt: Date;
226
+ updatedAt: Date;
227
+ } | null>;
228
+ export declare function deletePickupGroup(db: PostgresJsDatabase, id: string): Promise<{
229
+ id: string;
230
+ } | null>;
231
+ export declare function listPickupLocations(db: PostgresJsDatabase, query: PickupLocationListQuery): Promise<{
232
+ data: {
233
+ id: string;
234
+ groupId: string;
235
+ facilityId: string | null;
236
+ name: string;
237
+ description: string | null;
238
+ locationText: string | null;
239
+ leadTimeMinutes: number | null;
240
+ active: boolean;
241
+ sortOrder: number;
242
+ createdAt: Date;
243
+ updatedAt: Date;
244
+ }[];
245
+ total: number;
246
+ limit: number;
247
+ offset: number;
248
+ }>;
249
+ export declare function getPickupLocationById(db: PostgresJsDatabase, id: string): Promise<{
250
+ id: string;
251
+ groupId: string;
252
+ facilityId: string | null;
253
+ name: string;
254
+ description: string | null;
255
+ locationText: string | null;
256
+ leadTimeMinutes: number | null;
257
+ active: boolean;
258
+ sortOrder: number;
259
+ createdAt: Date;
260
+ updatedAt: Date;
261
+ } | null>;
262
+ export declare function createPickupLocation(db: PostgresJsDatabase, data: CreatePickupLocationInput): Promise<{
263
+ id: string;
264
+ name: string;
265
+ facilityId: string | null;
266
+ active: boolean;
267
+ createdAt: Date;
268
+ updatedAt: Date;
269
+ sortOrder: number;
270
+ description: string | null;
271
+ locationText: string | null;
272
+ groupId: string;
273
+ leadTimeMinutes: number | null;
274
+ } | undefined>;
275
+ export declare function updatePickupLocation(db: PostgresJsDatabase, id: string, data: UpdatePickupLocationInput): Promise<{
276
+ id: string;
277
+ groupId: string;
278
+ facilityId: string | null;
279
+ name: string;
280
+ description: string | null;
281
+ locationText: string | null;
282
+ leadTimeMinutes: number | null;
283
+ active: boolean;
284
+ sortOrder: number;
285
+ createdAt: Date;
286
+ updatedAt: Date;
287
+ } | null>;
288
+ export declare function deletePickupLocation(db: PostgresJsDatabase, id: string): Promise<{
289
+ id: string;
290
+ } | null>;
291
+ export declare function listLocationPickupTimes(db: PostgresJsDatabase, query: LocationPickupTimeListQuery): Promise<{
292
+ data: {
293
+ id: string;
294
+ pickupLocationId: string;
295
+ slotId: string | null;
296
+ startTimeId: string | null;
297
+ timingMode: "fixed_time" | "offset_from_start";
298
+ localTime: string | null;
299
+ offsetMinutes: number | null;
300
+ instructions: string | null;
301
+ initialCapacity: number | null;
302
+ remainingCapacity: number | null;
303
+ active: boolean;
304
+ createdAt: Date;
305
+ updatedAt: Date;
306
+ }[];
307
+ total: number;
308
+ limit: number;
309
+ offset: number;
310
+ }>;
311
+ export declare function getLocationPickupTimeById(db: PostgresJsDatabase, id: string): Promise<{
312
+ id: string;
313
+ pickupLocationId: string;
314
+ slotId: string | null;
315
+ startTimeId: string | null;
316
+ timingMode: "fixed_time" | "offset_from_start";
317
+ localTime: string | null;
318
+ offsetMinutes: number | null;
319
+ instructions: string | null;
320
+ initialCapacity: number | null;
321
+ remainingCapacity: number | null;
322
+ active: boolean;
323
+ createdAt: Date;
324
+ updatedAt: Date;
325
+ } | null>;
326
+ export declare function createLocationPickupTime(db: PostgresJsDatabase, data: CreateLocationPickupTimeInput): Promise<{
327
+ id: string;
328
+ localTime: string | null;
329
+ active: boolean;
330
+ createdAt: Date;
331
+ updatedAt: Date;
332
+ startTimeId: string | null;
333
+ slotId: string | null;
334
+ initialCapacity: number | null;
335
+ remainingCapacity: number | null;
336
+ pickupLocationId: string;
337
+ timingMode: "fixed_time" | "offset_from_start";
338
+ offsetMinutes: number | null;
339
+ instructions: string | null;
340
+ } | undefined>;
341
+ export declare function updateLocationPickupTime(db: PostgresJsDatabase, id: string, data: UpdateLocationPickupTimeInput): Promise<{
342
+ id: string;
343
+ pickupLocationId: string;
344
+ slotId: string | null;
345
+ startTimeId: string | null;
346
+ timingMode: "fixed_time" | "offset_from_start";
347
+ localTime: string | null;
348
+ offsetMinutes: number | null;
349
+ instructions: string | null;
350
+ initialCapacity: number | null;
351
+ remainingCapacity: number | null;
352
+ active: boolean;
353
+ createdAt: Date;
354
+ updatedAt: Date;
355
+ } | null>;
356
+ export declare function deleteLocationPickupTime(db: PostgresJsDatabase, id: string): Promise<{
357
+ id: string;
358
+ } | null>;
359
+ export declare function listCustomPickupAreas(db: PostgresJsDatabase, query: CustomPickupAreaListQuery): Promise<{
360
+ data: {
361
+ id: string;
362
+ meetingConfigId: string;
363
+ name: string;
364
+ description: string | null;
365
+ geographicText: string | null;
366
+ active: boolean;
367
+ createdAt: Date;
368
+ updatedAt: Date;
369
+ }[];
370
+ total: number;
371
+ limit: number;
372
+ offset: number;
373
+ }>;
374
+ export declare function getCustomPickupAreaById(db: PostgresJsDatabase, id: string): Promise<{
375
+ id: string;
376
+ meetingConfigId: string;
377
+ name: string;
378
+ description: string | null;
379
+ geographicText: string | null;
380
+ active: boolean;
381
+ createdAt: Date;
382
+ updatedAt: Date;
383
+ } | null>;
384
+ export declare function createCustomPickupArea(db: PostgresJsDatabase, data: CreateCustomPickupAreaInput): Promise<{
385
+ id: string;
386
+ name: string;
387
+ active: boolean;
388
+ createdAt: Date;
389
+ updatedAt: Date;
390
+ description: string | null;
391
+ meetingConfigId: string;
392
+ geographicText: string | null;
393
+ } | undefined>;
394
+ export declare function updateCustomPickupArea(db: PostgresJsDatabase, id: string, data: UpdateCustomPickupAreaInput): Promise<{
395
+ id: string;
396
+ meetingConfigId: string;
397
+ name: string;
398
+ description: string | null;
399
+ geographicText: string | null;
400
+ active: boolean;
401
+ createdAt: Date;
402
+ updatedAt: Date;
403
+ } | null>;
404
+ export declare function deleteCustomPickupArea(db: PostgresJsDatabase, id: string): Promise<{
405
+ id: string;
406
+ } | null>;
407
+ //# sourceMappingURL=service-pickups.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service-pickups.d.ts","sourceRoot":"","sources":["../src/service-pickups.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAWjE,OAAO,KAAK,EACV,gCAAgC,EAChC,+BAA+B,EAC/B,kCAAkC,EAClC,iCAAiC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