@voyant-travel/commerce 0.1.0 → 0.2.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.
@@ -21,7 +21,7 @@ export declare function listPolicies(db: PostgresJsDatabase, query: SellabilityP
21
21
  id: string;
22
22
  name: string;
23
23
  scope: "channel" | "market" | "global" | "product" | "option";
24
- policyType: "custom" | "currency" | "pickup" | "occupancy" | "capability" | "question" | "allotment" | "availability_window";
24
+ policyType: "custom" | "currency" | "pickup" | "capability" | "question" | "occupancy" | "allotment" | "availability_window";
25
25
  productId: string | null;
26
26
  optionId: string | null;
27
27
  marketId: string | null;
@@ -43,7 +43,7 @@ export declare function getPolicyById(db: PostgresJsDatabase, id: string): Promi
43
43
  id: string;
44
44
  name: string;
45
45
  scope: "channel" | "market" | "global" | "product" | "option";
46
- policyType: "custom" | "currency" | "pickup" | "occupancy" | "capability" | "question" | "allotment" | "availability_window";
46
+ policyType: "custom" | "currency" | "pickup" | "capability" | "question" | "occupancy" | "allotment" | "availability_window";
47
47
  productId: string | null;
48
48
  optionId: string | null;
49
49
  marketId: string | null;
@@ -64,22 +64,22 @@ export declare function createPolicy(db: PostgresJsDatabase, data: CreateSellabi
64
64
  createdAt: Date;
65
65
  priority: number;
66
66
  effects: Record<string, unknown>;
67
- notes: string | null;
68
67
  updatedAt: Date;
69
68
  scope: "channel" | "market" | "global" | "product" | "option";
69
+ notes: string | null;
70
70
  active: boolean;
71
71
  marketId: string | null;
72
72
  productId: string | null;
73
73
  optionId: string | null;
74
74
  channelId: string | null;
75
- policyType: "custom" | "currency" | "pickup" | "occupancy" | "capability" | "question" | "allotment" | "availability_window";
75
+ policyType: "custom" | "currency" | "pickup" | "capability" | "question" | "occupancy" | "allotment" | "availability_window";
76
76
  conditions: Record<string, unknown>;
77
77
  } | null>;
78
78
  export declare function updatePolicy(db: PostgresJsDatabase, id: string, data: UpdateSellabilityPolicyInput): Promise<{
79
79
  id: string;
80
80
  name: string;
81
81
  scope: "channel" | "market" | "global" | "product" | "option";
82
- policyType: "custom" | "currency" | "pickup" | "occupancy" | "capability" | "question" | "allotment" | "availability_window";
82
+ policyType: "custom" | "currency" | "pickup" | "capability" | "question" | "occupancy" | "allotment" | "availability_window";
83
83
  productId: string | null;
84
84
  optionId: string | null;
85
85
  marketId: string | null;
@@ -103,7 +103,7 @@ export declare function listPolicyResults(db: PostgresJsDatabase, query: Sellabi
103
103
  snapshotItemId: string | null;
104
104
  policyId: string | null;
105
105
  candidateIndex: number;
106
- status: "warning" | "passed" | "blocked" | "adjusted";
106
+ status: "blocked" | "warning" | "passed" | "adjusted";
107
107
  message: string | null;
108
108
  details: Record<string, unknown> | null;
109
109
  createdAt: Date;
@@ -118,16 +118,16 @@ export declare function getPolicyResultById(db: PostgresJsDatabase, id: string):
118
118
  snapshotItemId: string | null;
119
119
  policyId: string | null;
120
120
  candidateIndex: number;
121
- status: "warning" | "passed" | "blocked" | "adjusted";
121
+ status: "blocked" | "warning" | "passed" | "adjusted";
122
122
  message: string | null;
123
123
  details: Record<string, unknown> | null;
124
124
  createdAt: Date;
125
125
  } | null>;
126
126
  export declare function createPolicyResult(db: PostgresJsDatabase, data: CreateSellabilityPolicyResultInput): Promise<{
127
+ message: string | null;
127
128
  id: string;
128
- status: "warning" | "passed" | "blocked" | "adjusted";
129
+ status: "blocked" | "warning" | "passed" | "adjusted";
129
130
  createdAt: Date;
130
- message: string | null;
131
131
  details: Record<string, unknown> | null;
132
132
  snapshotId: string;
133
133
  candidateIndex: number;
@@ -140,7 +140,7 @@ export declare function updatePolicyResult(db: PostgresJsDatabase, id: string, d
140
140
  snapshotItemId: string | null;
141
141
  policyId: string | null;
142
142
  candidateIndex: number;
143
- status: "warning" | "passed" | "blocked" | "adjusted";
143
+ status: "blocked" | "warning" | "passed" | "adjusted";
144
144
  message: string | null;
145
145
  details: Record<string, unknown> | null;
146
146
  createdAt: Date;
@@ -183,11 +183,11 @@ export declare function createOfferRefreshRun(db: PostgresJsDatabase, data: Crea
183
183
  status: "failed" | "pending" | "running" | "completed" | "expired";
184
184
  createdAt: Date;
185
185
  startedAt: Date;
186
- notes: string | null;
187
186
  updatedAt: Date;
187
+ notes: string | null;
188
+ completedAt: Date | null;
188
189
  snapshotId: string | null;
189
190
  offerId: string;
190
- completedAt: Date | null;
191
191
  } | null>;
192
192
  export declare function updateOfferRefreshRun(db: PostgresJsDatabase, id: string, data: UpdateOfferRefreshRunInput): Promise<{
193
193
  id: string;
@@ -240,10 +240,10 @@ export declare function createOfferExpirationEvent(db: PostgresJsDatabase, data:
240
240
  createdAt: Date;
241
241
  updatedAt: Date;
242
242
  expiresAt: Date;
243
- snapshotId: string | null;
244
- offerId: string;
245
243
  reason: string | null;
244
+ snapshotId: string | null;
246
245
  expiredAt: Date | null;
246
+ offerId: string;
247
247
  } | null>;
248
248
  export declare function updateOfferExpirationEvent(db: PostgresJsDatabase, id: string, data: UpdateOfferExpirationEventInput): Promise<{
249
249
  id: string;
@@ -266,7 +266,7 @@ export declare function listExplanations(db: PostgresJsDatabase, query: Sellabil
266
266
  snapshotId: string;
267
267
  snapshotItemId: string | null;
268
268
  candidateIndex: number;
269
- explanationType: "warning" | "sellable" | "pickup" | "pricing" | "policy" | "allotment" | "blocked";
269
+ explanationType: "pricing" | "blocked" | "warning" | "sellable" | "pickup" | "policy" | "allotment";
270
270
  code: string | null;
271
271
  message: string;
272
272
  details: Record<string, unknown> | null;
@@ -281,29 +281,29 @@ export declare function getExplanationById(db: PostgresJsDatabase, id: string):
281
281
  snapshotId: string;
282
282
  snapshotItemId: string | null;
283
283
  candidateIndex: number;
284
- explanationType: "warning" | "sellable" | "pickup" | "pricing" | "policy" | "allotment" | "blocked";
284
+ explanationType: "pricing" | "blocked" | "warning" | "sellable" | "pickup" | "policy" | "allotment";
285
285
  code: string | null;
286
286
  message: string;
287
287
  details: Record<string, unknown> | null;
288
288
  createdAt: Date;
289
289
  } | null>;
290
290
  export declare function createExplanation(db: PostgresJsDatabase, data: CreateSellabilityExplanationInput): Promise<{
291
+ message: string;
291
292
  id: string;
292
293
  createdAt: Date;
293
294
  code: string | null;
294
- message: string;
295
295
  details: Record<string, unknown> | null;
296
296
  snapshotId: string;
297
297
  candidateIndex: number;
298
298
  snapshotItemId: string | null;
299
- explanationType: "warning" | "sellable" | "pickup" | "pricing" | "policy" | "allotment" | "blocked";
299
+ explanationType: "pricing" | "blocked" | "warning" | "sellable" | "pickup" | "policy" | "allotment";
300
300
  } | null>;
301
301
  export declare function updateExplanation(db: PostgresJsDatabase, id: string, data: UpdateSellabilityExplanationInput): Promise<{
302
302
  id: string;
303
303
  snapshotId: string;
304
304
  snapshotItemId: string | null;
305
305
  candidateIndex: number;
306
- explanationType: "warning" | "sellable" | "pickup" | "pricing" | "policy" | "allotment" | "blocked";
306
+ explanationType: "pricing" | "blocked" | "warning" | "sellable" | "pickup" | "policy" | "allotment";
307
307
  code: string | null;
308
308
  message: string;
309
309
  details: Record<string, unknown> | null;
@@ -33,7 +33,7 @@ export declare function resolve(db: PostgresJsDatabase, query: SellabilityResolv
33
33
  } | null;
34
34
  channel: {
35
35
  id: string;
36
- kind: "direct" | "reseller" | "affiliate" | "ota" | "marketplace" | "api_partner" | "connect";
36
+ kind: "direct" | "reseller" | "connect" | "affiliate" | "ota" | "marketplace" | "api_partner";
37
37
  } | null;
38
38
  sellability: {
39
39
  mode: "unavailable" | "sellable" | "on_request";
@@ -15,14 +15,14 @@ export declare function persistResolvedSnapshot(db: PostgresJsDatabase, input: {
15
15
  status: "expired" | "resolved" | "offer_constructed";
16
16
  createdAt: Date;
17
17
  updatedAt: Date;
18
+ expiresAt: Date | null;
18
19
  marketId: string | null;
19
20
  fxRateSetId: string | null;
20
21
  productId: string | null;
21
22
  optionId: string | null;
22
23
  channelId: string | null;
23
- offerId: string | null;
24
24
  slotId: string | null;
25
- expiresAt: Date | null;
25
+ offerId: string | null;
26
26
  requestedCurrencyCode: string | null;
27
27
  sourceCurrencyCode: string | null;
28
28
  queryPayload: Record<string, unknown>;
@@ -34,14 +34,14 @@ export declare function persistSnapshot(db: PostgresJsDatabase, input: Sellabili
34
34
  status: "expired" | "resolved" | "offer_constructed";
35
35
  createdAt: Date;
36
36
  updatedAt: Date;
37
+ expiresAt: Date | null;
37
38
  marketId: string | null;
38
39
  fxRateSetId: string | null;
39
40
  productId: string | null;
40
41
  optionId: string | null;
41
42
  channelId: string | null;
42
- offerId: string | null;
43
43
  slotId: string | null;
44
- expiresAt: Date | null;
44
+ offerId: string | null;
45
45
  requestedCurrencyCode: string | null;
46
46
  sourceCurrencyCode: string | null;
47
47
  queryPayload: Record<string, unknown>;
@@ -79,7 +79,7 @@ export declare function persistSnapshot(db: PostgresJsDatabase, input: Sellabili
79
79
  } | null;
80
80
  channel: {
81
81
  id: string;
82
- kind: "direct" | "reseller" | "affiliate" | "ota" | "marketplace" | "api_partner" | "connect";
82
+ kind: "direct" | "reseller" | "connect" | "affiliate" | "ota" | "marketplace" | "api_partner";
83
83
  } | null;
84
84
  sellability: {
85
85
  mode: "unavailable" | "sellable" | "on_request";