@voyantjs/finance-contracts 0.95.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/README.md ADDED
@@ -0,0 +1,25 @@
1
+ # @voyantjs/finance-contracts
2
+
3
+ Pure finance validation schemas (invoices, payments, tax, vouchers) and enums,
4
+ zod-only, for consumers (admin SDK, Voyant Connect) that validate finance
5
+ payloads without the finance runtime. `@voyantjs/finance` re-exports these so
6
+ existing import paths are unchanged.
7
+
8
+ ## Install
9
+
10
+ ```bash
11
+ pnpm add @voyantjs/finance-contracts zod
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ ```ts
17
+ import {
18
+ invoiceStatusSchema,
19
+ insertInvoiceSchema,
20
+ paymentMethodSchema,
21
+ } from "@voyantjs/finance-contracts"
22
+ ```
23
+
24
+ Existing `@voyantjs/finance/validation` and `@voyantjs/finance` imports remain
25
+ available for applications that already depend on the full runtime package.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=contracts.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts.test.d.ts","sourceRoot":"","sources":["../src/contracts.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { invoiceStatusSchema, paymentMethodSchema } from "./index.js";
3
+ describe("finance-contracts", () => {
4
+ it("accepts valid enum values", () => {
5
+ expect(invoiceStatusSchema.parse("issued")).toBe("issued");
6
+ expect(paymentMethodSchema.parse("bank_transfer")).toBe("bank_transfer");
7
+ });
8
+ it("rejects invalid enum values", () => {
9
+ expect(invoiceStatusSchema.safeParse("settled").success).toBe(false);
10
+ expect(paymentMethodSchema.safeParse("bitcoin").success).toBe(false);
11
+ });
12
+ });
@@ -0,0 +1,2 @@
1
+ export * from "./validation.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from "./validation.js";