@voyant-travel/mice 0.2.0 → 0.3.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/dist/routes.d.ts CHANGED
@@ -184,8 +184,8 @@ export declare const miceAdminRoutes: import("hono/hono-base").HonoBase<Env, {
184
184
  notes: string | null;
185
185
  capacity: number | null;
186
186
  programId: string;
187
- functionSpaceId: string | null;
188
187
  title: string;
188
+ functionSpaceId: string | null;
189
189
  sessionType: "keynote" | "breakout" | "meal" | "networking" | "gala" | "excursion" | "free";
190
190
  dayDate: string | null;
191
191
  startsAt: string | null;
@@ -222,8 +222,8 @@ export declare const miceAdminRoutes: import("hono/hono-base").HonoBase<Env, {
222
222
  notes: string | null;
223
223
  capacity: number | null;
224
224
  programId: string;
225
- functionSpaceId: string | null;
226
225
  title: string;
226
+ functionSpaceId: string | null;
227
227
  sessionType: "keynote" | "breakout" | "meal" | "networking" | "gala" | "excursion" | "free";
228
228
  dayDate: string | null;
229
229
  startsAt: string | null;
@@ -266,8 +266,8 @@ export declare const miceAdminRoutes: import("hono/hono-base").HonoBase<Env, {
266
266
  notes: string | null;
267
267
  capacity: number | null;
268
268
  programId: string;
269
- functionSpaceId: string | null;
270
269
  title: string;
270
+ functionSpaceId: string | null;
271
271
  sessionType: "keynote" | "breakout" | "meal" | "networking" | "gala" | "excursion" | "free";
272
272
  dayDate: string | null;
273
273
  startsAt: string | null;
@@ -321,8 +321,8 @@ export declare const miceAdminRoutes: import("hono/hono-base").HonoBase<Env, {
321
321
  notes: string | null;
322
322
  capacity: number | null;
323
323
  programId: string;
324
- functionSpaceId: string | null;
325
324
  title: string;
325
+ functionSpaceId: string | null;
326
326
  sessionType: "keynote" | "breakout" | "meal" | "networking" | "gala" | "excursion" | "free";
327
327
  dayDate: string | null;
328
328
  startsAt: string | null;
@@ -397,7 +397,400 @@ export declare const miceAdminRoutes: import("hono/hono-base").HonoBase<Env, {
397
397
  status: import("hono/utils/http-status").ContentfulStatusCode;
398
398
  };
399
399
  };
400
- }, "/", "/sessions/:id/inclusions">;
400
+ } & {
401
+ "/delegates": {
402
+ $get: {
403
+ input: {};
404
+ output: {
405
+ data: {
406
+ metadata: {
407
+ [x: string]: import("hono/utils/types").JSONValue;
408
+ } | null;
409
+ status: "cancelled" | "invited" | "registered" | "confirmed" | "checked_in" | "no_show";
410
+ id: string;
411
+ createdAt: string;
412
+ updatedAt: string;
413
+ role: "staff" | "attendee" | "speaker" | "sponsor" | "vip" | "exhibitor" | "organizer";
414
+ notes: string | null;
415
+ bookingId: string | null;
416
+ programId: string;
417
+ personId: string | null;
418
+ arrivalAt: string | null;
419
+ departureAt: string | null;
420
+ }[];
421
+ limit: number;
422
+ offset: number;
423
+ };
424
+ outputFormat: "json";
425
+ status: import("hono/utils/http-status").ContentfulStatusCode;
426
+ };
427
+ };
428
+ } & {
429
+ "/delegates": {
430
+ $post: {
431
+ input: {};
432
+ output: {
433
+ error: string;
434
+ };
435
+ outputFormat: "json";
436
+ status: 404;
437
+ } | {
438
+ input: {};
439
+ output: {
440
+ data: {
441
+ metadata: {
442
+ [x: string]: import("hono/utils/types").JSONValue;
443
+ } | null;
444
+ status: "cancelled" | "invited" | "registered" | "confirmed" | "checked_in" | "no_show";
445
+ id: string;
446
+ createdAt: string;
447
+ updatedAt: string;
448
+ role: "staff" | "attendee" | "speaker" | "sponsor" | "vip" | "exhibitor" | "organizer";
449
+ notes: string | null;
450
+ bookingId: string | null;
451
+ programId: string;
452
+ personId: string | null;
453
+ arrivalAt: string | null;
454
+ departureAt: string | null;
455
+ };
456
+ };
457
+ outputFormat: "json";
458
+ status: 201;
459
+ };
460
+ };
461
+ } & {
462
+ "/delegates/:id": {
463
+ $get: {
464
+ input: {
465
+ param: {
466
+ id: string;
467
+ };
468
+ };
469
+ output: {
470
+ error: string;
471
+ };
472
+ outputFormat: "json";
473
+ status: 404;
474
+ } | {
475
+ input: {
476
+ param: {
477
+ id: string;
478
+ };
479
+ };
480
+ output: {
481
+ data: {
482
+ metadata: {
483
+ [x: string]: import("hono/utils/types").JSONValue;
484
+ } | null;
485
+ status: "cancelled" | "invited" | "registered" | "confirmed" | "checked_in" | "no_show";
486
+ id: string;
487
+ createdAt: string;
488
+ updatedAt: string;
489
+ role: "staff" | "attendee" | "speaker" | "sponsor" | "vip" | "exhibitor" | "organizer";
490
+ notes: string | null;
491
+ bookingId: string | null;
492
+ programId: string;
493
+ personId: string | null;
494
+ arrivalAt: string | null;
495
+ departureAt: string | null;
496
+ enrollments: {
497
+ status: "cancelled" | "registered" | "waitlisted" | "attended";
498
+ id: string;
499
+ createdAt: string;
500
+ updatedAt: string;
501
+ sessionId: string;
502
+ delegateId: string;
503
+ }[];
504
+ };
505
+ };
506
+ outputFormat: "json";
507
+ status: import("hono/utils/http-status").ContentfulStatusCode;
508
+ };
509
+ };
510
+ } & {
511
+ "/delegates/:id": {
512
+ $patch: {
513
+ input: {
514
+ param: {
515
+ id: string;
516
+ };
517
+ };
518
+ output: {
519
+ error: string;
520
+ };
521
+ outputFormat: "json";
522
+ status: 404;
523
+ } | {
524
+ input: {
525
+ param: {
526
+ id: string;
527
+ };
528
+ };
529
+ output: {
530
+ data: {
531
+ metadata: {
532
+ [x: string]: import("hono/utils/types").JSONValue;
533
+ } | null;
534
+ status: "cancelled" | "invited" | "registered" | "confirmed" | "checked_in" | "no_show";
535
+ id: string;
536
+ createdAt: string;
537
+ updatedAt: string;
538
+ role: "staff" | "attendee" | "speaker" | "sponsor" | "vip" | "exhibitor" | "organizer";
539
+ notes: string | null;
540
+ bookingId: string | null;
541
+ programId: string;
542
+ personId: string | null;
543
+ arrivalAt: string | null;
544
+ departureAt: string | null;
545
+ };
546
+ };
547
+ outputFormat: "json";
548
+ status: import("hono/utils/http-status").ContentfulStatusCode;
549
+ };
550
+ };
551
+ } & {
552
+ "/delegates/:id/enrollments": {
553
+ $post: {
554
+ input: {
555
+ param: {
556
+ id: string;
557
+ };
558
+ };
559
+ output: {
560
+ data: {
561
+ status: "cancelled" | "registered" | "waitlisted" | "attended";
562
+ id: string;
563
+ createdAt: string;
564
+ updatedAt: string;
565
+ sessionId: string;
566
+ delegateId: string;
567
+ };
568
+ };
569
+ outputFormat: "json";
570
+ status: 200 | 201;
571
+ } | {
572
+ input: {
573
+ param: {
574
+ id: string;
575
+ };
576
+ };
577
+ output: {
578
+ error: string;
579
+ };
580
+ outputFormat: "json";
581
+ status: 404;
582
+ } | {
583
+ input: {
584
+ param: {
585
+ id: string;
586
+ };
587
+ };
588
+ output: {
589
+ error: string;
590
+ };
591
+ outputFormat: "json";
592
+ status: 409;
593
+ };
594
+ };
595
+ } & {
596
+ "/rooming-assignments": {
597
+ $get: {
598
+ input: {};
599
+ output: {
600
+ data: {
601
+ metadata: {
602
+ [x: string]: import("hono/utils/types").JSONValue;
603
+ } | null;
604
+ id: string;
605
+ createdAt: string;
606
+ updatedAt: string;
607
+ programId: string;
608
+ roomBlockId: string | null;
609
+ roomTypeId: string | null;
610
+ bedConfig: string | null;
611
+ sharingGroupId: string | null;
612
+ checkIn: string | null;
613
+ checkOut: string | null;
614
+ specialRequests: string | null;
615
+ }[];
616
+ limit: number;
617
+ offset: number;
618
+ };
619
+ outputFormat: "json";
620
+ status: import("hono/utils/http-status").ContentfulStatusCode;
621
+ };
622
+ };
623
+ } & {
624
+ "/rooming-assignments": {
625
+ $post: {
626
+ input: {};
627
+ output: {
628
+ error: string;
629
+ };
630
+ outputFormat: "json";
631
+ status: 404;
632
+ } | {
633
+ input: {};
634
+ output: {
635
+ data: {
636
+ metadata: {
637
+ [x: string]: import("hono/utils/types").JSONValue;
638
+ } | null;
639
+ id: string;
640
+ createdAt: string;
641
+ updatedAt: string;
642
+ programId: string;
643
+ roomBlockId: string | null;
644
+ roomTypeId: string | null;
645
+ bedConfig: string | null;
646
+ sharingGroupId: string | null;
647
+ checkIn: string | null;
648
+ checkOut: string | null;
649
+ specialRequests: string | null;
650
+ };
651
+ };
652
+ outputFormat: "json";
653
+ status: 201;
654
+ };
655
+ };
656
+ } & {
657
+ "/rooming-assignments/:id": {
658
+ $get: {
659
+ input: {
660
+ param: {
661
+ id: string;
662
+ };
663
+ };
664
+ output: {
665
+ error: string;
666
+ };
667
+ outputFormat: "json";
668
+ status: 404;
669
+ } | {
670
+ input: {
671
+ param: {
672
+ id: string;
673
+ };
674
+ };
675
+ output: {
676
+ data: {
677
+ metadata: {
678
+ [x: string]: import("hono/utils/types").JSONValue;
679
+ } | null;
680
+ id: string;
681
+ createdAt: string;
682
+ updatedAt: string;
683
+ programId: string;
684
+ roomBlockId: string | null;
685
+ roomTypeId: string | null;
686
+ bedConfig: string | null;
687
+ sharingGroupId: string | null;
688
+ checkIn: string | null;
689
+ checkOut: string | null;
690
+ specialRequests: string | null;
691
+ delegates: {
692
+ id: string;
693
+ createdAt: string;
694
+ delegateId: string;
695
+ roomingAssignmentId: string;
696
+ isPrimary: boolean;
697
+ bedLabel: string | null;
698
+ }[];
699
+ };
700
+ };
701
+ outputFormat: "json";
702
+ status: import("hono/utils/http-status").ContentfulStatusCode;
703
+ };
704
+ };
705
+ } & {
706
+ "/rooming-assignments/:id": {
707
+ $patch: {
708
+ input: {
709
+ param: {
710
+ id: string;
711
+ };
712
+ };
713
+ output: {
714
+ error: string;
715
+ };
716
+ outputFormat: "json";
717
+ status: 404;
718
+ } | {
719
+ input: {
720
+ param: {
721
+ id: string;
722
+ };
723
+ };
724
+ output: {
725
+ data: {
726
+ metadata: {
727
+ [x: string]: import("hono/utils/types").JSONValue;
728
+ } | null;
729
+ id: string;
730
+ createdAt: string;
731
+ updatedAt: string;
732
+ programId: string;
733
+ roomBlockId: string | null;
734
+ roomTypeId: string | null;
735
+ bedConfig: string | null;
736
+ sharingGroupId: string | null;
737
+ checkIn: string | null;
738
+ checkOut: string | null;
739
+ specialRequests: string | null;
740
+ };
741
+ };
742
+ outputFormat: "json";
743
+ status: import("hono/utils/http-status").ContentfulStatusCode;
744
+ };
745
+ };
746
+ } & {
747
+ "/rooming-assignments/:id/delegates": {
748
+ $put: {
749
+ input: {
750
+ param: {
751
+ id: string;
752
+ };
753
+ };
754
+ output: {
755
+ data: {
756
+ id: string;
757
+ createdAt: string;
758
+ delegateId: string;
759
+ roomingAssignmentId: string;
760
+ isPrimary: boolean;
761
+ bedLabel: string | null;
762
+ }[];
763
+ };
764
+ outputFormat: "json";
765
+ status: import("hono/utils/http-status").ContentfulStatusCode;
766
+ } | {
767
+ input: {
768
+ param: {
769
+ id: string;
770
+ };
771
+ };
772
+ output: {
773
+ error: string;
774
+ };
775
+ outputFormat: "json";
776
+ status: 404;
777
+ } | {
778
+ input: {
779
+ param: {
780
+ id: string;
781
+ };
782
+ };
783
+ output: {
784
+ error: string;
785
+ detail: {
786
+ offending: string[];
787
+ };
788
+ };
789
+ outputFormat: "json";
790
+ status: 409;
791
+ };
792
+ };
793
+ }, "/", "/rooming-assignments/:id/delegates">;
401
794
  export type MiceAdminRoutes = typeof miceAdminRoutes;
402
795
  export {};
403
796
  //# sourceMappingURL=routes.d.ts.map
@@ -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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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6CAmIxB,CAAA;AAEJ,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAA"}
package/dist/routes.js CHANGED
@@ -5,8 +5,12 @@
5
5
  import { parseJsonBody, parseQuery } from "@voyant-travel/hono";
6
6
  import { Hono } from "hono";
7
7
  import { createProgram, getProgram, listPrograms, updateProgram } from "./service.js";
8
+ import { createDelegate, enrollDelegate, getDelegate, listDelegates, updateDelegate, } from "./service-delegates.js";
9
+ import { createRoomingAssignment, getRoomingAssignment, listRoomingAssignments, setRoomingDelegates, updateRoomingAssignment, } from "./service-rooming.js";
8
10
  import { createSession, deleteSession, getSession, listSessions, setSessionInclusions, updateSession, } from "./service-sessions.js";
9
11
  import { createProgramSchema, programListQuerySchema, updateProgramSchema } from "./validation.js";
12
+ import { createDelegateSchema, delegateListQuerySchema, enrollDelegateSchema, updateDelegateSchema, } from "./validation-delegates.js";
13
+ import { createRoomingAssignmentSchema, roomingListQuerySchema, setRoomingDelegatesSchema, updateRoomingAssignmentSchema, } from "./validation-rooming.js";
10
14
  import { createSessionSchema, sessionListQuerySchema, setSessionInclusionsSchema, updateSessionSchema, } from "./validation-sessions.js";
11
15
  export const miceAdminRoutes = new Hono()
12
16
  .get("/programs", async (c) => {
@@ -68,4 +72,85 @@ export const miceAdminRoutes = new Hono()
68
72
  return c.json({ error: "Session not found" }, 404);
69
73
  const { inclusions } = await parseJsonBody(c, setSessionInclusionsSchema);
70
74
  return c.json({ data: await setSessionInclusions(c.get("db"), id, inclusions) });
75
+ })
76
+ // Delegates + session enrollment (RFC voyant#1489 Phase 3).
77
+ .get("/delegates", async (c) => {
78
+ const query = await parseQuery(c, delegateListQuerySchema);
79
+ return c.json(await listDelegates(c.get("db"), query));
80
+ })
81
+ .post("/delegates", async (c) => {
82
+ const body = await parseJsonBody(c, createDelegateSchema);
83
+ const outcome = await createDelegate(c.get("db"), body);
84
+ if (outcome.status === "program_not_found")
85
+ return c.json({ error: "Program not found" }, 404);
86
+ return c.json({ data: outcome.delegate }, 201);
87
+ })
88
+ .get("/delegates/:id", async (c) => {
89
+ const delegate = await getDelegate(c.get("db"), c.req.param("id"));
90
+ if (!delegate)
91
+ return c.json({ error: "Delegate not found" }, 404);
92
+ return c.json({ data: delegate });
93
+ })
94
+ .patch("/delegates/:id", async (c) => {
95
+ const body = await parseJsonBody(c, updateDelegateSchema);
96
+ const delegate = await updateDelegate(c.get("db"), c.req.param("id"), body);
97
+ if (!delegate)
98
+ return c.json({ error: "Delegate not found" }, 404);
99
+ return c.json({ data: delegate });
100
+ })
101
+ .post("/delegates/:id/enrollments", async (c) => {
102
+ const body = await parseJsonBody(c, enrollDelegateSchema);
103
+ const outcome = await enrollDelegate(c.get("db"), c.req.param("id"), body);
104
+ switch (outcome.status) {
105
+ case "ok":
106
+ return c.json({ data: outcome.enrollment }, outcome.idempotent ? 200 : 201);
107
+ case "delegate_not_found":
108
+ return c.json({ error: "Delegate not found" }, 404);
109
+ case "session_not_found":
110
+ return c.json({ error: "Session not found" }, 404);
111
+ case "program_mismatch":
112
+ return c.json({ error: "Session belongs to a different program" }, 409);
113
+ }
114
+ })
115
+ // Rooming manifest (RFC voyant#1489 Phase 3).
116
+ .get("/rooming-assignments", async (c) => {
117
+ const query = await parseQuery(c, roomingListQuerySchema);
118
+ return c.json(await listRoomingAssignments(c.get("db"), query));
119
+ })
120
+ .post("/rooming-assignments", async (c) => {
121
+ const body = await parseJsonBody(c, createRoomingAssignmentSchema);
122
+ const outcome = await createRoomingAssignment(c.get("db"), body);
123
+ if (outcome.status === "program_not_found")
124
+ return c.json({ error: "Program not found" }, 404);
125
+ return c.json({ data: outcome.assignment }, 201);
126
+ })
127
+ .get("/rooming-assignments/:id", async (c) => {
128
+ const assignment = await getRoomingAssignment(c.get("db"), c.req.param("id"));
129
+ if (!assignment)
130
+ return c.json({ error: "Rooming assignment not found" }, 404);
131
+ return c.json({ data: assignment });
132
+ })
133
+ .patch("/rooming-assignments/:id", async (c) => {
134
+ const body = await parseJsonBody(c, updateRoomingAssignmentSchema);
135
+ const assignment = await updateRoomingAssignment(c.get("db"), c.req.param("id"), body);
136
+ if (!assignment)
137
+ return c.json({ error: "Rooming assignment not found" }, 404);
138
+ return c.json({ data: assignment });
139
+ })
140
+ .put("/rooming-assignments/:id/delegates", async (c) => {
141
+ const { delegates } = await parseJsonBody(c, setRoomingDelegatesSchema);
142
+ const outcome = await setRoomingDelegates(c.get("db"), c.req.param("id"), delegates);
143
+ switch (outcome.status) {
144
+ case "ok":
145
+ return c.json({ data: outcome.delegates });
146
+ case "assignment_not_found":
147
+ return c.json({ error: "Rooming assignment not found" }, 404);
148
+ case "delegate_not_found":
149
+ return c.json({ error: "Delegate not found", detail: { missing: outcome.missing } }, 404);
150
+ case "program_mismatch":
151
+ return c.json({
152
+ error: "Delegate belongs to a different program",
153
+ detail: { offending: outcome.offending },
154
+ }, 409);
155
+ }
71
156
  });