@instockng/api-client 1.0.7 → 1.0.9

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 (70) hide show
  1. package/dist/apps/backend/src/http-app.js +28 -0
  2. package/dist/apps/backend/src/lib/brand-response.d.ts +1 -1
  3. package/dist/apps/backend/src/lib/cart-helpers.d.ts +13 -11
  4. package/dist/apps/backend/src/lib/cart-helpers.js +28 -0
  5. package/dist/apps/backend/src/lib/cart-response.d.ts +5 -5
  6. package/dist/apps/backend/src/lib/clerk.js +23 -0
  7. package/dist/apps/backend/src/lib/delivery-zone-response.d.ts +6 -4
  8. package/dist/apps/backend/src/lib/discount-code-response.d.ts +2 -2
  9. package/dist/apps/backend/src/lib/meta-capi.d.ts +5 -0
  10. package/dist/apps/backend/src/lib/meta-capi.js +33 -2
  11. package/dist/apps/backend/src/lib/order-recovery.d.ts +30 -24
  12. package/dist/apps/backend/src/lib/order-response.d.ts +9 -7
  13. package/dist/apps/backend/src/lib/product-response.d.ts +4 -4
  14. package/dist/apps/backend/src/lib/sentry.d.ts +48 -0
  15. package/dist/apps/backend/src/lib/sentry.js +180 -0
  16. package/dist/apps/backend/src/lib/utils.d.ts +1 -1
  17. package/dist/apps/backend/src/lib/utils.js +1 -1
  18. package/dist/apps/backend/src/notifications/producers/meta-capi-producer.js +18 -4
  19. package/dist/apps/backend/src/routes/admin/abandoned-carts.d.ts +18 -10
  20. package/dist/apps/backend/src/routes/admin/brands.d.ts +4 -4
  21. package/dist/apps/backend/src/routes/admin/customers.d.ts +13 -7
  22. package/dist/apps/backend/src/routes/admin/delivery-zones.d.ts +23 -15
  23. package/dist/apps/backend/src/routes/admin/discount-codes.d.ts +10 -10
  24. package/dist/apps/backend/src/routes/admin/inventory.d.ts +4 -0
  25. package/dist/apps/backend/src/routes/admin/inventory.js +10 -0
  26. package/dist/apps/backend/src/routes/admin/orders.d.ts +78 -42
  27. package/dist/apps/backend/src/routes/admin/orders.js +25 -0
  28. package/dist/apps/backend/src/routes/admin/products.d.ts +28 -12
  29. package/dist/apps/backend/src/routes/admin/products.js +34 -15
  30. package/dist/apps/backend/src/routes/admin/stats.d.ts +13 -7
  31. package/dist/apps/backend/src/routes/admin/variants.d.ts +5 -5
  32. package/dist/apps/backend/src/routes/admin/variants.js +42 -18
  33. package/dist/apps/backend/src/routes/admin/warehouses.d.ts +11 -7
  34. package/dist/apps/backend/src/routes/public/brands.d.ts +1 -1
  35. package/dist/apps/backend/src/routes/public/carts.d.ts +85 -47
  36. package/dist/apps/backend/src/routes/public/carts.js +148 -1
  37. package/dist/apps/backend/src/routes/public/delivery-zones.d.ts +2 -0
  38. package/dist/apps/backend/src/routes/public/delivery-zones.js +2 -0
  39. package/dist/apps/backend/src/routes/public/orders.d.ts +26 -14
  40. package/dist/apps/backend/src/routes/public/orders.js +24 -0
  41. package/dist/apps/backend/src/routes/public/products.d.ts +14 -6
  42. package/dist/apps/backend/src/types/index.d.ts +1 -0
  43. package/dist/apps/backend/src/validators/delivery-zone.d.ts +4 -0
  44. package/dist/apps/backend/src/validators/delivery-zone.js +4 -0
  45. package/dist/apps/backend/src/validators/discount-code.d.ts +3 -3
  46. package/dist/apps/backend/src/validators/order.d.ts +3 -1
  47. package/dist/apps/backend/src/validators/order.js +3 -1
  48. package/dist/packages/api-client/src/fetchers/brands.d.ts +1 -1
  49. package/dist/packages/api-client/src/fetchers/carts.d.ts +85 -47
  50. package/dist/packages/api-client/src/fetchers/delivery-zones.d.ts +2 -0
  51. package/dist/packages/api-client/src/fetchers/orders.d.ts +26 -14
  52. package/dist/packages/api-client/src/fetchers/products.d.ts +14 -6
  53. package/dist/packages/api-client/src/hooks/admin/abandoned-carts.d.ts +18 -10
  54. package/dist/packages/api-client/src/hooks/admin/brands.d.ts +4 -4
  55. package/dist/packages/api-client/src/hooks/admin/customers.d.ts +13 -7
  56. package/dist/packages/api-client/src/hooks/admin/delivery-zones.d.ts +23 -15
  57. package/dist/packages/api-client/src/hooks/admin/discount-codes.d.ts +10 -10
  58. package/dist/packages/api-client/src/hooks/admin/inventory.d.ts +4 -0
  59. package/dist/packages/api-client/src/hooks/admin/orders.d.ts +78 -42
  60. package/dist/packages/api-client/src/hooks/admin/products.d.ts +14 -6
  61. package/dist/packages/api-client/src/hooks/admin/stats.d.ts +13 -7
  62. package/dist/packages/api-client/src/hooks/admin/variants.d.ts +5 -5
  63. package/dist/packages/api-client/src/hooks/admin/warehouses.d.ts +11 -7
  64. package/dist/packages/api-client/src/hooks/public/brands.d.ts +1 -1
  65. package/dist/packages/api-client/src/hooks/public/carts.d.ts +85 -47
  66. package/dist/packages/api-client/src/hooks/public/delivery-zones.d.ts +2 -0
  67. package/dist/packages/api-client/src/hooks/public/orders.d.ts +26 -14
  68. package/dist/packages/api-client/src/hooks/public/products.d.ts +14 -6
  69. package/dist/packages/api-client/src/rpc-client.d.ts +335 -187
  70. package/package.json +1 -1
@@ -17,8 +17,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
17
17
  createdAt: string;
18
18
  updatedAt: string;
19
19
  deletedAt: string;
20
- name: string;
21
20
  id: string;
21
+ name: string;
22
22
  slug: string;
23
23
  logoUrl: string | null;
24
24
  siteUrl: string;
@@ -35,18 +35,20 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
35
35
  createdAt: string;
36
36
  updatedAt: string;
37
37
  deletedAt: string;
38
- name: string;
39
38
  id: string;
39
+ name: string;
40
40
  isActive: boolean;
41
41
  };
42
- name: string;
43
42
  id: string;
43
+ name: string;
44
44
  brandId: string | null;
45
45
  stateId: string;
46
46
  allowCOD: boolean;
47
47
  allowOnline: boolean;
48
48
  waybillOnly: boolean;
49
49
  estimatedDays: number | null;
50
+ noteTitle: string | null;
51
+ noteContent: string | null;
50
52
  isActive: boolean;
51
53
  };
52
54
  items: {
@@ -60,8 +62,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
60
62
  createdAt: string;
61
63
  updatedAt: string;
62
64
  deletedAt: string;
63
- name: string;
64
65
  id: string;
66
+ name: string;
65
67
  slug: string;
66
68
  brandId: string;
67
69
  isActive: boolean;
@@ -137,7 +139,9 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
137
139
  includes?: boolean;
138
140
  flatMap?: boolean;
139
141
  flat?: boolean;
142
+ at?: boolean;
140
143
  };
144
+ at: never;
141
145
  };
142
146
  } | {
143
147
  [x: number]: string | number | boolean | {
@@ -210,11 +214,13 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
210
214
  includes?: boolean;
211
215
  flatMap?: boolean;
212
216
  flat?: boolean;
217
+ at?: boolean;
213
218
  };
219
+ at: never;
214
220
  };
215
221
  };
216
- name: string | null;
217
222
  id: string;
223
+ name: string | null;
218
224
  isActive: boolean;
219
225
  thumbnailUrl: string | null;
220
226
  productId: string;
@@ -226,8 +232,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
226
232
  createdAt: string;
227
233
  updatedAt: string;
228
234
  deletedAt: string;
229
- name: string;
230
235
  id: string;
236
+ name: string;
231
237
  isActive: boolean;
232
238
  address: string | null;
233
239
  city: string | null;
@@ -239,8 +245,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
239
245
  warehouseId: string | null;
240
246
  quantity: number;
241
247
  }[];
242
- id: string;
243
248
  email: string | null;
249
+ id: string;
244
250
  brandId: string;
245
251
  deliveryZoneId: string;
246
252
  recoveryAttempts: number;
@@ -304,8 +310,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
304
310
  createdAt: string;
305
311
  updatedAt: string;
306
312
  deletedAt: string;
307
- name: string;
308
313
  id: string;
314
+ name: string;
309
315
  slug: string;
310
316
  logoUrl: string | null;
311
317
  siteUrl: string;
@@ -322,18 +328,20 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
322
328
  createdAt: string;
323
329
  updatedAt: string;
324
330
  deletedAt: string;
325
- name: string;
326
331
  id: string;
332
+ name: string;
327
333
  isActive: boolean;
328
334
  };
329
- name: string;
330
335
  id: string;
336
+ name: string;
331
337
  brandId: string | null;
332
338
  stateId: string;
333
339
  allowCOD: boolean;
334
340
  allowOnline: boolean;
335
341
  waybillOnly: boolean;
336
342
  estimatedDays: number | null;
343
+ noteTitle: string | null;
344
+ noteContent: string | null;
337
345
  isActive: boolean;
338
346
  };
339
347
  items: {
@@ -347,8 +355,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
347
355
  createdAt: string;
348
356
  updatedAt: string;
349
357
  deletedAt: string;
350
- name: string;
351
358
  id: string;
359
+ name: string;
352
360
  slug: string;
353
361
  brandId: string;
354
362
  isActive: boolean;
@@ -424,7 +432,9 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
424
432
  includes?: boolean;
425
433
  flatMap?: boolean;
426
434
  flat?: boolean;
435
+ at?: boolean;
427
436
  };
437
+ at: never;
428
438
  };
429
439
  } | {
430
440
  [x: number]: string | number | boolean | {
@@ -497,11 +507,13 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
497
507
  includes?: boolean;
498
508
  flatMap?: boolean;
499
509
  flat?: boolean;
510
+ at?: boolean;
500
511
  };
512
+ at: never;
501
513
  };
502
514
  };
503
- name: string | null;
504
515
  id: string;
516
+ name: string | null;
505
517
  isActive: boolean;
506
518
  thumbnailUrl: string | null;
507
519
  productId: string;
@@ -513,8 +525,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
513
525
  createdAt: string;
514
526
  updatedAt: string;
515
527
  deletedAt: string;
516
- name: string;
517
528
  id: string;
529
+ name: string;
518
530
  isActive: boolean;
519
531
  address: string | null;
520
532
  city: string | null;
@@ -526,8 +538,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
526
538
  warehouseId: string | null;
527
539
  quantity: number;
528
540
  }[];
529
- id: string;
530
541
  email: string | null;
542
+ id: string;
531
543
  brandId: string;
532
544
  deliveryZoneId: string;
533
545
  recoveryAttempts: number;
@@ -591,8 +603,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
591
603
  createdAt: string;
592
604
  updatedAt: string;
593
605
  deletedAt: string;
594
- name: string;
595
606
  id: string;
607
+ name: string;
596
608
  slug: string;
597
609
  logoUrl: string | null;
598
610
  siteUrl: string;
@@ -609,18 +621,20 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
609
621
  createdAt: string;
610
622
  updatedAt: string;
611
623
  deletedAt: string;
612
- name: string;
613
624
  id: string;
625
+ name: string;
614
626
  isActive: boolean;
615
627
  };
616
- name: string;
617
628
  id: string;
629
+ name: string;
618
630
  brandId: string | null;
619
631
  stateId: string;
620
632
  allowCOD: boolean;
621
633
  allowOnline: boolean;
622
634
  waybillOnly: boolean;
623
635
  estimatedDays: number | null;
636
+ noteTitle: string | null;
637
+ noteContent: string | null;
624
638
  isActive: boolean;
625
639
  };
626
640
  items: {
@@ -634,8 +648,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
634
648
  createdAt: string;
635
649
  updatedAt: string;
636
650
  deletedAt: string;
637
- name: string;
638
651
  id: string;
652
+ name: string;
639
653
  slug: string;
640
654
  brandId: string;
641
655
  isActive: boolean;
@@ -711,7 +725,9 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
711
725
  includes?: boolean;
712
726
  flatMap?: boolean;
713
727
  flat?: boolean;
728
+ at?: boolean;
714
729
  };
730
+ at: never;
715
731
  };
716
732
  } | {
717
733
  [x: number]: string | number | boolean | {
@@ -784,11 +800,13 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
784
800
  includes?: boolean;
785
801
  flatMap?: boolean;
786
802
  flat?: boolean;
803
+ at?: boolean;
787
804
  };
805
+ at: never;
788
806
  };
789
807
  };
790
- name: string | null;
791
808
  id: string;
809
+ name: string | null;
792
810
  isActive: boolean;
793
811
  thumbnailUrl: string | null;
794
812
  productId: string;
@@ -800,8 +818,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
800
818
  createdAt: string;
801
819
  updatedAt: string;
802
820
  deletedAt: string;
803
- name: string;
804
821
  id: string;
822
+ name: string;
805
823
  isActive: boolean;
806
824
  address: string | null;
807
825
  city: string | null;
@@ -813,8 +831,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
813
831
  warehouseId: string | null;
814
832
  quantity: number;
815
833
  }[];
816
- id: string;
817
834
  email: string | null;
835
+ id: string;
818
836
  brandId: string;
819
837
  deliveryZoneId: string;
820
838
  recoveryAttempts: number;
@@ -889,8 +907,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
889
907
  createdAt: string;
890
908
  updatedAt: string;
891
909
  deletedAt: string;
892
- name: string;
893
910
  id: string;
911
+ name: string;
894
912
  slug: string;
895
913
  logoUrl: string | null;
896
914
  siteUrl: string;
@@ -907,18 +925,20 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
907
925
  createdAt: string;
908
926
  updatedAt: string;
909
927
  deletedAt: string;
910
- name: string;
911
928
  id: string;
929
+ name: string;
912
930
  isActive: boolean;
913
931
  };
914
- name: string;
915
932
  id: string;
933
+ name: string;
916
934
  brandId: string | null;
917
935
  stateId: string;
918
936
  allowCOD: boolean;
919
937
  allowOnline: boolean;
920
938
  waybillOnly: boolean;
921
939
  estimatedDays: number | null;
940
+ noteTitle: string | null;
941
+ noteContent: string | null;
922
942
  isActive: boolean;
923
943
  };
924
944
  items: {
@@ -932,8 +952,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
932
952
  createdAt: string;
933
953
  updatedAt: string;
934
954
  deletedAt: string;
935
- name: string;
936
955
  id: string;
956
+ name: string;
937
957
  slug: string;
938
958
  brandId: string;
939
959
  isActive: boolean;
@@ -1009,7 +1029,9 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
1009
1029
  includes?: boolean;
1010
1030
  flatMap?: boolean;
1011
1031
  flat?: boolean;
1032
+ at?: boolean;
1012
1033
  };
1034
+ at: never;
1013
1035
  };
1014
1036
  } | {
1015
1037
  [x: number]: string | number | boolean | {
@@ -1082,11 +1104,13 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
1082
1104
  includes?: boolean;
1083
1105
  flatMap?: boolean;
1084
1106
  flat?: boolean;
1107
+ at?: boolean;
1085
1108
  };
1109
+ at: never;
1086
1110
  };
1087
1111
  };
1088
- name: string | null;
1089
1112
  id: string;
1113
+ name: string | null;
1090
1114
  isActive: boolean;
1091
1115
  thumbnailUrl: string | null;
1092
1116
  productId: string;
@@ -1098,8 +1122,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
1098
1122
  createdAt: string;
1099
1123
  updatedAt: string;
1100
1124
  deletedAt: string;
1101
- name: string;
1102
1125
  id: string;
1126
+ name: string;
1103
1127
  isActive: boolean;
1104
1128
  address: string | null;
1105
1129
  city: string | null;
@@ -1111,8 +1135,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
1111
1135
  warehouseId: string | null;
1112
1136
  quantity: number;
1113
1137
  }[];
1114
- id: string;
1115
1138
  email: string | null;
1139
+ id: string;
1116
1140
  brandId: string;
1117
1141
  deliveryZoneId: string;
1118
1142
  recoveryAttempts: number;
@@ -1157,8 +1181,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
1157
1181
  };
1158
1182
  output: {
1159
1183
  brand: {
1160
- name: string;
1161
1184
  id: string;
1185
+ name: string;
1162
1186
  slug: string;
1163
1187
  logoUrl: string | null;
1164
1188
  siteUrl: string;
@@ -1170,15 +1194,15 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
1170
1194
  };
1171
1195
  deliveryZone: {
1172
1196
  state: {
1173
- name: string;
1174
1197
  id: string;
1198
+ name: string;
1175
1199
  createdAt: string;
1176
1200
  updatedAt: string;
1177
1201
  deletedAt: string;
1178
1202
  isActive: boolean;
1179
1203
  };
1180
- name: string;
1181
1204
  id: string;
1205
+ name: string;
1182
1206
  createdAt: string;
1183
1207
  updatedAt: string;
1184
1208
  deletedAt: string;
@@ -1190,12 +1214,14 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
1190
1214
  allowOnline: boolean;
1191
1215
  waybillOnly: boolean;
1192
1216
  estimatedDays: number | null;
1217
+ noteTitle: string | null;
1218
+ noteContent: string | null;
1193
1219
  isActive: boolean;
1194
1220
  };
1195
1221
  items: {
1196
1222
  warehouse: {
1197
- name: string;
1198
1223
  id: string;
1224
+ name: string;
1199
1225
  createdAt: string;
1200
1226
  updatedAt: string;
1201
1227
  deletedAt: string;
@@ -1206,8 +1232,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
1206
1232
  };
1207
1233
  variant: {
1208
1234
  product: {
1209
- name: string;
1210
1235
  id: string;
1236
+ name: string;
1211
1237
  slug: string;
1212
1238
  createdAt: string;
1213
1239
  updatedAt: string;
@@ -1286,7 +1312,9 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
1286
1312
  includes?: boolean;
1287
1313
  flatMap?: boolean;
1288
1314
  flat?: boolean;
1315
+ at?: boolean;
1289
1316
  };
1317
+ at: never;
1290
1318
  };
1291
1319
  } | {
1292
1320
  [x: number]: string | number | boolean | {
@@ -1359,11 +1387,13 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
1359
1387
  includes?: boolean;
1360
1388
  flatMap?: boolean;
1361
1389
  flat?: boolean;
1390
+ at?: boolean;
1362
1391
  };
1392
+ at: never;
1363
1393
  };
1364
1394
  };
1365
- name: string | null;
1366
1395
  id: string;
1396
+ name: string | null;
1367
1397
  createdAt: string;
1368
1398
  updatedAt: string;
1369
1399
  deletedAt: string;
@@ -1382,8 +1412,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
1382
1412
  quantity: number;
1383
1413
  priceAtPurchase: string;
1384
1414
  }[];
1385
- id: string;
1386
1415
  email: string | null;
1416
+ id: string;
1387
1417
  createdAt: string;
1388
1418
  updatedAt: string;
1389
1419
  deletedAt: string;
@@ -1452,8 +1482,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
1452
1482
  createdAt: string;
1453
1483
  updatedAt: string;
1454
1484
  deletedAt: string;
1455
- name: string;
1456
1485
  id: string;
1486
+ name: string;
1457
1487
  slug: string;
1458
1488
  logoUrl: string | null;
1459
1489
  siteUrl: string;
@@ -1470,18 +1500,20 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
1470
1500
  createdAt: string;
1471
1501
  updatedAt: string;
1472
1502
  deletedAt: string;
1473
- name: string;
1474
1503
  id: string;
1504
+ name: string;
1475
1505
  isActive: boolean;
1476
1506
  };
1477
- name: string;
1478
1507
  id: string;
1508
+ name: string;
1479
1509
  brandId: string | null;
1480
1510
  stateId: string;
1481
1511
  allowCOD: boolean;
1482
1512
  allowOnline: boolean;
1483
1513
  waybillOnly: boolean;
1484
1514
  estimatedDays: number | null;
1515
+ noteTitle: string | null;
1516
+ noteContent: string | null;
1485
1517
  isActive: boolean;
1486
1518
  };
1487
1519
  items: {
@@ -1495,8 +1527,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
1495
1527
  createdAt: string;
1496
1528
  updatedAt: string;
1497
1529
  deletedAt: string;
1498
- name: string;
1499
1530
  id: string;
1531
+ name: string;
1500
1532
  slug: string;
1501
1533
  brandId: string;
1502
1534
  isActive: boolean;
@@ -1572,7 +1604,9 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
1572
1604
  includes?: boolean;
1573
1605
  flatMap?: boolean;
1574
1606
  flat?: boolean;
1607
+ at?: boolean;
1575
1608
  };
1609
+ at: never;
1576
1610
  };
1577
1611
  } | {
1578
1612
  [x: number]: string | number | boolean | {
@@ -1645,11 +1679,13 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
1645
1679
  includes?: boolean;
1646
1680
  flatMap?: boolean;
1647
1681
  flat?: boolean;
1682
+ at?: boolean;
1648
1683
  };
1684
+ at: never;
1649
1685
  };
1650
1686
  };
1651
- name: string | null;
1652
1687
  id: string;
1688
+ name: string | null;
1653
1689
  isActive: boolean;
1654
1690
  thumbnailUrl: string | null;
1655
1691
  productId: string;
@@ -1661,8 +1697,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
1661
1697
  createdAt: string;
1662
1698
  updatedAt: string;
1663
1699
  deletedAt: string;
1664
- name: string;
1665
1700
  id: string;
1701
+ name: string;
1666
1702
  isActive: boolean;
1667
1703
  address: string | null;
1668
1704
  city: string | null;
@@ -1674,8 +1710,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
1674
1710
  warehouseId: string | null;
1675
1711
  quantity: number;
1676
1712
  }[];
1677
- id: string;
1678
1713
  email: string | null;
1714
+ id: string;
1679
1715
  brandId: string;
1680
1716
  deliveryZoneId: string;
1681
1717
  recoveryAttempts: number;
@@ -9,6 +9,7 @@ import { OrderStatus } from '@prisma/client';
9
9
  import { formatOrderResponse } from '../../lib/order-response';
10
10
  import { markOrderAsProspect } from '../../lib/order-recovery';
11
11
  import { ORDER_INCLUDE_FULL } from '../../lib/cart-helpers';
12
+ import { captureException } from '../../lib/sentry';
12
13
  const app = new Hono()
13
14
  .post('/', zValidator('json', createOrderSchema), async (c) => {
14
15
  try {
@@ -88,6 +89,7 @@ const app = new Hono()
88
89
  brandId: brand.id,
89
90
  firstName: input.firstName,
90
91
  lastName: input.lastName,
92
+ email: input.email,
91
93
  phone: input.phone,
92
94
  address: input.address,
93
95
  city: input.city,
@@ -116,6 +118,15 @@ const app = new Hono()
116
118
  }
117
119
  catch (error) {
118
120
  console.error('Error creating order:', error);
121
+ // CRITICAL: Admin order creation failures
122
+ captureException(error instanceof Error ? error : new Error(String(error)), {
123
+ level: 'fatal',
124
+ tags: {
125
+ error_code: 'ADMIN_ORDER_CREATE_ERROR',
126
+ endpoint: 'POST /admin/orders',
127
+ },
128
+ honoContext: c,
129
+ });
119
130
  return c.json({ error: { code: 'INTERNAL_ERROR', message: error.message } }, 500);
120
131
  }
121
132
  }).get('/', async (c) => {
@@ -264,6 +275,7 @@ const app = new Hono()
264
275
  data: {
265
276
  firstName: input.firstName ?? order.firstName,
266
277
  lastName: input.lastName ?? order.lastName,
278
+ email: input.email ?? order.email,
267
279
  phone: input.phone ?? order.phone,
268
280
  address: input.address ?? order.address,
269
281
  city: input.city ?? order.city,
@@ -296,6 +308,7 @@ const app = new Hono()
296
308
  data: {
297
309
  firstName: input.firstName,
298
310
  lastName: input.lastName,
311
+ email: input.email,
299
312
  phone: input.phone,
300
313
  address: input.address,
301
314
  city: input.city,
@@ -505,6 +518,18 @@ const app = new Hono()
505
518
  return c.json(formatOrderResponse(updatedOrder));
506
519
  }
507
520
  catch (error) {
521
+ // CRITICAL: Order status updates include inventory adjustments
522
+ captureException(error instanceof Error ? error : new Error(String(error)), {
523
+ level: 'fatal',
524
+ tags: {
525
+ error_code: 'ORDER_STATUS_UPDATE_ERROR',
526
+ endpoint: 'PATCH /admin/orders/:id/status',
527
+ },
528
+ extra: {
529
+ orderId: c.req.param('id'),
530
+ },
531
+ honoContext: c,
532
+ });
508
533
  return c.json({
509
534
  error: { code: 'INTERNAL_ERROR', message: 'Failed to update order status' },
510
535
  }, 500);