@voyant-travel/distribution 0.123.0 → 0.124.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -46,8 +46,8 @@ export declare const externalRefsRoutes: import("hono/hono-base").HonoBase<Env,
46
46
  metadata: {
47
47
  [x: string]: import("hono/utils/types").JSONValue;
48
48
  } | null;
49
- id: string;
50
49
  status: "active" | "inactive" | "archived";
50
+ id: string;
51
51
  createdAt: string;
52
52
  updatedAt: string;
53
53
  entityType: string;
@@ -229,8 +229,8 @@ export declare const externalRefsRoutes: import("hono/hono-base").HonoBase<Env,
229
229
  metadata: {
230
230
  [x: string]: import("hono/utils/types").JSONValue;
231
231
  } | null;
232
- id: string;
233
232
  status: "active" | "inactive" | "archived";
233
+ id: string;
234
234
  createdAt: string;
235
235
  updatedAt: string;
236
236
  entityType: string;
@@ -45,8 +45,8 @@ export declare const externalRefsService: {
45
45
  createExternalRef(db: PostgresJsDatabase, data: CreateExternalRefInput): Promise<{
46
46
  namespace: string;
47
47
  metadata: Record<string, unknown> | null;
48
- id: string;
49
48
  status: "active" | "inactive" | "archived";
49
+ id: string;
50
50
  createdAt: Date;
51
51
  updatedAt: Date;
52
52
  entityType: string;
@@ -40,8 +40,8 @@ export declare const settlementRoutes: import("hono/hono-base").HonoBase<Distrib
40
40
  metadata: {
41
41
  [x: string]: import("hono/utils/types").JSONValue;
42
42
  } | null;
43
- id: string;
44
43
  status: "void" | "draft" | "open" | "posted" | "paid";
44
+ id: string;
45
45
  createdAt: string;
46
46
  updatedAt: string;
47
47
  notes: string | null;
@@ -210,8 +210,8 @@ export declare const settlementRoutes: import("hono/hono-base").HonoBase<Distrib
210
210
  input: {};
211
211
  output: {
212
212
  data: {
213
- id: string;
214
213
  status: "pending" | "void" | "paid" | "approved" | "disputed";
214
+ id: string;
215
215
  createdAt: string;
216
216
  updatedAt: string;
217
217
  notes: string | null;
@@ -380,8 +380,8 @@ export declare const settlementRoutes: import("hono/hono-base").HonoBase<Distrib
380
380
  metadata: {
381
381
  [x: string]: import("hono/utils/types").JSONValue;
382
382
  } | null;
383
- id: string;
384
383
  status: "running" | "completed" | "archived" | "draft";
384
+ id: string;
385
385
  createdAt: string;
386
386
  startedAt: string | null;
387
387
  updatedAt: string;
@@ -702,8 +702,8 @@ export declare const settlementRoutes: import("hono/hono-base").HonoBase<Distrib
702
702
  metadata: {
703
703
  [x: string]: import("hono/utils/types").JSONValue;
704
704
  } | null;
705
- id: string;
706
705
  status: "failed" | "pending" | "completed" | "skipped";
706
+ id: string;
707
707
  createdAt: string;
708
708
  updatedAt: string;
709
709
  notes: string | null;
@@ -1366,8 +1366,8 @@ export declare const settlementRoutes: import("hono/hono-base").HonoBase<Distrib
1366
1366
  metadata: {
1367
1367
  [x: string]: import("hono/utils/types").JSONValue;
1368
1368
  } | null;
1369
- id: string;
1370
1369
  status: "ignored" | "open" | "resolved" | "investigating";
1370
+ id: string;
1371
1371
  createdAt: string;
1372
1372
  updatedAt: string;
1373
1373
  notes: string | null;
@@ -1529,8 +1529,8 @@ export declare const settlementRoutes: import("hono/hono-base").HonoBase<Distrib
1529
1529
  metadata: {
1530
1530
  [x: string]: import("hono/utils/types").JSONValue;
1531
1531
  } | null;
1532
- id: string;
1533
1532
  status: "pending" | "approved" | "rejected";
1533
+ id: string;
1534
1534
  createdAt: string;
1535
1535
  updatedAt: string;
1536
1536
  notes: string | null;
package/dist/routes.d.ts CHANGED
@@ -573,8 +573,8 @@ export declare const distributionRoutes: import("hono/hono-base").HonoBase<Distr
573
573
  input: {};
574
574
  output: {
575
575
  data: {
576
- id: string;
577
576
  status: "active" | "expired" | "draft" | "terminated";
577
+ id: string;
578
578
  createdAt: string;
579
579
  updatedAt: string;
580
580
  notes: string | null;
@@ -1258,10 +1258,10 @@ export declare const distributionRoutes: import("hono/hono-base").HonoBase<Distr
1258
1258
  input: {};
1259
1259
  output: {
1260
1260
  data: {
1261
+ idempotencyKey: string | null;
1261
1262
  id: string;
1262
1263
  lastError: string | null;
1263
1264
  createdAt: string;
1264
- idempotencyKey: string | null;
1265
1265
  updatedAt: string;
1266
1266
  bookingId: string;
1267
1267
  channelId: string;
@@ -1488,11 +1488,11 @@ export declare const distributionRoutes: import("hono/hono-base").HonoBase<Distr
1488
1488
  input: {};
1489
1489
  output: {
1490
1490
  data: {
1491
+ status: "failed" | "pending" | "processed" | "ignored";
1491
1492
  id: string;
1492
1493
  payload: {
1493
1494
  [x: string]: import("hono/utils/types").JSONValue;
1494
1495
  };
1495
- status: "failed" | "pending" | "processed" | "ignored";
1496
1496
  createdAt: string;
1497
1497
  eventType: string;
1498
1498
  errorMessage: string | null;
@@ -2299,8 +2299,8 @@ export declare const distributionRoutes: import("hono/hono-base").HonoBase<Distr
2299
2299
  metadata: {
2300
2300
  [x: string]: import("hono/utils/types").JSONValue;
2301
2301
  } | null;
2302
- id: string;
2303
2302
  status: "void" | "draft" | "open" | "posted" | "paid";
2303
+ id: string;
2304
2304
  createdAt: string;
2305
2305
  updatedAt: string;
2306
2306
  notes: string | null;
@@ -2469,8 +2469,8 @@ export declare const distributionRoutes: import("hono/hono-base").HonoBase<Distr
2469
2469
  input: {};
2470
2470
  output: {
2471
2471
  data: {
2472
- id: string;
2473
2472
  status: "pending" | "void" | "paid" | "approved" | "disputed";
2473
+ id: string;
2474
2474
  createdAt: string;
2475
2475
  updatedAt: string;
2476
2476
  notes: string | null;
@@ -2639,8 +2639,8 @@ export declare const distributionRoutes: import("hono/hono-base").HonoBase<Distr
2639
2639
  metadata: {
2640
2640
  [x: string]: import("hono/utils/types").JSONValue;
2641
2641
  } | null;
2642
- id: string;
2643
2642
  status: "running" | "completed" | "archived" | "draft";
2643
+ id: string;
2644
2644
  createdAt: string;
2645
2645
  startedAt: string | null;
2646
2646
  updatedAt: string;
@@ -2961,8 +2961,8 @@ export declare const distributionRoutes: import("hono/hono-base").HonoBase<Distr
2961
2961
  metadata: {
2962
2962
  [x: string]: import("hono/utils/types").JSONValue;
2963
2963
  } | null;
2964
- id: string;
2965
2964
  status: "failed" | "pending" | "completed" | "skipped";
2965
+ id: string;
2966
2966
  createdAt: string;
2967
2967
  updatedAt: string;
2968
2968
  notes: string | null;
@@ -3625,8 +3625,8 @@ export declare const distributionRoutes: import("hono/hono-base").HonoBase<Distr
3625
3625
  metadata: {
3626
3626
  [x: string]: import("hono/utils/types").JSONValue;
3627
3627
  } | null;
3628
- id: string;
3629
3628
  status: "ignored" | "open" | "resolved" | "investigating";
3629
+ id: string;
3630
3630
  createdAt: string;
3631
3631
  updatedAt: string;
3632
3632
  notes: string | null;
@@ -3788,8 +3788,8 @@ export declare const distributionRoutes: import("hono/hono-base").HonoBase<Distr
3788
3788
  metadata: {
3789
3789
  [x: string]: import("hono/utils/types").JSONValue;
3790
3790
  } | null;
3791
- id: string;
3792
3791
  status: "pending" | "approved" | "rejected";
3792
+ id: string;
3793
3793
  createdAt: string;
3794
3794
  updatedAt: string;
3795
3795
  notes: string | null;
@@ -1,29 +1,24 @@
1
1
  import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
2
2
  import type { ChannelBookingLinkListQuery, ChannelCommissionRuleListQuery, ChannelContractListQuery, ChannelProductMappingListQuery, ChannelWebhookEventListQuery, CreateChannelBookingLinkInput, CreateChannelCommissionRuleInput, CreateChannelContractInput, CreateChannelProductMappingInput, CreateChannelWebhookEventInput, UpdateChannelBookingLinkInput, UpdateChannelCommissionRuleInput, UpdateChannelContractInput, UpdateChannelProductMappingInput, UpdateChannelWebhookEventInput } from "./types.js";
3
3
  export declare const commercialServiceOperations: {
4
- listContracts(db: PostgresJsDatabase, query: ChannelContractListQuery): Promise<{
5
- data: {
6
- id: string;
7
- channelId: string;
8
- supplierId: string | null;
9
- status: "active" | "expired" | "draft" | "terminated";
10
- startsAt: string;
11
- endsAt: string | null;
12
- paymentOwner: "split" | "operator" | "channel";
13
- cancellationOwner: "operator" | "channel" | "mixed";
14
- settlementTerms: string | null;
15
- notes: string | null;
16
- rateLimitRps: number | null;
17
- rateLimitBurst: number | null;
18
- rateLimitPriorityGates: Record<string, number> | null;
19
- policy: Record<string, unknown> | null;
20
- createdAt: Date;
21
- updatedAt: Date;
22
- }[];
23
- total: number;
24
- limit: number;
25
- offset: number;
26
- }>;
4
+ listContracts(db: PostgresJsDatabase, query: ChannelContractListQuery): Promise<import("@voyant-travel/types").ListResponse<{
5
+ id: string;
6
+ channelId: string;
7
+ supplierId: string | null;
8
+ status: "active" | "expired" | "draft" | "terminated";
9
+ startsAt: string;
10
+ endsAt: string | null;
11
+ paymentOwner: "split" | "operator" | "channel";
12
+ cancellationOwner: "operator" | "channel" | "mixed";
13
+ settlementTerms: string | null;
14
+ notes: string | null;
15
+ rateLimitRps: number | null;
16
+ rateLimitBurst: number | null;
17
+ rateLimitPriorityGates: Record<string, number> | null;
18
+ policy: Record<string, unknown> | null;
19
+ createdAt: Date;
20
+ updatedAt: Date;
21
+ }>>;
27
22
  getContractById(db: PostgresJsDatabase, id: string): Promise<{
28
23
  id: string;
29
24
  channelId: string;
@@ -43,8 +38,8 @@ export declare const commercialServiceOperations: {
43
38
  updatedAt: Date;
44
39
  } | null>;
45
40
  createContract(db: PostgresJsDatabase, data: CreateChannelContractInput): Promise<{
46
- id: string;
47
41
  status: "active" | "expired" | "draft" | "terminated";
42
+ id: string;
48
43
  createdAt: Date;
49
44
  updatedAt: Date;
50
45
  notes: string | null;
@@ -81,26 +76,21 @@ export declare const commercialServiceOperations: {
81
76
  deleteContract(db: PostgresJsDatabase, id: string): Promise<{
82
77
  id: string;
83
78
  } | null>;
84
- listCommissionRules(db: PostgresJsDatabase, query: ChannelCommissionRuleListQuery): Promise<{
85
- data: {
86
- id: string;
87
- contractId: string;
88
- scope: "category" | "booking" | "product" | "rate";
89
- productId: string | null;
90
- externalRateId: string | null;
91
- externalCategoryId: string | null;
92
- commissionType: "fixed" | "percentage";
93
- amountCents: number | null;
94
- percentBasisPoints: number | null;
95
- validFrom: string | null;
96
- validTo: string | null;
97
- createdAt: Date;
98
- updatedAt: Date;
99
- }[];
100
- total: number;
101
- limit: number;
102
- offset: number;
103
- }>;
79
+ listCommissionRules(db: PostgresJsDatabase, query: ChannelCommissionRuleListQuery): Promise<import("@voyant-travel/types").ListResponse<{
80
+ id: string;
81
+ contractId: string;
82
+ scope: "category" | "booking" | "product" | "rate";
83
+ productId: string | null;
84
+ externalRateId: string | null;
85
+ externalCategoryId: string | null;
86
+ commissionType: "fixed" | "percentage";
87
+ amountCents: number | null;
88
+ percentBasisPoints: number | null;
89
+ validFrom: string | null;
90
+ validTo: string | null;
91
+ createdAt: Date;
92
+ updatedAt: Date;
93
+ }>>;
104
94
  getCommissionRuleById(db: PostgresJsDatabase, id: string): Promise<{
105
95
  id: string;
106
96
  contractId: string;
@@ -149,30 +139,25 @@ export declare const commercialServiceOperations: {
149
139
  deleteCommissionRule(db: PostgresJsDatabase, id: string): Promise<{
150
140
  id: string;
151
141
  } | null>;
152
- listProductMappings(db: PostgresJsDatabase, query: ChannelProductMappingListQuery): Promise<{
153
- data: {
154
- id: string;
155
- channelId: string;
156
- productId: string;
157
- externalProductId: string | null;
158
- externalRateId: string | null;
159
- externalCategoryId: string | null;
160
- active: boolean;
161
- sourceKind: string | null;
162
- sourceConnectionId: string | null;
163
- pushBookings: boolean;
164
- pushAvailability: boolean;
165
- pushContent: boolean;
166
- policy: Record<string, unknown> | null;
167
- lastPushedContentHash: string | null;
168
- lastPushedContentAt: Date | null;
169
- createdAt: Date;
170
- updatedAt: Date;
171
- }[];
172
- total: number;
173
- limit: number;
174
- offset: number;
175
- }>;
142
+ listProductMappings(db: PostgresJsDatabase, query: ChannelProductMappingListQuery): Promise<import("@voyant-travel/types").ListResponse<{
143
+ id: string;
144
+ channelId: string;
145
+ productId: string;
146
+ externalProductId: string | null;
147
+ externalRateId: string | null;
148
+ externalCategoryId: string | null;
149
+ active: boolean;
150
+ sourceKind: string | null;
151
+ sourceConnectionId: string | null;
152
+ pushBookings: boolean;
153
+ pushAvailability: boolean;
154
+ pushContent: boolean;
155
+ policy: Record<string, unknown> | null;
156
+ lastPushedContentHash: string | null;
157
+ lastPushedContentAt: Date | null;
158
+ createdAt: Date;
159
+ updatedAt: Date;
160
+ }>>;
176
161
  getProductMappingById(db: PostgresJsDatabase, id: string): Promise<{
177
162
  id: string;
178
163
  channelId: string;
@@ -233,32 +218,27 @@ export declare const commercialServiceOperations: {
233
218
  deleteProductMapping(db: PostgresJsDatabase, id: string): Promise<{
234
219
  id: string;
235
220
  } | null>;
236
- listBookingLinks(db: PostgresJsDatabase, query: ChannelBookingLinkListQuery): Promise<{
237
- data: {
238
- id: string;
239
- channelId: string;
240
- bookingId: string;
241
- bookingItemId: string | null;
242
- externalBookingId: string | null;
243
- externalReference: string | null;
244
- externalStatus: string | null;
245
- bookedAtExternal: Date | null;
246
- lastSyncedAt: Date | null;
247
- sourceKind: string | null;
248
- sourceConnectionId: string | null;
249
- pushStatus: string;
250
- pushAttempts: number;
251
- lastPushAt: Date | null;
252
- lastError: string | null;
253
- pushedPayloadHash: string | null;
254
- idempotencyKey: string | null;
255
- createdAt: Date;
256
- updatedAt: Date;
257
- }[];
258
- total: number;
259
- limit: number;
260
- offset: number;
261
- }>;
221
+ listBookingLinks(db: PostgresJsDatabase, query: ChannelBookingLinkListQuery): Promise<import("@voyant-travel/types").ListResponse<{
222
+ id: string;
223
+ channelId: string;
224
+ bookingId: string;
225
+ bookingItemId: string | null;
226
+ externalBookingId: string | null;
227
+ externalReference: string | null;
228
+ externalStatus: string | null;
229
+ bookedAtExternal: Date | null;
230
+ lastSyncedAt: Date | null;
231
+ sourceKind: string | null;
232
+ sourceConnectionId: string | null;
233
+ pushStatus: string;
234
+ pushAttempts: number;
235
+ lastPushAt: Date | null;
236
+ lastError: string | null;
237
+ pushedPayloadHash: string | null;
238
+ idempotencyKey: string | null;
239
+ createdAt: Date;
240
+ updatedAt: Date;
241
+ }>>;
262
242
  getBookingLinkById(db: PostgresJsDatabase, id: string): Promise<{
263
243
  id: string;
264
244
  channelId: string;
@@ -281,10 +261,10 @@ export declare const commercialServiceOperations: {
281
261
  updatedAt: Date;
282
262
  } | null>;
283
263
  createBookingLink(db: PostgresJsDatabase, data: CreateChannelBookingLinkInput): Promise<{
264
+ idempotencyKey: string | null;
284
265
  id: string;
285
266
  lastError: string | null;
286
267
  createdAt: Date;
287
- idempotencyKey: string | null;
288
268
  updatedAt: Date;
289
269
  bookingId: string;
290
270
  channelId: string;
@@ -325,23 +305,18 @@ export declare const commercialServiceOperations: {
325
305
  deleteBookingLink(db: PostgresJsDatabase, id: string): Promise<{
326
306
  id: string;
327
307
  } | null>;
328
- listWebhookEvents(db: PostgresJsDatabase, query: ChannelWebhookEventListQuery): Promise<{
329
- data: {
330
- id: string;
331
- channelId: string;
332
- eventType: string;
333
- externalEventId: string | null;
334
- payload: Record<string, unknown>;
335
- receivedAt: Date;
336
- processedAt: Date | null;
337
- status: "failed" | "pending" | "processed" | "ignored";
338
- errorMessage: string | null;
339
- createdAt: Date;
340
- }[];
341
- total: number;
342
- limit: number;
343
- offset: number;
344
- }>;
308
+ listWebhookEvents(db: PostgresJsDatabase, query: ChannelWebhookEventListQuery): Promise<import("@voyant-travel/types").ListResponse<{
309
+ id: string;
310
+ channelId: string;
311
+ eventType: string;
312
+ externalEventId: string | null;
313
+ payload: Record<string, unknown>;
314
+ receivedAt: Date;
315
+ processedAt: Date | null;
316
+ status: "failed" | "pending" | "processed" | "ignored";
317
+ errorMessage: string | null;
318
+ createdAt: Date;
319
+ }>>;
345
320
  getWebhookEventById(db: PostgresJsDatabase, id: string): Promise<{
346
321
  id: string;
347
322
  channelId: string;
@@ -355,9 +330,9 @@ export declare const commercialServiceOperations: {
355
330
  createdAt: Date;
356
331
  } | null>;
357
332
  createWebhookEvent(db: PostgresJsDatabase, data: CreateChannelWebhookEventInput): Promise<{
333
+ status: "failed" | "pending" | "processed" | "ignored";
358
334
  id: string;
359
335
  payload: Record<string, unknown>;
360
- status: "failed" | "pending" | "processed" | "ignored";
361
336
  createdAt: Date;
362
337
  eventType: string;
363
338
  errorMessage: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"commercial.d.ts","sourceRoot":"","sources":["../../src/service/commercial.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAUjE,OAAO,KAAK,EACV,2BAA2B,EAC3B,8BAA8B,EAC9B,wBAAwB,EACxB,8BAA8B,EAC9B,4BAA4B,EAC5B,6BAA6B,EAC7B,gCAAgC,EAChC,0BAA0B,EAC1B,gCAAgC,EAChC,8BAA8B,EAC9B,6BAA6B,EAC7B,gCAAgC,EAChC,0BAA0B,EAC1B,gCAAgC,EAChC,8BAA8B,EAC/B,MAAM,YAAY,CAAA;AAEnB,eAAO,MAAM,2BAA2B;sBACd,kBAAkB,SAAS,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;wBAoBjD,kBAAkB,MAAM,MAAM;;;;;;;;;;;;;;;;;;uBAS/B,kBAAkB,QAAQ,0BAA0B;;;;;;;;;;;;;;;;;;uBAKpD,kBAAkB,MAAM,MAAM,QAAQ,0BAA0B;;;;;;;;;;;;;;;;;;uBAShE,kBAAkB,MAAM,MAAM;;;4BAQzB,kBAAkB,SAAS,8BAA8B;;;;;;;;;;;;;;;;;;;;8BAoBvD,kBAAkB,MAAM,MAAM;;;;;;;;;;;;;;;6BAS/B,kBAAkB,QAAQ,gCAAgC;;;;;;;;;;;;;;;6BAMnF,kBAAkB,MAClB,MAAM,QACJ,gCAAgC;;;;;;;;;;;;;;;6BAUT,kBAAkB,MAAM,MAAM;;;4BAQ/B,kBAAkB,SAAS,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;8BAoBvD,kBAAkB,MAAM,MAAM;;;;;;;;;;;;;;;;;;;6BAS/B,kBAAkB,QAAQ,gCAAgC;;;;;;;;;;;;;;;;;;;6BAMnF,kBAAkB,MAClB,MAAM,QACJ,gCAAgC;;;;;;;;;;;;;;;;;;;6BAUT,kBAAkB,MAAM,MAAM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;;;;;;;;;8BAoBvD,kBAAkB,MAAM,MAAM;;;;;;;;;;;;;;;6BAS/B,kBAAkB,QAAQ,gCAAgC;;;;;;;;;;;;;;;6BAMnF,kBAAkB,MAClB,MAAM,QACJ,gCAAgC;;;;;;;;;;;;;;;6BAUT,kBAAkB,MAAM,MAAM;;;4BAQ/B,kBAAkB,SAAS,8BAA8B;;;;;;;;;;;;;;;;;;;8BAoBvD,kBAAkB,MAAM,MAAM;;;;;;;;;;;;;;;;;;;6BAS/B,kBAAkB,QAAQ,gCAAgC;;;;;;;;;;;;;;;;;;;6BAMnF,kBAAkB,MAClB,MAAM,QACJ,gCAAgC;;;;;;;;;;;;;;;;;;;6BAUT,kBAAkB,MAAM,MAAM;;;yBAQlC,kBAAkB,SAAS,2BAA2B;;;;;;;;;;;;;;;;;;;;;2BAqBpD,kBAAkB,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;0BAS/B,kBAAkB,QAAQ,6BAA6B;;;;;;;;;;;;;;;;;;;;;0BAYvD,kBAAkB,MAAM,MAAM,QAAQ,6BAA6B;;;;;;;;;;;;;;;;;;;;;0BAenE,kBAAkB,MAAM,MAAM;;;0BAQ9B,kBAAkB,SAAS,4BAA4B;;;;;;;;;;;;4BAoBrD,kBAAkB,MAAM,MAAM;;;;;;;;;;;;2BAS/B,kBAAkB,QAAQ,8BAA8B;;;;;;;;;;;;2BAa/E,kBAAkB,MAClB,MAAM,QACJ,8BAA8B;;;;;;;;;;;;2BAcT,kBAAkB,MAAM,MAAM;;;CAO5D,CAAA"}
@@ -1,10 +1,5 @@
1
1
  export declare function paginate<T extends object>(rowsQuery: Promise<T[]>, countQuery: Promise<Array<{
2
2
  count: number;
3
- }>>, limit: number, offset: number): Promise<{
4
- data: T[];
5
- total: number;
6
- limit: number;
7
- offset: number;
8
- }>;
3
+ }>>, limit: number, offset: number): Promise<import("@voyant-travel/types").ListResponse<T>>;
9
4
  export declare function toDateOrNull(value: string | null | undefined): Date | null;
10
5
  //# sourceMappingURL=helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/service/helpers.ts"],"names":[],"mappings":"AAAA,wBAAsB,QAAQ,CAAC,CAAC,SAAS,MAAM,EAC7C,SAAS,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,EACvB,UAAU,EAAE,OAAO,CAAC,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,EAC7C,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM;;;;;GAIf;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,eAE5D"}
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/service/helpers.ts"],"names":[],"mappings":"AACA,wBAAsB,QAAQ,CAAC,CAAC,SAAS,MAAM,EAC7C,SAAS,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,EACvB,UAAU,EAAE,OAAO,CAAC,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,EAC7C,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,2DAIf;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,eAE5D"}
@@ -1,6 +1,7 @@
1
+ import { listResponse } from "@voyant-travel/types";
1
2
  export async function paginate(rowsQuery, countQuery, limit, offset) {
2
3
  const [data, countResult] = await Promise.all([rowsQuery, countQuery]);
3
- return { data, total: countResult[0]?.count ?? 0, limit, offset };
4
+ return listResponse(data, { total: countResult[0]?.count ?? 0, limit, offset });
4
5
  }
5
6
  export function toDateOrNull(value) {
6
7
  return value ? new Date(value) : null;
@@ -1,27 +1,22 @@
1
1
  import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
2
2
  import type { ChannelInventoryAllotmentListQuery, ChannelInventoryAllotmentTargetListQuery, ChannelInventoryReleaseRuleListQuery, CreateChannelInventoryAllotmentInput, CreateChannelInventoryAllotmentTargetInput, CreateChannelInventoryReleaseRuleInput, UpdateChannelInventoryAllotmentInput, UpdateChannelInventoryAllotmentTargetInput, UpdateChannelInventoryReleaseRuleInput } from "./types.js";
3
3
  export declare const inventoryServiceOperations: {
4
- listInventoryAllotments(db: PostgresJsDatabase, query: ChannelInventoryAllotmentListQuery): Promise<{
5
- data: {
6
- id: string;
7
- channelId: string;
8
- contractId: string | null;
9
- productId: string;
10
- optionId: string | null;
11
- startTimeId: string | null;
12
- validFrom: string | null;
13
- validTo: string | null;
14
- guaranteedCapacity: number | null;
15
- maxCapacity: number | null;
16
- active: boolean;
17
- notes: string | null;
18
- createdAt: Date;
19
- updatedAt: Date;
20
- }[];
21
- total: number;
22
- limit: number;
23
- offset: number;
24
- }>;
4
+ listInventoryAllotments(db: PostgresJsDatabase, query: ChannelInventoryAllotmentListQuery): Promise<import("@voyant-travel/types").ListResponse<{
5
+ id: string;
6
+ channelId: string;
7
+ contractId: string | null;
8
+ productId: string;
9
+ optionId: string | null;
10
+ startTimeId: string | null;
11
+ validFrom: string | null;
12
+ validTo: string | null;
13
+ guaranteedCapacity: number | null;
14
+ maxCapacity: number | null;
15
+ active: boolean;
16
+ notes: string | null;
17
+ createdAt: Date;
18
+ updatedAt: Date;
19
+ }>>;
25
20
  getInventoryAllotmentById(db: PostgresJsDatabase, id: string): Promise<{
26
21
  id: string;
27
22
  channelId: string;
@@ -73,25 +68,20 @@ export declare const inventoryServiceOperations: {
73
68
  deleteInventoryAllotment(db: PostgresJsDatabase, id: string): Promise<{
74
69
  id: string;
75
70
  } | null>;
76
- listInventoryAllotmentTargets(db: PostgresJsDatabase, query: ChannelInventoryAllotmentTargetListQuery): Promise<{
77
- data: {
78
- id: string;
79
- allotmentId: string;
80
- slotId: string | null;
81
- startTimeId: string | null;
82
- dateLocal: string | null;
83
- guaranteedCapacity: number | null;
84
- maxCapacity: number | null;
85
- soldCapacity: number | null;
86
- remainingCapacity: number | null;
87
- active: boolean;
88
- createdAt: Date;
89
- updatedAt: Date;
90
- }[];
91
- total: number;
92
- limit: number;
93
- offset: number;
94
- }>;
71
+ listInventoryAllotmentTargets(db: PostgresJsDatabase, query: ChannelInventoryAllotmentTargetListQuery): Promise<import("@voyant-travel/types").ListResponse<{
72
+ id: string;
73
+ allotmentId: string;
74
+ slotId: string | null;
75
+ startTimeId: string | null;
76
+ dateLocal: string | null;
77
+ guaranteedCapacity: number | null;
78
+ maxCapacity: number | null;
79
+ soldCapacity: number | null;
80
+ remainingCapacity: number | null;
81
+ active: boolean;
82
+ createdAt: Date;
83
+ updatedAt: Date;
84
+ }>>;
95
85
  getInventoryAllotmentTargetById(db: PostgresJsDatabase, id: string): Promise<{
96
86
  id: string;
97
87
  allotmentId: string;
@@ -137,22 +127,17 @@ export declare const inventoryServiceOperations: {
137
127
  deleteInventoryAllotmentTarget(db: PostgresJsDatabase, id: string): Promise<{
138
128
  id: string;
139
129
  } | null>;
140
- listInventoryReleaseRules(db: PostgresJsDatabase, query: ChannelInventoryReleaseRuleListQuery): Promise<{
141
- data: {
142
- id: string;
143
- allotmentId: string;
144
- releaseMode: "automatic" | "manual";
145
- releaseDaysBeforeStart: number | null;
146
- releaseHoursBeforeStart: number | null;
147
- unsoldAction: "release_to_general_pool" | "expire" | "retain";
148
- notes: string | null;
149
- createdAt: Date;
150
- updatedAt: Date;
151
- }[];
152
- total: number;
153
- limit: number;
154
- offset: number;
155
- }>;
130
+ listInventoryReleaseRules(db: PostgresJsDatabase, query: ChannelInventoryReleaseRuleListQuery): Promise<import("@voyant-travel/types").ListResponse<{
131
+ id: string;
132
+ allotmentId: string;
133
+ releaseMode: "automatic" | "manual";
134
+ releaseDaysBeforeStart: number | null;
135
+ releaseHoursBeforeStart: number | null;
136
+ unsoldAction: "release_to_general_pool" | "expire" | "retain";
137
+ notes: string | null;
138
+ createdAt: Date;
139
+ updatedAt: Date;
140
+ }>>;
156
141
  getInventoryReleaseRuleById(db: PostgresJsDatabase, id: string): Promise<{
157
142
  id: string;
158
143
  allotmentId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"inventory.d.ts","sourceRoot":"","sources":["../../src/service/inventory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAQjE,OAAO,KAAK,EACV,kCAAkC,EAClC,wCAAwC,EACxC,oCAAoC,EACpC,oCAAoC,EACpC,0CAA0C,EAC1C,sCAAsC,EACtC,oCAAoC,EACpC,0CAA0C,EAC1C,sCAAsC,EACvC,MAAM,YAAY,CAAA;AAEnB,eAAO,MAAM,0BAA0B;gCACH,kBAAkB,SAAS,kCAAkC;;;;;;;;;;;;;;;;;;;;;kCA6B3D,kBAAkB,MAAM,MAAM;;;;;;;;;;;;;;;;iCAU5D,kBAAkB,QAChB,oCAAoC;;;;;;;;;;;;;;;;iCAOtC,kBAAkB,MAClB,MAAM,QACJ,oCAAoC;;;;;;;;;;;;;;;;iCAUT,kBAAkB,MAAM,MAAM;;;sCAS3D,kBAAkB,SACf,wCAAwC;;;;;;;;;;;;;;;;;;;wCA8BP,kBAAkB,MAAM,MAAM;;;;;;;;;;;;;;uCAUlE,kBAAkB,QAChB,0CAA0C;;;;;;;;;;;;;;uCAO5C,kBAAkB,MAClB,MAAM,QACJ,0CAA0C;;;;;;;;;;;;;;uCAUT,kBAAkB,MAAM,MAAM;;;kCASjE,kBAAkB,SACf,oCAAoC;;;;;;;;;;;;;;;;oCAyBP,kBAAkB,MAAM,MAAM;;;;;;;;;;;mCAU9D,kBAAkB,QAChB,sCAAsC;;;;;;;;;;;mCAOxC,kBAAkB,MAClB,MAAM,QACJ,sCAAsC;;;;;;;;;;;mCAUT,kBAAkB,MAAM,MAAM;;;CAOpE,CAAA"}
1
+ {"version":3,"file":"inventory.d.ts","sourceRoot":"","sources":["../../src/service/inventory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAQjE,OAAO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