@voyant-travel/inventory 0.1.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 (311) hide show
  1. package/LICENSE +201 -0
  2. package/dist/action-ledger-drift.d.ts +29 -0
  3. package/dist/action-ledger-drift.d.ts.map +1 -0
  4. package/dist/action-ledger-drift.js +338 -0
  5. package/dist/action-ledger.d.ts +104 -0
  6. package/dist/action-ledger.d.ts.map +1 -0
  7. package/dist/action-ledger.js +100 -0
  8. package/dist/authoring/builder.d.ts +37 -0
  9. package/dist/authoring/builder.d.ts.map +1 -0
  10. package/dist/authoring/builder.js +248 -0
  11. package/dist/authoring/clone-content.d.ts +38 -0
  12. package/dist/authoring/clone-content.d.ts.map +1 -0
  13. package/dist/authoring/clone-content.js +367 -0
  14. package/dist/authoring/clone-pricing.d.ts +9 -0
  15. package/dist/authoring/clone-pricing.d.ts.map +1 -0
  16. package/dist/authoring/clone-pricing.js +242 -0
  17. package/dist/authoring/clone.d.ts +45 -0
  18. package/dist/authoring/clone.d.ts.map +1 -0
  19. package/dist/authoring/clone.js +142 -0
  20. package/dist/authoring/errors.d.ts +21 -0
  21. package/dist/authoring/errors.d.ts.map +1 -0
  22. package/dist/authoring/errors.js +13 -0
  23. package/dist/authoring/extension.d.ts +248 -0
  24. package/dist/authoring/extension.d.ts.map +1 -0
  25. package/dist/authoring/extension.js +116 -0
  26. package/dist/authoring/index.d.ts +12 -0
  27. package/dist/authoring/index.d.ts.map +1 -0
  28. package/dist/authoring/index.js +11 -0
  29. package/dist/authoring/schema.d.ts +85 -0
  30. package/dist/authoring/schema.d.ts.map +1 -0
  31. package/dist/authoring/schema.js +16 -0
  32. package/dist/authoring/service.d.ts +28 -0
  33. package/dist/authoring/service.d.ts.map +1 -0
  34. package/dist/authoring/service.js +66 -0
  35. package/dist/authoring/spec.d.ts +524 -0
  36. package/dist/authoring/spec.d.ts.map +1 -0
  37. package/dist/authoring/spec.js +167 -0
  38. package/dist/authoring/validate.d.ts +17 -0
  39. package/dist/authoring/validate.d.ts.map +1 -0
  40. package/dist/authoring/validate.js +83 -0
  41. package/dist/authoring.d.ts +2 -0
  42. package/dist/authoring.d.ts.map +1 -0
  43. package/dist/authoring.js +1 -0
  44. package/dist/booking-engine/handler-support.d.ts +91 -0
  45. package/dist/booking-engine/handler-support.d.ts.map +1 -0
  46. package/dist/booking-engine/handler-support.js +355 -0
  47. package/dist/booking-engine/handler.d.ts +404 -0
  48. package/dist/booking-engine/handler.d.ts.map +1 -0
  49. package/dist/booking-engine/handler.js +398 -0
  50. package/dist/booking-engine/index.d.ts +8 -0
  51. package/dist/booking-engine/index.d.ts.map +1 -0
  52. package/dist/booking-engine/index.js +7 -0
  53. package/dist/booking-engine.d.ts +2 -0
  54. package/dist/booking-engine.d.ts.map +1 -0
  55. package/dist/booking-engine.js +1 -0
  56. package/dist/booking-extension.d.ts +278 -0
  57. package/dist/booking-extension.d.ts.map +1 -0
  58. package/dist/booking-extension.js +161 -0
  59. package/dist/catalog-policy-departures.d.ts +52 -0
  60. package/dist/catalog-policy-departures.d.ts.map +1 -0
  61. package/dist/catalog-policy-departures.js +169 -0
  62. package/dist/catalog-policy-destinations.d.ts +43 -0
  63. package/dist/catalog-policy-destinations.d.ts.map +1 -0
  64. package/dist/catalog-policy-destinations.js +165 -0
  65. package/dist/catalog-policy-pricing.d.ts +55 -0
  66. package/dist/catalog-policy-pricing.d.ts.map +1 -0
  67. package/dist/catalog-policy-pricing.js +109 -0
  68. package/dist/catalog-policy-promotions.d.ts +52 -0
  69. package/dist/catalog-policy-promotions.d.ts.map +1 -0
  70. package/dist/catalog-policy-promotions.js +270 -0
  71. package/dist/catalog-policy-taxonomy.d.ts +51 -0
  72. package/dist/catalog-policy-taxonomy.d.ts.map +1 -0
  73. package/dist/catalog-policy-taxonomy.js +191 -0
  74. package/dist/catalog-policy.d.ts +33 -0
  75. package/dist/catalog-policy.d.ts.map +1 -0
  76. package/dist/catalog-policy.js +733 -0
  77. package/dist/content-shape.d.ts +15 -0
  78. package/dist/content-shape.d.ts.map +1 -0
  79. package/dist/content-shape.js +28 -0
  80. package/dist/draft-shape.d.ts +43 -0
  81. package/dist/draft-shape.d.ts.map +1 -0
  82. package/dist/draft-shape.js +48 -0
  83. package/dist/events.d.ts +37 -0
  84. package/dist/events.d.ts.map +1 -0
  85. package/dist/events.js +32 -0
  86. package/dist/extras/catalog-policy.d.ts +30 -0
  87. package/dist/extras/catalog-policy.d.ts.map +1 -0
  88. package/dist/extras/catalog-policy.js +319 -0
  89. package/dist/extras/content-shape.d.ts +5 -0
  90. package/dist/extras/content-shape.d.ts.map +1 -0
  91. package/dist/extras/content-shape.js +13 -0
  92. package/dist/extras/draft-shape.d.ts +34 -0
  93. package/dist/extras/draft-shape.d.ts.map +1 -0
  94. package/dist/extras/draft-shape.js +69 -0
  95. package/dist/extras/routes.d.ts +380 -0
  96. package/dist/extras/routes.d.ts.map +1 -0
  97. package/dist/extras/routes.js +59 -0
  98. package/dist/extras/schema-sourced-content.d.ts +254 -0
  99. package/dist/extras/schema-sourced-content.d.ts.map +1 -0
  100. package/dist/extras/schema-sourced-content.js +45 -0
  101. package/dist/extras/schema.d.ts +628 -0
  102. package/dist/extras/schema.d.ts.map +1 -0
  103. package/dist/extras/schema.js +87 -0
  104. package/dist/extras/service-catalog-plane.d.ts +77 -0
  105. package/dist/extras/service-catalog-plane.d.ts.map +1 -0
  106. package/dist/extras/service-catalog-plane.js +219 -0
  107. package/dist/extras/service-content-synthesizer.d.ts +41 -0
  108. package/dist/extras/service-content-synthesizer.d.ts.map +1 -0
  109. package/dist/extras/service-content-synthesizer.js +138 -0
  110. package/dist/extras/service-content.d.ts +48 -0
  111. package/dist/extras/service-content.d.ts.map +1 -0
  112. package/dist/extras/service-content.js +253 -0
  113. package/dist/extras/service.d.ts +185 -0
  114. package/dist/extras/service.d.ts.map +1 -0
  115. package/dist/extras/service.js +96 -0
  116. package/dist/extras/validation.d.ts +437 -0
  117. package/dist/extras/validation.d.ts.map +1 -0
  118. package/dist/extras/validation.js +149 -0
  119. package/dist/extras.d.ts +267 -0
  120. package/dist/extras.d.ts.map +1 -0
  121. package/dist/extras.js +19 -0
  122. package/dist/index.d.ts +22 -0
  123. package/dist/index.d.ts.map +1 -0
  124. package/dist/index.js +32 -0
  125. package/dist/interface.d.ts +5869 -0
  126. package/dist/interface.d.ts.map +1 -0
  127. package/dist/interface.js +54 -0
  128. package/dist/public-routes.d.ts +2 -0
  129. package/dist/public-routes.d.ts.map +1 -0
  130. package/dist/public-routes.js +1 -0
  131. package/dist/public-validation.d.ts +2 -0
  132. package/dist/public-validation.d.ts.map +1 -0
  133. package/dist/public-validation.js +1 -0
  134. package/dist/read-model.d.ts +25 -0
  135. package/dist/read-model.d.ts.map +1 -0
  136. package/dist/read-model.js +99 -0
  137. package/dist/route-env.d.ts +22 -0
  138. package/dist/route-env.d.ts.map +1 -0
  139. package/dist/route-env.js +1 -0
  140. package/dist/routes-associations.d.ts +164 -0
  141. package/dist/routes-associations.d.ts.map +1 -0
  142. package/dist/routes-associations.js +100 -0
  143. package/dist/routes-catalog.d.ts +436 -0
  144. package/dist/routes-catalog.d.ts.map +1 -0
  145. package/dist/routes-catalog.js +104 -0
  146. package/dist/routes-configuration.d.ts +773 -0
  147. package/dist/routes-configuration.d.ts.map +1 -0
  148. package/dist/routes-configuration.js +364 -0
  149. package/dist/routes-content.d.ts +74 -0
  150. package/dist/routes-content.d.ts.map +1 -0
  151. package/dist/routes-content.js +117 -0
  152. package/dist/routes-core.d.ts +331 -0
  153. package/dist/routes-core.d.ts.map +1 -0
  154. package/dist/routes-core.js +95 -0
  155. package/dist/routes-itinerary.d.ts +759 -0
  156. package/dist/routes-itinerary.d.ts.map +1 -0
  157. package/dist/routes-itinerary.js +387 -0
  158. package/dist/routes-maintenance.d.ts +32 -0
  159. package/dist/routes-maintenance.d.ts.map +1 -0
  160. package/dist/routes-maintenance.js +14 -0
  161. package/dist/routes-media.d.ts +634 -0
  162. package/dist/routes-media.d.ts.map +1 -0
  163. package/dist/routes-media.js +245 -0
  164. package/dist/routes-merchandising.d.ts +1120 -0
  165. package/dist/routes-merchandising.d.ts.map +1 -0
  166. package/dist/routes-merchandising.js +377 -0
  167. package/dist/routes-options.d.ts +363 -0
  168. package/dist/routes-options.d.ts.map +1 -0
  169. package/dist/routes-options.js +173 -0
  170. package/dist/routes-public.d.ts +776 -0
  171. package/dist/routes-public.d.ts.map +1 -0
  172. package/dist/routes-public.js +119 -0
  173. package/dist/routes-translations.d.ts +489 -0
  174. package/dist/routes-translations.d.ts.map +1 -0
  175. package/dist/routes-translations.js +258 -0
  176. package/dist/routes.d.ts +5097 -0
  177. package/dist/routes.d.ts.map +1 -0
  178. package/dist/routes.js +64 -0
  179. package/dist/schema-core.d.ts +1238 -0
  180. package/dist/schema-core.d.ts.map +1 -0
  181. package/dist/schema-core.js +157 -0
  182. package/dist/schema-itinerary.d.ts +1169 -0
  183. package/dist/schema-itinerary.d.ts.map +1 -0
  184. package/dist/schema-itinerary.js +130 -0
  185. package/dist/schema-relations.d.ts +117 -0
  186. package/dist/schema-relations.d.ts.map +1 -0
  187. package/dist/schema-relations.js +192 -0
  188. package/dist/schema-settings.d.ts +1800 -0
  189. package/dist/schema-settings.d.ts.map +1 -0
  190. package/dist/schema-settings.js +220 -0
  191. package/dist/schema-shared.d.ts +15 -0
  192. package/dist/schema-shared.d.ts.map +1 -0
  193. package/dist/schema-shared.js +91 -0
  194. package/dist/schema-sourced-content.d.ts +262 -0
  195. package/dist/schema-sourced-content.d.ts.map +1 -0
  196. package/dist/schema-sourced-content.js +69 -0
  197. package/dist/schema-taxonomy.d.ts +1363 -0
  198. package/dist/schema-taxonomy.d.ts.map +1 -0
  199. package/dist/schema-taxonomy.js +203 -0
  200. package/dist/schema.d.ts +10 -0
  201. package/dist/schema.d.ts.map +1 -0
  202. package/dist/schema.js +9 -0
  203. package/dist/service-aggregates.d.ts +29 -0
  204. package/dist/service-aggregates.d.ts.map +1 -0
  205. package/dist/service-aggregates.js +56 -0
  206. package/dist/service-catalog-plane-destinations.d.ts +30 -0
  207. package/dist/service-catalog-plane-destinations.d.ts.map +1 -0
  208. package/dist/service-catalog-plane-destinations.js +143 -0
  209. package/dist/service-catalog-plane-taxonomy.d.ts +73 -0
  210. package/dist/service-catalog-plane-taxonomy.d.ts.map +1 -0
  211. package/dist/service-catalog-plane-taxonomy.js +242 -0
  212. package/dist/service-catalog-plane.d.ts +179 -0
  213. package/dist/service-catalog-plane.d.ts.map +1 -0
  214. package/dist/service-catalog-plane.js +431 -0
  215. package/dist/service-catalog.d.ts +251 -0
  216. package/dist/service-catalog.d.ts.map +1 -0
  217. package/dist/service-catalog.js +517 -0
  218. package/dist/service-configuration.d.ts +261 -0
  219. package/dist/service-configuration.d.ts.map +1 -0
  220. package/dist/service-configuration.js +343 -0
  221. package/dist/service-content-owned.d.ts +68 -0
  222. package/dist/service-content-owned.d.ts.map +1 -0
  223. package/dist/service-content-owned.js +329 -0
  224. package/dist/service-content-synthesizer.d.ts +90 -0
  225. package/dist/service-content-synthesizer.d.ts.map +1 -0
  226. package/dist/service-content-synthesizer.js +178 -0
  227. package/dist/service-content.d.ts +106 -0
  228. package/dist/service-content.d.ts.map +1 -0
  229. package/dist/service-content.js +388 -0
  230. package/dist/service-core.d.ts +194 -0
  231. package/dist/service-core.d.ts.map +1 -0
  232. package/dist/service-core.js +213 -0
  233. package/dist/service-delivery-formats.d.ts +58 -0
  234. package/dist/service-delivery-formats.d.ts.map +1 -0
  235. package/dist/service-delivery-formats.js +107 -0
  236. package/dist/service-destinations.d.ts +223 -0
  237. package/dist/service-destinations.d.ts.map +1 -0
  238. package/dist/service-destinations.js +310 -0
  239. package/dist/service-itinerary-history.d.ts +457 -0
  240. package/dist/service-itinerary-history.d.ts.map +1 -0
  241. package/dist/service-itinerary-history.js +135 -0
  242. package/dist/service-itinerary.d.ts +1149 -0
  243. package/dist/service-itinerary.d.ts.map +1 -0
  244. package/dist/service-itinerary.js +419 -0
  245. package/dist/service-media.d.ts +272 -0
  246. package/dist/service-media.d.ts.map +1 -0
  247. package/dist/service-media.js +320 -0
  248. package/dist/service-merchandising.d.ts +184 -0
  249. package/dist/service-merchandising.d.ts.map +1 -0
  250. package/dist/service-merchandising.js +181 -0
  251. package/dist/service-option-translations.d.ts +268 -0
  252. package/dist/service-option-translations.d.ts.map +1 -0
  253. package/dist/service-option-translations.js +300 -0
  254. package/dist/service-options.d.ts +181 -0
  255. package/dist/service-options.d.ts.map +1 -0
  256. package/dist/service-options.js +179 -0
  257. package/dist/service-product-destinations.d.ts +37 -0
  258. package/dist/service-product-destinations.d.ts.map +1 -0
  259. package/dist/service-product-destinations.js +94 -0
  260. package/dist/service-public.d.ts +664 -0
  261. package/dist/service-public.d.ts.map +1 -0
  262. package/dist/service-public.js +374 -0
  263. package/dist/service-taxonomy.d.ts +197 -0
  264. package/dist/service-taxonomy.d.ts.map +1 -0
  265. package/dist/service-taxonomy.js +221 -0
  266. package/dist/service.d.ts +3929 -0
  267. package/dist/service.d.ts.map +1 -0
  268. package/dist/service.js +28 -0
  269. package/dist/tasks/brochure-printers.d.ts +31 -0
  270. package/dist/tasks/brochure-printers.d.ts.map +1 -0
  271. package/dist/tasks/brochure-printers.js +149 -0
  272. package/dist/tasks/brochure-templates.d.ts +36 -0
  273. package/dist/tasks/brochure-templates.d.ts.map +1 -0
  274. package/dist/tasks/brochure-templates.js +110 -0
  275. package/dist/tasks/brochures.d.ts +43 -0
  276. package/dist/tasks/brochures.d.ts.map +1 -0
  277. package/dist/tasks/brochures.js +72 -0
  278. package/dist/tasks/generate-pdf.d.ts +8 -0
  279. package/dist/tasks/generate-pdf.d.ts.map +1 -0
  280. package/dist/tasks/generate-pdf.js +106 -0
  281. package/dist/tasks/index.d.ts +5 -0
  282. package/dist/tasks/index.d.ts.map +1 -0
  283. package/dist/tasks/index.js +4 -0
  284. package/dist/tasks/pdf-text.d.ts +2 -0
  285. package/dist/tasks/pdf-text.d.ts.map +1 -0
  286. package/dist/tasks/pdf-text.js +40 -0
  287. package/dist/tasks.d.ts +2 -0
  288. package/dist/tasks.d.ts.map +1 -0
  289. package/dist/tasks.js +1 -0
  290. package/dist/validation-catalog.d.ts +2 -0
  291. package/dist/validation-catalog.d.ts.map +1 -0
  292. package/dist/validation-catalog.js +3 -0
  293. package/dist/validation-config.d.ts +2 -0
  294. package/dist/validation-config.d.ts.map +1 -0
  295. package/dist/validation-config.js +3 -0
  296. package/dist/validation-content.d.ts +2 -0
  297. package/dist/validation-content.d.ts.map +1 -0
  298. package/dist/validation-content.js +3 -0
  299. package/dist/validation-core.d.ts +2 -0
  300. package/dist/validation-core.d.ts.map +1 -0
  301. package/dist/validation-core.js +3 -0
  302. package/dist/validation-public.d.ts +2 -0
  303. package/dist/validation-public.d.ts.map +1 -0
  304. package/dist/validation-public.js +3 -0
  305. package/dist/validation-shared.d.ts +2 -0
  306. package/dist/validation-shared.d.ts.map +1 -0
  307. package/dist/validation-shared.js +3 -0
  308. package/dist/validation.d.ts +2 -0
  309. package/dist/validation.d.ts.map +1 -0
  310. package/dist/validation.js +3 -0
  311. package/package.json +204 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-itinerary.d.ts","sourceRoot":"","sources":["../src/schema-itinerary.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,130 @@
1
+ import { typeId, typeIdRef } from "@voyant-travel/db/lib/typeid-column";
2
+ import { sql } from "drizzle-orm";
3
+ import { boolean, index, integer, jsonb, pgTable, text, timestamp, uniqueIndex, } from "drizzle-orm/pg-core";
4
+ import { products } from "./schema-core.js";
5
+ import { productMediaTypeEnum, serviceTypeEnum } from "./schema-shared.js";
6
+ export const productItineraries = pgTable("product_itineraries", {
7
+ id: typeId("product_itineraries"),
8
+ productId: typeIdRef("product_id")
9
+ .notNull()
10
+ .references(() => products.id, { onDelete: "cascade" }),
11
+ name: text("name").notNull(),
12
+ isDefault: boolean("is_default").notNull().default(false),
13
+ sortOrder: integer("sort_order").notNull().default(0),
14
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
15
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
16
+ }, (table) => [
17
+ index("idx_product_itineraries_product").on(table.productId),
18
+ index("idx_product_itineraries_product_sort").on(table.productId, table.sortOrder, table.createdAt),
19
+ index("idx_product_itineraries_product_default").on(table.productId, table.isDefault),
20
+ uniqueIndex("uidx_product_itineraries_default")
21
+ .on(table.productId)
22
+ // agent-quality: raw-sql reviewed -- owner: inventory; dynamic SQL interpolation uses Drizzle parameter binding or vetted SQL identifiers.
23
+ .where(sql `${table.isDefault} = true`),
24
+ ]);
25
+ export const productDays = pgTable("product_days", {
26
+ id: typeId("product_days"),
27
+ itineraryId: typeIdRef("itinerary_id")
28
+ .notNull()
29
+ .references(() => productItineraries.id, { onDelete: "cascade" }),
30
+ dayNumber: integer("day_number").notNull(),
31
+ title: text("title"),
32
+ description: text("description"),
33
+ location: text("location"),
34
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
35
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
36
+ }, (table) => [
37
+ index("idx_product_days_itinerary").on(table.itineraryId),
38
+ index("idx_product_days_itinerary_day_number").on(table.itineraryId, table.dayNumber),
39
+ ]);
40
+ export const productDayTranslations = pgTable("product_day_translations", {
41
+ id: typeId("product_day_translations"),
42
+ dayId: typeIdRef("day_id")
43
+ .notNull()
44
+ .references(() => productDays.id, { onDelete: "cascade" }),
45
+ languageTag: text("language_tag").notNull(),
46
+ title: text("title"),
47
+ description: text("description"),
48
+ location: text("location"),
49
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
50
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
51
+ }, (table) => [
52
+ index("idx_product_day_translations_day").on(table.dayId),
53
+ index("idx_product_day_translations_language").on(table.languageTag),
54
+ uniqueIndex("uidx_product_day_translations_day_language").on(table.dayId, table.languageTag),
55
+ ]);
56
+ export const productDayServices = pgTable("product_day_services", {
57
+ id: typeId("product_day_services"),
58
+ dayId: typeIdRef("day_id")
59
+ .notNull()
60
+ .references(() => productDays.id, { onDelete: "cascade" }),
61
+ supplierServiceId: text("supplier_service_id"),
62
+ serviceType: serviceTypeEnum("service_type").notNull(),
63
+ name: text("name").notNull(),
64
+ description: text("description"),
65
+ countryCode: text("country_code"),
66
+ costCurrency: text("cost_currency").notNull(),
67
+ costAmountCents: integer("cost_amount_cents").notNull(),
68
+ quantity: integer("quantity").notNull().default(1),
69
+ sortOrder: integer("sort_order"),
70
+ notes: text("notes"),
71
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
72
+ }, (table) => [
73
+ index("idx_product_day_services_day").on(table.dayId),
74
+ index("idx_product_day_services_day_sort").on(table.dayId, table.sortOrder),
75
+ index("idx_product_day_services_supplier_service").on(table.supplierServiceId),
76
+ ]);
77
+ export const productVersions = pgTable("product_versions", {
78
+ id: typeId("product_versions"),
79
+ productId: typeIdRef("product_id")
80
+ .notNull()
81
+ .references(() => products.id, { onDelete: "cascade" }),
82
+ versionNumber: integer("version_number").notNull(),
83
+ snapshot: jsonb("snapshot").notNull(),
84
+ authorId: text("author_id").notNull(),
85
+ notes: text("notes"),
86
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
87
+ }, (table) => [
88
+ index("idx_product_versions_product").on(table.productId),
89
+ index("idx_product_versions_product_version").on(table.productId, table.versionNumber),
90
+ ]);
91
+ export const productNotes = pgTable("product_notes", {
92
+ id: typeId("product_notes"),
93
+ productId: typeIdRef("product_id")
94
+ .notNull()
95
+ .references(() => products.id, { onDelete: "cascade" }),
96
+ authorId: text("author_id").notNull(),
97
+ content: text("content").notNull(),
98
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
99
+ }, (table) => [
100
+ index("idx_product_notes_product").on(table.productId),
101
+ index("idx_product_notes_product_created").on(table.productId, table.createdAt),
102
+ ]);
103
+ export const productMedia = pgTable("product_media", {
104
+ id: typeId("product_media"),
105
+ productId: typeIdRef("product_id")
106
+ .notNull()
107
+ .references(() => products.id, { onDelete: "cascade" }),
108
+ dayId: typeIdRef("day_id").references(() => productDays.id, { onDelete: "cascade" }),
109
+ mediaType: productMediaTypeEnum("media_type").notNull(),
110
+ name: text("name").notNull(),
111
+ url: text("url").notNull(),
112
+ storageKey: text("storage_key"),
113
+ mimeType: text("mime_type"),
114
+ fileSize: integer("file_size"),
115
+ altText: text("alt_text"),
116
+ sortOrder: integer("sort_order").notNull().default(0),
117
+ isCover: boolean("is_cover").notNull().default(false),
118
+ isBrochure: boolean("is_brochure").notNull().default(false),
119
+ isBrochureCurrent: boolean("is_brochure_current").notNull().default(false),
120
+ brochureVersion: integer("brochure_version"),
121
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
122
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
123
+ }, (table) => [
124
+ index("idx_product_media_product").on(table.productId),
125
+ index("idx_product_media_day").on(table.dayId),
126
+ index("idx_product_media_product_day").on(table.productId, table.dayId),
127
+ index("idx_product_media_product_cover_sort").on(table.productId, table.isCover, table.sortOrder, table.createdAt),
128
+ index("idx_product_media_product_day_cover_sort").on(table.productId, table.dayId, table.isCover, table.sortOrder, table.createdAt),
129
+ index("idx_product_media_product_brochure_current_version").on(table.productId, table.isBrochure, table.dayId, table.isBrochureCurrent, table.brochureVersion, table.updatedAt, table.createdAt),
130
+ ]);
@@ -0,0 +1,117 @@
1
+ export declare const productsRelations: import("drizzle-orm").Relations<"products", {
2
+ productType: import("drizzle-orm").One<"product_types", false>;
3
+ activationSettings: import("drizzle-orm").Many<"product_activation_settings">;
4
+ ticketSettings: import("drizzle-orm").Many<"product_ticket_settings">;
5
+ visibilitySettings: import("drizzle-orm").Many<"product_visibility_settings">;
6
+ capabilities: import("drizzle-orm").Many<"product_capabilities">;
7
+ deliveryFormats: import("drizzle-orm").Many<"product_delivery_formats">;
8
+ features: import("drizzle-orm").Many<"product_features">;
9
+ faqs: import("drizzle-orm").Many<"product_faqs">;
10
+ locations: import("drizzle-orm").Many<"product_locations">;
11
+ options: import("drizzle-orm").Many<"product_options">;
12
+ itineraries: import("drizzle-orm").Many<"product_itineraries">;
13
+ translations: import("drizzle-orm").Many<"product_translations">;
14
+ versions: import("drizzle-orm").Many<"product_versions">;
15
+ notes: import("drizzle-orm").Many<"product_notes">;
16
+ media: import("drizzle-orm").Many<"product_media">;
17
+ categoryLinks: import("drizzle-orm").Many<"product_category_products">;
18
+ destinationLinks: import("drizzle-orm").Many<"product_destinations">;
19
+ tagLinks: import("drizzle-orm").Many<"product_tag_products">;
20
+ }>;
21
+ export declare const productOptionsRelations: import("drizzle-orm").Relations<"product_options", {
22
+ product: import("drizzle-orm").One<"products", true>;
23
+ translations: import("drizzle-orm").Many<"product_option_translations">;
24
+ units: import("drizzle-orm").Many<"option_units">;
25
+ }>;
26
+ export declare const optionUnitsRelations: import("drizzle-orm").Relations<"option_units", {
27
+ option: import("drizzle-orm").One<"product_options", true>;
28
+ translations: import("drizzle-orm").Many<"option_unit_translations">;
29
+ }>;
30
+ export declare const productActivationSettingsRelations: import("drizzle-orm").Relations<"product_activation_settings", {
31
+ product: import("drizzle-orm").One<"products", true>;
32
+ }>;
33
+ export declare const productTicketSettingsRelations: import("drizzle-orm").Relations<"product_ticket_settings", {
34
+ product: import("drizzle-orm").One<"products", true>;
35
+ }>;
36
+ export declare const productVisibilitySettingsRelations: import("drizzle-orm").Relations<"product_visibility_settings", {
37
+ product: import("drizzle-orm").One<"products", true>;
38
+ }>;
39
+ export declare const productCapabilitiesRelations: import("drizzle-orm").Relations<"product_capabilities", {
40
+ product: import("drizzle-orm").One<"products", true>;
41
+ }>;
42
+ export declare const productDeliveryFormatsRelations: import("drizzle-orm").Relations<"product_delivery_formats", {
43
+ product: import("drizzle-orm").One<"products", true>;
44
+ }>;
45
+ export declare const productFeaturesRelations: import("drizzle-orm").Relations<"product_features", {
46
+ product: import("drizzle-orm").One<"products", true>;
47
+ }>;
48
+ export declare const productFaqsRelations: import("drizzle-orm").Relations<"product_faqs", {
49
+ product: import("drizzle-orm").One<"products", true>;
50
+ }>;
51
+ export declare const productLocationsRelations: import("drizzle-orm").Relations<"product_locations", {
52
+ product: import("drizzle-orm").One<"products", true>;
53
+ }>;
54
+ export declare const productTranslationsRelations: import("drizzle-orm").Relations<"product_translations", {
55
+ product: import("drizzle-orm").One<"products", true>;
56
+ }>;
57
+ export declare const productOptionTranslationsRelations: import("drizzle-orm").Relations<"product_option_translations", {
58
+ option: import("drizzle-orm").One<"product_options", true>;
59
+ }>;
60
+ export declare const optionUnitTranslationsRelations: import("drizzle-orm").Relations<"option_unit_translations", {
61
+ unit: import("drizzle-orm").One<"option_units", true>;
62
+ }>;
63
+ export declare const productItinerariesRelations: import("drizzle-orm").Relations<"product_itineraries", {
64
+ product: import("drizzle-orm").One<"products", true>;
65
+ days: import("drizzle-orm").Many<"product_days">;
66
+ }>;
67
+ export declare const productDaysRelations: import("drizzle-orm").Relations<"product_days", {
68
+ itinerary: import("drizzle-orm").One<"product_itineraries", true>;
69
+ services: import("drizzle-orm").Many<"product_day_services">;
70
+ media: import("drizzle-orm").Many<"product_media">;
71
+ }>;
72
+ export declare const productDayServicesRelations: import("drizzle-orm").Relations<"product_day_services", {
73
+ day: import("drizzle-orm").One<"product_days", true>;
74
+ }>;
75
+ export declare const productVersionsRelations: import("drizzle-orm").Relations<"product_versions", {
76
+ product: import("drizzle-orm").One<"products", true>;
77
+ }>;
78
+ export declare const productNotesRelations: import("drizzle-orm").Relations<"product_notes", {
79
+ product: import("drizzle-orm").One<"products", true>;
80
+ }>;
81
+ export declare const productMediaRelations: import("drizzle-orm").Relations<"product_media", {
82
+ product: import("drizzle-orm").One<"products", true>;
83
+ day: import("drizzle-orm").One<"product_days", false>;
84
+ }>;
85
+ export declare const productTypesRelations: import("drizzle-orm").Relations<"product_types", {
86
+ products: import("drizzle-orm").Many<"products">;
87
+ }>;
88
+ export declare const destinationsRelations: import("drizzle-orm").Relations<"destinations", {
89
+ parent: import("drizzle-orm").One<"destinations", false>;
90
+ children: import("drizzle-orm").Many<"destinations">;
91
+ translations: import("drizzle-orm").Many<"destination_translations">;
92
+ productLinks: import("drizzle-orm").Many<"product_destinations">;
93
+ }>;
94
+ export declare const destinationTranslationsRelations: import("drizzle-orm").Relations<"destination_translations", {
95
+ destination: import("drizzle-orm").One<"destinations", true>;
96
+ }>;
97
+ export declare const productCategoriesRelations: import("drizzle-orm").Relations<"product_categories", {
98
+ parent: import("drizzle-orm").One<"product_categories", false>;
99
+ children: import("drizzle-orm").Many<"product_categories">;
100
+ productLinks: import("drizzle-orm").Many<"product_category_products">;
101
+ }>;
102
+ export declare const productTagsRelations: import("drizzle-orm").Relations<"product_tags", {
103
+ productLinks: import("drizzle-orm").Many<"product_tag_products">;
104
+ }>;
105
+ export declare const productCategoryProductsRelations: import("drizzle-orm").Relations<"product_category_products", {
106
+ product: import("drizzle-orm").One<"products", true>;
107
+ category: import("drizzle-orm").One<"product_categories", true>;
108
+ }>;
109
+ export declare const productTagProductsRelations: import("drizzle-orm").Relations<"product_tag_products", {
110
+ product: import("drizzle-orm").One<"products", true>;
111
+ tag: import("drizzle-orm").One<"product_tags", true>;
112
+ }>;
113
+ export declare const productDestinationsRelations: import("drizzle-orm").Relations<"product_destinations", {
114
+ product: import("drizzle-orm").One<"products", true>;
115
+ destination: import("drizzle-orm").One<"destinations", true>;
116
+ }>;
117
+ //# sourceMappingURL=schema-relations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-relations.d.ts","sourceRoot":"","sources":["../src/schema-relations.ts"],"names":[],"mappings":"AAmCA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;EAsB3B,CAAA;AAEH,eAAO,MAAM,uBAAuB;;;;EAIjC,CAAA;AAEH,eAAO,MAAM,oBAAoB;;;EAG9B,CAAA;AAEH,eAAO,MAAM,kCAAkC;;EAQ9C,CAAA;AAED,eAAO,MAAM,8BAA8B;;EAKxC,CAAA;AAEH,eAAO,MAAM,kCAAkC;;EAQ9C,CAAA;AAED,eAAO,MAAM,4BAA4B;;EAKtC,CAAA;AAEH,eAAO,MAAM,+BAA+B;;EAKzC,CAAA;AAEH,eAAO,MAAM,wBAAwB;;EAKlC,CAAA;AAEH,eAAO,MAAM,oBAAoB;;EAK9B,CAAA;AAEH,eAAO,MAAM,yBAAyB;;EAKnC,CAAA;AAEH,eAAO,MAAM,4BAA4B;;EAKtC,CAAA;AAEH,eAAO,MAAM,kCAAkC;;EAQ9C,CAAA;AAED,eAAO,MAAM,+BAA+B;;EAKzC,CAAA;AAEH,eAAO,MAAM,2BAA2B;;;EAMrC,CAAA;AAEH,eAAO,MAAM,oBAAoB;;;;EAO9B,CAAA;AAEH,eAAO,MAAM,2BAA2B;;EAErC,CAAA;AAEH,eAAO,MAAM,wBAAwB;;EAElC,CAAA;AAEH,eAAO,MAAM,qBAAqB;;EAE/B,CAAA;AAEH,eAAO,MAAM,qBAAqB;;;EAG/B,CAAA;AAEH,eAAO,MAAM,qBAAqB;;EAE/B,CAAA;AAEH,eAAO,MAAM,qBAAqB;;;;;EAS/B,CAAA;AAEH,eAAO,MAAM,gCAAgC;;EAK1C,CAAA;AAEH,eAAO,MAAM,0BAA0B;;;;EAQpC,CAAA;AAEH,eAAO,MAAM,oBAAoB;;EAE9B,CAAA;AAEH,eAAO,MAAM,gCAAgC;;;EAS1C,CAAA;AAEH,eAAO,MAAM,2BAA2B;;;EASrC,CAAA;AAEH,eAAO,MAAM,4BAA4B;;;EAStC,CAAA"}
@@ -0,0 +1,192 @@
1
+ import { relations } from "drizzle-orm";
2
+ import { optionUnits, productOptions, products } from "./schema-core.js";
3
+ import { productDayServices, productDays, productItineraries, productMedia, productNotes, productVersions, } from "./schema-itinerary.js";
4
+ import { optionUnitTranslations, productActivationSettings, productCapabilities, productDeliveryFormats, productFaqs, productFeatures, productLocations, productOptionTranslations, productTicketSettings, productTranslations, productVisibilitySettings, } from "./schema-settings.js";
5
+ import { destinations, destinationTranslations, productCategories, productCategoryProducts, productDestinations, productTagProducts, productTags, productTypes, } from "./schema-taxonomy.js";
6
+ export const productsRelations = relations(products, ({ one, many }) => ({
7
+ productType: one(productTypes, {
8
+ fields: [products.productTypeId],
9
+ references: [productTypes.id],
10
+ }),
11
+ activationSettings: many(productActivationSettings),
12
+ ticketSettings: many(productTicketSettings),
13
+ visibilitySettings: many(productVisibilitySettings),
14
+ capabilities: many(productCapabilities),
15
+ deliveryFormats: many(productDeliveryFormats),
16
+ features: many(productFeatures),
17
+ faqs: many(productFaqs),
18
+ locations: many(productLocations),
19
+ options: many(productOptions),
20
+ itineraries: many(productItineraries),
21
+ translations: many(productTranslations),
22
+ versions: many(productVersions),
23
+ notes: many(productNotes),
24
+ media: many(productMedia),
25
+ categoryLinks: many(productCategoryProducts),
26
+ destinationLinks: many(productDestinations),
27
+ tagLinks: many(productTagProducts),
28
+ }));
29
+ export const productOptionsRelations = relations(productOptions, ({ one, many }) => ({
30
+ product: one(products, { fields: [productOptions.productId], references: [products.id] }),
31
+ translations: many(productOptionTranslations),
32
+ units: many(optionUnits),
33
+ }));
34
+ export const optionUnitsRelations = relations(optionUnits, ({ one, many }) => ({
35
+ option: one(productOptions, { fields: [optionUnits.optionId], references: [productOptions.id] }),
36
+ translations: many(optionUnitTranslations),
37
+ }));
38
+ export const productActivationSettingsRelations = relations(productActivationSettings, ({ one }) => ({
39
+ product: one(products, {
40
+ fields: [productActivationSettings.productId],
41
+ references: [products.id],
42
+ }),
43
+ }));
44
+ export const productTicketSettingsRelations = relations(productTicketSettings, ({ one }) => ({
45
+ product: one(products, {
46
+ fields: [productTicketSettings.productId],
47
+ references: [products.id],
48
+ }),
49
+ }));
50
+ export const productVisibilitySettingsRelations = relations(productVisibilitySettings, ({ one }) => ({
51
+ product: one(products, {
52
+ fields: [productVisibilitySettings.productId],
53
+ references: [products.id],
54
+ }),
55
+ }));
56
+ export const productCapabilitiesRelations = relations(productCapabilities, ({ one }) => ({
57
+ product: one(products, {
58
+ fields: [productCapabilities.productId],
59
+ references: [products.id],
60
+ }),
61
+ }));
62
+ export const productDeliveryFormatsRelations = relations(productDeliveryFormats, ({ one }) => ({
63
+ product: one(products, {
64
+ fields: [productDeliveryFormats.productId],
65
+ references: [products.id],
66
+ }),
67
+ }));
68
+ export const productFeaturesRelations = relations(productFeatures, ({ one }) => ({
69
+ product: one(products, {
70
+ fields: [productFeatures.productId],
71
+ references: [products.id],
72
+ }),
73
+ }));
74
+ export const productFaqsRelations = relations(productFaqs, ({ one }) => ({
75
+ product: one(products, {
76
+ fields: [productFaqs.productId],
77
+ references: [products.id],
78
+ }),
79
+ }));
80
+ export const productLocationsRelations = relations(productLocations, ({ one }) => ({
81
+ product: one(products, {
82
+ fields: [productLocations.productId],
83
+ references: [products.id],
84
+ }),
85
+ }));
86
+ export const productTranslationsRelations = relations(productTranslations, ({ one }) => ({
87
+ product: one(products, {
88
+ fields: [productTranslations.productId],
89
+ references: [products.id],
90
+ }),
91
+ }));
92
+ export const productOptionTranslationsRelations = relations(productOptionTranslations, ({ one }) => ({
93
+ option: one(productOptions, {
94
+ fields: [productOptionTranslations.optionId],
95
+ references: [productOptions.id],
96
+ }),
97
+ }));
98
+ export const optionUnitTranslationsRelations = relations(optionUnitTranslations, ({ one }) => ({
99
+ unit: one(optionUnits, {
100
+ fields: [optionUnitTranslations.unitId],
101
+ references: [optionUnits.id],
102
+ }),
103
+ }));
104
+ export const productItinerariesRelations = relations(productItineraries, ({ one, many }) => ({
105
+ product: one(products, {
106
+ fields: [productItineraries.productId],
107
+ references: [products.id],
108
+ }),
109
+ days: many(productDays),
110
+ }));
111
+ export const productDaysRelations = relations(productDays, ({ one, many }) => ({
112
+ itinerary: one(productItineraries, {
113
+ fields: [productDays.itineraryId],
114
+ references: [productItineraries.id],
115
+ }),
116
+ services: many(productDayServices),
117
+ media: many(productMedia),
118
+ }));
119
+ export const productDayServicesRelations = relations(productDayServices, ({ one }) => ({
120
+ day: one(productDays, { fields: [productDayServices.dayId], references: [productDays.id] }),
121
+ }));
122
+ export const productVersionsRelations = relations(productVersions, ({ one }) => ({
123
+ product: one(products, { fields: [productVersions.productId], references: [products.id] }),
124
+ }));
125
+ export const productNotesRelations = relations(productNotes, ({ one }) => ({
126
+ product: one(products, { fields: [productNotes.productId], references: [products.id] }),
127
+ }));
128
+ export const productMediaRelations = relations(productMedia, ({ one }) => ({
129
+ product: one(products, { fields: [productMedia.productId], references: [products.id] }),
130
+ day: one(productDays, { fields: [productMedia.dayId], references: [productDays.id] }),
131
+ }));
132
+ export const productTypesRelations = relations(productTypes, ({ many }) => ({
133
+ products: many(products),
134
+ }));
135
+ export const destinationsRelations = relations(destinations, ({ one, many }) => ({
136
+ parent: one(destinations, {
137
+ fields: [destinations.parentId],
138
+ references: [destinations.id],
139
+ relationName: "destinationParentChild",
140
+ }),
141
+ children: many(destinations, { relationName: "destinationParentChild" }),
142
+ translations: many(destinationTranslations),
143
+ productLinks: many(productDestinations),
144
+ }));
145
+ export const destinationTranslationsRelations = relations(destinationTranslations, ({ one }) => ({
146
+ destination: one(destinations, {
147
+ fields: [destinationTranslations.destinationId],
148
+ references: [destinations.id],
149
+ }),
150
+ }));
151
+ export const productCategoriesRelations = relations(productCategories, ({ one, many }) => ({
152
+ parent: one(productCategories, {
153
+ fields: [productCategories.parentId],
154
+ references: [productCategories.id],
155
+ relationName: "parentChild",
156
+ }),
157
+ children: many(productCategories, { relationName: "parentChild" }),
158
+ productLinks: many(productCategoryProducts),
159
+ }));
160
+ export const productTagsRelations = relations(productTags, ({ many }) => ({
161
+ productLinks: many(productTagProducts),
162
+ }));
163
+ export const productCategoryProductsRelations = relations(productCategoryProducts, ({ one }) => ({
164
+ product: one(products, {
165
+ fields: [productCategoryProducts.productId],
166
+ references: [products.id],
167
+ }),
168
+ category: one(productCategories, {
169
+ fields: [productCategoryProducts.categoryId],
170
+ references: [productCategories.id],
171
+ }),
172
+ }));
173
+ export const productTagProductsRelations = relations(productTagProducts, ({ one }) => ({
174
+ product: one(products, {
175
+ fields: [productTagProducts.productId],
176
+ references: [products.id],
177
+ }),
178
+ tag: one(productTags, {
179
+ fields: [productTagProducts.tagId],
180
+ references: [productTags.id],
181
+ }),
182
+ }));
183
+ export const productDestinationsRelations = relations(productDestinations, ({ one }) => ({
184
+ product: one(products, {
185
+ fields: [productDestinations.productId],
186
+ references: [products.id],
187
+ }),
188
+ destination: one(destinations, {
189
+ fields: [productDestinations.destinationId],
190
+ references: [destinations.id],
191
+ }),
192
+ }));