@voyant-travel/finance 0.137.6 → 0.137.8

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.
@@ -77,6 +77,10 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
77
77
  };
78
78
  output: {
79
79
  error: string;
80
+ code?: string | undefined;
81
+ details?: {
82
+ [x: string]: import("hono/utils/types").JSONValue;
83
+ } | undefined;
80
84
  };
81
85
  outputFormat: "json";
82
86
  status: 400;
@@ -124,6 +128,10 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
124
128
  };
125
129
  output: {
126
130
  error: string;
131
+ code?: string | undefined;
132
+ details?: {
133
+ [x: string]: import("hono/utils/types").JSONValue;
134
+ } | undefined;
127
135
  };
128
136
  outputFormat: "json";
129
137
  status: 404;
@@ -175,6 +183,10 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
175
183
  };
176
184
  output: {
177
185
  error: string;
186
+ code?: string | undefined;
187
+ details?: {
188
+ [x: string]: import("hono/utils/types").JSONValue;
189
+ } | undefined;
178
190
  };
179
191
  outputFormat: "json";
180
192
  status: 400;
@@ -197,6 +209,10 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
197
209
  };
198
210
  output: {
199
211
  error: string;
212
+ code?: string | undefined;
213
+ details?: {
214
+ [x: string]: import("hono/utils/types").JSONValue;
215
+ } | undefined;
200
216
  };
201
217
  outputFormat: "json";
202
218
  status: 404;
@@ -248,6 +264,10 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
248
264
  };
249
265
  output: {
250
266
  error: string;
267
+ code?: string | undefined;
268
+ details?: {
269
+ [x: string]: import("hono/utils/types").JSONValue;
270
+ } | undefined;
251
271
  };
252
272
  outputFormat: "json";
253
273
  status: 404;
@@ -309,6 +329,10 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
309
329
  };
310
330
  output: {
311
331
  error: string;
332
+ code?: string | undefined;
333
+ details?: {
334
+ [x: string]: import("hono/utils/types").JSONValue;
335
+ } | undefined;
312
336
  };
313
337
  outputFormat: "json";
314
338
  status: 400;
@@ -348,6 +372,10 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
348
372
  };
349
373
  output: {
350
374
  error: string;
375
+ code?: string | undefined;
376
+ details?: {
377
+ [x: string]: import("hono/utils/types").JSONValue;
378
+ } | undefined;
351
379
  };
352
380
  outputFormat: "json";
353
381
  status: 404;
@@ -391,6 +419,10 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
391
419
  };
392
420
  output: {
393
421
  error: string;
422
+ code?: string | undefined;
423
+ details?: {
424
+ [x: string]: import("hono/utils/types").JSONValue;
425
+ } | undefined;
394
426
  };
395
427
  outputFormat: "json";
396
428
  status: 400;
@@ -410,6 +442,10 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
410
442
  };
411
443
  output: {
412
444
  error: string;
445
+ code?: string | undefined;
446
+ details?: {
447
+ [x: string]: import("hono/utils/types").JSONValue;
448
+ } | undefined;
413
449
  };
414
450
  outputFormat: "json";
415
451
  status: 404;
@@ -453,6 +489,10 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
453
489
  };
454
490
  output: {
455
491
  error: string;
492
+ code?: string | undefined;
493
+ details?: {
494
+ [x: string]: import("hono/utils/types").JSONValue;
495
+ } | undefined;
456
496
  };
457
497
  outputFormat: "json";
458
498
  status: 404;
@@ -477,7 +517,7 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
477
517
  limit?: unknown;
478
518
  offset?: unknown;
479
519
  code?: string | undefined;
480
- active?: unknown;
520
+ active?: "0" | "1" | "true" | "false" | undefined;
481
521
  };
482
522
  };
483
523
  output: {
@@ -521,6 +561,10 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
521
561
  };
522
562
  output: {
523
563
  error: string;
564
+ code?: string | undefined;
565
+ details?: {
566
+ [x: string]: import("hono/utils/types").JSONValue;
567
+ } | undefined;
524
568
  };
525
569
  outputFormat: "json";
526
570
  status: 400;
@@ -568,6 +612,10 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
568
612
  };
569
613
  output: {
570
614
  error: string;
615
+ code?: string | undefined;
616
+ details?: {
617
+ [x: string]: import("hono/utils/types").JSONValue;
618
+ } | undefined;
571
619
  };
572
620
  outputFormat: "json";
573
621
  status: 404;
@@ -619,6 +667,10 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
619
667
  };
620
668
  output: {
621
669
  error: string;
670
+ code?: string | undefined;
671
+ details?: {
672
+ [x: string]: import("hono/utils/types").JSONValue;
673
+ } | undefined;
622
674
  };
623
675
  outputFormat: "json";
624
676
  status: 400;
@@ -642,6 +694,10 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
642
694
  };
643
695
  output: {
644
696
  error: string;
697
+ code?: string | undefined;
698
+ details?: {
699
+ [x: string]: import("hono/utils/types").JSONValue;
700
+ } | undefined;
645
701
  };
646
702
  outputFormat: "json";
647
703
  status: 404;
@@ -693,6 +749,10 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
693
749
  };
694
750
  output: {
695
751
  error: string;
752
+ code?: string | undefined;
753
+ details?: {
754
+ [x: string]: import("hono/utils/types").JSONValue;
755
+ } | undefined;
696
756
  };
697
757
  outputFormat: "json";
698
758
  status: 404;
@@ -760,6 +820,10 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
760
820
  };
761
821
  output: {
762
822
  error: string;
823
+ code?: string | undefined;
824
+ details?: {
825
+ [x: string]: import("hono/utils/types").JSONValue;
826
+ } | undefined;
763
827
  };
764
828
  outputFormat: "json";
765
829
  status: 400;
@@ -805,6 +869,10 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
805
869
  };
806
870
  output: {
807
871
  error: string;
872
+ code?: string | undefined;
873
+ details?: {
874
+ [x: string]: import("hono/utils/types").JSONValue;
875
+ } | undefined;
808
876
  };
809
877
  outputFormat: "json";
810
878
  status: 404;
@@ -854,6 +922,10 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
854
922
  };
855
923
  output: {
856
924
  error: string;
925
+ code?: string | undefined;
926
+ details?: {
927
+ [x: string]: import("hono/utils/types").JSONValue;
928
+ } | undefined;
857
929
  };
858
930
  outputFormat: "json";
859
931
  status: 400;
@@ -876,6 +948,10 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
876
948
  };
877
949
  output: {
878
950
  error: string;
951
+ code?: string | undefined;
952
+ details?: {
953
+ [x: string]: import("hono/utils/types").JSONValue;
954
+ } | undefined;
879
955
  };
880
956
  outputFormat: "json";
881
957
  status: 404;
@@ -925,6 +1001,10 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
925
1001
  };
926
1002
  output: {
927
1003
  error: string;
1004
+ code?: string | undefined;
1005
+ details?: {
1006
+ [x: string]: import("hono/utils/types").JSONValue;
1007
+ } | undefined;
928
1008
  };
929
1009
  outputFormat: "json";
930
1010
  status: 404;
@@ -997,6 +1077,10 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
997
1077
  };
998
1078
  output: {
999
1079
  error: string;
1080
+ code?: string | undefined;
1081
+ details?: {
1082
+ [x: string]: import("hono/utils/types").JSONValue;
1083
+ } | undefined;
1000
1084
  };
1001
1085
  outputFormat: "json";
1002
1086
  status: 400;
@@ -1046,6 +1130,10 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
1046
1130
  };
1047
1131
  output: {
1048
1132
  error: string;
1133
+ code?: string | undefined;
1134
+ details?: {
1135
+ [x: string]: import("hono/utils/types").JSONValue;
1136
+ } | undefined;
1049
1137
  };
1050
1138
  outputFormat: "json";
1051
1139
  status: 404;
@@ -1099,6 +1187,10 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
1099
1187
  };
1100
1188
  output: {
1101
1189
  error: string;
1190
+ code?: string | undefined;
1191
+ details?: {
1192
+ [x: string]: import("hono/utils/types").JSONValue;
1193
+ } | undefined;
1102
1194
  };
1103
1195
  outputFormat: "json";
1104
1196
  status: 400;
@@ -1123,6 +1215,10 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
1123
1215
  };
1124
1216
  output: {
1125
1217
  error: string;
1218
+ code?: string | undefined;
1219
+ details?: {
1220
+ [x: string]: import("hono/utils/types").JSONValue;
1221
+ } | undefined;
1126
1222
  };
1127
1223
  outputFormat: "json";
1128
1224
  status: 404;
@@ -1176,6 +1272,10 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
1176
1272
  };
1177
1273
  output: {
1178
1274
  error: string;
1275
+ code?: string | undefined;
1276
+ details?: {
1277
+ [x: string]: import("hono/utils/types").JSONValue;
1278
+ } | undefined;
1179
1279
  };
1180
1280
  outputFormat: "json";
1181
1281
  status: 404;
@@ -1292,6 +1392,10 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
1292
1392
  };
1293
1393
  output: {
1294
1394
  error: string;
1395
+ code?: string | undefined;
1396
+ details?: {
1397
+ [x: string]: import("hono/utils/types").JSONValue;
1398
+ } | undefined;
1295
1399
  };
1296
1400
  outputFormat: "json";
1297
1401
  status: 400;
@@ -1335,6 +1439,10 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
1335
1439
  };
1336
1440
  output: {
1337
1441
  error: string;
1442
+ code?: string | undefined;
1443
+ details?: {
1444
+ [x: string]: import("hono/utils/types").JSONValue;
1445
+ } | undefined;
1338
1446
  };
1339
1447
  outputFormat: "json";
1340
1448
  status: 404;
@@ -1366,6 +1474,10 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
1366
1474
  };
1367
1475
  output: {
1368
1476
  error: string;
1477
+ code?: string | undefined;
1478
+ details?: {
1479
+ [x: string]: import("hono/utils/types").JSONValue;
1480
+ } | undefined;
1369
1481
  };
1370
1482
  outputFormat: "json";
1371
1483
  status: 400;
@@ -1393,6 +1505,10 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
1393
1505
  };
1394
1506
  output: {
1395
1507
  error: string;
1508
+ code?: string | undefined;
1509
+ details?: {
1510
+ [x: string]: import("hono/utils/types").JSONValue;
1511
+ } | undefined;
1396
1512
  };
1397
1513
  outputFormat: "json";
1398
1514
  status: 404;
@@ -1452,6 +1568,10 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
1452
1568
  };
1453
1569
  output: {
1454
1570
  error: string;
1571
+ code?: string | undefined;
1572
+ details?: {
1573
+ [x: string]: import("hono/utils/types").JSONValue;
1574
+ } | undefined;
1455
1575
  };
1456
1576
  outputFormat: "json";
1457
1577
  status: 404;
@@ -1478,6 +1598,10 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
1478
1598
  };
1479
1599
  output: {
1480
1600
  error: string;
1601
+ code?: string | undefined;
1602
+ details?: {
1603
+ [x: string]: import("hono/utils/types").JSONValue;
1604
+ } | undefined;
1481
1605
  };
1482
1606
  outputFormat: "json";
1483
1607
  status: 404;
@@ -1503,6 +1627,10 @@ export declare const financeReferenceDataRoutes: OpenAPIHono<Env, import("hono/t
1503
1627
  };
1504
1628
  output: {
1505
1629
  error: string;
1630
+ code?: string | undefined;
1631
+ details?: {
1632
+ [x: string]: import("hono/utils/types").JSONValue;
1633
+ } | undefined;
1506
1634
  };
1507
1635
  outputFormat: "json";
1508
1636
  status: 409;
@@ -1 +1 @@
1
- {"version":3,"file":"routes-reference-data.d.ts","sourceRoot":"","sources":["../src/routes-reference-data.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAe,WAAW,EAAK,MAAM,mBAAmB,CAAA;AAI/D,OAAO,EAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAQL,CAAA"}
@@ -27,8 +27,13 @@ import { openApiValidationHook } from "@voyant-travel/hono";
27
27
  import { listResponseSchema } from "@voyant-travel/types";
28
28
  import { notFound } from "./routes-shared.js";
29
29
  import { financeService } from "./service.js";
30
+ import { ReferenceDataValidationError } from "./service-reference-data.js";
30
31
  import { insertInvoiceNumberSeriesSchema, insertInvoiceTemplateSchema, insertTaxClassSchema, insertTaxPolicyProfileSchema, insertTaxPolicyRuleSchema, insertTaxRegimeSchema, invoiceNumberSeriesListQuerySchema, invoiceTemplateListQuerySchema, taxClassListQuerySchema, taxPolicyProfileListQuerySchema, taxPolicyRuleListQuerySchema, taxRegimeListQuerySchema, updateInvoiceNumberSeriesSchema, updateInvoiceTemplateSchema, updateTaxClassSchema, updateTaxPolicyProfileSchema, updateTaxPolicyRuleSchema, updateTaxRegimeSchema, } from "./validation.js";
31
- const errorResponseSchema = z.object({ error: z.string() });
32
+ const errorResponseSchema = z.object({
33
+ error: z.string(),
34
+ code: z.string().optional(),
35
+ details: z.record(z.string(), z.unknown()).optional(),
36
+ });
32
37
  const deleteResponseSchema = z.object({ success: z.boolean() });
33
38
  const idParamSchema = z.object({ id: z.string() });
34
39
  /**
@@ -575,14 +580,32 @@ const deleteTaxClassRoute = createRoute({
575
580
  });
576
581
  const taxClassRoutes = new OpenAPIHono({ defaultHook: openApiValidationHook })
577
582
  .openapi(listTaxClassesRoute, async (c) => c.json(await financeService.listTaxClasses(c.get("db"), c.req.valid("query")), 200))
578
- .openapi(createTaxClassRoute, async (c) => c.json({ data: created(await financeService.createTaxClass(c.get("db"), c.req.valid("json"))) }, 201))
583
+ .openapi(createTaxClassRoute, async (c) => {
584
+ try {
585
+ return c.json({ data: created(await financeService.createTaxClass(c.get("db"), c.req.valid("json"))) }, 201);
586
+ }
587
+ catch (error) {
588
+ if (error instanceof ReferenceDataValidationError) {
589
+ return c.json({ error: error.message, code: error.code, details: error.details }, error.status);
590
+ }
591
+ throw error;
592
+ }
593
+ })
579
594
  .openapi(getTaxClassRoute, async (c) => {
580
595
  const row = await financeService.getTaxClassById(c.get("db"), c.req.valid("param").id);
581
596
  return row ? c.json({ data: row }, 200) : notFound(c, "Tax class not found");
582
597
  })
583
598
  .openapi(updateTaxClassRoute, async (c) => {
584
- const row = await financeService.updateTaxClass(c.get("db"), c.req.valid("param").id, c.req.valid("json"));
585
- return row ? c.json({ data: row }, 200) : notFound(c, "Tax class not found");
599
+ try {
600
+ const row = await financeService.updateTaxClass(c.get("db"), c.req.valid("param").id, c.req.valid("json"));
601
+ return row ? c.json({ data: row }, 200) : notFound(c, "Tax class not found");
602
+ }
603
+ catch (error) {
604
+ if (error instanceof ReferenceDataValidationError) {
605
+ return c.json({ error: error.message, code: error.code, details: error.details }, error.status);
606
+ }
607
+ throw error;
608
+ }
586
609
  })
587
610
  .openapi(deleteTaxClassRoute, async (c) => {
588
611
  const row = await financeService.deleteTaxClass(c.get("db"), c.req.valid("param").id);
package/dist/routes.d.ts CHANGED
@@ -6542,6 +6542,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
6542
6542
  };
6543
6543
  output: {
6544
6544
  error: string;
6545
+ code?: string | undefined;
6546
+ details?: {
6547
+ [x: string]: import("hono/utils/types").JSONValue;
6548
+ } | undefined;
6545
6549
  };
6546
6550
  outputFormat: "json";
6547
6551
  status: 400;
@@ -6589,6 +6593,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
6589
6593
  };
6590
6594
  output: {
6591
6595
  error: string;
6596
+ code?: string | undefined;
6597
+ details?: {
6598
+ [x: string]: import("hono/utils/types").JSONValue;
6599
+ } | undefined;
6592
6600
  };
6593
6601
  outputFormat: "json";
6594
6602
  status: 404;
@@ -6640,6 +6648,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
6640
6648
  };
6641
6649
  output: {
6642
6650
  error: string;
6651
+ code?: string | undefined;
6652
+ details?: {
6653
+ [x: string]: import("hono/utils/types").JSONValue;
6654
+ } | undefined;
6643
6655
  };
6644
6656
  outputFormat: "json";
6645
6657
  status: 400;
@@ -6662,6 +6674,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
6662
6674
  };
6663
6675
  output: {
6664
6676
  error: string;
6677
+ code?: string | undefined;
6678
+ details?: {
6679
+ [x: string]: import("hono/utils/types").JSONValue;
6680
+ } | undefined;
6665
6681
  };
6666
6682
  outputFormat: "json";
6667
6683
  status: 404;
@@ -6713,6 +6729,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
6713
6729
  };
6714
6730
  output: {
6715
6731
  error: string;
6732
+ code?: string | undefined;
6733
+ details?: {
6734
+ [x: string]: import("hono/utils/types").JSONValue;
6735
+ } | undefined;
6716
6736
  };
6717
6737
  outputFormat: "json";
6718
6738
  status: 404;
@@ -6774,6 +6794,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
6774
6794
  };
6775
6795
  output: {
6776
6796
  error: string;
6797
+ code?: string | undefined;
6798
+ details?: {
6799
+ [x: string]: import("hono/utils/types").JSONValue;
6800
+ } | undefined;
6777
6801
  };
6778
6802
  outputFormat: "json";
6779
6803
  status: 400;
@@ -6813,6 +6837,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
6813
6837
  };
6814
6838
  output: {
6815
6839
  error: string;
6840
+ code?: string | undefined;
6841
+ details?: {
6842
+ [x: string]: import("hono/utils/types").JSONValue;
6843
+ } | undefined;
6816
6844
  };
6817
6845
  outputFormat: "json";
6818
6846
  status: 404;
@@ -6856,6 +6884,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
6856
6884
  };
6857
6885
  output: {
6858
6886
  error: string;
6887
+ code?: string | undefined;
6888
+ details?: {
6889
+ [x: string]: import("hono/utils/types").JSONValue;
6890
+ } | undefined;
6859
6891
  };
6860
6892
  outputFormat: "json";
6861
6893
  status: 400;
@@ -6875,6 +6907,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
6875
6907
  };
6876
6908
  output: {
6877
6909
  error: string;
6910
+ code?: string | undefined;
6911
+ details?: {
6912
+ [x: string]: import("hono/utils/types").JSONValue;
6913
+ } | undefined;
6878
6914
  };
6879
6915
  outputFormat: "json";
6880
6916
  status: 404;
@@ -6918,6 +6954,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
6918
6954
  };
6919
6955
  output: {
6920
6956
  error: string;
6957
+ code?: string | undefined;
6958
+ details?: {
6959
+ [x: string]: import("hono/utils/types").JSONValue;
6960
+ } | undefined;
6921
6961
  };
6922
6962
  outputFormat: "json";
6923
6963
  status: 404;
@@ -6942,7 +6982,7 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
6942
6982
  limit?: unknown;
6943
6983
  offset?: unknown;
6944
6984
  code?: string | undefined;
6945
- active?: unknown;
6985
+ active?: "0" | "1" | "true" | "false" | undefined;
6946
6986
  };
6947
6987
  };
6948
6988
  output: {
@@ -6986,6 +7026,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
6986
7026
  };
6987
7027
  output: {
6988
7028
  error: string;
7029
+ code?: string | undefined;
7030
+ details?: {
7031
+ [x: string]: import("hono/utils/types").JSONValue;
7032
+ } | undefined;
6989
7033
  };
6990
7034
  outputFormat: "json";
6991
7035
  status: 400;
@@ -7033,6 +7077,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
7033
7077
  };
7034
7078
  output: {
7035
7079
  error: string;
7080
+ code?: string | undefined;
7081
+ details?: {
7082
+ [x: string]: import("hono/utils/types").JSONValue;
7083
+ } | undefined;
7036
7084
  };
7037
7085
  outputFormat: "json";
7038
7086
  status: 404;
@@ -7084,6 +7132,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
7084
7132
  };
7085
7133
  output: {
7086
7134
  error: string;
7135
+ code?: string | undefined;
7136
+ details?: {
7137
+ [x: string]: import("hono/utils/types").JSONValue;
7138
+ } | undefined;
7087
7139
  };
7088
7140
  outputFormat: "json";
7089
7141
  status: 400;
@@ -7107,6 +7159,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
7107
7159
  };
7108
7160
  output: {
7109
7161
  error: string;
7162
+ code?: string | undefined;
7163
+ details?: {
7164
+ [x: string]: import("hono/utils/types").JSONValue;
7165
+ } | undefined;
7110
7166
  };
7111
7167
  outputFormat: "json";
7112
7168
  status: 404;
@@ -7158,6 +7214,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
7158
7214
  };
7159
7215
  output: {
7160
7216
  error: string;
7217
+ code?: string | undefined;
7218
+ details?: {
7219
+ [x: string]: import("hono/utils/types").JSONValue;
7220
+ } | undefined;
7161
7221
  };
7162
7222
  outputFormat: "json";
7163
7223
  status: 404;
@@ -7225,6 +7285,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
7225
7285
  };
7226
7286
  output: {
7227
7287
  error: string;
7288
+ code?: string | undefined;
7289
+ details?: {
7290
+ [x: string]: import("hono/utils/types").JSONValue;
7291
+ } | undefined;
7228
7292
  };
7229
7293
  outputFormat: "json";
7230
7294
  status: 400;
@@ -7270,6 +7334,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
7270
7334
  };
7271
7335
  output: {
7272
7336
  error: string;
7337
+ code?: string | undefined;
7338
+ details?: {
7339
+ [x: string]: import("hono/utils/types").JSONValue;
7340
+ } | undefined;
7273
7341
  };
7274
7342
  outputFormat: "json";
7275
7343
  status: 404;
@@ -7319,6 +7387,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
7319
7387
  };
7320
7388
  output: {
7321
7389
  error: string;
7390
+ code?: string | undefined;
7391
+ details?: {
7392
+ [x: string]: import("hono/utils/types").JSONValue;
7393
+ } | undefined;
7322
7394
  };
7323
7395
  outputFormat: "json";
7324
7396
  status: 400;
@@ -7341,6 +7413,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
7341
7413
  };
7342
7414
  output: {
7343
7415
  error: string;
7416
+ code?: string | undefined;
7417
+ details?: {
7418
+ [x: string]: import("hono/utils/types").JSONValue;
7419
+ } | undefined;
7344
7420
  };
7345
7421
  outputFormat: "json";
7346
7422
  status: 404;
@@ -7390,6 +7466,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
7390
7466
  };
7391
7467
  output: {
7392
7468
  error: string;
7469
+ code?: string | undefined;
7470
+ details?: {
7471
+ [x: string]: import("hono/utils/types").JSONValue;
7472
+ } | undefined;
7393
7473
  };
7394
7474
  outputFormat: "json";
7395
7475
  status: 404;
@@ -7462,6 +7542,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
7462
7542
  };
7463
7543
  output: {
7464
7544
  error: string;
7545
+ code?: string | undefined;
7546
+ details?: {
7547
+ [x: string]: import("hono/utils/types").JSONValue;
7548
+ } | undefined;
7465
7549
  };
7466
7550
  outputFormat: "json";
7467
7551
  status: 400;
@@ -7511,6 +7595,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
7511
7595
  };
7512
7596
  output: {
7513
7597
  error: string;
7598
+ code?: string | undefined;
7599
+ details?: {
7600
+ [x: string]: import("hono/utils/types").JSONValue;
7601
+ } | undefined;
7514
7602
  };
7515
7603
  outputFormat: "json";
7516
7604
  status: 404;
@@ -7564,6 +7652,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
7564
7652
  };
7565
7653
  output: {
7566
7654
  error: string;
7655
+ code?: string | undefined;
7656
+ details?: {
7657
+ [x: string]: import("hono/utils/types").JSONValue;
7658
+ } | undefined;
7567
7659
  };
7568
7660
  outputFormat: "json";
7569
7661
  status: 400;
@@ -7588,6 +7680,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
7588
7680
  };
7589
7681
  output: {
7590
7682
  error: string;
7683
+ code?: string | undefined;
7684
+ details?: {
7685
+ [x: string]: import("hono/utils/types").JSONValue;
7686
+ } | undefined;
7591
7687
  };
7592
7688
  outputFormat: "json";
7593
7689
  status: 404;
@@ -7641,6 +7737,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
7641
7737
  };
7642
7738
  output: {
7643
7739
  error: string;
7740
+ code?: string | undefined;
7741
+ details?: {
7742
+ [x: string]: import("hono/utils/types").JSONValue;
7743
+ } | undefined;
7644
7744
  };
7645
7745
  outputFormat: "json";
7646
7746
  status: 404;
@@ -7757,6 +7857,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
7757
7857
  };
7758
7858
  output: {
7759
7859
  error: string;
7860
+ code?: string | undefined;
7861
+ details?: {
7862
+ [x: string]: import("hono/utils/types").JSONValue;
7863
+ } | undefined;
7760
7864
  };
7761
7865
  outputFormat: "json";
7762
7866
  status: 400;
@@ -7800,6 +7904,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
7800
7904
  };
7801
7905
  output: {
7802
7906
  error: string;
7907
+ code?: string | undefined;
7908
+ details?: {
7909
+ [x: string]: import("hono/utils/types").JSONValue;
7910
+ } | undefined;
7803
7911
  };
7804
7912
  outputFormat: "json";
7805
7913
  status: 404;
@@ -7831,6 +7939,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
7831
7939
  };
7832
7940
  output: {
7833
7941
  error: string;
7942
+ code?: string | undefined;
7943
+ details?: {
7944
+ [x: string]: import("hono/utils/types").JSONValue;
7945
+ } | undefined;
7834
7946
  };
7835
7947
  outputFormat: "json";
7836
7948
  status: 400;
@@ -7858,6 +7970,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
7858
7970
  };
7859
7971
  output: {
7860
7972
  error: string;
7973
+ code?: string | undefined;
7974
+ details?: {
7975
+ [x: string]: import("hono/utils/types").JSONValue;
7976
+ } | undefined;
7861
7977
  };
7862
7978
  outputFormat: "json";
7863
7979
  status: 404;
@@ -7917,6 +8033,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
7917
8033
  };
7918
8034
  output: {
7919
8035
  error: string;
8036
+ code?: string | undefined;
8037
+ details?: {
8038
+ [x: string]: import("hono/utils/types").JSONValue;
8039
+ } | undefined;
7920
8040
  };
7921
8041
  outputFormat: "json";
7922
8042
  status: 404;
@@ -7943,6 +8063,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
7943
8063
  };
7944
8064
  output: {
7945
8065
  error: string;
8066
+ code?: string | undefined;
8067
+ details?: {
8068
+ [x: string]: import("hono/utils/types").JSONValue;
8069
+ } | undefined;
7946
8070
  };
7947
8071
  outputFormat: "json";
7948
8072
  status: 404;
@@ -7968,6 +8092,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
7968
8092
  };
7969
8093
  output: {
7970
8094
  error: string;
8095
+ code?: string | undefined;
8096
+ details?: {
8097
+ [x: string]: import("hono/utils/types").JSONValue;
8098
+ } | undefined;
7971
8099
  };
7972
8100
  outputFormat: "json";
7973
8101
  status: 409;
@@ -1 +1 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAI7D,OAAO,EAAE,6BAA6B,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAE3F,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAA;AAU7C,eAAO,MAAM,aAA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G,OAAO,aAAa,CAAA;AAChD,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAA"}
@@ -1,4 +1,10 @@
1
1
  import type { CreateInvoiceExternalRefInput, CreateTaxClassInput, CreateTaxPolicyProfileInput, CreateTaxPolicyRuleInput, CreateTaxRegimeInput, PostgresJsDatabase, TaxClassListQuery, TaxPolicyProfileListQuery, TaxPolicyRuleListQuery, TaxRegimeListQuery, UpdateTaxClassInput, UpdateTaxPolicyProfileInput, UpdateTaxPolicyRuleInput, UpdateTaxRegimeInput } from "./service-shared.js";
2
+ export declare class ReferenceDataValidationError extends Error {
3
+ readonly status = 400;
4
+ readonly code: string;
5
+ readonly details?: Record<string, unknown>;
6
+ constructor(message: string, details?: Record<string, unknown>, code?: string);
7
+ }
2
8
  export declare const financeReferenceDataService: {
3
9
  listTaxRegimes(db: PostgresJsDatabase, query: TaxRegimeListQuery): Promise<import("@voyant-travel/types").ListResponse<{
4
10
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"service-reference-data.d.ts","sourceRoot":"","sources":["../src/service-reference-data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,6BAA6B,EAC7B,mBAAmB,EACnB,2BAA2B,EAC3B,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,yBAAyB,EACzB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,2BAA2B,EAC3B,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,qBAAqB,CAAA;AAiB5B,eAAO,MAAM,2BAA2B;uBACb,kBAAkB,SAAS,kBAAkB;;;;;;;;;;;;;yBAoB3C,kBAAkB,MAAM,MAAM;;;;;;;;;;;;;wBAK/B,kBAAkB,QAAQ,oBAAoB;;;;;;;;;;;;;wBAiB9C,kBAAkB,MAAM,MAAM,QAAQ,oBAAoB;;;;;;;;;;;;;wBAS1D,kBAAkB,MAAM,MAAM;;;uBAY/B,kBAAkB,SAAS,iBAAiB;;;;;;;;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;iCAkDF,kBAAkB,MAAM,MAAM;;;CAOlE,CAAA"}
@@ -1,4 +1,34 @@
1
- import { and, asc, desc, eq, invoiceExternalRefs, invoices, paginate, sql, taxClasses, taxPolicyProfiles, taxPolicyRules, taxRegimes, toTimestamp, } from "./service-shared.js";
1
+ import { and, asc, desc, eq, inArray, invoiceExternalRefs, invoices, paginate, sql, taxClasses, taxPolicyProfiles, taxPolicyRules, taxRegimes, toTimestamp, } from "./service-shared.js";
2
+ export class ReferenceDataValidationError extends Error {
3
+ status = 400;
4
+ code;
5
+ details;
6
+ constructor(message, details, code = "invalid_request") {
7
+ super(message);
8
+ this.name = "ReferenceDataValidationError";
9
+ this.code = code;
10
+ this.details = details;
11
+ }
12
+ }
13
+ async function assertTaxClassRegimesExist(db, data) {
14
+ const referencedIds = new Set();
15
+ if (data.defaultRegimeId)
16
+ referencedIds.add(data.defaultRegimeId);
17
+ for (const line of data.lines ?? [])
18
+ referencedIds.add(line.regime_id);
19
+ if (referencedIds.size === 0)
20
+ return;
21
+ const requestedIds = [...referencedIds];
22
+ const rows = await db
23
+ .select({ id: taxRegimes.id })
24
+ .from(taxRegimes)
25
+ .where(inArray(taxRegimes.id, requestedIds));
26
+ const existingIds = new Set(rows.map((row) => row.id));
27
+ const missingRegimeIds = requestedIds.filter((id) => !existingIds.has(id));
28
+ if (missingRegimeIds.length > 0) {
29
+ throw new ReferenceDataValidationError("Tax class references unknown tax regimes", { missingRegimeIds }, "invalid_reference");
30
+ }
31
+ }
2
32
  export const financeReferenceDataService = {
3
33
  async listTaxRegimes(db, query) {
4
34
  const conditions = [];
@@ -75,6 +105,7 @@ export const financeReferenceDataService = {
75
105
  return row ?? null;
76
106
  },
77
107
  async createTaxClass(db, data) {
108
+ await assertTaxClassRegimesExist(db, data);
78
109
  const [row] = await db
79
110
  .insert(taxClasses)
80
111
  .values({
@@ -89,6 +120,7 @@ export const financeReferenceDataService = {
89
120
  return row ?? null;
90
121
  },
91
122
  async updateTaxClass(db, id, data) {
123
+ await assertTaxClassRegimesExist(db, data);
92
124
  const [row] = await db
93
125
  .update(taxClasses)
94
126
  .set({ ...data, updatedAt: new Date() })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voyant-travel/finance",
3
- "version": "0.137.6",
3
+ "version": "0.137.8",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {
@@ -107,7 +107,7 @@
107
107
  "@voyant-travel/core": "^0.111.0",
108
108
  "@voyant-travel/db": "^0.109.4",
109
109
  "@voyant-travel/types": "^0.106.1",
110
- "@voyant-travel/finance-contracts": "^0.105.5",
110
+ "@voyant-travel/finance-contracts": "^0.105.6",
111
111
  "@voyant-travel/hono": "^0.118.2",
112
112
  "@voyant-travel/storage": "^0.106.0",
113
113
  "@voyant-travel/utils": "^0.105.5"