@voyantjs/finance-react 0.3.0 → 0.3.1
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/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/use-public-booking-documents.d.ts +29 -0
- package/dist/hooks/use-public-booking-documents.d.ts.map +1 -0
- package/dist/hooks/use-public-booking-documents.js +12 -0
- package/dist/hooks/use-public-payment-session-mutation.d.ts +1 -1
- package/dist/hooks/use-public-payment-session.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/operations.d.ts +28 -3
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations.js +4 -1
- package/dist/query-keys.d.ts +1 -0
- package/dist/query-keys.d.ts.map +1 -1
- package/dist/query-keys.js +1 -0
- package/dist/query-options.d.ts +109 -4
- package/dist/query-options.d.ts.map +1 -1
- package/dist/query-options.js +13 -1
- package/dist/schemas.d.ts +52 -3
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +3 -2
- package/package.json +5 -5
package/dist/hooks/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from "./use-invoice-notes.js";
|
|
|
9
9
|
export * from "./use-invoice-payment-mutation.js";
|
|
10
10
|
export * from "./use-invoice-payments.js";
|
|
11
11
|
export * from "./use-invoices.js";
|
|
12
|
+
export * from "./use-public-booking-documents.js";
|
|
12
13
|
export * from "./use-public-booking-payment-options.js";
|
|
13
14
|
export * from "./use-public-payment-session.js";
|
|
14
15
|
export * from "./use-public-payment-session-mutation.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,uCAAuC,CAAA;AACrD,cAAc,+BAA+B,CAAA;AAC7C,cAAc,qCAAqC,CAAA;AACnD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,2BAA2B,CAAA;AACzC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,wBAAwB,CAAA;AACtC,cAAc,mCAAmC,CAAA;AACjD,cAAc,2BAA2B,CAAA;AACzC,cAAc,mBAAmB,CAAA;AACjC,cAAc,yCAAyC,CAAA;AACvD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,0CAA0C,CAAA;AACxD,cAAc,6CAA6C,CAAA;AAC3D,cAAc,oCAAoC,CAAA;AAClD,cAAc,4BAA4B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,uCAAuC,CAAA;AACrD,cAAc,+BAA+B,CAAA;AAC7C,cAAc,qCAAqC,CAAA;AACnD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,2BAA2B,CAAA;AACzC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,wBAAwB,CAAA;AACtC,cAAc,mCAAmC,CAAA;AACjD,cAAc,2BAA2B,CAAA;AACzC,cAAc,mBAAmB,CAAA;AACjC,cAAc,mCAAmC,CAAA;AACjD,cAAc,yCAAyC,CAAA;AACvD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,0CAA0C,CAAA;AACxD,cAAc,6CAA6C,CAAA;AAC3D,cAAc,oCAAoC,CAAA;AAClD,cAAc,4BAA4B,CAAA"}
|
package/dist/hooks/index.js
CHANGED
|
@@ -9,6 +9,7 @@ export * from "./use-invoice-notes.js";
|
|
|
9
9
|
export * from "./use-invoice-payment-mutation.js";
|
|
10
10
|
export * from "./use-invoice-payments.js";
|
|
11
11
|
export * from "./use-invoices.js";
|
|
12
|
+
export * from "./use-public-booking-documents.js";
|
|
12
13
|
export * from "./use-public-booking-payment-options.js";
|
|
13
14
|
export * from "./use-public-payment-session.js";
|
|
14
15
|
export * from "./use-public-payment-session-mutation.js";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface UsePublicBookingDocumentsOptions {
|
|
2
|
+
enabled?: boolean;
|
|
3
|
+
}
|
|
4
|
+
export declare function usePublicBookingDocuments(bookingId: string | null | undefined, options?: UsePublicBookingDocumentsOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
5
|
+
data: {
|
|
6
|
+
bookingId: string;
|
|
7
|
+
documents: {
|
|
8
|
+
invoiceId: string;
|
|
9
|
+
invoiceNumber: string;
|
|
10
|
+
invoiceType: "invoice" | "proforma" | "credit_note";
|
|
11
|
+
invoiceStatus: "draft" | "void" | "sent" | "partially_paid" | "paid" | "overdue";
|
|
12
|
+
currency: string;
|
|
13
|
+
totalCents: number;
|
|
14
|
+
paidCents: number;
|
|
15
|
+
balanceDueCents: number;
|
|
16
|
+
issueDate: string;
|
|
17
|
+
dueDate: string;
|
|
18
|
+
renditionId: string | null;
|
|
19
|
+
documentStatus: "pending" | "failed" | "missing" | "ready" | "stale";
|
|
20
|
+
format: "html" | "pdf" | "xml" | "json" | null;
|
|
21
|
+
language: string | null;
|
|
22
|
+
generatedAt: string | null;
|
|
23
|
+
fileSize: number | null;
|
|
24
|
+
checksum: string | null;
|
|
25
|
+
downloadUrl: string | null;
|
|
26
|
+
}[];
|
|
27
|
+
};
|
|
28
|
+
}, Error>;
|
|
29
|
+
//# sourceMappingURL=use-public-booking-documents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-public-booking-documents.d.ts","sourceRoot":"","sources":["../../src/hooks/use-public-booking-documents.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,gCAAgC;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,OAAO,GAAE,gCAAqC;;;;;;;;;;;;;;;;;;;;;;;;UAS/C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantFinanceContext } from "../provider.js";
|
|
4
|
+
import { getPublicBookingDocumentsQueryOptions } from "../query-options.js";
|
|
5
|
+
export function usePublicBookingDocuments(bookingId, options = {}) {
|
|
6
|
+
const { baseUrl, fetcher } = useVoyantFinanceContext();
|
|
7
|
+
const { enabled = true } = options;
|
|
8
|
+
return useQuery({
|
|
9
|
+
...getPublicBookingDocumentsQueryOptions({ baseUrl, fetcher }, bookingId),
|
|
10
|
+
enabled: enabled && Boolean(bookingId),
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -13,7 +13,7 @@ export type StartPublicPaymentSessionTarget = {
|
|
|
13
13
|
export declare function usePublicPaymentSessionMutation(): import("@tanstack/react-query").UseMutationResult<{
|
|
14
14
|
data: {
|
|
15
15
|
id: string;
|
|
16
|
-
targetType: "other" | "booking_payment_schedule" | "booking_guarantee" | "booking" | "order"
|
|
16
|
+
targetType: "invoice" | "other" | "booking_payment_schedule" | "booking_guarantee" | "booking" | "order";
|
|
17
17
|
targetId: string | null;
|
|
18
18
|
bookingId: string | null;
|
|
19
19
|
invoiceId: string | null;
|
|
@@ -4,7 +4,7 @@ export interface UsePublicPaymentSessionOptions {
|
|
|
4
4
|
export declare function usePublicPaymentSession(sessionId: string | null | undefined, options?: UsePublicPaymentSessionOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
5
5
|
data: {
|
|
6
6
|
id: string;
|
|
7
|
-
targetType: "other" | "booking_payment_schedule" | "booking_guarantee" | "booking" | "order"
|
|
7
|
+
targetType: "invoice" | "other" | "booking_payment_schedule" | "booking_guarantee" | "booking" | "order";
|
|
8
8
|
targetId: string | null;
|
|
9
9
|
bookingId: string | null;
|
|
10
10
|
invoiceId: string | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { defaultFetcher, fetchWithValidation, VoyantApiError, type VoyantFetcher, withQueryParams, } from "./client.js";
|
|
2
2
|
export * from "./hooks/index.js";
|
|
3
|
-
export { getPublicBookingPaymentOptions, getPublicPaymentSession, startPublicBookingGuaranteePaymentSession, startPublicBookingSchedulePaymentSession, validatePublicVoucher, } from "./operations.js";
|
|
3
|
+
export { getPublicBookingDocuments, getPublicBookingPaymentOptions, getPublicPaymentSession, startPublicBookingGuaranteePaymentSession, startPublicBookingSchedulePaymentSession, validatePublicVoucher, } from "./operations.js";
|
|
4
4
|
export { useVoyantFinanceContext, type VoyantFinanceContextValue, VoyantFinanceProvider, type VoyantFinanceProviderProps, } from "./provider.js";
|
|
5
5
|
export { financeQueryKeys } from "./query-keys.js";
|
|
6
|
-
export { getInvoiceCreditNotesQueryOptions, getInvoiceLineItemsQueryOptions, getInvoiceNotesQueryOptions, getInvoicePaymentsQueryOptions, getInvoiceQueryOptions, getInvoicesQueryOptions, getPublicBookingPaymentOptionsQueryOptions, getPublicPaymentSessionQueryOptions, getSupplierPaymentsQueryOptions, } from "./query-options.js";
|
|
6
|
+
export { getInvoiceCreditNotesQueryOptions, getInvoiceLineItemsQueryOptions, getInvoiceNotesQueryOptions, getInvoicePaymentsQueryOptions, getInvoiceQueryOptions, getInvoicesQueryOptions, getPublicBookingDocumentsQueryOptions, getPublicBookingPaymentOptionsQueryOptions, getPublicPaymentSessionQueryOptions, getSupplierPaymentsQueryOptions, } from "./query-options.js";
|
|
7
7
|
export * from "./schemas.js";
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,KAAK,aAAa,EAClB,eAAe,GAChB,MAAM,aAAa,CAAA;AACpB,cAAc,kBAAkB,CAAA;AAChC,OAAO,EACL,8BAA8B,EAC9B,uBAAuB,EACvB,yCAAyC,EACzC,wCAAwC,EACxC,qBAAqB,GACtB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,uBAAuB,EACvB,KAAK,yBAAyB,EAC9B,qBAAqB,EACrB,KAAK,0BAA0B,GAChC,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EACL,iCAAiC,EACjC,+BAA+B,EAC/B,2BAA2B,EAC3B,8BAA8B,EAC9B,sBAAsB,EACtB,uBAAuB,EACvB,0CAA0C,EAC1C,mCAAmC,EACnC,+BAA+B,GAChC,MAAM,oBAAoB,CAAA;AAC3B,cAAc,cAAc,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,KAAK,aAAa,EAClB,eAAe,GAChB,MAAM,aAAa,CAAA;AACpB,cAAc,kBAAkB,CAAA;AAChC,OAAO,EACL,yBAAyB,EACzB,8BAA8B,EAC9B,uBAAuB,EACvB,yCAAyC,EACzC,wCAAwC,EACxC,qBAAqB,GACtB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,uBAAuB,EACvB,KAAK,yBAAyB,EAC9B,qBAAqB,EACrB,KAAK,0BAA0B,GAChC,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EACL,iCAAiC,EACjC,+BAA+B,EAC/B,2BAA2B,EAC3B,8BAA8B,EAC9B,sBAAsB,EACtB,uBAAuB,EACvB,qCAAqC,EACrC,0CAA0C,EAC1C,mCAAmC,EACnC,+BAA+B,GAChC,MAAM,oBAAoB,CAAA;AAC3B,cAAc,cAAc,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { defaultFetcher, fetchWithValidation, VoyantApiError, withQueryParams, } from "./client.js";
|
|
2
2
|
export * from "./hooks/index.js";
|
|
3
|
-
export { getPublicBookingPaymentOptions, getPublicPaymentSession, startPublicBookingGuaranteePaymentSession, startPublicBookingSchedulePaymentSession, validatePublicVoucher, } from "./operations.js";
|
|
3
|
+
export { getPublicBookingDocuments, getPublicBookingPaymentOptions, getPublicPaymentSession, startPublicBookingGuaranteePaymentSession, startPublicBookingSchedulePaymentSession, validatePublicVoucher, } from "./operations.js";
|
|
4
4
|
export { useVoyantFinanceContext, VoyantFinanceProvider, } from "./provider.js";
|
|
5
5
|
export { financeQueryKeys } from "./query-keys.js";
|
|
6
|
-
export { getInvoiceCreditNotesQueryOptions, getInvoiceLineItemsQueryOptions, getInvoiceNotesQueryOptions, getInvoicePaymentsQueryOptions, getInvoiceQueryOptions, getInvoicesQueryOptions, getPublicBookingPaymentOptionsQueryOptions, getPublicPaymentSessionQueryOptions, getSupplierPaymentsQueryOptions, } from "./query-options.js";
|
|
6
|
+
export { getInvoiceCreditNotesQueryOptions, getInvoiceLineItemsQueryOptions, getInvoiceNotesQueryOptions, getInvoicePaymentsQueryOptions, getInvoiceQueryOptions, getInvoicesQueryOptions, getPublicBookingDocumentsQueryOptions, getPublicBookingPaymentOptionsQueryOptions, getPublicPaymentSessionQueryOptions, getSupplierPaymentsQueryOptions, } from "./query-options.js";
|
|
7
7
|
export * from "./schemas.js";
|
package/dist/operations.d.ts
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
import { type FetchWithValidationOptions } from "./client.js";
|
|
2
2
|
import { type PublicStartPaymentSessionInput, type PublicValidateVoucherInput } from "./schemas.js";
|
|
3
|
+
export declare function getPublicBookingDocuments(client: FetchWithValidationOptions, bookingId: string): Promise<{
|
|
4
|
+
data: {
|
|
5
|
+
bookingId: string;
|
|
6
|
+
documents: {
|
|
7
|
+
invoiceId: string;
|
|
8
|
+
invoiceNumber: string;
|
|
9
|
+
invoiceType: "invoice" | "proforma" | "credit_note";
|
|
10
|
+
invoiceStatus: "draft" | "void" | "sent" | "partially_paid" | "paid" | "overdue";
|
|
11
|
+
currency: string;
|
|
12
|
+
totalCents: number;
|
|
13
|
+
paidCents: number;
|
|
14
|
+
balanceDueCents: number;
|
|
15
|
+
issueDate: string;
|
|
16
|
+
dueDate: string;
|
|
17
|
+
renditionId: string | null;
|
|
18
|
+
documentStatus: "pending" | "failed" | "missing" | "ready" | "stale";
|
|
19
|
+
format: "html" | "pdf" | "xml" | "json" | null;
|
|
20
|
+
language: string | null;
|
|
21
|
+
generatedAt: string | null;
|
|
22
|
+
fileSize: number | null;
|
|
23
|
+
checksum: string | null;
|
|
24
|
+
downloadUrl: string | null;
|
|
25
|
+
}[];
|
|
26
|
+
};
|
|
27
|
+
}>;
|
|
3
28
|
export declare function getPublicBookingPaymentOptions(client: FetchWithValidationOptions, bookingId: string, filters?: {
|
|
4
29
|
personId?: string;
|
|
5
30
|
organizationId?: string;
|
|
@@ -51,7 +76,7 @@ export declare function getPublicBookingPaymentOptions(client: FetchWithValidati
|
|
|
51
76
|
export declare function getPublicPaymentSession(client: FetchWithValidationOptions, sessionId: string): Promise<{
|
|
52
77
|
data: {
|
|
53
78
|
id: string;
|
|
54
|
-
targetType: "other" | "booking_payment_schedule" | "booking_guarantee" | "booking" | "order"
|
|
79
|
+
targetType: "invoice" | "other" | "booking_payment_schedule" | "booking_guarantee" | "booking" | "order";
|
|
55
80
|
targetId: string | null;
|
|
56
81
|
bookingId: string | null;
|
|
57
82
|
invoiceId: string | null;
|
|
@@ -80,7 +105,7 @@ export declare function getPublicPaymentSession(client: FetchWithValidationOptio
|
|
|
80
105
|
export declare function startPublicBookingSchedulePaymentSession(client: FetchWithValidationOptions, bookingId: string, scheduleId: string, input: PublicStartPaymentSessionInput): Promise<{
|
|
81
106
|
data: {
|
|
82
107
|
id: string;
|
|
83
|
-
targetType: "other" | "booking_payment_schedule" | "booking_guarantee" | "booking" | "order"
|
|
108
|
+
targetType: "invoice" | "other" | "booking_payment_schedule" | "booking_guarantee" | "booking" | "order";
|
|
84
109
|
targetId: string | null;
|
|
85
110
|
bookingId: string | null;
|
|
86
111
|
invoiceId: string | null;
|
|
@@ -109,7 +134,7 @@ export declare function startPublicBookingSchedulePaymentSession(client: FetchWi
|
|
|
109
134
|
export declare function startPublicBookingGuaranteePaymentSession(client: FetchWithValidationOptions, bookingId: string, guaranteeId: string, input: PublicStartPaymentSessionInput): Promise<{
|
|
110
135
|
data: {
|
|
111
136
|
id: string;
|
|
112
|
-
targetType: "other" | "booking_payment_schedule" | "booking_guarantee" | "booking" | "order"
|
|
137
|
+
targetType: "invoice" | "other" | "booking_payment_schedule" | "booking_guarantee" | "booking" | "order";
|
|
113
138
|
targetId: string | null;
|
|
114
139
|
bookingId: string | null;
|
|
115
140
|
invoiceId: string | null;
|
package/dist/operations.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../src/operations.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,0BAA0B,EAAwC,MAAM,aAAa,CAAA;AACnG,OAAO,EACL,KAAK,8BAA8B,EACnC,KAAK,0BAA0B,
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../src/operations.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,0BAA0B,EAAwC,MAAM,aAAa,CAAA;AACnG,OAAO,EACL,KAAK,8BAA8B,EACnC,KAAK,0BAA0B,EAKhC,MAAM,cAAc,CAAA;AAErB,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,0BAA0B,EAAE,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;GAM9F;AAED,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,0BAA0B,EAClC,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE;IACR,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAOF;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,0BAA0B,EAAE,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAM5F;AAED,wBAAgB,wCAAwC,CACtD,MAAM,EAAE,0BAA0B,EAClC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAQtC;AAED,wBAAgB,yCAAyC,CACvD,MAAM,EAAE,0BAA0B,EAClC,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAQtC;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,0BAA0B,EAClC,KAAK,EAAE,0BAA0B;;;;;;;;;;;;;;;GAQlC"}
|
package/dist/operations.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { fetchWithValidation, withQueryParams } from "./client.js";
|
|
3
|
-
import { publicBookingPaymentOptionsResponse, publicPaymentSessionResponse, publicVoucherValidationResponse, } from "./schemas.js";
|
|
3
|
+
import { publicBookingFinanceDocumentsResponse, publicBookingPaymentOptionsResponse, publicPaymentSessionResponse, publicVoucherValidationResponse, } from "./schemas.js";
|
|
4
|
+
export function getPublicBookingDocuments(client, bookingId) {
|
|
5
|
+
return fetchWithValidation(`/v1/public/finance/bookings/${bookingId}/documents`, publicBookingFinanceDocumentsResponse, client);
|
|
6
|
+
}
|
|
4
7
|
export function getPublicBookingPaymentOptions(client, bookingId, filters) {
|
|
5
8
|
return fetchWithValidation(withQueryParams(`/v1/public/finance/bookings/${bookingId}/payment-options`, filters), publicBookingPaymentOptionsResponse, client);
|
|
6
9
|
}
|
package/dist/query-keys.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export declare const financeQueryKeys: {
|
|
|
26
26
|
readonly supplierPayments: () => readonly ["voyant", "finance", "supplier-payments"];
|
|
27
27
|
readonly supplierPaymentsList: (filters: FinanceSupplierPaymentListFilters) => readonly ["voyant", "finance", "supplier-payments", "list", FinanceSupplierPaymentListFilters];
|
|
28
28
|
readonly publicCheckout: () => readonly ["voyant", "finance", "public-checkout"];
|
|
29
|
+
readonly publicBookingDocuments: (bookingId: string) => readonly ["voyant", "finance", "public-checkout", "booking-documents", string];
|
|
29
30
|
readonly publicBookingPaymentOptions: (bookingId: string, filters: PublicBookingPaymentOptionsFilters) => readonly ["voyant", "finance", "public-checkout", "booking-payment-options", string, PublicBookingPaymentOptionsFilters];
|
|
30
31
|
readonly publicPaymentSession: (sessionId: string) => readonly ["voyant", "finance", "public-checkout", "payment-session", string];
|
|
31
32
|
readonly publicVoucherValidation: () => readonly ["voyant", "finance", "public-checkout", "voucher-validation"];
|
package/dist/query-keys.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-keys.d.ts","sourceRoot":"","sources":["../src/query-keys.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,yBAAyB;IACxC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B;AAED,MAAM,WAAW,iCAAiC;IAChD,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B;AAED,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC7B,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC7B,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,eAAe,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CACtC;AAED,eAAO,MAAM,gBAAgB;;;qCAIH,yBAAyB;2BAEnC,MAAM;oCACG,MAAM;mCACP,MAAM;sCACH,MAAM;gCAEZ,MAAM;;6CAGO,iCAAiC;;
|
|
1
|
+
{"version":3,"file":"query-keys.d.ts","sourceRoot":"","sources":["../src/query-keys.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,yBAAyB;IACxC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B;AAED,MAAM,WAAW,iCAAiC;IAChD,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B;AAED,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC7B,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC7B,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,eAAe,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CACtC;AAED,eAAO,MAAM,gBAAgB;;;qCAIH,yBAAyB;2BAEnC,MAAM;oCACG,MAAM;mCACP,MAAM;sCACH,MAAM;gCAEZ,MAAM;;6CAGO,iCAAiC;;iDAI7B,MAAM;sDAED,MAAM,WAAW,kCAAkC;+CAE1D,MAAM;;CAIhC,CAAA"}
|
package/dist/query-keys.js
CHANGED
|
@@ -10,6 +10,7 @@ export const financeQueryKeys = {
|
|
|
10
10
|
supplierPayments: () => [...financeQueryKeys.all, "supplier-payments"],
|
|
11
11
|
supplierPaymentsList: (filters) => [...financeQueryKeys.supplierPayments(), "list", filters],
|
|
12
12
|
publicCheckout: () => [...financeQueryKeys.all, "public-checkout"],
|
|
13
|
+
publicBookingDocuments: (bookingId) => [...financeQueryKeys.publicCheckout(), "booking-documents", bookingId],
|
|
13
14
|
publicBookingPaymentOptions: (bookingId, filters) => [...financeQueryKeys.publicCheckout(), "booking-payment-options", bookingId, filters],
|
|
14
15
|
publicPaymentSession: (sessionId) => [...financeQueryKeys.publicCheckout(), "payment-session", sessionId],
|
|
15
16
|
publicVoucherValidation: () => [...financeQueryKeys.publicCheckout(), "voucher-validation"],
|
package/dist/query-options.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type { UseInvoiceLineItemsOptions } from "./hooks/use-invoice-line-items.
|
|
|
5
5
|
import type { UseInvoiceNotesOptions } from "./hooks/use-invoice-notes.js";
|
|
6
6
|
import type { UseInvoicePaymentsOptions } from "./hooks/use-invoice-payments.js";
|
|
7
7
|
import type { UseInvoicesOptions } from "./hooks/use-invoices.js";
|
|
8
|
+
import type { UsePublicBookingDocumentsOptions } from "./hooks/use-public-booking-documents.js";
|
|
8
9
|
import type { UsePublicBookingPaymentOptionsOptions } from "./hooks/use-public-booking-payment-options.js";
|
|
9
10
|
import type { UsePublicPaymentSessionOptions } from "./hooks/use-public-payment-session.js";
|
|
10
11
|
import type { UseSupplierPaymentsOptions } from "./hooks/use-supplier-payments.js";
|
|
@@ -656,10 +657,114 @@ export declare function getPublicBookingPaymentOptionsQueryOptions(client: Fetch
|
|
|
656
657
|
[dataTagErrorSymbol]: Error;
|
|
657
658
|
};
|
|
658
659
|
};
|
|
660
|
+
export declare function getPublicBookingDocumentsQueryOptions(client: FetchWithValidationOptions, bookingId: string | null | undefined, options?: UsePublicBookingDocumentsOptions): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
661
|
+
data: {
|
|
662
|
+
bookingId: string;
|
|
663
|
+
documents: {
|
|
664
|
+
invoiceId: string;
|
|
665
|
+
invoiceNumber: string;
|
|
666
|
+
invoiceType: "invoice" | "proforma" | "credit_note";
|
|
667
|
+
invoiceStatus: "draft" | "void" | "sent" | "partially_paid" | "paid" | "overdue";
|
|
668
|
+
currency: string;
|
|
669
|
+
totalCents: number;
|
|
670
|
+
paidCents: number;
|
|
671
|
+
balanceDueCents: number;
|
|
672
|
+
issueDate: string;
|
|
673
|
+
dueDate: string;
|
|
674
|
+
renditionId: string | null;
|
|
675
|
+
documentStatus: "pending" | "failed" | "missing" | "ready" | "stale";
|
|
676
|
+
format: "html" | "pdf" | "xml" | "json" | null;
|
|
677
|
+
language: string | null;
|
|
678
|
+
generatedAt: string | null;
|
|
679
|
+
fileSize: number | null;
|
|
680
|
+
checksum: string | null;
|
|
681
|
+
downloadUrl: string | null;
|
|
682
|
+
}[];
|
|
683
|
+
};
|
|
684
|
+
}, Error, {
|
|
685
|
+
data: {
|
|
686
|
+
bookingId: string;
|
|
687
|
+
documents: {
|
|
688
|
+
invoiceId: string;
|
|
689
|
+
invoiceNumber: string;
|
|
690
|
+
invoiceType: "invoice" | "proforma" | "credit_note";
|
|
691
|
+
invoiceStatus: "draft" | "void" | "sent" | "partially_paid" | "paid" | "overdue";
|
|
692
|
+
currency: string;
|
|
693
|
+
totalCents: number;
|
|
694
|
+
paidCents: number;
|
|
695
|
+
balanceDueCents: number;
|
|
696
|
+
issueDate: string;
|
|
697
|
+
dueDate: string;
|
|
698
|
+
renditionId: string | null;
|
|
699
|
+
documentStatus: "pending" | "failed" | "missing" | "ready" | "stale";
|
|
700
|
+
format: "html" | "pdf" | "xml" | "json" | null;
|
|
701
|
+
language: string | null;
|
|
702
|
+
generatedAt: string | null;
|
|
703
|
+
fileSize: number | null;
|
|
704
|
+
checksum: string | null;
|
|
705
|
+
downloadUrl: string | null;
|
|
706
|
+
}[];
|
|
707
|
+
};
|
|
708
|
+
}, readonly ["voyant", "finance", "public-checkout", "booking-documents", string]>, "queryFn"> & {
|
|
709
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
710
|
+
data: {
|
|
711
|
+
bookingId: string;
|
|
712
|
+
documents: {
|
|
713
|
+
invoiceId: string;
|
|
714
|
+
invoiceNumber: string;
|
|
715
|
+
invoiceType: "invoice" | "proforma" | "credit_note";
|
|
716
|
+
invoiceStatus: "draft" | "void" | "sent" | "partially_paid" | "paid" | "overdue";
|
|
717
|
+
currency: string;
|
|
718
|
+
totalCents: number;
|
|
719
|
+
paidCents: number;
|
|
720
|
+
balanceDueCents: number;
|
|
721
|
+
issueDate: string;
|
|
722
|
+
dueDate: string;
|
|
723
|
+
renditionId: string | null;
|
|
724
|
+
documentStatus: "pending" | "failed" | "missing" | "ready" | "stale";
|
|
725
|
+
format: "html" | "pdf" | "xml" | "json" | null;
|
|
726
|
+
language: string | null;
|
|
727
|
+
generatedAt: string | null;
|
|
728
|
+
fileSize: number | null;
|
|
729
|
+
checksum: string | null;
|
|
730
|
+
downloadUrl: string | null;
|
|
731
|
+
}[];
|
|
732
|
+
};
|
|
733
|
+
}, readonly ["voyant", "finance", "public-checkout", "booking-documents", string], never> | undefined;
|
|
734
|
+
} & {
|
|
735
|
+
queryKey: readonly ["voyant", "finance", "public-checkout", "booking-documents", string] & {
|
|
736
|
+
[dataTagSymbol]: {
|
|
737
|
+
data: {
|
|
738
|
+
bookingId: string;
|
|
739
|
+
documents: {
|
|
740
|
+
invoiceId: string;
|
|
741
|
+
invoiceNumber: string;
|
|
742
|
+
invoiceType: "invoice" | "proforma" | "credit_note";
|
|
743
|
+
invoiceStatus: "draft" | "void" | "sent" | "partially_paid" | "paid" | "overdue";
|
|
744
|
+
currency: string;
|
|
745
|
+
totalCents: number;
|
|
746
|
+
paidCents: number;
|
|
747
|
+
balanceDueCents: number;
|
|
748
|
+
issueDate: string;
|
|
749
|
+
dueDate: string;
|
|
750
|
+
renditionId: string | null;
|
|
751
|
+
documentStatus: "pending" | "failed" | "missing" | "ready" | "stale";
|
|
752
|
+
format: "html" | "pdf" | "xml" | "json" | null;
|
|
753
|
+
language: string | null;
|
|
754
|
+
generatedAt: string | null;
|
|
755
|
+
fileSize: number | null;
|
|
756
|
+
checksum: string | null;
|
|
757
|
+
downloadUrl: string | null;
|
|
758
|
+
}[];
|
|
759
|
+
};
|
|
760
|
+
};
|
|
761
|
+
[dataTagErrorSymbol]: Error;
|
|
762
|
+
};
|
|
763
|
+
};
|
|
659
764
|
export declare function getPublicPaymentSessionQueryOptions(client: FetchWithValidationOptions, sessionId: string | null | undefined, options?: UsePublicPaymentSessionOptions): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
660
765
|
data: {
|
|
661
766
|
id: string;
|
|
662
|
-
targetType: "other" | "booking_payment_schedule" | "booking_guarantee" | "booking" | "order"
|
|
767
|
+
targetType: "invoice" | "other" | "booking_payment_schedule" | "booking_guarantee" | "booking" | "order";
|
|
663
768
|
targetId: string | null;
|
|
664
769
|
bookingId: string | null;
|
|
665
770
|
invoiceId: string | null;
|
|
@@ -687,7 +792,7 @@ export declare function getPublicPaymentSessionQueryOptions(client: FetchWithVal
|
|
|
687
792
|
}, Error, {
|
|
688
793
|
data: {
|
|
689
794
|
id: string;
|
|
690
|
-
targetType: "other" | "booking_payment_schedule" | "booking_guarantee" | "booking" | "order"
|
|
795
|
+
targetType: "invoice" | "other" | "booking_payment_schedule" | "booking_guarantee" | "booking" | "order";
|
|
691
796
|
targetId: string | null;
|
|
692
797
|
bookingId: string | null;
|
|
693
798
|
invoiceId: string | null;
|
|
@@ -716,7 +821,7 @@ export declare function getPublicPaymentSessionQueryOptions(client: FetchWithVal
|
|
|
716
821
|
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
717
822
|
data: {
|
|
718
823
|
id: string;
|
|
719
|
-
targetType: "other" | "booking_payment_schedule" | "booking_guarantee" | "booking" | "order"
|
|
824
|
+
targetType: "invoice" | "other" | "booking_payment_schedule" | "booking_guarantee" | "booking" | "order";
|
|
720
825
|
targetId: string | null;
|
|
721
826
|
bookingId: string | null;
|
|
722
827
|
invoiceId: string | null;
|
|
@@ -747,7 +852,7 @@ export declare function getPublicPaymentSessionQueryOptions(client: FetchWithVal
|
|
|
747
852
|
[dataTagSymbol]: {
|
|
748
853
|
data: {
|
|
749
854
|
id: string;
|
|
750
|
-
targetType: "other" | "booking_payment_schedule" | "booking_guarantee" | "booking" | "order"
|
|
855
|
+
targetType: "invoice" | "other" | "booking_payment_schedule" | "booking_guarantee" | "booking" | "order";
|
|
751
856
|
targetId: string | null;
|
|
752
857
|
bookingId: string | null;
|
|
753
858
|
invoiceId: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-options.d.ts","sourceRoot":"","sources":["../src/query-options.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,0BAA0B,EAAuB,MAAM,aAAa,CAAA;AAClF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAA;AACvF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAA;AACnF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AAC1E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAA;AAChF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AACjE,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,+CAA+C,CAAA;AAC1G,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,uCAAuC,CAAA;AAC3F,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAA;
|
|
1
|
+
{"version":3,"file":"query-options.d.ts","sourceRoot":"","sources":["../src/query-options.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,0BAA0B,EAAuB,MAAM,aAAa,CAAA;AAClF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wB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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAc/C;AAED,wBAAgB,mCAAmC,CACjD,MAAM,EAAE,0BAA0B,EAClC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,OAAO,GAAE,8BAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAc7C"}
|
package/dist/query-options.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { queryOptions } from "@tanstack/react-query";
|
|
3
3
|
import { fetchWithValidation } from "./client.js";
|
|
4
|
-
import { getPublicBookingPaymentOptions, getPublicPaymentSession } from "./operations.js";
|
|
4
|
+
import { getPublicBookingDocuments, getPublicBookingPaymentOptions, getPublicPaymentSession, } from "./operations.js";
|
|
5
5
|
import { financeQueryKeys } from "./query-keys.js";
|
|
6
6
|
import { invoiceCreditNotesResponse, invoiceLineItemsResponse, invoiceListResponse, invoiceNotesResponse, invoicePaymentsResponse, invoiceSingleResponse, supplierPaymentListResponse, } from "./schemas.js";
|
|
7
7
|
export function getInvoicesQueryOptions(client, options = {}) {
|
|
@@ -103,6 +103,18 @@ export function getPublicBookingPaymentOptionsQueryOptions(client, bookingId, op
|
|
|
103
103
|
},
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
|
+
export function getPublicBookingDocumentsQueryOptions(client, bookingId, options = {}) {
|
|
107
|
+
const { enabled: _enabled = true } = options;
|
|
108
|
+
return queryOptions({
|
|
109
|
+
queryKey: financeQueryKeys.publicBookingDocuments(bookingId ?? ""),
|
|
110
|
+
queryFn: async () => {
|
|
111
|
+
if (!bookingId) {
|
|
112
|
+
throw new Error("getPublicBookingDocumentsQueryOptions requires a bookingId");
|
|
113
|
+
}
|
|
114
|
+
return getPublicBookingDocuments(client, bookingId);
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
}
|
|
106
118
|
export function getPublicPaymentSessionQueryOptions(client, sessionId, options = {}) {
|
|
107
119
|
const { enabled: _enabled = true } = options;
|
|
108
120
|
return queryOptions({
|
package/dist/schemas.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { publicBookingPaymentOptionsSchema, publicPaymentOptionsQuerySchema, publicPaymentSessionSchema, publicStartPaymentSessionSchema, publicValidateVoucherSchema, publicVoucherValidationSchema } from "@voyantjs/finance";
|
|
1
|
+
import { publicBookingFinanceDocumentsSchema, publicBookingPaymentOptionsSchema, publicFinanceBookingDocumentSchema, publicPaymentOptionsQuerySchema, publicPaymentSessionSchema, publicStartPaymentSessionSchema, publicValidateVoucherSchema, publicVoucherValidationSchema } from "@voyantjs/finance";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
export declare const paginatedEnvelope: <T extends z.ZodTypeAny>(item: T) => z.ZodObject<{
|
|
4
4
|
data: z.ZodArray<T>;
|
|
@@ -274,7 +274,7 @@ export declare const invoiceNotesResponse: z.ZodObject<{
|
|
|
274
274
|
createdAt: z.ZodString;
|
|
275
275
|
}, z.core.$strip>>;
|
|
276
276
|
}, z.core.$strip>;
|
|
277
|
-
export { publicBookingPaymentOptionsSchema, publicPaymentOptionsQuerySchema, publicPaymentSessionSchema, publicStartPaymentSessionSchema, publicValidateVoucherSchema, publicVoucherValidationSchema, };
|
|
277
|
+
export { publicBookingFinanceDocumentsSchema, publicBookingPaymentOptionsSchema, publicFinanceBookingDocumentSchema, publicPaymentOptionsQuerySchema, publicPaymentSessionSchema, publicStartPaymentSessionSchema, publicValidateVoucherSchema, publicVoucherValidationSchema, };
|
|
278
278
|
export declare const publicBookingPaymentOptionsResponse: z.ZodObject<{
|
|
279
279
|
data: z.ZodObject<{
|
|
280
280
|
bookingId: z.ZodString;
|
|
@@ -348,16 +348,63 @@ export declare const publicBookingPaymentOptionsResponse: z.ZodObject<{
|
|
|
348
348
|
}, z.core.$strip>>;
|
|
349
349
|
}, z.core.$strip>;
|
|
350
350
|
}, z.core.$strip>;
|
|
351
|
+
export declare const publicBookingFinanceDocumentsResponse: z.ZodObject<{
|
|
352
|
+
data: z.ZodObject<{
|
|
353
|
+
bookingId: z.ZodString;
|
|
354
|
+
documents: z.ZodArray<z.ZodObject<{
|
|
355
|
+
invoiceId: z.ZodString;
|
|
356
|
+
invoiceNumber: z.ZodString;
|
|
357
|
+
invoiceType: z.ZodEnum<{
|
|
358
|
+
invoice: "invoice";
|
|
359
|
+
proforma: "proforma";
|
|
360
|
+
credit_note: "credit_note";
|
|
361
|
+
}>;
|
|
362
|
+
invoiceStatus: z.ZodEnum<{
|
|
363
|
+
draft: "draft";
|
|
364
|
+
void: "void";
|
|
365
|
+
sent: "sent";
|
|
366
|
+
partially_paid: "partially_paid";
|
|
367
|
+
paid: "paid";
|
|
368
|
+
overdue: "overdue";
|
|
369
|
+
}>;
|
|
370
|
+
currency: z.ZodString;
|
|
371
|
+
totalCents: z.ZodNumber;
|
|
372
|
+
paidCents: z.ZodNumber;
|
|
373
|
+
balanceDueCents: z.ZodNumber;
|
|
374
|
+
issueDate: z.ZodString;
|
|
375
|
+
dueDate: z.ZodString;
|
|
376
|
+
renditionId: z.ZodNullable<z.ZodString>;
|
|
377
|
+
documentStatus: z.ZodEnum<{
|
|
378
|
+
pending: "pending";
|
|
379
|
+
failed: "failed";
|
|
380
|
+
missing: "missing";
|
|
381
|
+
ready: "ready";
|
|
382
|
+
stale: "stale";
|
|
383
|
+
}>;
|
|
384
|
+
format: z.ZodNullable<z.ZodEnum<{
|
|
385
|
+
html: "html";
|
|
386
|
+
pdf: "pdf";
|
|
387
|
+
xml: "xml";
|
|
388
|
+
json: "json";
|
|
389
|
+
}>>;
|
|
390
|
+
language: z.ZodNullable<z.ZodString>;
|
|
391
|
+
generatedAt: z.ZodNullable<z.ZodString>;
|
|
392
|
+
fileSize: z.ZodNullable<z.ZodNumber>;
|
|
393
|
+
checksum: z.ZodNullable<z.ZodString>;
|
|
394
|
+
downloadUrl: z.ZodNullable<z.ZodString>;
|
|
395
|
+
}, z.core.$strip>>;
|
|
396
|
+
}, z.core.$strip>;
|
|
397
|
+
}, z.core.$strip>;
|
|
351
398
|
export declare const publicPaymentSessionResponse: z.ZodObject<{
|
|
352
399
|
data: z.ZodObject<{
|
|
353
400
|
id: z.ZodString;
|
|
354
401
|
targetType: z.ZodEnum<{
|
|
402
|
+
invoice: "invoice";
|
|
355
403
|
other: "other";
|
|
356
404
|
booking_payment_schedule: "booking_payment_schedule";
|
|
357
405
|
booking_guarantee: "booking_guarantee";
|
|
358
406
|
booking: "booking";
|
|
359
407
|
order: "order";
|
|
360
|
-
invoice: "invoice";
|
|
361
408
|
}>;
|
|
362
409
|
targetId: z.ZodNullable<z.ZodString>;
|
|
363
410
|
bookingId: z.ZodNullable<z.ZodString>;
|
|
@@ -428,6 +475,8 @@ export declare const publicVoucherValidationResponse: z.ZodObject<{
|
|
|
428
475
|
}, z.core.$strip>;
|
|
429
476
|
}, z.core.$strip>;
|
|
430
477
|
export type PublicBookingPaymentOptionsRecord = z.infer<typeof publicBookingPaymentOptionsSchema>;
|
|
478
|
+
export type PublicBookingFinanceDocumentsRecord = z.infer<typeof publicBookingFinanceDocumentsSchema>;
|
|
479
|
+
export type PublicFinanceBookingDocumentRecord = z.infer<typeof publicFinanceBookingDocumentSchema>;
|
|
431
480
|
export type PublicPaymentSessionRecord = z.infer<typeof publicPaymentSessionSchema>;
|
|
432
481
|
export type PublicStartPaymentSessionInput = z.input<typeof publicStartPaymentSessionSchema>;
|
|
433
482
|
export type PublicValidateVoucherInput = z.input<typeof publicValidateVoucherSchema>;
|
package/dist/schemas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iCAAiC,EACjC,+BAA+B,EAC/B,0BAA0B,EAC1B,+BAA+B,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAoD,CAAA;AACpG,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAEjD,CAAA;AACD,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAA6C,CAAA;AACtF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;iBAAgD,CAAA;AAE5F,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAA;AACjG,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,mCAAmC,CAC3C,CAAA;AACD,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAA;AACnG,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AACnF,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAA;AAC5F,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAA;AACpF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAA"}
|
package/dist/schemas.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { publicBookingPaymentOptionsSchema, publicPaymentOptionsQuerySchema, publicPaymentSessionSchema, publicStartPaymentSessionSchema, publicValidateVoucherSchema, publicVoucherValidationSchema, } from "@voyantjs/finance";
|
|
1
|
+
import { publicBookingFinanceDocumentsSchema, publicBookingPaymentOptionsSchema, publicFinanceBookingDocumentSchema, publicPaymentOptionsQuerySchema, publicPaymentSessionSchema, publicStartPaymentSessionSchema, publicValidateVoucherSchema, publicVoucherValidationSchema, } from "@voyantjs/finance";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
export const paginatedEnvelope = (item) => z.object({
|
|
4
4
|
data: z.array(item),
|
|
@@ -99,7 +99,8 @@ export const invoiceLineItemsResponse = arrayEnvelope(lineItemRecordSchema);
|
|
|
99
99
|
export const invoicePaymentsResponse = arrayEnvelope(paymentRecordSchema);
|
|
100
100
|
export const invoiceCreditNotesResponse = arrayEnvelope(creditNoteRecordSchema);
|
|
101
101
|
export const invoiceNotesResponse = arrayEnvelope(financeNoteRecordSchema);
|
|
102
|
-
export { publicBookingPaymentOptionsSchema, publicPaymentOptionsQuerySchema, publicPaymentSessionSchema, publicStartPaymentSessionSchema, publicValidateVoucherSchema, publicVoucherValidationSchema, };
|
|
102
|
+
export { publicBookingFinanceDocumentsSchema, publicBookingPaymentOptionsSchema, publicFinanceBookingDocumentSchema, publicPaymentOptionsQuerySchema, publicPaymentSessionSchema, publicStartPaymentSessionSchema, publicValidateVoucherSchema, publicVoucherValidationSchema, };
|
|
103
103
|
export const publicBookingPaymentOptionsResponse = singleEnvelope(publicBookingPaymentOptionsSchema);
|
|
104
|
+
export const publicBookingFinanceDocumentsResponse = singleEnvelope(publicBookingFinanceDocumentsSchema);
|
|
104
105
|
export const publicPaymentSessionResponse = singleEnvelope(publicPaymentSessionSchema);
|
|
105
106
|
export const publicVoucherValidationResponse = singleEnvelope(publicVoucherValidationSchema);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/finance-react",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"license": "FSL-1.1-Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"react": "^19.0.0",
|
|
36
36
|
"react-dom": "^19.0.0",
|
|
37
37
|
"zod": "^4.0.0",
|
|
38
|
-
"@voyantjs/finance": "0.3.
|
|
38
|
+
"@voyantjs/finance": "0.3.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@tanstack/react-query": "^5.96.2",
|
|
@@ -46,12 +46,12 @@
|
|
|
46
46
|
"typescript": "^6.0.2",
|
|
47
47
|
"vitest": "^4.1.2",
|
|
48
48
|
"zod": "^4.3.6",
|
|
49
|
-
"@voyantjs/finance": "0.3.
|
|
50
|
-
"@voyantjs/react": "0.3.
|
|
49
|
+
"@voyantjs/finance": "0.3.1",
|
|
50
|
+
"@voyantjs/react": "0.3.1",
|
|
51
51
|
"@voyantjs/voyant-typescript-config": "0.1.0"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@voyantjs/react": "0.3.
|
|
54
|
+
"@voyantjs/react": "0.3.1"
|
|
55
55
|
},
|
|
56
56
|
"files": [
|
|
57
57
|
"dist"
|