@voyantjs/hospitality 0.5.0 → 0.6.2

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.
@@ -34,8 +34,8 @@ export declare const hospitalityOperationsRoutes: import("hono/hono-base").HonoB
34
34
  input: {};
35
35
  output: {
36
36
  data: {
37
- id: string;
38
37
  date: string;
38
+ id: string;
39
39
  createdAt: string;
40
40
  updatedAt: string;
41
41
  notes: string | null;
@@ -195,8 +195,8 @@ export declare const hospitalityOperationsRoutes: import("hono/hono-base").HonoB
195
195
  input: {};
196
196
  output: {
197
197
  data: {
198
- id: string;
199
198
  date: string;
199
+ id: string;
200
200
  createdAt: string;
201
201
  updatedAt: string;
202
202
  notes: string | null;
@@ -354,14 +354,14 @@ export declare const hospitalityOperationsRoutes: import("hono/hono-base").HonoB
354
354
  input: {};
355
355
  output: {
356
356
  data: {
357
+ metadata: {
358
+ [x: string]: import("hono/utils/types").JSONValue;
359
+ } | null;
357
360
  id: string;
358
- status: "draft" | "confirmed" | "cancelled" | "held" | "released";
359
361
  createdAt: string;
360
362
  updatedAt: string;
363
+ status: "draft" | "confirmed" | "cancelled" | "held" | "released";
361
364
  notes: string | null;
362
- metadata: {
363
- [x: string]: import("hono/utils/types").JSONValue;
364
- } | null;
365
365
  quantity: number;
366
366
  propertyId: string;
367
367
  roomTypeId: string | null;
@@ -520,12 +520,12 @@ export declare const hospitalityOperationsRoutes: import("hono/hono-base").HonoB
520
520
  input: {};
521
521
  output: {
522
522
  data: {
523
- id: string;
524
- createdAt: string;
525
- notes: string | null;
526
523
  metadata: {
527
524
  [x: string]: import("hono/utils/types").JSONValue;
528
525
  } | null;
526
+ id: string;
527
+ createdAt: string;
528
+ notes: string | null;
529
529
  roomUnitId: string;
530
530
  statusCode: string;
531
531
  housekeepingStatus: string | null;
@@ -674,15 +674,15 @@ export declare const hospitalityOperationsRoutes: import("hono/hono-base").HonoB
674
674
  input: {};
675
675
  output: {
676
676
  data: {
677
+ metadata: {
678
+ [x: string]: import("hono/utils/types").JSONValue;
679
+ } | null;
677
680
  id: string;
678
- status: "in_progress" | "cancelled" | "open" | "resolved";
679
681
  createdAt: string;
680
682
  updatedAt: string;
683
+ status: "in_progress" | "cancelled" | "open" | "resolved";
681
684
  notes: string | null;
682
685
  reason: string | null;
683
- metadata: {
684
- [x: string]: import("hono/utils/types").JSONValue;
685
- } | null;
686
686
  propertyId: string;
687
687
  roomTypeId: string | null;
688
688
  roomUnitId: string | null;
@@ -840,15 +840,15 @@ export declare const hospitalityOperationsRoutes: import("hono/hono-base").HonoB
840
840
  input: {};
841
841
  output: {
842
842
  data: {
843
+ metadata: {
844
+ [x: string]: import("hono/utils/types").JSONValue;
845
+ } | null;
843
846
  id: string;
844
- status: "in_progress" | "completed" | "cancelled" | "open";
845
- completedAt: string | null;
846
847
  createdAt: string;
847
848
  updatedAt: string;
849
+ status: "in_progress" | "completed" | "cancelled" | "open";
848
850
  notes: string | null;
849
- metadata: {
850
- [x: string]: import("hono/utils/types").JSONValue;
851
- } | null;
851
+ completedAt: string | null;
852
852
  propertyId: string;
853
853
  roomUnitId: string;
854
854
  stayBookingItemId: string | null;
@@ -1021,13 +1021,13 @@ export declare const hospitalityOperationsRoutes: import("hono/hono-base").HonoB
1021
1021
  input: {};
1022
1022
  output: {
1023
1023
  data: {
1024
+ metadata: {
1025
+ [x: string]: import("hono/utils/types").JSONValue;
1026
+ } | null;
1024
1027
  id: string;
1025
1028
  createdAt: string;
1026
1029
  updatedAt: string;
1027
1030
  notes: string | null;
1028
- metadata: {
1029
- [x: string]: import("hono/utils/types").JSONValue;
1030
- } | null;
1031
1031
  active: boolean;
1032
1032
  validFrom: string | null;
1033
1033
  validTo: string | null;
@@ -1220,14 +1220,14 @@ export declare const hospitalityOperationsRoutes: import("hono/hono-base").HonoB
1220
1220
  input: {};
1221
1221
  output: {
1222
1222
  data: {
1223
+ metadata: {
1224
+ [x: string]: import("hono/utils/types").JSONValue;
1225
+ } | null;
1223
1226
  id: string;
1224
- status: "cancelled" | "reserved" | "checked_in" | "checked_out" | "no_show";
1225
1227
  createdAt: string;
1226
1228
  updatedAt: string;
1229
+ status: "cancelled" | "reserved" | "checked_in" | "checked_out" | "no_show";
1227
1230
  notes: string | null;
1228
- metadata: {
1229
- [x: string]: import("hono/utils/types").JSONValue;
1230
- } | null;
1231
1231
  bookingItemId: string;
1232
1232
  propertyId: string;
1233
1233
  roomTypeId: string;
@@ -1408,13 +1408,13 @@ export declare const hospitalityOperationsRoutes: import("hono/hono-base").HonoB
1408
1408
  input: {};
1409
1409
  output: {
1410
1410
  data: {
1411
- id: string;
1412
1411
  date: string;
1412
+ id: string;
1413
+ createdAt: string;
1414
+ updatedAt: string;
1413
1415
  sellCurrency: string;
1414
1416
  sellAmountCents: number | null;
1415
1417
  costAmountCents: number | null;
1416
- createdAt: string;
1417
- updatedAt: string;
1418
1418
  costCurrency: string | null;
1419
1419
  stayBookingItemId: string;
1420
1420
  taxAmountCents: number | null;
@@ -1567,13 +1567,13 @@ export declare const hospitalityOperationsRoutes: import("hono/hono-base").HonoB
1567
1567
  input: {};
1568
1568
  output: {
1569
1569
  data: {
1570
+ metadata: {
1571
+ [x: string]: import("hono/utils/types").JSONValue;
1572
+ } | null;
1570
1573
  id: string;
1571
1574
  createdAt: string;
1572
1575
  updatedAt: string;
1573
1576
  notes: string | null;
1574
- metadata: {
1575
- [x: string]: import("hono/utils/types").JSONValue;
1576
- } | null;
1577
1577
  propertyId: string;
1578
1578
  roomUnitId: string | null;
1579
1579
  stayBookingItemId: string;
@@ -1732,12 +1732,12 @@ export declare const hospitalityOperationsRoutes: import("hono/hono-base").HonoB
1732
1732
  input: {};
1733
1733
  output: {
1734
1734
  data: {
1735
- id: string;
1736
- createdAt: string;
1737
- notes: string | null;
1738
1735
  metadata: {
1739
1736
  [x: string]: import("hono/utils/types").JSONValue;
1740
1737
  } | null;
1738
+ id: string;
1739
+ createdAt: string;
1740
+ notes: string | null;
1741
1741
  roomUnitId: string | null;
1742
1742
  stayOperationId: string;
1743
1743
  checkpointType: "no_show" | "arrival" | "room_assigned" | "check_in" | "room_move" | "charge_posted" | "check_out" | "note";
@@ -1885,17 +1885,17 @@ export declare const hospitalityOperationsRoutes: import("hono/hono-base").HonoB
1885
1885
  input: {};
1886
1886
  output: {
1887
1887
  data: {
1888
+ metadata: {
1889
+ [x: string]: import("hono/utils/types").JSONValue;
1890
+ } | null;
1888
1891
  id: string;
1889
- sellAmountCents: number;
1890
- costAmountCents: number | null;
1891
1892
  createdAt: string;
1892
1893
  updatedAt: string;
1893
1894
  notes: string | null;
1894
- metadata: {
1895
- [x: string]: import("hono/utils/types").JSONValue;
1896
- } | null;
1897
- kind: "other" | "fee" | "adjustment" | "lodging" | "meal" | "minibar";
1898
1895
  description: string;
1896
+ sellAmountCents: number;
1897
+ costAmountCents: number | null;
1898
+ kind: "other" | "fee" | "adjustment" | "lodging" | "meal" | "minibar";
1899
1899
  serviceDate: string;
1900
1900
  quantity: number;
1901
1901
  bookingItemId: string | null;
@@ -2028,7 +2028,7 @@ export declare const hospitalityOperationsRoutes: import("hono/hono-base").HonoB
2028
2028
  id: string;
2029
2029
  stayOperationId: string;
2030
2030
  currencyCode: string;
2031
- status: "open" | "closed" | "transferred" | "void";
2031
+ status: "void" | "open" | "closed" | "transferred";
2032
2032
  openedAt: string;
2033
2033
  closedAt: string | null;
2034
2034
  notes: string | null;
@@ -2052,14 +2052,14 @@ export declare const hospitalityOperationsRoutes: import("hono/hono-base").HonoB
2052
2052
  input: {};
2053
2053
  output: {
2054
2054
  data: {
2055
+ metadata: {
2056
+ [x: string]: import("hono/utils/types").JSONValue;
2057
+ } | null;
2055
2058
  id: string;
2056
- status: "open" | "closed" | "transferred" | "void";
2057
2059
  createdAt: string;
2058
2060
  updatedAt: string;
2061
+ status: "void" | "open" | "closed" | "transferred";
2059
2062
  notes: string | null;
2060
- metadata: {
2061
- [x: string]: import("hono/utils/types").JSONValue;
2062
- } | null;
2063
2063
  currencyCode: string;
2064
2064
  stayOperationId: string;
2065
2065
  openedAt: string;
@@ -2094,7 +2094,7 @@ export declare const hospitalityOperationsRoutes: import("hono/hono-base").HonoB
2094
2094
  id: string;
2095
2095
  stayOperationId: string;
2096
2096
  currencyCode: string;
2097
- status: "open" | "closed" | "transferred" | "void";
2097
+ status: "void" | "open" | "closed" | "transferred";
2098
2098
  openedAt: string;
2099
2099
  closedAt: string | null;
2100
2100
  notes: string | null;
@@ -2133,7 +2133,7 @@ export declare const hospitalityOperationsRoutes: import("hono/hono-base").HonoB
2133
2133
  id: string;
2134
2134
  stayOperationId: string;
2135
2135
  currencyCode: string;
2136
- status: "open" | "closed" | "transferred" | "void";
2136
+ status: "void" | "open" | "closed" | "transferred";
2137
2137
  openedAt: string;
2138
2138
  closedAt: string | null;
2139
2139
  notes: string | null;
@@ -2211,13 +2211,13 @@ export declare const hospitalityOperationsRoutes: import("hono/hono-base").HonoB
2211
2211
  input: {};
2212
2212
  output: {
2213
2213
  data: {
2214
+ metadata: {
2215
+ [x: string]: import("hono/utils/types").JSONValue;
2216
+ } | null;
2214
2217
  id: string;
2215
2218
  createdAt: string;
2216
2219
  updatedAt: string;
2217
2220
  notes: string | null;
2218
- metadata: {
2219
- [x: string]: import("hono/utils/types").JSONValue;
2220
- } | null;
2221
2221
  description: string;
2222
2222
  quantity: number;
2223
2223
  taxAmountCents: number | null;
@@ -43,13 +43,13 @@ export declare const hospitalityStayRoutes: import("hono/hono-base").HonoBase<En
43
43
  input: {};
44
44
  output: {
45
45
  data: {
46
+ metadata: {
47
+ [x: string]: import("hono/utils/types").JSONValue;
48
+ } | null;
46
49
  id: string;
47
50
  createdAt: string;
48
51
  updatedAt: string;
49
52
  notes: string | null;
50
- metadata: {
51
- [x: string]: import("hono/utils/types").JSONValue;
52
- } | null;
53
53
  active: boolean;
54
54
  validFrom: string | null;
55
55
  validTo: string | null;
@@ -242,14 +242,14 @@ export declare const hospitalityStayRoutes: import("hono/hono-base").HonoBase<En
242
242
  input: {};
243
243
  output: {
244
244
  data: {
245
+ metadata: {
246
+ [x: string]: import("hono/utils/types").JSONValue;
247
+ } | null;
245
248
  id: string;
246
- status: "cancelled" | "reserved" | "checked_in" | "checked_out" | "no_show";
247
249
  createdAt: string;
248
250
  updatedAt: string;
251
+ status: "cancelled" | "reserved" | "checked_in" | "checked_out" | "no_show";
249
252
  notes: string | null;
250
- metadata: {
251
- [x: string]: import("hono/utils/types").JSONValue;
252
- } | null;
253
253
  bookingItemId: string;
254
254
  propertyId: string;
255
255
  roomTypeId: string;
@@ -430,13 +430,13 @@ export declare const hospitalityStayRoutes: import("hono/hono-base").HonoBase<En
430
430
  input: {};
431
431
  output: {
432
432
  data: {
433
- id: string;
434
433
  date: string;
434
+ id: string;
435
+ createdAt: string;
436
+ updatedAt: string;
435
437
  sellCurrency: string;
436
438
  sellAmountCents: number | null;
437
439
  costAmountCents: number | null;
438
- createdAt: string;
439
- updatedAt: string;
440
440
  costCurrency: string | null;
441
441
  stayBookingItemId: string;
442
442
  taxAmountCents: number | null;
@@ -589,13 +589,13 @@ export declare const hospitalityStayRoutes: import("hono/hono-base").HonoBase<En
589
589
  input: {};
590
590
  output: {
591
591
  data: {
592
+ metadata: {
593
+ [x: string]: import("hono/utils/types").JSONValue;
594
+ } | null;
592
595
  id: string;
593
596
  createdAt: string;
594
597
  updatedAt: string;
595
598
  notes: string | null;
596
- metadata: {
597
- [x: string]: import("hono/utils/types").JSONValue;
598
- } | null;
599
599
  propertyId: string;
600
600
  roomUnitId: string | null;
601
601
  stayBookingItemId: string;
@@ -754,12 +754,12 @@ export declare const hospitalityStayRoutes: import("hono/hono-base").HonoBase<En
754
754
  input: {};
755
755
  output: {
756
756
  data: {
757
- id: string;
758
- createdAt: string;
759
- notes: string | null;
760
757
  metadata: {
761
758
  [x: string]: import("hono/utils/types").JSONValue;
762
759
  } | null;
760
+ id: string;
761
+ createdAt: string;
762
+ notes: string | null;
763
763
  roomUnitId: string | null;
764
764
  stayOperationId: string;
765
765
  checkpointType: "no_show" | "arrival" | "room_assigned" | "check_in" | "room_move" | "charge_posted" | "check_out" | "note";
@@ -907,17 +907,17 @@ export declare const hospitalityStayRoutes: import("hono/hono-base").HonoBase<En
907
907
  input: {};
908
908
  output: {
909
909
  data: {
910
+ metadata: {
911
+ [x: string]: import("hono/utils/types").JSONValue;
912
+ } | null;
910
913
  id: string;
911
- sellAmountCents: number;
912
- costAmountCents: number | null;
913
914
  createdAt: string;
914
915
  updatedAt: string;
915
916
  notes: string | null;
916
- metadata: {
917
- [x: string]: import("hono/utils/types").JSONValue;
918
- } | null;
919
- kind: "other" | "fee" | "adjustment" | "lodging" | "meal" | "minibar";
920
917
  description: string;
918
+ sellAmountCents: number;
919
+ costAmountCents: number | null;
920
+ kind: "other" | "fee" | "adjustment" | "lodging" | "meal" | "minibar";
921
921
  serviceDate: string;
922
922
  quantity: number;
923
923
  bookingItemId: string | null;
@@ -1050,7 +1050,7 @@ export declare const hospitalityStayRoutes: import("hono/hono-base").HonoBase<En
1050
1050
  id: string;
1051
1051
  stayOperationId: string;
1052
1052
  currencyCode: string;
1053
- status: "open" | "closed" | "transferred" | "void";
1053
+ status: "void" | "open" | "closed" | "transferred";
1054
1054
  openedAt: string;
1055
1055
  closedAt: string | null;
1056
1056
  notes: string | null;
@@ -1074,14 +1074,14 @@ export declare const hospitalityStayRoutes: import("hono/hono-base").HonoBase<En
1074
1074
  input: {};
1075
1075
  output: {
1076
1076
  data: {
1077
+ metadata: {
1078
+ [x: string]: import("hono/utils/types").JSONValue;
1079
+ } | null;
1077
1080
  id: string;
1078
- status: "open" | "closed" | "transferred" | "void";
1079
1081
  createdAt: string;
1080
1082
  updatedAt: string;
1083
+ status: "void" | "open" | "closed" | "transferred";
1081
1084
  notes: string | null;
1082
- metadata: {
1083
- [x: string]: import("hono/utils/types").JSONValue;
1084
- } | null;
1085
1085
  currencyCode: string;
1086
1086
  stayOperationId: string;
1087
1087
  openedAt: string;
@@ -1116,7 +1116,7 @@ export declare const hospitalityStayRoutes: import("hono/hono-base").HonoBase<En
1116
1116
  id: string;
1117
1117
  stayOperationId: string;
1118
1118
  currencyCode: string;
1119
- status: "open" | "closed" | "transferred" | "void";
1119
+ status: "void" | "open" | "closed" | "transferred";
1120
1120
  openedAt: string;
1121
1121
  closedAt: string | null;
1122
1122
  notes: string | null;
@@ -1155,7 +1155,7 @@ export declare const hospitalityStayRoutes: import("hono/hono-base").HonoBase<En
1155
1155
  id: string;
1156
1156
  stayOperationId: string;
1157
1157
  currencyCode: string;
1158
- status: "open" | "closed" | "transferred" | "void";
1158
+ status: "void" | "open" | "closed" | "transferred";
1159
1159
  openedAt: string;
1160
1160
  closedAt: string | null;
1161
1161
  notes: string | null;
@@ -1233,13 +1233,13 @@ export declare const hospitalityStayRoutes: import("hono/hono-base").HonoBase<En
1233
1233
  input: {};
1234
1234
  output: {
1235
1235
  data: {
1236
+ metadata: {
1237
+ [x: string]: import("hono/utils/types").JSONValue;
1238
+ } | null;
1236
1239
  id: string;
1237
1240
  createdAt: string;
1238
1241
  updatedAt: string;
1239
1242
  notes: string | null;
1240
- metadata: {
1241
- [x: string]: import("hono/utils/types").JSONValue;
1242
- } | null;
1243
1243
  description: string;
1244
1244
  quantity: number;
1245
1245
  taxAmountCents: number | null;
@@ -1 +1 @@
1
- {"version":3,"file":"routes-stays.d.ts","sourceRoot":"","sources":["../src/routes-stays.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAA;AA8B7C,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAgR9B,CAAA"}
@@ -1,15 +1,16 @@
1
+ import { parseJsonBody, parseQuery } from "@voyantjs/hono";
1
2
  import { Hono } from "hono";
2
3
  import { notFound } from "./routes-shared.js";
3
4
  import { hospitalityService } from "./service.js";
4
5
  import { insertStayBookingItemSchema, insertStayCheckpointSchema, insertStayDailyRateSchema, insertStayFolioLineSchema, insertStayFolioSchema, insertStayOperationSchema, insertStayRuleSchema, insertStayServicePostSchema, stayBookingItemListQuerySchema, stayCheckpointListQuerySchema, stayDailyRateListQuerySchema, stayFolioLineListQuerySchema, stayFolioListQuerySchema, stayOperationListQuerySchema, stayRuleListQuerySchema, stayServicePostListQuerySchema, updateStayBookingItemSchema, updateStayCheckpointSchema, updateStayDailyRateSchema, updateStayFolioLineSchema, updateStayFolioSchema, updateStayOperationSchema, updateStayRuleSchema, updateStayServicePostSchema, } from "./validation.js";
5
6
  export const hospitalityStayRoutes = new Hono()
6
7
  .get("/stay-rules", async (c) => {
7
- const query = stayRuleListQuerySchema.parse(Object.fromEntries(new URL(c.req.url).searchParams));
8
+ const query = await parseQuery(c, stayRuleListQuerySchema);
8
9
  return c.json(await hospitalityService.listStayRules(c.get("db"), query));
9
10
  })
10
11
  .post("/stay-rules", async (c) => {
11
12
  return c.json({
12
- data: await hospitalityService.createStayRule(c.get("db"), insertStayRuleSchema.parse(await c.req.json())),
13
+ data: await hospitalityService.createStayRule(c.get("db"), await parseJsonBody(c, insertStayRuleSchema)),
13
14
  }, 201);
14
15
  })
15
16
  .get("/stay-rules/:id", async (c) => {
@@ -19,7 +20,7 @@ export const hospitalityStayRoutes = new Hono()
19
20
  return c.json({ data: row });
20
21
  })
21
22
  .patch("/stay-rules/:id", async (c) => {
22
- const row = await hospitalityService.updateStayRule(c.get("db"), c.req.param("id"), updateStayRuleSchema.parse(await c.req.json()));
23
+ const row = await hospitalityService.updateStayRule(c.get("db"), c.req.param("id"), await parseJsonBody(c, updateStayRuleSchema));
23
24
  if (!row)
24
25
  return c.json(notFound("Stay rule"), 404);
25
26
  return c.json({ data: row });
@@ -31,12 +32,12 @@ export const hospitalityStayRoutes = new Hono()
31
32
  return c.json({ success: true });
32
33
  })
33
34
  .get("/stay-booking-items", async (c) => {
34
- const query = stayBookingItemListQuerySchema.parse(Object.fromEntries(new URL(c.req.url).searchParams));
35
+ const query = await parseQuery(c, stayBookingItemListQuerySchema);
35
36
  return c.json(await hospitalityService.listStayBookingItems(c.get("db"), query));
36
37
  })
37
38
  .post("/stay-booking-items", async (c) => {
38
39
  return c.json({
39
- data: await hospitalityService.createStayBookingItem(c.get("db"), insertStayBookingItemSchema.parse(await c.req.json())),
40
+ data: await hospitalityService.createStayBookingItem(c.get("db"), await parseJsonBody(c, insertStayBookingItemSchema)),
40
41
  }, 201);
41
42
  })
42
43
  .get("/stay-booking-items/:id", async (c) => {
@@ -46,7 +47,7 @@ export const hospitalityStayRoutes = new Hono()
46
47
  return c.json({ data: row });
47
48
  })
48
49
  .patch("/stay-booking-items/:id", async (c) => {
49
- const row = await hospitalityService.updateStayBookingItem(c.get("db"), c.req.param("id"), updateStayBookingItemSchema.parse(await c.req.json()));
50
+ const row = await hospitalityService.updateStayBookingItem(c.get("db"), c.req.param("id"), await parseJsonBody(c, updateStayBookingItemSchema));
50
51
  if (!row)
51
52
  return c.json(notFound("Stay booking item"), 404);
52
53
  return c.json({ data: row });
@@ -58,12 +59,12 @@ export const hospitalityStayRoutes = new Hono()
58
59
  return c.json({ success: true });
59
60
  })
60
61
  .get("/stay-daily-rates", async (c) => {
61
- const query = stayDailyRateListQuerySchema.parse(Object.fromEntries(new URL(c.req.url).searchParams));
62
+ const query = await parseQuery(c, stayDailyRateListQuerySchema);
62
63
  return c.json(await hospitalityService.listStayDailyRates(c.get("db"), query));
63
64
  })
64
65
  .post("/stay-daily-rates", async (c) => {
65
66
  return c.json({
66
- data: await hospitalityService.createStayDailyRate(c.get("db"), insertStayDailyRateSchema.parse(await c.req.json())),
67
+ data: await hospitalityService.createStayDailyRate(c.get("db"), await parseJsonBody(c, insertStayDailyRateSchema)),
67
68
  }, 201);
68
69
  })
69
70
  .get("/stay-daily-rates/:id", async (c) => {
@@ -73,7 +74,7 @@ export const hospitalityStayRoutes = new Hono()
73
74
  return c.json({ data: row });
74
75
  })
75
76
  .patch("/stay-daily-rates/:id", async (c) => {
76
- const row = await hospitalityService.updateStayDailyRate(c.get("db"), c.req.param("id"), updateStayDailyRateSchema.parse(await c.req.json()));
77
+ const row = await hospitalityService.updateStayDailyRate(c.get("db"), c.req.param("id"), await parseJsonBody(c, updateStayDailyRateSchema));
77
78
  if (!row)
78
79
  return c.json(notFound("Stay daily rate"), 404);
79
80
  return c.json({ data: row });
@@ -85,11 +86,11 @@ export const hospitalityStayRoutes = new Hono()
85
86
  return c.json({ success: true });
86
87
  })
87
88
  .get("/stay-operations", async (c) => {
88
- const query = stayOperationListQuerySchema.parse(Object.fromEntries(new URL(c.req.url).searchParams));
89
+ const query = await parseQuery(c, stayOperationListQuerySchema);
89
90
  return c.json(await hospitalityService.listStayOperations(c.get("db"), query));
90
91
  })
91
92
  .post("/stay-operations", async (c) => c.json({
92
- data: await hospitalityService.createStayOperation(c.get("db"), insertStayOperationSchema.parse(await c.req.json())),
93
+ data: await hospitalityService.createStayOperation(c.get("db"), await parseJsonBody(c, insertStayOperationSchema)),
93
94
  }, 201))
94
95
  .get("/stay-operations/:id", async (c) => {
95
96
  const row = await hospitalityService.getStayOperationById(c.get("db"), c.req.param("id"));
@@ -98,7 +99,7 @@ export const hospitalityStayRoutes = new Hono()
98
99
  return c.json({ data: row });
99
100
  })
100
101
  .patch("/stay-operations/:id", async (c) => {
101
- const row = await hospitalityService.updateStayOperation(c.get("db"), c.req.param("id"), updateStayOperationSchema.parse(await c.req.json()));
102
+ const row = await hospitalityService.updateStayOperation(c.get("db"), c.req.param("id"), await parseJsonBody(c, updateStayOperationSchema));
102
103
  if (!row)
103
104
  return c.json(notFound("Stay operation"), 404);
104
105
  return c.json({ data: row });
@@ -110,11 +111,11 @@ export const hospitalityStayRoutes = new Hono()
110
111
  return c.json({ success: true });
111
112
  })
112
113
  .get("/stay-checkpoints", async (c) => {
113
- const query = stayCheckpointListQuerySchema.parse(Object.fromEntries(new URL(c.req.url).searchParams));
114
+ const query = await parseQuery(c, stayCheckpointListQuerySchema);
114
115
  return c.json(await hospitalityService.listStayCheckpoints(c.get("db"), query));
115
116
  })
116
117
  .post("/stay-checkpoints", async (c) => c.json({
117
- data: await hospitalityService.createStayCheckpoint(c.get("db"), insertStayCheckpointSchema.parse(await c.req.json())),
118
+ data: await hospitalityService.createStayCheckpoint(c.get("db"), await parseJsonBody(c, insertStayCheckpointSchema)),
118
119
  }, 201))
119
120
  .get("/stay-checkpoints/:id", async (c) => {
120
121
  const row = await hospitalityService.getStayCheckpointById(c.get("db"), c.req.param("id"));
@@ -123,7 +124,7 @@ export const hospitalityStayRoutes = new Hono()
123
124
  return c.json({ data: row });
124
125
  })
125
126
  .patch("/stay-checkpoints/:id", async (c) => {
126
- const row = await hospitalityService.updateStayCheckpoint(c.get("db"), c.req.param("id"), updateStayCheckpointSchema.parse(await c.req.json()));
127
+ const row = await hospitalityService.updateStayCheckpoint(c.get("db"), c.req.param("id"), await parseJsonBody(c, updateStayCheckpointSchema));
127
128
  if (!row)
128
129
  return c.json(notFound("Stay checkpoint"), 404);
129
130
  return c.json({ data: row });
@@ -135,11 +136,11 @@ export const hospitalityStayRoutes = new Hono()
135
136
  return c.json({ success: true });
136
137
  })
137
138
  .get("/stay-service-posts", async (c) => {
138
- const query = stayServicePostListQuerySchema.parse(Object.fromEntries(new URL(c.req.url).searchParams));
139
+ const query = await parseQuery(c, stayServicePostListQuerySchema);
139
140
  return c.json(await hospitalityService.listStayServicePosts(c.get("db"), query));
140
141
  })
141
142
  .post("/stay-service-posts", async (c) => c.json({
142
- data: await hospitalityService.createStayServicePost(c.get("db"), insertStayServicePostSchema.parse(await c.req.json())),
143
+ data: await hospitalityService.createStayServicePost(c.get("db"), await parseJsonBody(c, insertStayServicePostSchema)),
143
144
  }, 201))
144
145
  .get("/stay-service-posts/:id", async (c) => {
145
146
  const row = await hospitalityService.getStayServicePostById(c.get("db"), c.req.param("id"));
@@ -148,7 +149,7 @@ export const hospitalityStayRoutes = new Hono()
148
149
  return c.json({ data: row });
149
150
  })
150
151
  .patch("/stay-service-posts/:id", async (c) => {
151
- const row = await hospitalityService.updateStayServicePost(c.get("db"), c.req.param("id"), updateStayServicePostSchema.parse(await c.req.json()));
152
+ const row = await hospitalityService.updateStayServicePost(c.get("db"), c.req.param("id"), await parseJsonBody(c, updateStayServicePostSchema));
152
153
  if (!row)
153
154
  return c.json(notFound("Stay service post"), 404);
154
155
  return c.json({ data: row });
@@ -160,11 +161,11 @@ export const hospitalityStayRoutes = new Hono()
160
161
  return c.json({ success: true });
161
162
  })
162
163
  .get("/stay-folios", async (c) => {
163
- const query = stayFolioListQuerySchema.parse(Object.fromEntries(new URL(c.req.url).searchParams));
164
+ const query = await parseQuery(c, stayFolioListQuerySchema);
164
165
  return c.json(await hospitalityService.listStayFolios(c.get("db"), query));
165
166
  })
166
167
  .post("/stay-folios", async (c) => c.json({
167
- data: await hospitalityService.createStayFolio(c.get("db"), insertStayFolioSchema.parse(await c.req.json())),
168
+ data: await hospitalityService.createStayFolio(c.get("db"), await parseJsonBody(c, insertStayFolioSchema)),
168
169
  }, 201))
169
170
  .get("/stay-folios/:id", async (c) => {
170
171
  const row = await hospitalityService.getStayFolioById(c.get("db"), c.req.param("id"));
@@ -173,7 +174,7 @@ export const hospitalityStayRoutes = new Hono()
173
174
  return c.json({ data: row });
174
175
  })
175
176
  .patch("/stay-folios/:id", async (c) => {
176
- const row = await hospitalityService.updateStayFolio(c.get("db"), c.req.param("id"), updateStayFolioSchema.parse(await c.req.json()));
177
+ const row = await hospitalityService.updateStayFolio(c.get("db"), c.req.param("id"), await parseJsonBody(c, updateStayFolioSchema));
177
178
  if (!row)
178
179
  return c.json(notFound("Stay folio"), 404);
179
180
  return c.json({ data: row });
@@ -185,11 +186,11 @@ export const hospitalityStayRoutes = new Hono()
185
186
  return c.json({ success: true });
186
187
  })
187
188
  .get("/stay-folio-lines", async (c) => {
188
- const query = stayFolioLineListQuerySchema.parse(Object.fromEntries(new URL(c.req.url).searchParams));
189
+ const query = await parseQuery(c, stayFolioLineListQuerySchema);
189
190
  return c.json(await hospitalityService.listStayFolioLines(c.get("db"), query));
190
191
  })
191
192
  .post("/stay-folio-lines", async (c) => c.json({
192
- data: await hospitalityService.createStayFolioLine(c.get("db"), insertStayFolioLineSchema.parse(await c.req.json())),
193
+ data: await hospitalityService.createStayFolioLine(c.get("db"), await parseJsonBody(c, insertStayFolioLineSchema)),
193
194
  }, 201))
194
195
  .get("/stay-folio-lines/:id", async (c) => {
195
196
  const row = await hospitalityService.getStayFolioLineById(c.get("db"), c.req.param("id"));
@@ -198,7 +199,7 @@ export const hospitalityStayRoutes = new Hono()
198
199
  return c.json({ data: row });
199
200
  })
200
201
  .patch("/stay-folio-lines/:id", async (c) => {
201
- const row = await hospitalityService.updateStayFolioLine(c.get("db"), c.req.param("id"), updateStayFolioLineSchema.parse(await c.req.json()));
202
+ const row = await hospitalityService.updateStayFolioLine(c.get("db"), c.req.param("id"), await parseJsonBody(c, updateStayFolioLineSchema));
202
203
  if (!row)
203
204
  return c.json(notFound("Stay folio line"), 404);
204
205
  return c.json({ data: row });