@voyant-travel/commerce 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 (210) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +145 -0
  3. package/dist/accepted-quote-version-reservation-golden-flow.test.d.ts +2 -0
  4. package/dist/accepted-quote-version-reservation-golden-flow.test.d.ts.map +1 -0
  5. package/dist/accepted-quote-version-reservation-golden-flow.test.js +398 -0
  6. package/dist/index.d.ts +15 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +14 -0
  9. package/dist/interface.d.ts +18 -0
  10. package/dist/interface.d.ts.map +1 -0
  11. package/dist/interface.js +246 -0
  12. package/dist/interface.test.d.ts +2 -0
  13. package/dist/interface.test.d.ts.map +1 -0
  14. package/dist/interface.test.js +357 -0
  15. package/dist/markets/index.d.ts +11 -0
  16. package/dist/markets/index.d.ts.map +1 -0
  17. package/dist/markets/index.js +12 -0
  18. package/dist/markets/routes.d.ts +1182 -0
  19. package/dist/markets/routes.d.ts.map +1 -0
  20. package/dist/markets/routes.js +209 -0
  21. package/dist/markets/schema.d.ts +1527 -0
  22. package/dist/markets/schema.d.ts.map +1 -0
  23. package/dist/markets/schema.js +240 -0
  24. package/dist/markets/service-core.d.ts +253 -0
  25. package/dist/markets/service-core.d.ts.map +1 -0
  26. package/dist/markets/service-core.js +242 -0
  27. package/dist/markets/service-rules.d.ts +191 -0
  28. package/dist/markets/service-rules.d.ts.map +1 -0
  29. package/dist/markets/service-rules.js +155 -0
  30. package/dist/markets/service-shared.d.ts +36 -0
  31. package/dist/markets/service-shared.d.ts.map +1 -0
  32. package/dist/markets/service-shared.js +7 -0
  33. package/dist/markets/service.d.ts +43 -0
  34. package/dist/markets/service.d.ts.map +1 -0
  35. package/dist/markets/service.js +42 -0
  36. package/dist/markets/validation.d.ts +451 -0
  37. package/dist/markets/validation.d.ts.map +1 -0
  38. package/dist/markets/validation.js +160 -0
  39. package/dist/pricing/events.d.ts +53 -0
  40. package/dist/pricing/events.d.ts.map +1 -0
  41. package/dist/pricing/events.js +28 -0
  42. package/dist/pricing/index.d.ts +15 -0
  43. package/dist/pricing/index.d.ts.map +1 -0
  44. package/dist/pricing/index.js +18 -0
  45. package/dist/pricing/routes-core.d.ts +981 -0
  46. package/dist/pricing/routes-core.d.ts.map +1 -0
  47. package/dist/pricing/routes-core.js +102 -0
  48. package/dist/pricing/routes-public.d.ts +136 -0
  49. package/dist/pricing/routes-public.d.ts.map +1 -0
  50. package/dist/pricing/routes-public.js +14 -0
  51. package/dist/pricing/routes-rules.d.ts +1339 -0
  52. package/dist/pricing/routes-rules.d.ts.map +1 -0
  53. package/dist/pricing/routes-rules.js +138 -0
  54. package/dist/pricing/routes-shared.d.ts +14 -0
  55. package/dist/pricing/routes-shared.d.ts.map +1 -0
  56. package/dist/pricing/routes-shared.js +3 -0
  57. package/dist/pricing/routes.d.ts +7 -0
  58. package/dist/pricing/routes.d.ts.map +1 -0
  59. package/dist/pricing/routes.js +6 -0
  60. package/dist/pricing/schema-catalogs.d.ts +467 -0
  61. package/dist/pricing/schema-catalogs.d.ts.map +1 -0
  62. package/dist/pricing/schema-catalogs.js +47 -0
  63. package/dist/pricing/schema-categories.d.ts +497 -0
  64. package/dist/pricing/schema-categories.d.ts.map +1 -0
  65. package/dist/pricing/schema-categories.js +54 -0
  66. package/dist/pricing/schema-departure-overrides.d.ts +228 -0
  67. package/dist/pricing/schema-departure-overrides.d.ts.map +1 -0
  68. package/dist/pricing/schema-departure-overrides.js +36 -0
  69. package/dist/pricing/schema-option-rules.d.ts +1770 -0
  70. package/dist/pricing/schema-option-rules.d.ts.map +1 -0
  71. package/dist/pricing/schema-option-rules.js +181 -0
  72. package/dist/pricing/schema-policies.d.ts +395 -0
  73. package/dist/pricing/schema-policies.d.ts.map +1 -0
  74. package/dist/pricing/schema-policies.js +41 -0
  75. package/dist/pricing/schema-relations.d.ts +59 -0
  76. package/dist/pricing/schema-relations.d.ts.map +1 -0
  77. package/dist/pricing/schema-relations.js +111 -0
  78. package/dist/pricing/schema-shared.d.ts +11 -0
  79. package/dist/pricing/schema-shared.d.ts.map +1 -0
  80. package/dist/pricing/schema-shared.js +67 -0
  81. package/dist/pricing/schema.d.ts +8 -0
  82. package/dist/pricing/schema.d.ts.map +1 -0
  83. package/dist/pricing/schema.js +7 -0
  84. package/dist/pricing/service-catalog-plane-pricing.d.ts +95 -0
  85. package/dist/pricing/service-catalog-plane-pricing.d.ts.map +1 -0
  86. package/dist/pricing/service-catalog-plane-pricing.js +382 -0
  87. package/dist/pricing/service-catalogs.d.ts +139 -0
  88. package/dist/pricing/service-catalogs.d.ts.map +1 -0
  89. package/dist/pricing/service-catalogs.js +89 -0
  90. package/dist/pricing/service-categories.d.ts +147 -0
  91. package/dist/pricing/service-categories.d.ts.map +1 -0
  92. package/dist/pricing/service-categories.js +105 -0
  93. package/dist/pricing/service-departure-overrides.d.ts +67 -0
  94. package/dist/pricing/service-departure-overrides.d.ts.map +1 -0
  95. package/dist/pricing/service-departure-overrides.js +54 -0
  96. package/dist/pricing/service-option-rules.d.ts +321 -0
  97. package/dist/pricing/service-option-rules.d.ts.map +1 -0
  98. package/dist/pricing/service-option-rules.js +340 -0
  99. package/dist/pricing/service-policies.d.ts +123 -0
  100. package/dist/pricing/service-policies.d.ts.map +1 -0
  101. package/dist/pricing/service-policies.js +95 -0
  102. package/dist/pricing/service-public.d.ts +89 -0
  103. package/dist/pricing/service-public.d.ts.map +1 -0
  104. package/dist/pricing/service-public.js +473 -0
  105. package/dist/pricing/service-rule-resolver.d.ts +67 -0
  106. package/dist/pricing/service-rule-resolver.d.ts.map +1 -0
  107. package/dist/pricing/service-rule-resolver.js +204 -0
  108. package/dist/pricing/service-shared.d.ts +53 -0
  109. package/dist/pricing/service-shared.d.ts.map +1 -0
  110. package/dist/pricing/service-shared.js +4 -0
  111. package/dist/pricing/service-transfer-rules.d.ts +211 -0
  112. package/dist/pricing/service-transfer-rules.d.ts.map +1 -0
  113. package/dist/pricing/service-transfer-rules.js +139 -0
  114. package/dist/pricing/service.d.ts +79 -0
  115. package/dist/pricing/service.d.ts.map +1 -0
  116. package/dist/pricing/service.js +78 -0
  117. package/dist/pricing/validation-public.d.ts +412 -0
  118. package/dist/pricing/validation-public.d.ts.map +1 -0
  119. package/dist/pricing/validation-public.js +111 -0
  120. package/dist/pricing/validation-shared.d.ts +71 -0
  121. package/dist/pricing/validation-shared.d.ts.map +1 -0
  122. package/dist/pricing/validation-shared.js +63 -0
  123. package/dist/pricing/validation.d.ts +987 -0
  124. package/dist/pricing/validation.d.ts.map +1 -0
  125. package/dist/pricing/validation.js +307 -0
  126. package/dist/promotions/events.d.ts +38 -0
  127. package/dist/promotions/events.d.ts.map +1 -0
  128. package/dist/promotions/events.js +25 -0
  129. package/dist/promotions/index.d.ts +12 -0
  130. package/dist/promotions/index.d.ts.map +1 -0
  131. package/dist/promotions/index.js +17 -0
  132. package/dist/promotions/routes-shared.d.ts +14 -0
  133. package/dist/promotions/routes-shared.d.ts.map +1 -0
  134. package/dist/promotions/routes-shared.js +3 -0
  135. package/dist/promotions/routes.d.ts +395 -0
  136. package/dist/promotions/routes.d.ts.map +1 -0
  137. package/dist/promotions/routes.js +55 -0
  138. package/dist/promotions/schema.d.ts +675 -0
  139. package/dist/promotions/schema.d.ts.map +1 -0
  140. package/dist/promotions/schema.js +126 -0
  141. package/dist/promotions/service-booking-confirmed.d.ts +77 -0
  142. package/dist/promotions/service-booking-confirmed.d.ts.map +1 -0
  143. package/dist/promotions/service-booking-confirmed.js +134 -0
  144. package/dist/promotions/service-boundary-scheduler.d.ts +85 -0
  145. package/dist/promotions/service-boundary-scheduler.d.ts.map +1 -0
  146. package/dist/promotions/service-boundary-scheduler.js +141 -0
  147. package/dist/promotions/service-catalog-evaluator.d.ts +22 -0
  148. package/dist/promotions/service-catalog-evaluator.d.ts.map +1 -0
  149. package/dist/promotions/service-catalog-evaluator.js +33 -0
  150. package/dist/promotions/service-catalog-plane-promotions.d.ts +73 -0
  151. package/dist/promotions/service-catalog-plane-promotions.d.ts.map +1 -0
  152. package/dist/promotions/service-catalog-plane-promotions.js +118 -0
  153. package/dist/promotions/service-evaluator.d.ts +134 -0
  154. package/dist/promotions/service-evaluator.d.ts.map +1 -0
  155. package/dist/promotions/service-evaluator.js +302 -0
  156. package/dist/promotions/service-storefront.d.ts +147 -0
  157. package/dist/promotions/service-storefront.d.ts.map +1 -0
  158. package/dist/promotions/service-storefront.js +326 -0
  159. package/dist/promotions/service.d.ts +143 -0
  160. package/dist/promotions/service.d.ts.map +1 -0
  161. package/dist/promotions/service.js +359 -0
  162. package/dist/promotions/validation.d.ts +195 -0
  163. package/dist/promotions/validation.d.ts.map +1 -0
  164. package/dist/promotions/validation.js +167 -0
  165. package/dist/promotions/workflow-bulk-reindex.d.ts +36 -0
  166. package/dist/promotions/workflow-bulk-reindex.d.ts.map +1 -0
  167. package/dist/promotions/workflow-bulk-reindex.js +53 -0
  168. package/dist/promotions/workflow-runtime.d.ts +17 -0
  169. package/dist/promotions/workflow-runtime.d.ts.map +1 -0
  170. package/dist/promotions/workflow-runtime.js +9 -0
  171. package/dist/runtime.d.ts +18 -0
  172. package/dist/runtime.d.ts.map +1 -0
  173. package/dist/runtime.js +27 -0
  174. package/dist/runtime.test.d.ts +2 -0
  175. package/dist/runtime.test.d.ts.map +1 -0
  176. package/dist/runtime.test.js +25 -0
  177. package/dist/schema.d.ts +5 -0
  178. package/dist/schema.d.ts.map +1 -0
  179. package/dist/schema.js +4 -0
  180. package/dist/sellability/index.d.ts +13 -0
  181. package/dist/sellability/index.d.ts.map +1 -0
  182. package/dist/sellability/index.js +17 -0
  183. package/dist/sellability/routes.d.ts +2332 -0
  184. package/dist/sellability/routes.d.ts.map +1 -0
  185. package/dist/sellability/routes.js +166 -0
  186. package/dist/sellability/schema.d.ts +1716 -0
  187. package/dist/sellability/schema.d.ts.map +1 -0
  188. package/dist/sellability/schema.js +278 -0
  189. package/dist/sellability/service-records.d.ts +316 -0
  190. package/dist/sellability/service-records.d.ts.map +1 -0
  191. package/dist/sellability/service-records.js +253 -0
  192. package/dist/sellability/service-resolve.d.ts +72 -0
  193. package/dist/sellability/service-resolve.d.ts.map +1 -0
  194. package/dist/sellability/service-resolve.js +580 -0
  195. package/dist/sellability/service-shared.d.ts +124 -0
  196. package/dist/sellability/service-shared.d.ts.map +1 -0
  197. package/dist/sellability/service-shared.js +96 -0
  198. package/dist/sellability/service-snapshots.d.ts +191 -0
  199. package/dist/sellability/service-snapshots.d.ts.map +1 -0
  200. package/dist/sellability/service-snapshots.js +153 -0
  201. package/dist/sellability/service.d.ts +1038 -0
  202. package/dist/sellability/service.d.ts.map +1 -0
  203. package/dist/sellability/service.js +17 -0
  204. package/dist/sellability/validation.d.ts +477 -0
  205. package/dist/sellability/validation.d.ts.map +1 -0
  206. package/dist/sellability/validation.js +192 -0
  207. package/dist/types.d.ts +239 -0
  208. package/dist/types.d.ts.map +1 -0
  209. package/dist/types.js +1 -0
  210. package/package.json +62 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routes-core.d.ts","sourceRoot":"","sources":["../../src/pricing/routes-core.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,GAAG,EAAY,MAAM,oBAAoB,CAAA;AAuBvD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BAqN1B,CAAA"}
@@ -0,0 +1,102 @@
1
+ import { parseJsonBody, parseQuery } from "@voyant-travel/hono";
2
+ import { Hono } from "hono";
3
+ import { notFound } from "./routes-shared.js";
4
+ import { pricingService } from "./service.js";
5
+ import { cancellationPolicyListQuerySchema, cancellationPolicyRuleListQuerySchema, insertCancellationPolicyRuleSchema, insertCancellationPolicySchema, insertPriceCatalogSchema, insertPriceScheduleSchema, insertPricingCategoryDependencySchema, insertPricingCategorySchema, priceCatalogListQuerySchema, priceScheduleListQuerySchema, pricingCategoryDependencyListQuerySchema, pricingCategoryListQuerySchema, updateCancellationPolicyRuleSchema, updateCancellationPolicySchema, updatePriceCatalogSchema, updatePriceScheduleSchema, updatePricingCategoryDependencySchema, updatePricingCategorySchema, } from "./validation.js";
6
+ export const pricingCoreRoutes = new Hono()
7
+ .get("/pricing-categories", async (c) => c.json(await pricingService.listPricingCategories(c.get("db"), await parseQuery(c, pricingCategoryListQuerySchema))))
8
+ .post("/pricing-categories", async (c) => c.json({
9
+ data: await pricingService.createPricingCategory(c.get("db"), await parseJsonBody(c, insertPricingCategorySchema)),
10
+ }, 201))
11
+ .get("/pricing-categories/:id", async (c) => {
12
+ const row = await pricingService.getPricingCategoryById(c.get("db"), c.req.param("id"));
13
+ return row ? c.json({ data: row }) : notFound(c, "Pricing category not found");
14
+ })
15
+ .patch("/pricing-categories/:id", async (c) => {
16
+ const row = await pricingService.updatePricingCategory(c.get("db"), c.req.param("id"), await parseJsonBody(c, updatePricingCategorySchema));
17
+ return row ? c.json({ data: row }) : notFound(c, "Pricing category not found");
18
+ })
19
+ .delete("/pricing-categories/:id", async (c) => {
20
+ const row = await pricingService.deletePricingCategory(c.get("db"), c.req.param("id"));
21
+ return row ? c.json({ success: true }) : notFound(c, "Pricing category not found");
22
+ })
23
+ .get("/pricing-category-dependencies", async (c) => c.json(await pricingService.listPricingCategoryDependencies(c.get("db"), await parseQuery(c, pricingCategoryDependencyListQuerySchema))))
24
+ .post("/pricing-category-dependencies", async (c) => c.json({
25
+ data: await pricingService.createPricingCategoryDependency(c.get("db"), await parseJsonBody(c, insertPricingCategoryDependencySchema)),
26
+ }, 201))
27
+ .get("/pricing-category-dependencies/:id", async (c) => {
28
+ const row = await pricingService.getPricingCategoryDependencyById(c.get("db"), c.req.param("id"));
29
+ return row ? c.json({ data: row }) : notFound(c, "Pricing category dependency not found");
30
+ })
31
+ .patch("/pricing-category-dependencies/:id", async (c) => {
32
+ const row = await pricingService.updatePricingCategoryDependency(c.get("db"), c.req.param("id"), await parseJsonBody(c, updatePricingCategoryDependencySchema));
33
+ return row ? c.json({ data: row }) : notFound(c, "Pricing category dependency not found");
34
+ })
35
+ .delete("/pricing-category-dependencies/:id", async (c) => {
36
+ const row = await pricingService.deletePricingCategoryDependency(c.get("db"), c.req.param("id"));
37
+ return row ? c.json({ success: true }) : notFound(c, "Pricing category dependency not found");
38
+ })
39
+ .get("/cancellation-policies", async (c) => c.json(await pricingService.listCancellationPolicies(c.get("db"), await parseQuery(c, cancellationPolicyListQuerySchema))))
40
+ .post("/cancellation-policies", async (c) => c.json({
41
+ data: await pricingService.createCancellationPolicy(c.get("db"), await parseJsonBody(c, insertCancellationPolicySchema)),
42
+ }, 201))
43
+ .get("/cancellation-policies/:id", async (c) => {
44
+ const row = await pricingService.getCancellationPolicyById(c.get("db"), c.req.param("id"));
45
+ return row ? c.json({ data: row }) : notFound(c, "Cancellation policy not found");
46
+ })
47
+ .patch("/cancellation-policies/:id", async (c) => {
48
+ const row = await pricingService.updateCancellationPolicy(c.get("db"), c.req.param("id"), await parseJsonBody(c, updateCancellationPolicySchema));
49
+ return row ? c.json({ data: row }) : notFound(c, "Cancellation policy not found");
50
+ })
51
+ .delete("/cancellation-policies/:id", async (c) => {
52
+ const row = await pricingService.deleteCancellationPolicy(c.get("db"), c.req.param("id"));
53
+ return row ? c.json({ success: true }) : notFound(c, "Cancellation policy not found");
54
+ })
55
+ .get("/cancellation-policy-rules", async (c) => c.json(await pricingService.listCancellationPolicyRules(c.get("db"), await parseQuery(c, cancellationPolicyRuleListQuerySchema))))
56
+ .post("/cancellation-policy-rules", async (c) => c.json({
57
+ data: await pricingService.createCancellationPolicyRule(c.get("db"), await parseJsonBody(c, insertCancellationPolicyRuleSchema)),
58
+ }, 201))
59
+ .get("/cancellation-policy-rules/:id", async (c) => {
60
+ const row = await pricingService.getCancellationPolicyRuleById(c.get("db"), c.req.param("id"));
61
+ return row ? c.json({ data: row }) : notFound(c, "Cancellation policy rule not found");
62
+ })
63
+ .patch("/cancellation-policy-rules/:id", async (c) => {
64
+ const row = await pricingService.updateCancellationPolicyRule(c.get("db"), c.req.param("id"), await parseJsonBody(c, updateCancellationPolicyRuleSchema));
65
+ return row ? c.json({ data: row }) : notFound(c, "Cancellation policy rule not found");
66
+ })
67
+ .delete("/cancellation-policy-rules/:id", async (c) => {
68
+ const row = await pricingService.deleteCancellationPolicyRule(c.get("db"), c.req.param("id"));
69
+ return row ? c.json({ success: true }) : notFound(c, "Cancellation policy rule not found");
70
+ })
71
+ .get("/price-catalogs", async (c) => c.json(await pricingService.listPriceCatalogs(c.get("db"), await parseQuery(c, priceCatalogListQuerySchema))))
72
+ .post("/price-catalogs", async (c) => c.json({
73
+ data: await pricingService.createPriceCatalog(c.get("db"), await parseJsonBody(c, insertPriceCatalogSchema)),
74
+ }, 201))
75
+ .get("/price-catalogs/:id", async (c) => {
76
+ const row = await pricingService.getPriceCatalogById(c.get("db"), c.req.param("id"));
77
+ return row ? c.json({ data: row }) : notFound(c, "Price catalog not found");
78
+ })
79
+ .patch("/price-catalogs/:id", async (c) => {
80
+ const row = await pricingService.updatePriceCatalog(c.get("db"), c.req.param("id"), await parseJsonBody(c, updatePriceCatalogSchema));
81
+ return row ? c.json({ data: row }) : notFound(c, "Price catalog not found");
82
+ })
83
+ .delete("/price-catalogs/:id", async (c) => {
84
+ const row = await pricingService.deletePriceCatalog(c.get("db"), c.req.param("id"));
85
+ return row ? c.json({ success: true }) : notFound(c, "Price catalog not found");
86
+ })
87
+ .get("/price-schedules", async (c) => c.json(await pricingService.listPriceSchedules(c.get("db"), await parseQuery(c, priceScheduleListQuerySchema))))
88
+ .post("/price-schedules", async (c) => c.json({
89
+ data: await pricingService.createPriceSchedule(c.get("db"), await parseJsonBody(c, insertPriceScheduleSchema)),
90
+ }, 201))
91
+ .get("/price-schedules/:id", async (c) => {
92
+ const row = await pricingService.getPriceScheduleById(c.get("db"), c.req.param("id"));
93
+ return row ? c.json({ data: row }) : notFound(c, "Price schedule not found");
94
+ })
95
+ .patch("/price-schedules/:id", async (c) => {
96
+ const row = await pricingService.updatePriceSchedule(c.get("db"), c.req.param("id"), await parseJsonBody(c, updatePriceScheduleSchema));
97
+ return row ? c.json({ data: row }) : notFound(c, "Price schedule not found");
98
+ })
99
+ .delete("/price-schedules/:id", async (c) => {
100
+ const row = await pricingService.deletePriceSchedule(c.get("db"), c.req.param("id"));
101
+ return row ? c.json({ success: true }) : notFound(c, "Price schedule not found");
102
+ });
@@ -0,0 +1,136 @@
1
+ import { type Env } from "./routes-shared.js";
2
+ export declare const publicPricingRoutes: import("hono/hono-base").HonoBase<Env, {
3
+ "/products/:productId/pricing": {
4
+ $get: {
5
+ input: {
6
+ param: {
7
+ productId: string;
8
+ };
9
+ };
10
+ output: {
11
+ error: string;
12
+ };
13
+ outputFormat: "json";
14
+ status: 404;
15
+ } | {
16
+ input: {
17
+ param: {
18
+ productId: string;
19
+ };
20
+ };
21
+ output: {
22
+ data: {
23
+ productId: string;
24
+ catalog: {
25
+ currencyCode: string;
26
+ id: string;
27
+ code: string;
28
+ name: string;
29
+ };
30
+ options: {
31
+ id: string;
32
+ name: string;
33
+ description: string | null;
34
+ status: string;
35
+ isDefault: boolean;
36
+ bookingMode: string;
37
+ capacityMode: string;
38
+ pricingRules: {
39
+ id: string;
40
+ name: string;
41
+ description: string | null;
42
+ pricingMode: "on_request" | "per_person" | "per_booking" | "starting_from" | "free";
43
+ baseSellAmountCents: number | null;
44
+ minPerBooking: number | null;
45
+ maxPerBooking: number | null;
46
+ isDefault: boolean;
47
+ cancellationPolicyId: string | null;
48
+ unitPrices: {
49
+ id: string;
50
+ unitId: string;
51
+ unitName: string;
52
+ unitType: string;
53
+ pricingMode: "on_request" | "per_person" | "per_booking" | "free" | "per_unit" | "included";
54
+ sellAmountCents: number | null;
55
+ minQuantity: number | null;
56
+ maxQuantity: number | null;
57
+ pricingCategoryId: string | null;
58
+ sortOrder: number;
59
+ tiers: {
60
+ id: string;
61
+ minQuantity: number;
62
+ maxQuantity: number | null;
63
+ sellAmountCents: number | null;
64
+ sortOrder: number;
65
+ }[];
66
+ }[];
67
+ startTimeAdjustments: {
68
+ id: string;
69
+ startTimeId: string;
70
+ label: string | null;
71
+ startTimeLocal: string;
72
+ ruleMode: string;
73
+ adjustmentType: string | null;
74
+ sellAdjustmentCents: number | null;
75
+ adjustmentBasisPoints: number | null;
76
+ }[];
77
+ }[];
78
+ }[];
79
+ };
80
+ };
81
+ outputFormat: "json";
82
+ status: import("hono/utils/http-status").ContentfulStatusCode;
83
+ };
84
+ };
85
+ } & {
86
+ "/products/:productId/availability": {
87
+ $get: {
88
+ input: {
89
+ param: {
90
+ productId: string;
91
+ };
92
+ };
93
+ output: {
94
+ error: string;
95
+ };
96
+ outputFormat: "json";
97
+ status: 404;
98
+ } | {
99
+ input: {
100
+ param: {
101
+ productId: string;
102
+ };
103
+ };
104
+ output: {
105
+ productId: string;
106
+ slots: {
107
+ id: string;
108
+ optionId: string | null;
109
+ dateLocal: string | null;
110
+ startsAt: string | null;
111
+ endsAt: string | null;
112
+ timezone: string;
113
+ status: string;
114
+ unlimited: boolean;
115
+ remainingPax: number | null;
116
+ remainingResources: number | null;
117
+ pastCutoff: boolean;
118
+ tooEarly: boolean;
119
+ startTime: {
120
+ id: string;
121
+ label: string | null;
122
+ startTimeLocal: string;
123
+ durationMinutes: number | null;
124
+ } | null;
125
+ }[];
126
+ total: number;
127
+ limit: number;
128
+ offset: number;
129
+ };
130
+ outputFormat: "json";
131
+ status: import("hono/utils/http-status").ContentfulStatusCode;
132
+ };
133
+ };
134
+ }, "/", "/products/:productId/availability">;
135
+ export type PublicPricingRoutes = typeof publicPricingRoutes;
136
+ //# sourceMappingURL=routes-public.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routes-public.d.ts","sourceRoot":"","sources":["../../src/pricing/routes-public.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,GAAG,EAAY,MAAM,oBAAoB,CAAA;AAOvD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4CAkB5B,CAAA;AAEJ,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAA"}
@@ -0,0 +1,14 @@
1
+ import { parseQuery } from "@voyant-travel/hono";
2
+ import { Hono } from "hono";
3
+ import { notFound } from "./routes-shared.js";
4
+ import { publicPricingService } from "./service-public.js";
5
+ import { publicAvailabilitySnapshotQuerySchema, publicProductPricingQuerySchema, } from "./validation-public.js";
6
+ export const publicPricingRoutes = new Hono()
7
+ .get("/products/:productId/pricing", async (c) => {
8
+ const snapshot = await publicPricingService.getProductPricingSnapshot(c.get("db"), c.req.param("productId"), parseQuery(c, publicProductPricingQuerySchema));
9
+ return snapshot ? c.json({ data: snapshot }) : notFound(c, "Public pricing snapshot not found");
10
+ })
11
+ .get("/products/:productId/availability", async (c) => {
12
+ const snapshot = await publicPricingService.getAvailabilitySnapshot(c.get("db"), c.req.param("productId"), parseQuery(c, publicAvailabilitySnapshotQuerySchema));
13
+ return snapshot ? c.json(snapshot) : notFound(c, "Public availability snapshot not found");
14
+ });