@voyant-travel/distribution 0.109.8

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 (168) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +42 -0
  3. package/dist/booking-extension.d.ts +168 -0
  4. package/dist/booking-extension.d.ts.map +1 -0
  5. package/dist/booking-extension.js +102 -0
  6. package/dist/channel-push/admin-routes.d.ts +31 -0
  7. package/dist/channel-push/admin-routes.d.ts.map +1 -0
  8. package/dist/channel-push/admin-routes.js +165 -0
  9. package/dist/channel-push/availability-push.d.ts +76 -0
  10. package/dist/channel-push/availability-push.d.ts.map +1 -0
  11. package/dist/channel-push/availability-push.js +236 -0
  12. package/dist/channel-push/booking-push-helpers.d.ts +36 -0
  13. package/dist/channel-push/booking-push-helpers.d.ts.map +1 -0
  14. package/dist/channel-push/booking-push-helpers.js +169 -0
  15. package/dist/channel-push/booking-push.d.ts +108 -0
  16. package/dist/channel-push/booking-push.d.ts.map +1 -0
  17. package/dist/channel-push/booking-push.js +335 -0
  18. package/dist/channel-push/boundary-sql.d.ts +23 -0
  19. package/dist/channel-push/boundary-sql.d.ts.map +1 -0
  20. package/dist/channel-push/boundary-sql.js +75 -0
  21. package/dist/channel-push/content-push.d.ts +60 -0
  22. package/dist/channel-push/content-push.d.ts.map +1 -0
  23. package/dist/channel-push/content-push.js +252 -0
  24. package/dist/channel-push/index.d.ts +15 -0
  25. package/dist/channel-push/index.d.ts.map +1 -0
  26. package/dist/channel-push/index.js +18 -0
  27. package/dist/channel-push/plugin.d.ts +18 -0
  28. package/dist/channel-push/plugin.d.ts.map +1 -0
  29. package/dist/channel-push/plugin.js +21 -0
  30. package/dist/channel-push/reconciler.d.ts +85 -0
  31. package/dist/channel-push/reconciler.d.ts.map +1 -0
  32. package/dist/channel-push/reconciler.js +179 -0
  33. package/dist/channel-push/subscriber.d.ts +40 -0
  34. package/dist/channel-push/subscriber.d.ts.map +1 -0
  35. package/dist/channel-push/subscriber.js +199 -0
  36. package/dist/channel-push/types.d.ts +43 -0
  37. package/dist/channel-push/types.d.ts.map +1 -0
  38. package/dist/channel-push/types.js +32 -0
  39. package/dist/channel-push/workflows.d.ts +56 -0
  40. package/dist/channel-push/workflows.d.ts.map +1 -0
  41. package/dist/channel-push/workflows.js +100 -0
  42. package/dist/external-refs/index.d.ts +11 -0
  43. package/dist/external-refs/index.d.ts.map +1 -0
  44. package/dist/external-refs/index.js +12 -0
  45. package/dist/external-refs/routes.d.ts +253 -0
  46. package/dist/external-refs/routes.d.ts.map +1 -0
  47. package/dist/external-refs/routes.js +52 -0
  48. package/dist/external-refs/schema.d.ts +251 -0
  49. package/dist/external-refs/schema.d.ts.map +1 -0
  50. package/dist/external-refs/schema.js +32 -0
  51. package/dist/external-refs/service.d.ts +82 -0
  52. package/dist/external-refs/service.d.ts.map +1 -0
  53. package/dist/external-refs/service.js +112 -0
  54. package/dist/external-refs/validation.d.ts +91 -0
  55. package/dist/external-refs/validation.d.ts.map +1 -0
  56. package/dist/external-refs/validation.js +40 -0
  57. package/dist/index.d.ts +21 -0
  58. package/dist/index.d.ts.map +1 -0
  59. package/dist/index.js +20 -0
  60. package/dist/interface-types.d.ts +128 -0
  61. package/dist/interface-types.d.ts.map +1 -0
  62. package/dist/interface-types.js +1 -0
  63. package/dist/interface.d.ts +10 -0
  64. package/dist/interface.d.ts.map +1 -0
  65. package/dist/interface.js +286 -0
  66. package/dist/rate-limit.d.ts +69 -0
  67. package/dist/rate-limit.d.ts.map +1 -0
  68. package/dist/rate-limit.js +135 -0
  69. package/dist/routes/batch.d.ts +200 -0
  70. package/dist/routes/batch.d.ts.map +1 -0
  71. package/dist/routes/batch.js +52 -0
  72. package/dist/routes/env.d.ts +8 -0
  73. package/dist/routes/env.d.ts.map +1 -0
  74. package/dist/routes/env.js +1 -0
  75. package/dist/routes/inventory.d.ts +604 -0
  76. package/dist/routes/inventory.d.ts.map +1 -0
  77. package/dist/routes/inventory.js +138 -0
  78. package/dist/routes/settlements.d.ts +1649 -0
  79. package/dist/routes/settlements.d.ts.map +1 -0
  80. package/dist/routes/settlements.js +265 -0
  81. package/dist/routes.d.ts +3909 -0
  82. package/dist/routes.d.ts.map +1 -0
  83. package/dist/routes.js +323 -0
  84. package/dist/schema-automation.d.ts +680 -0
  85. package/dist/schema-automation.d.ts.map +1 -0
  86. package/dist/schema-automation.js +76 -0
  87. package/dist/schema-core.d.ts +1674 -0
  88. package/dist/schema-core.d.ts.map +1 -0
  89. package/dist/schema-core.js +227 -0
  90. package/dist/schema-finance.d.ts +1372 -0
  91. package/dist/schema-finance.d.ts.map +1 -0
  92. package/dist/schema-finance.js +153 -0
  93. package/dist/schema-inventory.d.ts +855 -0
  94. package/dist/schema-inventory.d.ts.map +1 -0
  95. package/dist/schema-inventory.js +102 -0
  96. package/dist/schema-push-intents.d.ts +387 -0
  97. package/dist/schema-push-intents.d.ts.map +1 -0
  98. package/dist/schema-push-intents.js +77 -0
  99. package/dist/schema-relations.d.ts +95 -0
  100. package/dist/schema-relations.d.ts.map +1 -0
  101. package/dist/schema-relations.js +196 -0
  102. package/dist/schema-shared.d.ts +24 -0
  103. package/dist/schema-shared.d.ts.map +1 -0
  104. package/dist/schema-shared.js +123 -0
  105. package/dist/schema.d.ts +9 -0
  106. package/dist/schema.d.ts.map +1 -0
  107. package/dist/schema.js +8 -0
  108. package/dist/service/channels.d.ts +167 -0
  109. package/dist/service/channels.d.ts.map +1 -0
  110. package/dist/service/channels.js +305 -0
  111. package/dist/service/commercial.d.ts +385 -0
  112. package/dist/service/commercial.d.ts.map +1 -0
  113. package/dist/service/commercial.js +248 -0
  114. package/dist/service/helpers.d.ts +10 -0
  115. package/dist/service/helpers.d.ts.map +1 -0
  116. package/dist/service/helpers.js +7 -0
  117. package/dist/service/inventory.d.ts +193 -0
  118. package/dist/service/inventory.d.ts.map +1 -0
  119. package/dist/service/inventory.js +154 -0
  120. package/dist/service/settlement-policies.d.ts +325 -0
  121. package/dist/service/settlement-policies.d.ts.map +1 -0
  122. package/dist/service/settlement-policies.js +272 -0
  123. package/dist/service/settlements.d.ts +357 -0
  124. package/dist/service/settlements.d.ts.map +1 -0
  125. package/dist/service/settlements.js +319 -0
  126. package/dist/service/types.d.ts +60 -0
  127. package/dist/service/types.d.ts.map +1 -0
  128. package/dist/service/types.js +1 -0
  129. package/dist/service.d.ts +1418 -0
  130. package/dist/service.d.ts.map +1 -0
  131. package/dist/service.js +17 -0
  132. package/dist/suppliers/index.d.ts +15 -0
  133. package/dist/suppliers/index.d.ts.map +1 -0
  134. package/dist/suppliers/index.js +23 -0
  135. package/dist/suppliers/routes.d.ts +1202 -0
  136. package/dist/suppliers/routes.d.ts.map +1 -0
  137. package/dist/suppliers/routes.js +290 -0
  138. package/dist/suppliers/schema.d.ts +1272 -0
  139. package/dist/suppliers/schema.d.ts.map +1 -0
  140. package/dist/suppliers/schema.js +219 -0
  141. package/dist/suppliers/service-aggregates.d.ts +23 -0
  142. package/dist/suppliers/service-aggregates.d.ts.map +1 -0
  143. package/dist/suppliers/service-aggregates.js +51 -0
  144. package/dist/suppliers/service-core.d.ts +89 -0
  145. package/dist/suppliers/service-core.d.ts.map +1 -0
  146. package/dist/suppliers/service-core.js +164 -0
  147. package/dist/suppliers/service-identity.d.ts +162 -0
  148. package/dist/suppliers/service-identity.d.ts.map +1 -0
  149. package/dist/suppliers/service-identity.js +101 -0
  150. package/dist/suppliers/service-operations.d.ts +1500 -0
  151. package/dist/suppliers/service-operations.d.ts.map +1 -0
  152. package/dist/suppliers/service-operations.js +157 -0
  153. package/dist/suppliers/service-shared.d.ts +45 -0
  154. package/dist/suppliers/service-shared.d.ts.map +1 -0
  155. package/dist/suppliers/service-shared.js +294 -0
  156. package/dist/suppliers/service.d.ts +41 -0
  157. package/dist/suppliers/service.d.ts.map +1 -0
  158. package/dist/suppliers/service.js +40 -0
  159. package/dist/suppliers/validation.d.ts +2 -0
  160. package/dist/suppliers/validation.d.ts.map +1 -0
  161. package/dist/suppliers/validation.js +1 -0
  162. package/dist/validation.d.ts +1371 -0
  163. package/dist/validation.d.ts.map +1 -0
  164. package/dist/validation.js +445 -0
  165. package/dist/webhook-deliveries.d.ts +86 -0
  166. package/dist/webhook-deliveries.d.ts.map +1 -0
  167. package/dist/webhook-deliveries.js +296 -0
  168. package/package.json +71 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-relations.d.ts","sourceRoot":"","sources":["../src/schema-relations.ts"],"names":[],"mappings":"AA+BA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;EAe3B,CAAA;AAEH,eAAO,MAAM,kCAAkC;;EAQ9C,CAAA;AAED,eAAO,MAAM,yBAAyB;;;;;;;EAUnC,CAAA;AAEH,eAAO,MAAM,+BAA+B;;EAKzC,CAAA;AAEH,eAAO,MAAM,+BAA+B;;EAKzC,CAAA;AAEH,eAAO,MAAM,4BAA4B;;EAKtC,CAAA;AAEH,eAAO,MAAM,mCAAmC;;;;;;EAe/C,CAAA;AAED,eAAO,MAAM,yCAAyC;;EAQrD,CAAA;AAED,eAAO,MAAM,qCAAqC;;;EASjD,CAAA;AAED,eAAO,MAAM,8BAA8B;;;;;EAWxC,CAAA;AAEH,eAAO,MAAM,+BAA+B;;;;EAazC,CAAA;AAEH,eAAO,MAAM,kCAAkC;;;;EAa9C,CAAA;AAED,eAAO,MAAM,mCAAmC;;;EAY/C,CAAA;AAED,eAAO,MAAM,0CAA0C;;;;EAgBtD,CAAA;AAED,eAAO,MAAM,kCAAkC;;;EAY9C,CAAA;AAED,eAAO,MAAM,sCAAsC;;;EAYlD,CAAA;AAED,eAAO,MAAM,gCAAgC;;EAK1C,CAAA;AAEH,eAAO,MAAM,oCAAoC;;;;EAgBhD,CAAA;AAED,eAAO,MAAM,mCAAmC;;EAQ/C,CAAA;AAED,eAAO,MAAM,6BAA6B;;EAKvC,CAAA"}
@@ -0,0 +1,196 @@
1
+ import { relations } from "drizzle-orm";
2
+ import { channelReconciliationPolicies, channelReleaseSchedules, channelSettlementPolicies, } from "./schema-automation.js";
3
+ import { channelBookingLinks, channelCommissionRules, channelContactProjections, channelContracts, channelProductMappings, channels, channelWebhookEvents, } from "./schema-core.js";
4
+ import { channelReconciliationItems, channelReconciliationRuns, channelRemittanceExceptions, channelSettlementApprovals, channelSettlementItems, channelSettlementRuns, } from "./schema-finance.js";
5
+ import { channelInventoryAllotments, channelInventoryAllotmentTargets, channelInventoryReleaseExecutions, channelInventoryReleaseRules, } from "./schema-inventory.js";
6
+ import { suppliers } from "./suppliers/schema.js";
7
+ export const channelsRelations = relations(channels, ({ many, one }) => ({
8
+ contracts: many(channelContracts),
9
+ productMappings: many(channelProductMappings),
10
+ bookingLinks: many(channelBookingLinks),
11
+ webhookEvents: many(channelWebhookEvents),
12
+ inventoryAllotments: many(channelInventoryAllotments),
13
+ settlementRuns: many(channelSettlementRuns),
14
+ reconciliationRuns: many(channelReconciliationRuns),
15
+ settlementPolicies: many(channelSettlementPolicies),
16
+ reconciliationPolicies: many(channelReconciliationPolicies),
17
+ remittanceExceptions: many(channelRemittanceExceptions),
18
+ contactProjection: one(channelContactProjections, {
19
+ fields: [channels.id],
20
+ references: [channelContactProjections.channelId],
21
+ }),
22
+ }));
23
+ export const channelContactProjectionsRelations = relations(channelContactProjections, ({ one }) => ({
24
+ channel: one(channels, {
25
+ fields: [channelContactProjections.channelId],
26
+ references: [channels.id],
27
+ }),
28
+ }));
29
+ export const channelContractsRelations = relations(channelContracts, ({ one, many }) => ({
30
+ channel: one(channels, { fields: [channelContracts.channelId], references: [channels.id] }),
31
+ supplier: one(suppliers, {
32
+ fields: [channelContracts.supplierId],
33
+ references: [suppliers.id],
34
+ }),
35
+ commissionRules: many(channelCommissionRules),
36
+ inventoryAllotments: many(channelInventoryAllotments),
37
+ settlementRuns: many(channelSettlementRuns),
38
+ reconciliationRuns: many(channelReconciliationRuns),
39
+ }));
40
+ export const channelCommissionRulesRelations = relations(channelCommissionRules, ({ one }) => ({
41
+ contract: one(channelContracts, {
42
+ fields: [channelCommissionRules.contractId],
43
+ references: [channelContracts.id],
44
+ }),
45
+ }));
46
+ export const channelProductMappingsRelations = relations(channelProductMappings, ({ one }) => ({
47
+ channel: one(channels, {
48
+ fields: [channelProductMappings.channelId],
49
+ references: [channels.id],
50
+ }),
51
+ }));
52
+ export const channelBookingLinksRelations = relations(channelBookingLinks, ({ one }) => ({
53
+ channel: one(channels, {
54
+ fields: [channelBookingLinks.channelId],
55
+ references: [channels.id],
56
+ }),
57
+ }));
58
+ export const channelInventoryAllotmentsRelations = relations(channelInventoryAllotments, ({ one, many }) => ({
59
+ channel: one(channels, {
60
+ fields: [channelInventoryAllotments.channelId],
61
+ references: [channels.id],
62
+ }),
63
+ contract: one(channelContracts, {
64
+ fields: [channelInventoryAllotments.contractId],
65
+ references: [channelContracts.id],
66
+ }),
67
+ targets: many(channelInventoryAllotmentTargets),
68
+ releaseRules: many(channelInventoryReleaseRules),
69
+ releaseExecutions: many(channelInventoryReleaseExecutions),
70
+ }));
71
+ export const channelInventoryAllotmentTargetsRelations = relations(channelInventoryAllotmentTargets, ({ one }) => ({
72
+ allotment: one(channelInventoryAllotments, {
73
+ fields: [channelInventoryAllotmentTargets.allotmentId],
74
+ references: [channelInventoryAllotments.id],
75
+ }),
76
+ }));
77
+ export const channelInventoryReleaseRulesRelations = relations(channelInventoryReleaseRules, ({ one, many }) => ({
78
+ allotment: one(channelInventoryAllotments, {
79
+ fields: [channelInventoryReleaseRules.allotmentId],
80
+ references: [channelInventoryAllotments.id],
81
+ }),
82
+ schedules: many(channelReleaseSchedules),
83
+ }));
84
+ export const channelSettlementRunsRelations = relations(channelSettlementRuns, ({ one, many }) => ({
85
+ channel: one(channels, {
86
+ fields: [channelSettlementRuns.channelId],
87
+ references: [channels.id],
88
+ }),
89
+ contract: one(channelContracts, {
90
+ fields: [channelSettlementRuns.contractId],
91
+ references: [channelContracts.id],
92
+ }),
93
+ items: many(channelSettlementItems),
94
+ approvals: many(channelSettlementApprovals),
95
+ }));
96
+ export const channelSettlementItemsRelations = relations(channelSettlementItems, ({ one }) => ({
97
+ settlementRun: one(channelSettlementRuns, {
98
+ fields: [channelSettlementItems.settlementRunId],
99
+ references: [channelSettlementRuns.id],
100
+ }),
101
+ bookingLink: one(channelBookingLinks, {
102
+ fields: [channelSettlementItems.bookingLinkId],
103
+ references: [channelBookingLinks.id],
104
+ }),
105
+ commissionRule: one(channelCommissionRules, {
106
+ fields: [channelSettlementItems.commissionRuleId],
107
+ references: [channelCommissionRules.id],
108
+ }),
109
+ }));
110
+ export const channelReconciliationRunsRelations = relations(channelReconciliationRuns, ({ one, many }) => ({
111
+ channel: one(channels, {
112
+ fields: [channelReconciliationRuns.channelId],
113
+ references: [channels.id],
114
+ }),
115
+ contract: one(channelContracts, {
116
+ fields: [channelReconciliationRuns.contractId],
117
+ references: [channelContracts.id],
118
+ }),
119
+ items: many(channelReconciliationItems),
120
+ }));
121
+ export const channelReconciliationItemsRelations = relations(channelReconciliationItems, ({ one }) => ({
122
+ reconciliationRun: one(channelReconciliationRuns, {
123
+ fields: [channelReconciliationItems.reconciliationRunId],
124
+ references: [channelReconciliationRuns.id],
125
+ }),
126
+ bookingLink: one(channelBookingLinks, {
127
+ fields: [channelReconciliationItems.bookingLinkId],
128
+ references: [channelBookingLinks.id],
129
+ }),
130
+ }));
131
+ export const channelInventoryReleaseExecutionsRelations = relations(channelInventoryReleaseExecutions, ({ one }) => ({
132
+ allotment: one(channelInventoryAllotments, {
133
+ fields: [channelInventoryReleaseExecutions.allotmentId],
134
+ references: [channelInventoryAllotments.id],
135
+ }),
136
+ releaseRule: one(channelInventoryReleaseRules, {
137
+ fields: [channelInventoryReleaseExecutions.releaseRuleId],
138
+ references: [channelInventoryReleaseRules.id],
139
+ }),
140
+ target: one(channelInventoryAllotmentTargets, {
141
+ fields: [channelInventoryReleaseExecutions.targetId],
142
+ references: [channelInventoryAllotmentTargets.id],
143
+ }),
144
+ }));
145
+ export const channelSettlementPoliciesRelations = relations(channelSettlementPolicies, ({ one }) => ({
146
+ channel: one(channels, {
147
+ fields: [channelSettlementPolicies.channelId],
148
+ references: [channels.id],
149
+ }),
150
+ contract: one(channelContracts, {
151
+ fields: [channelSettlementPolicies.contractId],
152
+ references: [channelContracts.id],
153
+ }),
154
+ }));
155
+ export const channelReconciliationPoliciesRelations = relations(channelReconciliationPolicies, ({ one }) => ({
156
+ channel: one(channels, {
157
+ fields: [channelReconciliationPolicies.channelId],
158
+ references: [channels.id],
159
+ }),
160
+ contract: one(channelContracts, {
161
+ fields: [channelReconciliationPolicies.contractId],
162
+ references: [channelContracts.id],
163
+ }),
164
+ }));
165
+ export const channelReleaseSchedulesRelations = relations(channelReleaseSchedules, ({ one }) => ({
166
+ releaseRule: one(channelInventoryReleaseRules, {
167
+ fields: [channelReleaseSchedules.releaseRuleId],
168
+ references: [channelInventoryReleaseRules.id],
169
+ }),
170
+ }));
171
+ export const channelRemittanceExceptionsRelations = relations(channelRemittanceExceptions, ({ one }) => ({
172
+ channel: one(channels, {
173
+ fields: [channelRemittanceExceptions.channelId],
174
+ references: [channels.id],
175
+ }),
176
+ settlementItem: one(channelSettlementItems, {
177
+ fields: [channelRemittanceExceptions.settlementItemId],
178
+ references: [channelSettlementItems.id],
179
+ }),
180
+ reconciliationItem: one(channelReconciliationItems, {
181
+ fields: [channelRemittanceExceptions.reconciliationItemId],
182
+ references: [channelReconciliationItems.id],
183
+ }),
184
+ }));
185
+ export const channelSettlementApprovalsRelations = relations(channelSettlementApprovals, ({ one }) => ({
186
+ settlementRun: one(channelSettlementRuns, {
187
+ fields: [channelSettlementApprovals.settlementRunId],
188
+ references: [channelSettlementRuns.id],
189
+ }),
190
+ }));
191
+ export const channelWebhookEventsRelations = relations(channelWebhookEvents, ({ one }) => ({
192
+ channel: one(channels, {
193
+ fields: [channelWebhookEvents.channelId],
194
+ references: [channels.id],
195
+ }),
196
+ }));
@@ -0,0 +1,24 @@
1
+ export declare const channelKindEnum: import("drizzle-orm/pg-core").PgEnum<["direct", "affiliate", "ota", "reseller", "marketplace", "api_partner", "connect"]>;
2
+ export declare const channelStatusEnum: import("drizzle-orm/pg-core").PgEnum<["active", "inactive", "pending", "archived"]>;
3
+ export declare const channelContractStatusEnum: import("drizzle-orm/pg-core").PgEnum<["draft", "active", "expired", "terminated"]>;
4
+ export declare const distributionPaymentOwnerEnum: import("drizzle-orm/pg-core").PgEnum<["operator", "channel", "split"]>;
5
+ export declare const distributionCancellationOwnerEnum: import("drizzle-orm/pg-core").PgEnum<["operator", "channel", "mixed"]>;
6
+ export declare const channelCommissionScopeEnum: import("drizzle-orm/pg-core").PgEnum<["booking", "product", "rate", "category"]>;
7
+ export declare const channelCommissionTypeEnum: import("drizzle-orm/pg-core").PgEnum<["fixed", "percentage"]>;
8
+ export declare const channelWebhookStatusEnum: import("drizzle-orm/pg-core").PgEnum<["pending", "processed", "failed", "ignored"]>;
9
+ export declare const channelAllotmentReleaseModeEnum: import("drizzle-orm/pg-core").PgEnum<["automatic", "manual"]>;
10
+ export declare const channelAllotmentUnsoldActionEnum: import("drizzle-orm/pg-core").PgEnum<["release_to_general_pool", "expire", "retain"]>;
11
+ export declare const channelSettlementRunStatusEnum: import("drizzle-orm/pg-core").PgEnum<["draft", "open", "posted", "paid", "void"]>;
12
+ export declare const channelSettlementItemStatusEnum: import("drizzle-orm/pg-core").PgEnum<["pending", "approved", "disputed", "paid", "void"]>;
13
+ export declare const channelReconciliationRunStatusEnum: import("drizzle-orm/pg-core").PgEnum<["draft", "running", "completed", "archived"]>;
14
+ export declare const channelReconciliationIssueTypeEnum: import("drizzle-orm/pg-core").PgEnum<["missing_booking", "status_mismatch", "amount_mismatch", "cancel_mismatch", "missing_payout", "other"]>;
15
+ export declare const channelReconciliationSeverityEnum: import("drizzle-orm/pg-core").PgEnum<["info", "warning", "error"]>;
16
+ export declare const channelReconciliationResolutionStatusEnum: import("drizzle-orm/pg-core").PgEnum<["open", "ignored", "resolved"]>;
17
+ export declare const channelReleaseExecutionStatusEnum: import("drizzle-orm/pg-core").PgEnum<["pending", "completed", "skipped", "failed"]>;
18
+ export declare const channelReleaseExecutionActionEnum: import("drizzle-orm/pg-core").PgEnum<["released", "expired", "retained", "manual_override"]>;
19
+ export declare const channelSettlementPolicyFrequencyEnum: import("drizzle-orm/pg-core").PgEnum<["manual", "daily", "weekly", "monthly"]>;
20
+ export declare const channelReconciliationPolicyFrequencyEnum: import("drizzle-orm/pg-core").PgEnum<["manual", "daily", "weekly", "monthly"]>;
21
+ export declare const channelReleaseScheduleKindEnum: import("drizzle-orm/pg-core").PgEnum<["manual", "hourly", "daily"]>;
22
+ export declare const channelRemittanceExceptionStatusEnum: import("drizzle-orm/pg-core").PgEnum<["open", "investigating", "resolved", "ignored"]>;
23
+ export declare const channelSettlementApprovalStatusEnum: import("drizzle-orm/pg-core").PgEnum<["pending", "approved", "rejected"]>;
24
+ //# sourceMappingURL=schema-shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-shared.d.ts","sourceRoot":"","sources":["../src/schema-shared.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,2HAQ1B,CAAA;AAEF,eAAO,MAAM,iBAAiB,qFAK5B,CAAA;AAEF,eAAO,MAAM,yBAAyB,oFAKpC,CAAA;AAEF,eAAO,MAAM,4BAA4B,wEAIvC,CAAA;AAEF,eAAO,MAAM,iCAAiC,wEAI5C,CAAA;AAEF,eAAO,MAAM,0BAA0B,kFAKrC,CAAA;AAEF,eAAO,MAAM,yBAAyB,+DAA6D,CAAA;AAEnG,eAAO,MAAM,wBAAwB,qFAKnC,CAAA;AAEF,eAAO,MAAM,+BAA+B,+DAG1C,CAAA;AAEF,eAAO,MAAM,gCAAgC,uFAI3C,CAAA;AAEF,eAAO,MAAM,8BAA8B,mFAMzC,CAAA;AAEF,eAAO,MAAM,+BAA+B,2FAM1C,CAAA;AAEF,eAAO,MAAM,kCAAkC,qFAK7C,CAAA;AAEF,eAAO,MAAM,kCAAkC,+IAO7C,CAAA;AAEF,eAAO,MAAM,iCAAiC,oEAI5C,CAAA;AAEF,eAAO,MAAM,yCAAyC,uEAGrD,CAAA;AAED,eAAO,MAAM,iCAAiC,qFAK5C,CAAA;AAEF,eAAO,MAAM,iCAAiC,8FAK5C,CAAA;AAEF,eAAO,MAAM,oCAAoC,gFAK/C,CAAA;AAEF,eAAO,MAAM,wCAAwC,gFAGpD,CAAA;AAED,eAAO,MAAM,8BAA8B,qEAIzC,CAAA;AAEF,eAAO,MAAM,oCAAoC,wFAK/C,CAAA;AAEF,eAAO,MAAM,mCAAmC,2EAI9C,CAAA"}
@@ -0,0 +1,123 @@
1
+ import { pgEnum } from "drizzle-orm/pg-core";
2
+ export const channelKindEnum = pgEnum("channel_kind", [
3
+ "direct",
4
+ "affiliate",
5
+ "ota",
6
+ "reseller",
7
+ "marketplace",
8
+ "api_partner",
9
+ "connect",
10
+ ]);
11
+ export const channelStatusEnum = pgEnum("channel_status", [
12
+ "active",
13
+ "inactive",
14
+ "pending",
15
+ "archived",
16
+ ]);
17
+ export const channelContractStatusEnum = pgEnum("channel_contract_status", [
18
+ "draft",
19
+ "active",
20
+ "expired",
21
+ "terminated",
22
+ ]);
23
+ export const distributionPaymentOwnerEnum = pgEnum("distribution_payment_owner", [
24
+ "operator",
25
+ "channel",
26
+ "split",
27
+ ]);
28
+ export const distributionCancellationOwnerEnum = pgEnum("distribution_cancellation_owner", [
29
+ "operator",
30
+ "channel",
31
+ "mixed",
32
+ ]);
33
+ export const channelCommissionScopeEnum = pgEnum("channel_commission_scope", [
34
+ "booking",
35
+ "product",
36
+ "rate",
37
+ "category",
38
+ ]);
39
+ export const channelCommissionTypeEnum = pgEnum("channel_commission_type", ["fixed", "percentage"]);
40
+ export const channelWebhookStatusEnum = pgEnum("channel_webhook_status", [
41
+ "pending",
42
+ "processed",
43
+ "failed",
44
+ "ignored",
45
+ ]);
46
+ export const channelAllotmentReleaseModeEnum = pgEnum("channel_allotment_release_mode", [
47
+ "automatic",
48
+ "manual",
49
+ ]);
50
+ export const channelAllotmentUnsoldActionEnum = pgEnum("channel_allotment_unsold_action", [
51
+ "release_to_general_pool",
52
+ "expire",
53
+ "retain",
54
+ ]);
55
+ export const channelSettlementRunStatusEnum = pgEnum("channel_settlement_run_status", [
56
+ "draft",
57
+ "open",
58
+ "posted",
59
+ "paid",
60
+ "void",
61
+ ]);
62
+ export const channelSettlementItemStatusEnum = pgEnum("channel_settlement_item_status", [
63
+ "pending",
64
+ "approved",
65
+ "disputed",
66
+ "paid",
67
+ "void",
68
+ ]);
69
+ export const channelReconciliationRunStatusEnum = pgEnum("channel_reconciliation_run_status", [
70
+ "draft",
71
+ "running",
72
+ "completed",
73
+ "archived",
74
+ ]);
75
+ export const channelReconciliationIssueTypeEnum = pgEnum("channel_reconciliation_issue_type", [
76
+ "missing_booking",
77
+ "status_mismatch",
78
+ "amount_mismatch",
79
+ "cancel_mismatch",
80
+ "missing_payout",
81
+ "other",
82
+ ]);
83
+ export const channelReconciliationSeverityEnum = pgEnum("channel_reconciliation_severity", [
84
+ "info",
85
+ "warning",
86
+ "error",
87
+ ]);
88
+ export const channelReconciliationResolutionStatusEnum = pgEnum("channel_reconciliation_resolution_status", ["open", "ignored", "resolved"]);
89
+ export const channelReleaseExecutionStatusEnum = pgEnum("channel_release_execution_status", [
90
+ "pending",
91
+ "completed",
92
+ "skipped",
93
+ "failed",
94
+ ]);
95
+ export const channelReleaseExecutionActionEnum = pgEnum("channel_release_execution_action", [
96
+ "released",
97
+ "expired",
98
+ "retained",
99
+ "manual_override",
100
+ ]);
101
+ export const channelSettlementPolicyFrequencyEnum = pgEnum("channel_settlement_policy_frequency", [
102
+ "manual",
103
+ "daily",
104
+ "weekly",
105
+ "monthly",
106
+ ]);
107
+ export const channelReconciliationPolicyFrequencyEnum = pgEnum("channel_reconciliation_policy_frequency", ["manual", "daily", "weekly", "monthly"]);
108
+ export const channelReleaseScheduleKindEnum = pgEnum("channel_release_schedule_kind", [
109
+ "manual",
110
+ "hourly",
111
+ "daily",
112
+ ]);
113
+ export const channelRemittanceExceptionStatusEnum = pgEnum("channel_remittance_exception_status", [
114
+ "open",
115
+ "investigating",
116
+ "resolved",
117
+ "ignored",
118
+ ]);
119
+ export const channelSettlementApprovalStatusEnum = pgEnum("channel_settlement_approval_status", [
120
+ "pending",
121
+ "approved",
122
+ "rejected",
123
+ ]);
@@ -0,0 +1,9 @@
1
+ export { bookingDistributionDetails, bookingPaymentOwnerEnum } from "./booking-extension.js";
2
+ export * from "./schema-automation.js";
3
+ export * from "./schema-core.js";
4
+ export * from "./schema-finance.js";
5
+ export * from "./schema-inventory.js";
6
+ export * from "./schema-push-intents.js";
7
+ export * from "./schema-relations.js";
8
+ export * from "./schema-shared.js";
9
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAA;AAC5F,cAAc,wBAAwB,CAAA;AACtC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA"}
package/dist/schema.js ADDED
@@ -0,0 +1,8 @@
1
+ export { bookingDistributionDetails, bookingPaymentOwnerEnum } from "./booking-extension.js";
2
+ export * from "./schema-automation.js";
3
+ export * from "./schema-core.js";
4
+ export * from "./schema-finance.js";
5
+ export * from "./schema-inventory.js";
6
+ export * from "./schema-push-intents.js";
7
+ export * from "./schema-relations.js";
8
+ export * from "./schema-shared.js";
@@ -0,0 +1,167 @@
1
+ import type { InsertContactPointForEntity, InsertNamedContactForEntity, UpdateContactPoint as UpdateIdentityContactPoint, UpdateNamedContact as UpdateIdentityNamedContact } from "@voyant-travel/identity/validation";
2
+ import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
3
+ import type { Channel } from "../schema.js";
4
+ import type { ChannelListQuery, CreateChannelInput, UpdateChannelInput } from "./types.js";
5
+ type ChannelHydratedFields = {
6
+ website: string | null;
7
+ contactName: string | null;
8
+ contactEmail: string | null;
9
+ };
10
+ export declare const channelServiceOperations: {
11
+ listChannels(db: PostgresJsDatabase, query: ChannelListQuery): Promise<{
12
+ data: ({
13
+ id: string;
14
+ name: string;
15
+ description: string | null;
16
+ kind: "direct" | "affiliate" | "ota" | "reseller" | "marketplace" | "api_partner" | "connect";
17
+ status: "active" | "inactive" | "pending" | "archived";
18
+ metadata: Record<string, unknown> | null;
19
+ rateLimitRps: number | null;
20
+ rateLimitBurst: number | null;
21
+ rateLimitPriorityGates: Record<string, number> | null;
22
+ createdAt: Date;
23
+ updatedAt: Date;
24
+ } & ChannelHydratedFields)[];
25
+ total: number;
26
+ limit: number;
27
+ offset: number;
28
+ }>;
29
+ getChannelById(db: PostgresJsDatabase, id: string): Promise<({
30
+ id: string;
31
+ name: string;
32
+ description: string | null;
33
+ kind: "direct" | "affiliate" | "ota" | "reseller" | "marketplace" | "api_partner" | "connect";
34
+ status: "active" | "inactive" | "pending" | "archived";
35
+ metadata: Record<string, unknown> | null;
36
+ rateLimitRps: number | null;
37
+ rateLimitBurst: number | null;
38
+ rateLimitPriorityGates: Record<string, number> | null;
39
+ createdAt: Date;
40
+ updatedAt: Date;
41
+ } & ChannelHydratedFields) | null>;
42
+ createChannel(db: PostgresJsDatabase, data: CreateChannelInput): Promise<({
43
+ id: string;
44
+ name: string;
45
+ description: string | null;
46
+ kind: "direct" | "affiliate" | "ota" | "reseller" | "marketplace" | "api_partner" | "connect";
47
+ status: "active" | "inactive" | "pending" | "archived";
48
+ metadata: Record<string, unknown> | null;
49
+ rateLimitRps: number | null;
50
+ rateLimitBurst: number | null;
51
+ rateLimitPriorityGates: Record<string, number> | null;
52
+ createdAt: Date;
53
+ updatedAt: Date;
54
+ } & ChannelHydratedFields) | null>;
55
+ updateChannel(db: PostgresJsDatabase, id: string, data: UpdateChannelInput): Promise<({
56
+ id: string;
57
+ name: string;
58
+ description: string | null;
59
+ kind: "direct" | "affiliate" | "ota" | "reseller" | "marketplace" | "api_partner" | "connect";
60
+ status: "active" | "inactive" | "pending" | "archived";
61
+ metadata: Record<string, unknown> | null;
62
+ rateLimitRps: number | null;
63
+ rateLimitBurst: number | null;
64
+ rateLimitPriorityGates: Record<string, number> | null;
65
+ createdAt: Date;
66
+ updatedAt: Date;
67
+ } & ChannelHydratedFields) | null>;
68
+ deleteChannel(db: PostgresJsDatabase, id: string): Promise<{
69
+ id: string;
70
+ } | null>;
71
+ listChannelContactPoints(db: PostgresJsDatabase, channelId: string): Promise<{
72
+ id: string;
73
+ entityType: string;
74
+ entityId: string;
75
+ kind: "other" | "website" | "email" | "phone" | "mobile" | "whatsapp" | "sms" | "fax" | "social";
76
+ label: string | null;
77
+ value: string;
78
+ normalizedValue: string | null;
79
+ isPrimary: boolean;
80
+ notes: string | null;
81
+ metadata: Record<string, unknown> | null;
82
+ createdAt: Date;
83
+ updatedAt: Date;
84
+ }[] | null>;
85
+ createChannelContactPoint(db: PostgresJsDatabase, channelId: string, data: InsertContactPointForEntity): Promise<{
86
+ createdAt: Date;
87
+ updatedAt: Date;
88
+ metadata: Record<string, unknown> | null;
89
+ value: string;
90
+ id: string;
91
+ kind: "other" | "website" | "email" | "phone" | "mobile" | "whatsapp" | "sms" | "fax" | "social";
92
+ notes: string | null;
93
+ entityType: string;
94
+ entityId: string;
95
+ isPrimary: boolean;
96
+ label: string | null;
97
+ normalizedValue: string | null;
98
+ } | null>;
99
+ updateChannelContactPoint(db: PostgresJsDatabase, id: string, data: UpdateIdentityContactPoint): Promise<{
100
+ id: string;
101
+ entityType: string;
102
+ entityId: string;
103
+ kind: "other" | "website" | "email" | "phone" | "mobile" | "whatsapp" | "sms" | "fax" | "social";
104
+ label: string | null;
105
+ value: string;
106
+ normalizedValue: string | null;
107
+ isPrimary: boolean;
108
+ notes: string | null;
109
+ metadata: Record<string, unknown> | null;
110
+ createdAt: Date;
111
+ updatedAt: Date;
112
+ } | null>;
113
+ deleteChannelContactPoint(db: PostgresJsDatabase, id: string): Promise<{
114
+ id: string;
115
+ } | null>;
116
+ listChannelContacts(db: PostgresJsDatabase, channelId: string): Promise<{
117
+ id: string;
118
+ entityType: string;
119
+ entityId: string;
120
+ role: "primary" | "other" | "general" | "reservations" | "operations" | "front_desk" | "sales" | "emergency" | "accounting" | "legal";
121
+ name: string;
122
+ title: string | null;
123
+ email: string | null;
124
+ phone: string | null;
125
+ isPrimary: boolean;
126
+ notes: string | null;
127
+ metadata: Record<string, unknown> | null;
128
+ createdAt: Date;
129
+ updatedAt: Date;
130
+ }[] | null>;
131
+ createChannelContact(db: PostgresJsDatabase, channelId: string, data: InsertNamedContactForEntity): Promise<{
132
+ name: string;
133
+ createdAt: Date;
134
+ updatedAt: Date;
135
+ metadata: Record<string, unknown> | null;
136
+ id: string;
137
+ title: string | null;
138
+ notes: string | null;
139
+ entityType: string;
140
+ entityId: string;
141
+ isPrimary: boolean;
142
+ email: string | null;
143
+ phone: string | null;
144
+ role: "primary" | "other" | "general" | "reservations" | "operations" | "front_desk" | "sales" | "emergency" | "accounting" | "legal";
145
+ } | null>;
146
+ updateChannelContact(db: PostgresJsDatabase, id: string, data: UpdateIdentityNamedContact): Promise<{
147
+ id: string;
148
+ entityType: string;
149
+ entityId: string;
150
+ role: "primary" | "other" | "general" | "reservations" | "operations" | "front_desk" | "sales" | "emergency" | "accounting" | "legal";
151
+ name: string;
152
+ title: string | null;
153
+ email: string | null;
154
+ phone: string | null;
155
+ isPrimary: boolean;
156
+ notes: string | null;
157
+ metadata: Record<string, unknown> | null;
158
+ createdAt: Date;
159
+ updatedAt: Date;
160
+ } | null>;
161
+ deleteChannelContact(db: PostgresJsDatabase, id: string): Promise<{
162
+ id: string;
163
+ } | null>;
164
+ };
165
+ export type HydratedChannel = Channel & ChannelHydratedFields;
166
+ export {};
167
+ //# sourceMappingURL=channels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channels.d.ts","sourceRoot":"","sources":["../../src/service/channels.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,2BAA2B,EAC3B,2BAA2B,EAC3B,kBAAkB,IAAI,0BAA0B,EAChD,kBAAkB,IAAI,0BAA0B,EACjD,MAAM,oCAAoC,CAAA;AAE3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAEjE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAQ1F,KAAK,qBAAqB,GAAG;IAC3B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;CAC5B,CAAA;AAkND,eAAO,MAAM,wBAAwB;qBACZ,kBAAkB,SAAS,gBAAgB;;;;;;;;;;;;;;;;;;uBAwBzC,kBAAkB,MAAM,MAAM;;;;;;;;;;;;;sBAU/B,kBAAkB,QAAQ,kBAAkB;;;;;;;;;;;;;sBAS5C,kBAAkB,MAAM,MAAM,QAAQ,kBAAkB;;;;;;;;;;;;;sBAoBxD,kBAAkB,MAAM,MAAM;;;iCASnB,kBAAkB,aAAa,MAAM;;;;;;;;;;;;;;kCAOlE,kBAAkB,aACX,MAAM,QACX,2BAA2B;;;;;;;;;;;;;;kCAiB7B,kBAAkB,MAClB,MAAM,QACJ,0BAA0B;;;;;;;;;;;;;;kCAaE,kBAAkB,MAAM,MAAM;;;4BAWpC,kBAAkB,aAAa,MAAM;;;;;;;;;;;;;;;6BAO7D,kBAAkB,aACX,MAAM,QACX,2BAA2B;;;;;;;;;;;;;;;6BAgBJ,kBAAkB,MAAM,MAAM,QAAQ,0BAA0B;;;;;;;;;;;;;;;6BAYhE,kBAAkB,MAAM,MAAM;;;CAU9D,CAAA;AAED,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,qBAAqB,CAAA"}