@voyantjs/finance-react 0.4.4 → 0.5.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/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/use-booking-guarantees.d.ts +82 -0
- package/dist/hooks/use-booking-guarantees.d.ts.map +1 -0
- package/dist/hooks/use-booking-guarantees.js +46 -0
- package/dist/hooks/use-booking-payment-schedules.d.ts +63 -0
- package/dist/hooks/use-booking-payment-schedules.d.ts.map +1 -0
- package/dist/hooks/use-booking-payment-schedules.js +46 -0
- package/dist/hooks/use-invoice-mutation.d.ts +2 -2
- package/dist/hooks/use-invoice-payment-mutation.d.ts +1 -1
- package/dist/hooks/use-invoice-payments.d.ts +1 -1
- package/dist/hooks/use-invoice.d.ts +1 -1
- package/dist/hooks/use-invoices.d.ts +1 -1
- package/dist/hooks/use-public-booking-documents.d.ts +3 -3
- package/dist/hooks/use-public-booking-payment-options.d.ts +3 -3
- package/dist/hooks/use-public-booking-payments.d.ts +2 -2
- package/dist/hooks/use-public-finance-document-by-reference.d.ts +3 -3
- package/dist/hooks/use-public-payment-session-mutation.d.ts +3 -3
- package/dist/hooks/use-public-payment-session.d.ts +3 -3
- package/dist/hooks/use-public-voucher-validation-mutation.d.ts +1 -1
- package/dist/hooks/use-supplier-payment-mutation.d.ts +2 -2
- package/dist/hooks/use-supplier-payments.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/operations.d.ts +21 -21
- package/dist/query-keys.d.ts +2 -0
- package/dist/query-keys.d.ts.map +1 -1
- package/dist/query-keys.js +2 -0
- package/dist/query-options.d.ts +222 -72
- package/dist/query-options.d.ts.map +1 -1
- package/dist/query-options.js +15 -1
- package/dist/schemas.d.ts +202 -43
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +66 -0
- package/package.json +5 -5
package/dist/hooks/index.d.ts
CHANGED
|
@@ -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,mCAAmC,CAAA;AACjD,cAAc,yCAAyC,CAAA;AACvD,cAAc,kCAAkC,CAAA;AAChD,cAAc,+CAA+C,CAAA;AAC7D,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,6BAA6B,CAAA;AAC3C,cAAc,oCAAoC,CAAA;AAClD,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,kCAAkC,CAAA;AAChD,cAAc,+CAA+C,CAAA;AAC7D,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
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export interface UseBookingGuaranteesOptions {
|
|
2
|
+
enabled?: boolean;
|
|
3
|
+
}
|
|
4
|
+
export declare function useBookingGuarantees(bookingId: string | null | undefined, options?: UseBookingGuaranteesOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
5
|
+
data: {
|
|
6
|
+
id: string;
|
|
7
|
+
bookingId: string;
|
|
8
|
+
bookingPaymentScheduleId: string | null;
|
|
9
|
+
bookingItemId: string | null;
|
|
10
|
+
guaranteeType: "other" | "voucher" | "bank_transfer" | "credit_card" | "deposit" | "preauth" | "card_on_file" | "agency_letter";
|
|
11
|
+
status: "expired" | "cancelled" | "pending" | "released" | "failed" | "active";
|
|
12
|
+
currency: string | null;
|
|
13
|
+
amountCents: number | null;
|
|
14
|
+
provider: string | null;
|
|
15
|
+
referenceNumber: string | null;
|
|
16
|
+
guaranteedAt: string | null;
|
|
17
|
+
expiresAt: string | null;
|
|
18
|
+
releasedAt: string | null;
|
|
19
|
+
notes: string | null;
|
|
20
|
+
createdAt: string;
|
|
21
|
+
updatedAt: string;
|
|
22
|
+
}[];
|
|
23
|
+
}, Error>;
|
|
24
|
+
export interface CreateBookingGuaranteeInput {
|
|
25
|
+
guaranteeType: string;
|
|
26
|
+
status?: string;
|
|
27
|
+
currency?: string | null;
|
|
28
|
+
amountCents?: number | null;
|
|
29
|
+
provider?: string | null;
|
|
30
|
+
referenceNumber?: string | null;
|
|
31
|
+
guaranteedAt?: string | null;
|
|
32
|
+
expiresAt?: string | null;
|
|
33
|
+
notes?: string | null;
|
|
34
|
+
bookingPaymentScheduleId?: string | null;
|
|
35
|
+
bookingItemId?: string | null;
|
|
36
|
+
}
|
|
37
|
+
export type UpdateBookingGuaranteeInput = Partial<CreateBookingGuaranteeInput>;
|
|
38
|
+
export declare function useBookingGuaranteeMutation(bookingId: string): {
|
|
39
|
+
create: import("@tanstack/react-query").UseMutationResult<{
|
|
40
|
+
id: string;
|
|
41
|
+
bookingId: string;
|
|
42
|
+
bookingPaymentScheduleId: string | null;
|
|
43
|
+
bookingItemId: string | null;
|
|
44
|
+
guaranteeType: "other" | "voucher" | "bank_transfer" | "credit_card" | "deposit" | "preauth" | "card_on_file" | "agency_letter";
|
|
45
|
+
status: "expired" | "cancelled" | "pending" | "released" | "failed" | "active";
|
|
46
|
+
currency: string | null;
|
|
47
|
+
amountCents: number | null;
|
|
48
|
+
provider: string | null;
|
|
49
|
+
referenceNumber: string | null;
|
|
50
|
+
guaranteedAt: string | null;
|
|
51
|
+
expiresAt: string | null;
|
|
52
|
+
releasedAt: string | null;
|
|
53
|
+
notes: string | null;
|
|
54
|
+
createdAt: string;
|
|
55
|
+
updatedAt: string;
|
|
56
|
+
}, Error, CreateBookingGuaranteeInput, unknown>;
|
|
57
|
+
update: import("@tanstack/react-query").UseMutationResult<{
|
|
58
|
+
id: string;
|
|
59
|
+
bookingId: string;
|
|
60
|
+
bookingPaymentScheduleId: string | null;
|
|
61
|
+
bookingItemId: string | null;
|
|
62
|
+
guaranteeType: "other" | "voucher" | "bank_transfer" | "credit_card" | "deposit" | "preauth" | "card_on_file" | "agency_letter";
|
|
63
|
+
status: "expired" | "cancelled" | "pending" | "released" | "failed" | "active";
|
|
64
|
+
currency: string | null;
|
|
65
|
+
amountCents: number | null;
|
|
66
|
+
provider: string | null;
|
|
67
|
+
referenceNumber: string | null;
|
|
68
|
+
guaranteedAt: string | null;
|
|
69
|
+
expiresAt: string | null;
|
|
70
|
+
releasedAt: string | null;
|
|
71
|
+
notes: string | null;
|
|
72
|
+
createdAt: string;
|
|
73
|
+
updatedAt: string;
|
|
74
|
+
}, Error, {
|
|
75
|
+
id: string;
|
|
76
|
+
input: UpdateBookingGuaranteeInput;
|
|
77
|
+
}, unknown>;
|
|
78
|
+
remove: import("@tanstack/react-query").UseMutationResult<{
|
|
79
|
+
success: boolean;
|
|
80
|
+
}, Error, string, unknown>;
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=use-booking-guarantees.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-booking-guarantees.d.ts","sourceRoot":"","sources":["../../src/hooks/use-booking-guarantees.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,2BAA2B;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,OAAO,GAAE,2BAAgC;;;;;;;;;;;;;;;;;;;UAS1C;AAED,MAAM,WAAW,2BAA2B;IAC1C,aAAa,EAAE,MAAM,CAAA;IACrB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,wBAAwB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC9B;AAED,MAAM,MAAM,2BAA2B,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAA;AAM9E,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAwBjB,MAAM;eAAS,2BAA2B;;;;;EAwBrF"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
3
|
+
import { fetchWithValidation } from "../client.js";
|
|
4
|
+
import { useVoyantFinanceContext } from "../provider.js";
|
|
5
|
+
import { financeQueryKeys } from "../query-keys.js";
|
|
6
|
+
import { getBookingGuaranteesQueryOptions } from "../query-options.js";
|
|
7
|
+
import { bookingGuaranteeRecordSchema, successEnvelope } from "../schemas.js";
|
|
8
|
+
export function useBookingGuarantees(bookingId, options = {}) {
|
|
9
|
+
const { baseUrl, fetcher } = useVoyantFinanceContext();
|
|
10
|
+
const { enabled = true } = options;
|
|
11
|
+
return useQuery({
|
|
12
|
+
...getBookingGuaranteesQueryOptions({ baseUrl, fetcher }, bookingId),
|
|
13
|
+
enabled: enabled && Boolean(bookingId),
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
const guaranteeSingleResponse = bookingGuaranteeRecordSchema.transform((data) => ({
|
|
17
|
+
data,
|
|
18
|
+
}));
|
|
19
|
+
export function useBookingGuaranteeMutation(bookingId) {
|
|
20
|
+
const { baseUrl, fetcher } = useVoyantFinanceContext();
|
|
21
|
+
const queryClient = useQueryClient();
|
|
22
|
+
const invalidate = () => {
|
|
23
|
+
void queryClient.invalidateQueries({
|
|
24
|
+
queryKey: financeQueryKeys.bookingGuarantees(bookingId),
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
const create = useMutation({
|
|
28
|
+
mutationFn: async (input) => {
|
|
29
|
+
const res = await fetchWithValidation(`/v1/finance/bookings/${bookingId}/guarantees`, guaranteeSingleResponse, { baseUrl, fetcher }, { method: "POST", body: JSON.stringify(input) });
|
|
30
|
+
return res.data;
|
|
31
|
+
},
|
|
32
|
+
onSuccess: invalidate,
|
|
33
|
+
});
|
|
34
|
+
const update = useMutation({
|
|
35
|
+
mutationFn: async ({ id, input }) => {
|
|
36
|
+
const res = await fetchWithValidation(`/v1/finance/bookings/${bookingId}/guarantees/${id}`, guaranteeSingleResponse, { baseUrl, fetcher }, { method: "PATCH", body: JSON.stringify(input) });
|
|
37
|
+
return res.data;
|
|
38
|
+
},
|
|
39
|
+
onSuccess: invalidate,
|
|
40
|
+
});
|
|
41
|
+
const remove = useMutation({
|
|
42
|
+
mutationFn: async (guaranteeId) => fetchWithValidation(`/v1/finance/bookings/${bookingId}/guarantees/${guaranteeId}`, successEnvelope, { baseUrl, fetcher }, { method: "DELETE" }),
|
|
43
|
+
onSuccess: invalidate,
|
|
44
|
+
});
|
|
45
|
+
return { create, update, remove };
|
|
46
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export interface UseBookingPaymentSchedulesOptions {
|
|
2
|
+
enabled?: boolean;
|
|
3
|
+
}
|
|
4
|
+
export declare function useBookingPaymentSchedules(bookingId: string | null | undefined, options?: UseBookingPaymentSchedulesOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
5
|
+
data: {
|
|
6
|
+
id: string;
|
|
7
|
+
bookingId: string;
|
|
8
|
+
bookingItemId: string | null;
|
|
9
|
+
scheduleType: "other" | "deposit" | "installment" | "balance" | "hold";
|
|
10
|
+
status: "expired" | "cancelled" | "pending" | "paid" | "due" | "waived";
|
|
11
|
+
dueDate: string;
|
|
12
|
+
currency: string;
|
|
13
|
+
amountCents: number;
|
|
14
|
+
notes: string | null;
|
|
15
|
+
createdAt: string;
|
|
16
|
+
updatedAt: string;
|
|
17
|
+
}[];
|
|
18
|
+
}, Error>;
|
|
19
|
+
export interface CreateBookingPaymentScheduleInput {
|
|
20
|
+
scheduleType?: string;
|
|
21
|
+
status?: string;
|
|
22
|
+
dueDate: string;
|
|
23
|
+
currency: string;
|
|
24
|
+
amountCents: number;
|
|
25
|
+
bookingItemId?: string | null;
|
|
26
|
+
notes?: string | null;
|
|
27
|
+
}
|
|
28
|
+
export type UpdateBookingPaymentScheduleInput = Partial<CreateBookingPaymentScheduleInput>;
|
|
29
|
+
export declare function useBookingPaymentScheduleMutation(bookingId: string): {
|
|
30
|
+
create: import("@tanstack/react-query").UseMutationResult<{
|
|
31
|
+
id: string;
|
|
32
|
+
bookingId: string;
|
|
33
|
+
bookingItemId: string | null;
|
|
34
|
+
scheduleType: "other" | "deposit" | "installment" | "balance" | "hold";
|
|
35
|
+
status: "expired" | "cancelled" | "pending" | "paid" | "due" | "waived";
|
|
36
|
+
dueDate: string;
|
|
37
|
+
currency: string;
|
|
38
|
+
amountCents: number;
|
|
39
|
+
notes: string | null;
|
|
40
|
+
createdAt: string;
|
|
41
|
+
updatedAt: string;
|
|
42
|
+
}, Error, CreateBookingPaymentScheduleInput, unknown>;
|
|
43
|
+
update: import("@tanstack/react-query").UseMutationResult<{
|
|
44
|
+
id: string;
|
|
45
|
+
bookingId: string;
|
|
46
|
+
bookingItemId: string | null;
|
|
47
|
+
scheduleType: "other" | "deposit" | "installment" | "balance" | "hold";
|
|
48
|
+
status: "expired" | "cancelled" | "pending" | "paid" | "due" | "waived";
|
|
49
|
+
dueDate: string;
|
|
50
|
+
currency: string;
|
|
51
|
+
amountCents: number;
|
|
52
|
+
notes: string | null;
|
|
53
|
+
createdAt: string;
|
|
54
|
+
updatedAt: string;
|
|
55
|
+
}, Error, {
|
|
56
|
+
id: string;
|
|
57
|
+
input: UpdateBookingPaymentScheduleInput;
|
|
58
|
+
}, unknown>;
|
|
59
|
+
remove: import("@tanstack/react-query").UseMutationResult<{
|
|
60
|
+
success: boolean;
|
|
61
|
+
}, Error, string, unknown>;
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=use-booking-payment-schedules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-booking-payment-schedules.d.ts","sourceRoot":"","sources":["../../src/hooks/use-booking-payment-schedules.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,iCAAiC;IAChD,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,OAAO,GAAE,iCAAsC;;;;;;;;;;;;;;UAShD;AAED,MAAM,WAAW,iCAAiC;IAChD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACtB;AAED,MAAM,MAAM,iCAAiC,GAAG,OAAO,CAAC,iCAAiC,CAAC,CAAA;AAM1F,wBAAgB,iCAAiC,CAAC,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;YAwBvB,MAAM;eAAS,iCAAiC;;;;;EAwB3F"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
3
|
+
import { fetchWithValidation } from "../client.js";
|
|
4
|
+
import { useVoyantFinanceContext } from "../provider.js";
|
|
5
|
+
import { financeQueryKeys } from "../query-keys.js";
|
|
6
|
+
import { getBookingPaymentSchedulesQueryOptions } from "../query-options.js";
|
|
7
|
+
import { bookingPaymentScheduleRecordSchema, successEnvelope } from "../schemas.js";
|
|
8
|
+
export function useBookingPaymentSchedules(bookingId, options = {}) {
|
|
9
|
+
const { baseUrl, fetcher } = useVoyantFinanceContext();
|
|
10
|
+
const { enabled = true } = options;
|
|
11
|
+
return useQuery({
|
|
12
|
+
...getBookingPaymentSchedulesQueryOptions({ baseUrl, fetcher }, bookingId),
|
|
13
|
+
enabled: enabled && Boolean(bookingId),
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
const scheduleSingleResponse = bookingPaymentScheduleRecordSchema.transform((data) => ({
|
|
17
|
+
data,
|
|
18
|
+
}));
|
|
19
|
+
export function useBookingPaymentScheduleMutation(bookingId) {
|
|
20
|
+
const { baseUrl, fetcher } = useVoyantFinanceContext();
|
|
21
|
+
const queryClient = useQueryClient();
|
|
22
|
+
const invalidate = () => {
|
|
23
|
+
void queryClient.invalidateQueries({
|
|
24
|
+
queryKey: financeQueryKeys.bookingPaymentSchedules(bookingId),
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
const create = useMutation({
|
|
28
|
+
mutationFn: async (input) => {
|
|
29
|
+
const res = await fetchWithValidation(`/v1/finance/bookings/${bookingId}/payment-schedules`, scheduleSingleResponse, { baseUrl, fetcher }, { method: "POST", body: JSON.stringify(input) });
|
|
30
|
+
return res.data;
|
|
31
|
+
},
|
|
32
|
+
onSuccess: invalidate,
|
|
33
|
+
});
|
|
34
|
+
const update = useMutation({
|
|
35
|
+
mutationFn: async ({ id, input }) => {
|
|
36
|
+
const res = await fetchWithValidation(`/v1/finance/bookings/${bookingId}/payment-schedules/${id}`, scheduleSingleResponse, { baseUrl, fetcher }, { method: "PATCH", body: JSON.stringify(input) });
|
|
37
|
+
return res.data;
|
|
38
|
+
},
|
|
39
|
+
onSuccess: invalidate,
|
|
40
|
+
});
|
|
41
|
+
const remove = useMutation({
|
|
42
|
+
mutationFn: async (scheduleId) => fetchWithValidation(`/v1/finance/bookings/${bookingId}/payment-schedules/${scheduleId}`, successEnvelope, { baseUrl, fetcher }, { method: "DELETE" }),
|
|
43
|
+
onSuccess: invalidate,
|
|
44
|
+
});
|
|
45
|
+
return { create, update, remove };
|
|
46
|
+
}
|
|
@@ -23,7 +23,7 @@ export declare function useInvoiceMutation(): {
|
|
|
23
23
|
bookingId: string;
|
|
24
24
|
personId: string | null;
|
|
25
25
|
organizationId: string | null;
|
|
26
|
-
status: "draft" | "
|
|
26
|
+
status: "draft" | "sent" | "partially_paid" | "paid" | "overdue" | "void";
|
|
27
27
|
currency: string;
|
|
28
28
|
subtotalCents: number;
|
|
29
29
|
taxCents: number;
|
|
@@ -42,7 +42,7 @@ export declare function useInvoiceMutation(): {
|
|
|
42
42
|
bookingId: string;
|
|
43
43
|
personId: string | null;
|
|
44
44
|
organizationId: string | null;
|
|
45
|
-
status: "draft" | "
|
|
45
|
+
status: "draft" | "sent" | "partially_paid" | "paid" | "overdue" | "void";
|
|
46
46
|
currency: string;
|
|
47
47
|
subtotalCents: number;
|
|
48
48
|
taxCents: number;
|
|
@@ -13,7 +13,7 @@ export declare function useInvoicePaymentMutation(invoiceId: string): import("@t
|
|
|
13
13
|
amountCents: number;
|
|
14
14
|
currency: string;
|
|
15
15
|
paymentMethod: string;
|
|
16
|
-
status: "
|
|
16
|
+
status: "completed" | "pending" | "failed" | "refunded";
|
|
17
17
|
referenceNumber: string | null;
|
|
18
18
|
paymentDate: string;
|
|
19
19
|
notes: string | null;
|
|
@@ -8,7 +8,7 @@ export declare function useInvoicePayments(invoiceId: string | null | undefined,
|
|
|
8
8
|
amountCents: number;
|
|
9
9
|
currency: string;
|
|
10
10
|
paymentMethod: string;
|
|
11
|
-
status: "
|
|
11
|
+
status: "completed" | "pending" | "failed" | "refunded";
|
|
12
12
|
referenceNumber: string | null;
|
|
13
13
|
paymentDate: string;
|
|
14
14
|
notes: string | null;
|
|
@@ -8,7 +8,7 @@ export declare function useInvoice(id: string | null | undefined, options?: UseI
|
|
|
8
8
|
bookingId: string;
|
|
9
9
|
personId: string | null;
|
|
10
10
|
organizationId: string | null;
|
|
11
|
-
status: "draft" | "
|
|
11
|
+
status: "draft" | "sent" | "partially_paid" | "paid" | "overdue" | "void";
|
|
12
12
|
currency: string;
|
|
13
13
|
subtotalCents: number;
|
|
14
14
|
taxCents: number;
|
|
@@ -9,7 +9,7 @@ export declare function useInvoices(options?: UseInvoicesOptions): import("@tans
|
|
|
9
9
|
bookingId: string;
|
|
10
10
|
personId: string | null;
|
|
11
11
|
organizationId: string | null;
|
|
12
|
-
status: "draft" | "
|
|
12
|
+
status: "draft" | "sent" | "partially_paid" | "paid" | "overdue" | "void";
|
|
13
13
|
currency: string;
|
|
14
14
|
subtotalCents: number;
|
|
15
15
|
taxCents: number;
|
|
@@ -8,7 +8,7 @@ export declare function usePublicBookingDocuments(bookingId: string | null | und
|
|
|
8
8
|
invoiceId: string;
|
|
9
9
|
invoiceNumber: string;
|
|
10
10
|
invoiceType: "invoice" | "proforma" | "credit_note";
|
|
11
|
-
invoiceStatus: "draft" | "
|
|
11
|
+
invoiceStatus: "draft" | "sent" | "partially_paid" | "paid" | "overdue" | "void";
|
|
12
12
|
currency: string;
|
|
13
13
|
totalCents: number;
|
|
14
14
|
paidCents: number;
|
|
@@ -16,8 +16,8 @@ export declare function usePublicBookingDocuments(bookingId: string | null | und
|
|
|
16
16
|
issueDate: string;
|
|
17
17
|
dueDate: string;
|
|
18
18
|
renditionId: string | null;
|
|
19
|
-
documentStatus: "pending" | "failed" | "
|
|
20
|
-
format: "
|
|
19
|
+
documentStatus: "pending" | "failed" | "ready" | "stale" | "missing";
|
|
20
|
+
format: "json" | "pdf" | "html" | "xml" | null;
|
|
21
21
|
language: string | null;
|
|
22
22
|
generatedAt: string | null;
|
|
23
23
|
fileSize: number | null;
|
|
@@ -9,8 +9,8 @@ export declare function usePublicBookingPaymentOptions(bookingId: string | null
|
|
|
9
9
|
id: string;
|
|
10
10
|
label: string;
|
|
11
11
|
provider: string | null;
|
|
12
|
-
instrumentType: "
|
|
13
|
-
status: "
|
|
12
|
+
instrumentType: "other" | "voucher" | "wallet" | "credit_card" | "debit_card" | "cash" | "direct_bill" | "bank_account";
|
|
13
|
+
status: "expired" | "revoked" | "active" | "inactive" | "failed_verification";
|
|
14
14
|
brand: string | null;
|
|
15
15
|
last4: string | null;
|
|
16
16
|
expiryMonth: number | null;
|
|
@@ -20,7 +20,7 @@ export declare function usePublicBookingPaymentOptions(bookingId: string | null
|
|
|
20
20
|
schedules: {
|
|
21
21
|
id: string;
|
|
22
22
|
scheduleType: "other" | "deposit" | "installment" | "balance" | "hold";
|
|
23
|
-
status: "
|
|
23
|
+
status: "expired" | "cancelled" | "pending" | "paid" | "due" | "waived";
|
|
24
24
|
dueDate: string;
|
|
25
25
|
currency: string;
|
|
26
26
|
amountCents: number;
|
|
@@ -9,8 +9,8 @@ export declare function usePublicBookingPayments(bookingId: string | null | unde
|
|
|
9
9
|
invoiceId: string;
|
|
10
10
|
invoiceNumber: string;
|
|
11
11
|
invoiceType: "invoice" | "proforma" | "credit_note";
|
|
12
|
-
status: "
|
|
13
|
-
paymentMethod: "
|
|
12
|
+
status: "completed" | "pending" | "failed" | "refunded";
|
|
13
|
+
paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill";
|
|
14
14
|
amountCents: number;
|
|
15
15
|
currency: string;
|
|
16
16
|
paymentDate: string;
|
|
@@ -6,7 +6,7 @@ export declare function usePublicFinanceDocumentByReference(reference: string |
|
|
|
6
6
|
invoiceId: string;
|
|
7
7
|
invoiceNumber: string;
|
|
8
8
|
invoiceType: "invoice" | "proforma" | "credit_note";
|
|
9
|
-
invoiceStatus: "draft" | "
|
|
9
|
+
invoiceStatus: "draft" | "sent" | "partially_paid" | "paid" | "overdue" | "void";
|
|
10
10
|
currency: string;
|
|
11
11
|
totalCents: number;
|
|
12
12
|
paidCents: number;
|
|
@@ -14,8 +14,8 @@ export declare function usePublicFinanceDocumentByReference(reference: string |
|
|
|
14
14
|
issueDate: string;
|
|
15
15
|
dueDate: string;
|
|
16
16
|
renditionId: string | null;
|
|
17
|
-
documentStatus: "pending" | "failed" | "
|
|
18
|
-
format: "
|
|
17
|
+
documentStatus: "pending" | "failed" | "ready" | "stale" | "missing";
|
|
18
|
+
format: "json" | "pdf" | "html" | "xml" | null;
|
|
19
19
|
language: string | null;
|
|
20
20
|
generatedAt: string | null;
|
|
21
21
|
fileSize: number | null;
|
|
@@ -13,13 +13,13 @@ export type StartPublicPaymentSessionTarget = {
|
|
|
13
13
|
export declare function usePublicPaymentSessionMutation(): import("@tanstack/react-query").UseMutationResult<{
|
|
14
14
|
data: {
|
|
15
15
|
id: string;
|
|
16
|
-
targetType: "
|
|
16
|
+
targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee";
|
|
17
17
|
targetId: string | null;
|
|
18
18
|
bookingId: string | null;
|
|
19
19
|
invoiceId: string | null;
|
|
20
20
|
bookingPaymentScheduleId: string | null;
|
|
21
21
|
bookingGuaranteeId: string | null;
|
|
22
|
-
status: "
|
|
22
|
+
status: "expired" | "cancelled" | "pending" | "failed" | "paid" | "requires_redirect" | "processing" | "authorized";
|
|
23
23
|
provider: string | null;
|
|
24
24
|
providerSessionId: string | null;
|
|
25
25
|
providerPaymentId: string | null;
|
|
@@ -27,7 +27,7 @@ export declare function usePublicPaymentSessionMutation(): import("@tanstack/rea
|
|
|
27
27
|
clientReference: string | null;
|
|
28
28
|
currency: string;
|
|
29
29
|
amountCents: number;
|
|
30
|
-
paymentMethod: "
|
|
30
|
+
paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
|
|
31
31
|
payerEmail: string | null;
|
|
32
32
|
payerName: string | null;
|
|
33
33
|
redirectUrl: string | null;
|
|
@@ -4,13 +4,13 @@ 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: "
|
|
7
|
+
targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee";
|
|
8
8
|
targetId: string | null;
|
|
9
9
|
bookingId: string | null;
|
|
10
10
|
invoiceId: string | null;
|
|
11
11
|
bookingPaymentScheduleId: string | null;
|
|
12
12
|
bookingGuaranteeId: string | null;
|
|
13
|
-
status: "
|
|
13
|
+
status: "expired" | "cancelled" | "pending" | "failed" | "paid" | "requires_redirect" | "processing" | "authorized";
|
|
14
14
|
provider: string | null;
|
|
15
15
|
providerSessionId: string | null;
|
|
16
16
|
providerPaymentId: string | null;
|
|
@@ -18,7 +18,7 @@ export declare function usePublicPaymentSession(sessionId: string | null | undef
|
|
|
18
18
|
clientReference: string | null;
|
|
19
19
|
currency: string;
|
|
20
20
|
amountCents: number;
|
|
21
|
-
paymentMethod: "
|
|
21
|
+
paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
|
|
22
22
|
payerEmail: string | null;
|
|
23
23
|
payerName: string | null;
|
|
24
24
|
redirectUrl: string | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare function usePublicVoucherValidationMutation(): import("@tanstack/react-query").UseMutationResult<{
|
|
2
2
|
data: {
|
|
3
3
|
valid: boolean;
|
|
4
|
-
reason: "
|
|
4
|
+
reason: "expired" | "inactive" | "not_found" | "not_started" | "booking_mismatch" | "currency_mismatch" | "insufficient_balance" | null;
|
|
5
5
|
voucher: {
|
|
6
6
|
id: string;
|
|
7
7
|
code: string;
|
|
@@ -18,7 +18,7 @@ export declare function useSupplierPaymentMutation(): {
|
|
|
18
18
|
amountCents: number;
|
|
19
19
|
currency: string;
|
|
20
20
|
paymentMethod: string;
|
|
21
|
-
status: "
|
|
21
|
+
status: "completed" | "pending" | "failed" | "refunded";
|
|
22
22
|
referenceNumber: string | null;
|
|
23
23
|
paymentDate: string;
|
|
24
24
|
createdAt: string;
|
|
@@ -31,7 +31,7 @@ export declare function useSupplierPaymentMutation(): {
|
|
|
31
31
|
amountCents: number;
|
|
32
32
|
currency: string;
|
|
33
33
|
paymentMethod: string;
|
|
34
|
-
status: "
|
|
34
|
+
status: "completed" | "pending" | "failed" | "refunded";
|
|
35
35
|
referenceNumber: string | null;
|
|
36
36
|
paymentDate: string;
|
|
37
37
|
createdAt: string;
|
|
@@ -10,7 +10,7 @@ export declare function useSupplierPayments(options?: UseSupplierPaymentsOptions
|
|
|
10
10
|
amountCents: number;
|
|
11
11
|
currency: string;
|
|
12
12
|
paymentMethod: string;
|
|
13
|
-
status: "
|
|
13
|
+
status: "completed" | "pending" | "failed" | "refunded";
|
|
14
14
|
referenceNumber: string | null;
|
|
15
15
|
paymentDate: string;
|
|
16
16
|
createdAt: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,6 @@ export * from "./hooks/index.js";
|
|
|
3
3
|
export { getPublicBookingDocuments, getPublicBookingPaymentOptions, getPublicBookingPayments, getPublicFinanceDocumentByReference, 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, getPublicBookingDocumentsQueryOptions, getPublicBookingPaymentOptionsQueryOptions, getPublicBookingPaymentsQueryOptions, getPublicFinanceDocumentByReferenceQueryOptions, getPublicPaymentSessionQueryOptions, getSupplierPaymentsQueryOptions, } from "./query-options.js";
|
|
6
|
+
export { getBookingGuaranteesQueryOptions, getBookingPaymentSchedulesQueryOptions, getInvoiceCreditNotesQueryOptions, getInvoiceLineItemsQueryOptions, getInvoiceNotesQueryOptions, getInvoicePaymentsQueryOptions, getInvoiceQueryOptions, getInvoicesQueryOptions, getPublicBookingDocumentsQueryOptions, getPublicBookingPaymentOptionsQueryOptions, getPublicBookingPaymentsQueryOptions, getPublicFinanceDocumentByReferenceQueryOptions, 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,yBAAyB,EACzB,8BAA8B,EAC9B,wBAAwB,EACxB,mCAAmC,EACnC,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,oCAAoC,EACpC,+CAA+C,EAC/C,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,wBAAwB,EACxB,mCAAmC,EACnC,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,gCAAgC,EAChC,sCAAsC,EACtC,iCAAiC,EACjC,+BAA+B,EAC/B,2BAA2B,EAC3B,8BAA8B,EAC9B,sBAAsB,EACtB,uBAAuB,EACvB,qCAAqC,EACrC,0CAA0C,EAC1C,oCAAoC,EACpC,+CAA+C,EAC/C,mCAAmC,EACnC,+BAA+B,GAChC,MAAM,oBAAoB,CAAA;AAC3B,cAAc,cAAc,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -3,5 +3,5 @@ export * from "./hooks/index.js";
|
|
|
3
3
|
export { getPublicBookingDocuments, getPublicBookingPaymentOptions, getPublicBookingPayments, getPublicFinanceDocumentByReference, 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, getPublicBookingDocumentsQueryOptions, getPublicBookingPaymentOptionsQueryOptions, getPublicBookingPaymentsQueryOptions, getPublicFinanceDocumentByReferenceQueryOptions, getPublicPaymentSessionQueryOptions, getSupplierPaymentsQueryOptions, } from "./query-options.js";
|
|
6
|
+
export { getBookingGuaranteesQueryOptions, getBookingPaymentSchedulesQueryOptions, getInvoiceCreditNotesQueryOptions, getInvoiceLineItemsQueryOptions, getInvoiceNotesQueryOptions, getInvoicePaymentsQueryOptions, getInvoiceQueryOptions, getInvoicesQueryOptions, getPublicBookingDocumentsQueryOptions, getPublicBookingPaymentOptionsQueryOptions, getPublicBookingPaymentsQueryOptions, getPublicFinanceDocumentByReferenceQueryOptions, getPublicPaymentSessionQueryOptions, getSupplierPaymentsQueryOptions, } from "./query-options.js";
|
|
7
7
|
export * from "./schemas.js";
|