@voyant-travel/mice 0.1.0 → 0.2.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.
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for describing the origin of the Work and
141
+ reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may accept and charge a
167
+ fee for, the acceptance of support, warranty, indemnity, or
168
+ other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 PixelMakers Studio SRL
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/dist/routes.d.ts CHANGED
@@ -15,26 +15,26 @@ export declare const miceAdminRoutes: import("hono/hono-base").HonoBase<Env, {
15
15
  input: {};
16
16
  output: {
17
17
  data: {
18
- status: "lead" | "planning" | "contracted" | "operating" | "completed" | "cancelled";
19
- type: "meeting" | "incentive" | "conference" | "exhibition" | "other";
20
- organizationId: string | null;
18
+ currency: string | null;
21
19
  metadata: {
22
20
  [x: string]: import("hono/utils/types").JSONValue;
23
21
  } | null;
24
- code: string | null;
22
+ status: "completed" | "cancelled" | "lead" | "planning" | "contracted" | "operating";
23
+ type: "other" | "meeting" | "incentive" | "conference" | "exhibition";
25
24
  id: string;
26
25
  name: string;
26
+ createdAt: string;
27
+ code: string | null;
28
+ updatedAt: string;
29
+ organizationId: string | null;
30
+ startDate: string | null;
31
+ endDate: string | null;
27
32
  primaryContactPersonId: string | null;
28
33
  accountManagerId: string | null;
29
34
  destination: string | null;
30
- startDate: string | null;
31
- endDate: string | null;
32
35
  estimatedPax: number | null;
33
36
  confirmedPax: number | null;
34
- currency: string | null;
35
37
  budgetAmountCents: number | null;
36
- createdAt: string;
37
- updatedAt: string;
38
38
  }[];
39
39
  limit: number;
40
40
  offset: number;
@@ -49,26 +49,26 @@ export declare const miceAdminRoutes: import("hono/hono-base").HonoBase<Env, {
49
49
  input: {};
50
50
  output: {
51
51
  data: {
52
- status: "lead" | "planning" | "contracted" | "operating" | "completed" | "cancelled";
53
- type: "meeting" | "incentive" | "conference" | "exhibition" | "other";
54
- organizationId: string | null;
52
+ currency: string | null;
55
53
  metadata: {
56
54
  [x: string]: import("hono/utils/types").JSONValue;
57
55
  } | null;
58
- code: string | null;
56
+ status: "completed" | "cancelled" | "lead" | "planning" | "contracted" | "operating";
57
+ type: "other" | "meeting" | "incentive" | "conference" | "exhibition";
59
58
  id: string;
60
59
  name: string;
60
+ createdAt: string;
61
+ code: string | null;
62
+ updatedAt: string;
63
+ organizationId: string | null;
64
+ startDate: string | null;
65
+ endDate: string | null;
61
66
  primaryContactPersonId: string | null;
62
67
  accountManagerId: string | null;
63
68
  destination: string | null;
64
- startDate: string | null;
65
- endDate: string | null;
66
69
  estimatedPax: number | null;
67
70
  confirmedPax: number | null;
68
- currency: string | null;
69
71
  budgetAmountCents: number | null;
70
- createdAt: string;
71
- updatedAt: string;
72
72
  };
73
73
  };
74
74
  outputFormat: "json";
@@ -96,26 +96,26 @@ export declare const miceAdminRoutes: import("hono/hono-base").HonoBase<Env, {
96
96
  };
97
97
  output: {
98
98
  data: {
99
- status: "lead" | "planning" | "contracted" | "operating" | "completed" | "cancelled";
100
- type: "meeting" | "incentive" | "conference" | "exhibition" | "other";
101
- organizationId: string | null;
99
+ currency: string | null;
102
100
  metadata: {
103
101
  [x: string]: import("hono/utils/types").JSONValue;
104
102
  } | null;
105
- code: string | null;
103
+ status: "completed" | "cancelled" | "lead" | "planning" | "contracted" | "operating";
104
+ type: "other" | "meeting" | "incentive" | "conference" | "exhibition";
106
105
  id: string;
107
106
  name: string;
107
+ createdAt: string;
108
+ code: string | null;
109
+ updatedAt: string;
110
+ organizationId: string | null;
111
+ startDate: string | null;
112
+ endDate: string | null;
108
113
  primaryContactPersonId: string | null;
109
114
  accountManagerId: string | null;
110
115
  destination: string | null;
111
- startDate: string | null;
112
- endDate: string | null;
113
116
  estimatedPax: number | null;
114
117
  confirmedPax: number | null;
115
- currency: string | null;
116
118
  budgetAmountCents: number | null;
117
- createdAt: string;
118
- updatedAt: string;
119
119
  };
120
120
  };
121
121
  outputFormat: "json";
@@ -143,26 +143,26 @@ export declare const miceAdminRoutes: import("hono/hono-base").HonoBase<Env, {
143
143
  };
144
144
  output: {
145
145
  data: {
146
- status: "lead" | "planning" | "contracted" | "operating" | "completed" | "cancelled";
147
- type: "meeting" | "incentive" | "conference" | "exhibition" | "other";
148
- organizationId: string | null;
146
+ currency: string | null;
149
147
  metadata: {
150
148
  [x: string]: import("hono/utils/types").JSONValue;
151
149
  } | null;
152
- code: string | null;
150
+ status: "completed" | "cancelled" | "lead" | "planning" | "contracted" | "operating";
151
+ type: "other" | "meeting" | "incentive" | "conference" | "exhibition";
153
152
  id: string;
154
153
  name: string;
154
+ createdAt: string;
155
+ code: string | null;
156
+ updatedAt: string;
157
+ organizationId: string | null;
158
+ startDate: string | null;
159
+ endDate: string | null;
155
160
  primaryContactPersonId: string | null;
156
161
  accountManagerId: string | null;
157
162
  destination: string | null;
158
- startDate: string | null;
159
- endDate: string | null;
160
163
  estimatedPax: number | null;
161
164
  confirmedPax: number | null;
162
- currency: string | null;
163
165
  budgetAmountCents: number | null;
164
- createdAt: string;
165
- updatedAt: string;
166
166
  };
167
167
  };
168
168
  outputFormat: "json";
@@ -179,19 +179,19 @@ export declare const miceAdminRoutes: import("hono/hono-base").HonoBase<Env, {
179
179
  [x: string]: import("hono/utils/types").JSONValue;
180
180
  } | null;
181
181
  id: string;
182
- title: string;
183
182
  createdAt: string;
184
183
  updatedAt: string;
184
+ notes: string | null;
185
+ capacity: number | null;
185
186
  programId: string;
186
- sessionType: "keynote" | "breakout" | "meal" | "networking" | "gala" | "excursion" | "free";
187
187
  functionSpaceId: string | null;
188
+ title: string;
189
+ sessionType: "keynote" | "breakout" | "meal" | "networking" | "gala" | "excursion" | "free";
188
190
  dayDate: string | null;
189
191
  startsAt: string | null;
190
192
  endsAt: string | null;
191
193
  track: string | null;
192
- capacity: number | null;
193
194
  requiresRegistration: boolean;
194
- notes: string | null;
195
195
  }[];
196
196
  limit: number;
197
197
  offset: number;
@@ -203,6 +203,13 @@ export declare const miceAdminRoutes: import("hono/hono-base").HonoBase<Env, {
203
203
  } & {
204
204
  "/sessions": {
205
205
  $post: {
206
+ input: {};
207
+ output: {
208
+ error: string;
209
+ };
210
+ outputFormat: "json";
211
+ status: 404;
212
+ } | {
206
213
  input: {};
207
214
  output: {
208
215
  data: {
@@ -210,19 +217,19 @@ export declare const miceAdminRoutes: import("hono/hono-base").HonoBase<Env, {
210
217
  [x: string]: import("hono/utils/types").JSONValue;
211
218
  } | null;
212
219
  id: string;
213
- title: string;
214
220
  createdAt: string;
215
221
  updatedAt: string;
222
+ notes: string | null;
223
+ capacity: number | null;
216
224
  programId: string;
217
- sessionType: "keynote" | "breakout" | "meal" | "networking" | "gala" | "excursion" | "free";
218
225
  functionSpaceId: string | null;
226
+ title: string;
227
+ sessionType: "keynote" | "breakout" | "meal" | "networking" | "gala" | "excursion" | "free";
219
228
  dayDate: string | null;
220
229
  startsAt: string | null;
221
230
  endsAt: string | null;
222
231
  track: string | null;
223
- capacity: number | null;
224
232
  requiresRegistration: boolean;
225
- notes: string | null;
226
233
  };
227
234
  };
228
235
  outputFormat: "json";
@@ -254,29 +261,29 @@ export declare const miceAdminRoutes: import("hono/hono-base").HonoBase<Env, {
254
261
  [x: string]: import("hono/utils/types").JSONValue;
255
262
  } | null;
256
263
  id: string;
257
- title: string;
258
264
  createdAt: string;
259
265
  updatedAt: string;
266
+ notes: string | null;
267
+ capacity: number | null;
260
268
  programId: string;
261
- sessionType: "keynote" | "breakout" | "meal" | "networking" | "gala" | "excursion" | "free";
262
269
  functionSpaceId: string | null;
270
+ title: string;
271
+ sessionType: "keynote" | "breakout" | "meal" | "networking" | "gala" | "excursion" | "free";
263
272
  dayDate: string | null;
264
273
  startsAt: string | null;
265
274
  endsAt: string | null;
266
275
  track: string | null;
267
- capacity: number | null;
268
276
  requiresRegistration: boolean;
269
- notes: string | null;
270
277
  inclusions: {
271
- id: string;
272
- description: string | null;
273
278
  currency: string | null;
279
+ id: string;
274
280
  createdAt: string;
281
+ description: string | null;
275
282
  updatedAt: string;
283
+ sessionId: string;
276
284
  kind: "other" | "fnb" | "av" | "materials" | "signage";
277
285
  quantity: number;
278
286
  costAmountCents: number | null;
279
- sessionId: string;
280
287
  }[];
281
288
  };
282
289
  };
@@ -309,19 +316,19 @@ export declare const miceAdminRoutes: import("hono/hono-base").HonoBase<Env, {
309
316
  [x: string]: import("hono/utils/types").JSONValue;
310
317
  } | null;
311
318
  id: string;
312
- title: string;
313
319
  createdAt: string;
314
320
  updatedAt: string;
321
+ notes: string | null;
322
+ capacity: number | null;
315
323
  programId: string;
316
- sessionType: "keynote" | "breakout" | "meal" | "networking" | "gala" | "excursion" | "free";
317
324
  functionSpaceId: string | null;
325
+ title: string;
326
+ sessionType: "keynote" | "breakout" | "meal" | "networking" | "gala" | "excursion" | "free";
318
327
  dayDate: string | null;
319
328
  startsAt: string | null;
320
329
  endsAt: string | null;
321
330
  track: string | null;
322
- capacity: number | null;
323
331
  requiresRegistration: boolean;
324
- notes: string | null;
325
332
  };
326
333
  };
327
334
  outputFormat: "json";
@@ -375,15 +382,15 @@ export declare const miceAdminRoutes: import("hono/hono-base").HonoBase<Env, {
375
382
  };
376
383
  output: {
377
384
  data: {
378
- id: string;
379
- description: string | null;
380
385
  currency: string | null;
386
+ id: string;
381
387
  createdAt: string;
388
+ description: string | null;
382
389
  updatedAt: string;
390
+ sessionId: string;
383
391
  kind: "other" | "fnb" | "av" | "materials" | "signage";
384
392
  quantity: number;
385
393
  costAmountCents: number | null;
386
- sessionId: string;
387
394
  }[];
388
395
  };
389
396
  outputFormat: "json";
@@ -1 +1 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAoBjE,KAAK,GAAG,GAAG;IACT,SAAS,EAAE;QACT,EAAE,EAAE,kBAAkB,CAAA;QACtB,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;CACF,CAAA;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;mCAqDxB,CAAA;AAEJ,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAA"}
package/dist/routes.js CHANGED
@@ -37,7 +37,10 @@ export const miceAdminRoutes = new Hono()
37
37
  })
38
38
  .post("/sessions", async (c) => {
39
39
  const body = await parseJsonBody(c, createSessionSchema);
40
- return c.json({ data: await createSession(c.get("db"), body) }, 201);
40
+ const outcome = await createSession(c.get("db"), body);
41
+ if (outcome.status === "program_not_found")
42
+ return c.json({ error: "Program not found" }, 404);
43
+ return c.json({ data: outcome.session }, 201);
41
44
  })
42
45
  .get("/sessions/:id", async (c) => {
43
46
  const session = await getSession(c.get("db"), c.req.param("id"));
package/dist/schema.d.ts CHANGED
@@ -120,7 +120,7 @@ export declare const programs: import("drizzle-orm/pg-core").PgTableWithColumns<
120
120
  tableName: "mice_programs";
121
121
  dataType: "string";
122
122
  columnType: "PgEnumColumn";
123
- data: "meeting" | "incentive" | "conference" | "exhibition" | "other";
123
+ data: "other" | "meeting" | "incentive" | "conference" | "exhibition";
124
124
  driverParam: string;
125
125
  notNull: true;
126
126
  hasDefault: true;
@@ -137,7 +137,7 @@ export declare const programs: import("drizzle-orm/pg-core").PgTableWithColumns<
137
137
  tableName: "mice_programs";
138
138
  dataType: "string";
139
139
  columnType: "PgEnumColumn";
140
- data: "lead" | "planning" | "contracted" | "operating" | "completed" | "cancelled";
140
+ data: "completed" | "cancelled" | "lead" | "planning" | "contracted" | "operating";
141
141
  driverParam: string;
142
142
  notNull: true;
143
143
  hasDefault: true;
@@ -1,7 +1,13 @@
1
1
  import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
2
2
  import { type ProgramSession, type SessionInclusion } from "./schema-sessions.js";
3
3
  import type { CreateSessionBody, SessionInclusionInput, SessionListQuery, UpdateSessionBody } from "./validation-sessions.js";
4
- export declare function createSession(db: PostgresJsDatabase, input: CreateSessionBody): Promise<ProgramSession>;
4
+ export type CreateSessionOutcome = {
5
+ status: "ok";
6
+ session: ProgramSession;
7
+ } | {
8
+ status: "program_not_found";
9
+ };
10
+ export declare function createSession(db: PostgresJsDatabase, input: CreateSessionBody): Promise<CreateSessionOutcome>;
5
11
  export declare function getSession(db: PostgresJsDatabase, id: string): Promise<(ProgramSession & {
6
12
  inclusions: SessionInclusion[];
7
13
  }) | null>;
@@ -1 +1 @@
1
- {"version":3,"file":"service-sessions.d.ts","sourceRoot":"","sources":["../src/service-sessions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAEjE,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,gBAAgB,EAEtB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,0BAA0B,CAAA;AAYjC,wBAAsB,aAAa,CACjC,EAAE,EAAE,kBAAkB,EACtB,KAAK,EAAE,iBAAiB,GACvB,OAAO,CAAC,cAAc,CAAC,CAIzB;AAED,wBAAsB,UAAU,CAC9B,EAAE,EAAE,kBAAkB,EACtB,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,CAAC,cAAc,GAAG;IAAE,UAAU,EAAE,gBAAgB,EAAE,CAAA;CAAE,CAAC,GAAG,IAAI,CAAC,CAYvE;AAED,wBAAsB,YAAY,CAChC,EAAE,EAAE,kBAAkB,EACtB,KAAK,EAAE,gBAAgB,GACtB,OAAO,CAAC;IAAE,IAAI,EAAE,cAAc,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAWpE;AAED,wBAAsB,aAAa,CACjC,EAAE,EAAE,kBAAkB,EACtB,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,iBAAiB,GACvB,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAOhC;AAED,wBAAsB,aAAa,CAAC,EAAE,EAAE,kBAAkB,EAAE,EAAE,EAAE,MAAM,G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a,CACjC,EAAE,EAAE,kBAAkB,EACtB,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,iBAAiB,GACvB,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAOhC;AAED,wBAAsB,aAAa,CAAC,EAAE,EAAE,kBAAkB,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAGxF;AAED,+EAA+E;AAC/E,wBAAsB,oBAAoB,CACxC,EAAE,EAAE,kBAAkB,EACtB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,qBAAqB,EAAE,GAClC,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAS7B;AAED,eAAO,MAAM,cAAc;;;;;;;CAO1B,CAAA"}
@@ -1,4 +1,5 @@
1
1
  import { and, asc, eq } from "drizzle-orm";
2
+ import { programs } from "./schema.js";
2
3
  import { programSessions, sessionInclusions, } from "./schema-sessions.js";
3
4
  /** Coerce ISO datetime strings (from validation) into Date for timestamp columns. */
4
5
  function withTimestamps(input) {
@@ -10,10 +11,19 @@ function withTimestamps(input) {
10
11
  };
11
12
  }
12
13
  export async function createSession(db, input) {
14
+ // Validate the program FK up front so a stale/mistyped programId is a 4xx,
15
+ // not a raw FK-violation 500.
16
+ const [program] = await db
17
+ .select({ id: programs.id })
18
+ .from(programs)
19
+ .where(eq(programs.id, input.programId))
20
+ .limit(1);
21
+ if (!program)
22
+ return { status: "program_not_found" };
13
23
  const [session] = await db.insert(programSessions).values(withTimestamps(input)).returning();
14
24
  if (!session)
15
25
  throw new Error("createSession: insert returned no rows");
16
- return session;
26
+ return { status: "ok", session };
17
27
  }
18
28
  export async function getSession(db, id) {
19
29
  const [session] = await db
@@ -37,6 +37,9 @@ export declare const createSessionSchema: z.ZodObject<{
37
37
  notes: z.ZodOptional<z.ZodString>;
38
38
  }, z.core.$strip>;
39
39
  export declare const updateSessionSchema: z.ZodObject<{
40
+ notes: z.ZodOptional<z.ZodOptional<z.ZodString>>;
41
+ capacity: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
42
+ functionSpaceId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
40
43
  title: z.ZodOptional<z.ZodString>;
41
44
  sessionType: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
42
45
  keynote: "keynote";
@@ -47,14 +50,11 @@ export declare const updateSessionSchema: z.ZodObject<{
47
50
  excursion: "excursion";
48
51
  free: "free";
49
52
  }>>>;
50
- functionSpaceId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
51
53
  dayDate: z.ZodOptional<z.ZodOptional<z.ZodString>>;
52
54
  startsAt: z.ZodOptional<z.ZodOptional<z.ZodString>>;
53
55
  endsAt: z.ZodOptional<z.ZodOptional<z.ZodString>>;
54
56
  track: z.ZodOptional<z.ZodOptional<z.ZodString>>;
55
- capacity: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
56
57
  requiresRegistration: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
57
- notes: z.ZodOptional<z.ZodOptional<z.ZodString>>;
58
58
  }, z.core.$strip>;
59
59
  export declare const sessionListQuerySchema: z.ZodObject<{
60
60
  programId: z.ZodString;
@@ -1,18 +1,18 @@
1
1
  import { z } from "zod";
2
2
  export declare const programTypeSchema: z.ZodEnum<{
3
+ other: "other";
3
4
  meeting: "meeting";
4
5
  incentive: "incentive";
5
6
  conference: "conference";
6
7
  exhibition: "exhibition";
7
- other: "other";
8
8
  }>;
9
9
  export declare const programStatusSchema: z.ZodEnum<{
10
+ completed: "completed";
11
+ cancelled: "cancelled";
10
12
  lead: "lead";
11
13
  planning: "planning";
12
14
  contracted: "contracted";
13
15
  operating: "operating";
14
- completed: "completed";
15
- cancelled: "cancelled";
16
16
  }>;
17
17
  export declare const createProgramSchema: z.ZodObject<{
18
18
  name: z.ZodString;
@@ -21,19 +21,19 @@ export declare const createProgramSchema: z.ZodObject<{
21
21
  accountManagerId: z.ZodOptional<z.ZodString>;
22
22
  code: z.ZodOptional<z.ZodString>;
23
23
  type: z.ZodDefault<z.ZodEnum<{
24
+ other: "other";
24
25
  meeting: "meeting";
25
26
  incentive: "incentive";
26
27
  conference: "conference";
27
28
  exhibition: "exhibition";
28
- other: "other";
29
29
  }>>;
30
30
  status: z.ZodDefault<z.ZodEnum<{
31
+ completed: "completed";
32
+ cancelled: "cancelled";
31
33
  lead: "lead";
32
34
  planning: "planning";
33
35
  contracted: "contracted";
34
36
  operating: "operating";
35
- completed: "completed";
36
- cancelled: "cancelled";
37
37
  }>>;
38
38
  destination: z.ZodOptional<z.ZodString>;
39
39
  startDate: z.ZodOptional<z.ZodString>;
@@ -50,19 +50,19 @@ export declare const updateProgramSchema: z.ZodObject<{
50
50
  accountManagerId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
51
51
  code: z.ZodOptional<z.ZodOptional<z.ZodString>>;
52
52
  type: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
53
+ other: "other";
53
54
  meeting: "meeting";
54
55
  incentive: "incentive";
55
56
  conference: "conference";
56
57
  exhibition: "exhibition";
57
- other: "other";
58
58
  }>>>;
59
59
  status: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
60
+ completed: "completed";
61
+ cancelled: "cancelled";
60
62
  lead: "lead";
61
63
  planning: "planning";
62
64
  contracted: "contracted";
63
65
  operating: "operating";
64
- completed: "completed";
65
- cancelled: "cancelled";
66
66
  }>>>;
67
67
  destination: z.ZodOptional<z.ZodOptional<z.ZodString>>;
68
68
  startDate: z.ZodOptional<z.ZodOptional<z.ZodString>>;
@@ -74,19 +74,19 @@ export declare const updateProgramSchema: z.ZodObject<{
74
74
  }, z.core.$strip>;
75
75
  export declare const programListQuerySchema: z.ZodObject<{
76
76
  status: z.ZodOptional<z.ZodEnum<{
77
+ completed: "completed";
78
+ cancelled: "cancelled";
77
79
  lead: "lead";
78
80
  planning: "planning";
79
81
  contracted: "contracted";
80
82
  operating: "operating";
81
- completed: "completed";
82
- cancelled: "cancelled";
83
83
  }>>;
84
84
  type: z.ZodOptional<z.ZodEnum<{
85
+ other: "other";
85
86
  meeting: "meeting";
86
87
  incentive: "incentive";
87
88
  conference: "conference";
88
89
  exhibition: "exhibition";
89
- other: "other";
90
90
  }>>;
91
91
  organizationId: z.ZodOptional<z.ZodString>;
92
92
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
package/package.json CHANGED
@@ -1,36 +1,43 @@
1
1
  {
2
2
  "name": "@voyant-travel/mice",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {
7
- ".": "./src/index.ts",
8
- "./schema": "./src/schema.ts",
9
- "./validation": "./src/validation.ts",
10
- "./routes": "./src/routes.ts"
11
- },
12
- "scripts": {
13
- "typecheck": "tsc --noEmit",
14
- "lint": "biome check src/",
15
- "test": "vitest run",
16
- "build": "tsc -p tsconfig.json",
17
- "clean": "rm -rf dist tsconfig.tsbuildinfo",
18
- "prepack": "pnpm run build",
19
- "db:generate": "drizzle-kit generate --config=drizzle.migrations.config.ts --name=mice_baseline && node ../../scripts/migrations/guard-create-type.mjs ./migrations && node ../../scripts/migrations/ensure-extensions.mjs ./migrations"
7
+ ".": {
8
+ "types": "./dist/index.d.ts",
9
+ "import": "./dist/index.js",
10
+ "default": "./dist/index.js"
11
+ },
12
+ "./schema": {
13
+ "types": "./dist/schema.d.ts",
14
+ "import": "./dist/schema.js",
15
+ "default": "./dist/schema.js"
16
+ },
17
+ "./validation": {
18
+ "types": "./dist/validation.d.ts",
19
+ "import": "./dist/validation.js",
20
+ "default": "./dist/validation.js"
21
+ },
22
+ "./routes": {
23
+ "types": "./dist/routes.d.ts",
24
+ "import": "./dist/routes.js",
25
+ "default": "./dist/routes.js"
26
+ }
20
27
  },
21
28
  "dependencies": {
22
- "@voyant-travel/core": "workspace:^",
23
- "@voyant-travel/db": "workspace:^",
24
- "@voyant-travel/hono": "workspace:^",
25
29
  "drizzle-orm": "^0.45.2",
26
30
  "hono": "^4.12.10",
27
- "zod": "^4.3.6"
31
+ "zod": "^4.3.6",
32
+ "@voyant-travel/core": "^0.111.0",
33
+ "@voyant-travel/db": "^0.109.1",
34
+ "@voyant-travel/hono": "^0.116.0"
28
35
  },
29
36
  "devDependencies": {
30
- "@voyant-travel/voyant-typescript-config": "workspace:^",
31
37
  "drizzle-kit": "^0.31.10",
32
38
  "typescript": "^6.0.2",
33
- "vitest": "^4.1.2"
39
+ "vitest": "^4.1.2",
40
+ "@voyant-travel/voyant-typescript-config": "^0.1.0"
34
41
  },
35
42
  "files": [
36
43
  "dist",
@@ -38,31 +45,7 @@
38
45
  "migrations/meta/_journal.json"
39
46
  ],
40
47
  "publishConfig": {
41
- "access": "public",
42
- "exports": {
43
- ".": {
44
- "types": "./dist/index.d.ts",
45
- "import": "./dist/index.js",
46
- "default": "./dist/index.js"
47
- },
48
- "./schema": {
49
- "types": "./dist/schema.d.ts",
50
- "import": "./dist/schema.js",
51
- "default": "./dist/schema.js"
52
- },
53
- "./validation": {
54
- "types": "./dist/validation.d.ts",
55
- "import": "./dist/validation.js",
56
- "default": "./dist/validation.js"
57
- },
58
- "./routes": {
59
- "types": "./dist/routes.d.ts",
60
- "import": "./dist/routes.js",
61
- "default": "./dist/routes.js"
62
- }
63
- },
64
- "main": "./dist/index.js",
65
- "types": "./dist/index.d.ts"
48
+ "access": "public"
66
49
  },
67
50
  "repository": {
68
51
  "type": "git",
@@ -71,5 +54,15 @@
71
54
  },
72
55
  "voyant": {
73
56
  "schema": "./schema"
74
- }
75
- }
57
+ },
58
+ "scripts": {
59
+ "typecheck": "tsc --noEmit",
60
+ "lint": "biome check src/",
61
+ "test": "vitest run",
62
+ "build": "tsc -p tsconfig.json",
63
+ "clean": "rm -rf dist tsconfig.tsbuildinfo",
64
+ "db:generate": "drizzle-kit generate --config=drizzle.migrations.config.ts --name=mice_baseline && node ../../scripts/migrations/guard-create-type.mjs ./migrations && node ../../scripts/migrations/ensure-extensions.mjs ./migrations"
65
+ },
66
+ "main": "./dist/index.js",
67
+ "types": "./dist/index.d.ts"
68
+ }