@voyantjs/finance-react 0.20.0 → 0.21.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 +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/use-admin-booking-payments.d.ts +28 -0
- package/dist/hooks/use-admin-booking-payments.d.ts.map +1 -0
- package/dist/hooks/use-admin-booking-payments.js +18 -0
- package/dist/hooks/use-booking-guarantees.d.ts +3 -3
- package/dist/hooks/use-invoice-mutation.d.ts +4 -0
- package/dist/hooks/use-invoice-mutation.d.ts.map +1 -1
- 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 +2 -0
- package/dist/hooks/use-invoice.d.ts.map +1 -1
- package/dist/hooks/use-invoices.d.ts +2 -0
- package/dist/hooks/use-invoices.d.ts.map +1 -1
- package/dist/hooks/use-public-booking-payments.d.ts +1 -1
- 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/hooks/use-supplier-payment-mutation.d.ts +2 -2
- package/dist/hooks/use-supplier-payments.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 -4
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations.js +9 -0
- package/dist/query-keys.d.ts +9 -0
- package/dist/query-keys.d.ts.map +1 -1
- package/dist/query-keys.js +1 -0
- package/dist/query-options.d.ts +112 -20
- package/dist/query-options.d.ts.map +1 -1
- package/dist/query-options.js +16 -1
- package/dist/schemas.d.ts +33 -13
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +14 -2
- 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,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;AAC1C,cAAc,kBAAkB,CAAA;AAChC,cAAc,2BAA2B,CAAA;AACzC,cAAc,mBAAmB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAA;AAC/C,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;AAC1C,cAAc,kBAAkB,CAAA;AAChC,cAAc,2BAA2B,CAAA;AACzC,cAAc,mBAAmB,CAAA"}
|
package/dist/hooks/index.js
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface UseAdminBookingPaymentsOptions {
|
|
2
|
+
enabled?: boolean;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Admin variant of `usePublicBookingPayments`. Same response shape;
|
|
6
|
+
* targets the admin endpoint so a staff session is authorized to
|
|
7
|
+
* read. Use this from the operator dashboard's booking detail page;
|
|
8
|
+
* the customer-portal stays on the public hook.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useAdminBookingPayments(bookingId: string | null | undefined, options?: UseAdminBookingPaymentsOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
11
|
+
data: {
|
|
12
|
+
bookingId: string;
|
|
13
|
+
payments: {
|
|
14
|
+
id: string;
|
|
15
|
+
invoiceId: string;
|
|
16
|
+
invoiceNumber: string;
|
|
17
|
+
invoiceType: "invoice" | "proforma" | "credit_note";
|
|
18
|
+
status: "pending" | "failed" | "completed" | "refunded";
|
|
19
|
+
paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill";
|
|
20
|
+
amountCents: number;
|
|
21
|
+
currency: string;
|
|
22
|
+
paymentDate: string;
|
|
23
|
+
referenceNumber: string | null;
|
|
24
|
+
notes: string | null;
|
|
25
|
+
}[];
|
|
26
|
+
};
|
|
27
|
+
}, Error>;
|
|
28
|
+
//# sourceMappingURL=use-admin-booking-payments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-admin-booking-payments.d.ts","sourceRoot":"","sources":["../../src/hooks/use-admin-booking-payments.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,8BAA8B;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,OAAO,GAAE,8BAAmC;;;;;;;;;;;;;;;;;UAS7C"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantFinanceContext } from "../provider.js";
|
|
4
|
+
import { getAdminBookingPaymentsQueryOptions } from "../query-options.js";
|
|
5
|
+
/**
|
|
6
|
+
* Admin variant of `usePublicBookingPayments`. Same response shape;
|
|
7
|
+
* targets the admin endpoint so a staff session is authorized to
|
|
8
|
+
* read. Use this from the operator dashboard's booking detail page;
|
|
9
|
+
* the customer-portal stays on the public hook.
|
|
10
|
+
*/
|
|
11
|
+
export function useAdminBookingPayments(bookingId, options = {}) {
|
|
12
|
+
const { baseUrl, fetcher } = useVoyantFinanceContext();
|
|
13
|
+
const { enabled = true } = options;
|
|
14
|
+
return useQuery({
|
|
15
|
+
...getAdminBookingPaymentsQueryOptions({ baseUrl, fetcher }, bookingId),
|
|
16
|
+
enabled: enabled && Boolean(bookingId),
|
|
17
|
+
});
|
|
18
|
+
}
|
|
@@ -8,7 +8,7 @@ export declare function useBookingGuarantees(bookingId: string | null | undefine
|
|
|
8
8
|
bookingPaymentScheduleId: string | null;
|
|
9
9
|
bookingItemId: string | null;
|
|
10
10
|
guaranteeType: "other" | "voucher" | "bank_transfer" | "credit_card" | "deposit" | "preauth" | "card_on_file" | "agency_letter";
|
|
11
|
-
status: "pending" | "active" | "
|
|
11
|
+
status: "pending" | "active" | "failed" | "expired" | "cancelled" | "released";
|
|
12
12
|
currency: string | null;
|
|
13
13
|
amountCents: number | null;
|
|
14
14
|
provider: string | null;
|
|
@@ -42,7 +42,7 @@ export declare function useBookingGuaranteeMutation(bookingId: string): {
|
|
|
42
42
|
bookingPaymentScheduleId: string | null;
|
|
43
43
|
bookingItemId: string | null;
|
|
44
44
|
guaranteeType: "other" | "voucher" | "bank_transfer" | "credit_card" | "deposit" | "preauth" | "card_on_file" | "agency_letter";
|
|
45
|
-
status: "pending" | "active" | "
|
|
45
|
+
status: "pending" | "active" | "failed" | "expired" | "cancelled" | "released";
|
|
46
46
|
currency: string | null;
|
|
47
47
|
amountCents: number | null;
|
|
48
48
|
provider: string | null;
|
|
@@ -60,7 +60,7 @@ export declare function useBookingGuaranteeMutation(bookingId: string): {
|
|
|
60
60
|
bookingPaymentScheduleId: string | null;
|
|
61
61
|
bookingItemId: string | null;
|
|
62
62
|
guaranteeType: "other" | "voucher" | "bank_transfer" | "credit_card" | "deposit" | "preauth" | "card_on_file" | "agency_letter";
|
|
63
|
-
status: "pending" | "active" | "
|
|
63
|
+
status: "pending" | "active" | "failed" | "expired" | "cancelled" | "released";
|
|
64
64
|
currency: string | null;
|
|
65
65
|
amountCents: number | null;
|
|
66
66
|
provider: string | null;
|
|
@@ -18,6 +18,7 @@ export interface CreateInvoiceInput {
|
|
|
18
18
|
export type UpdateInvoiceInput = Partial<CreateInvoiceInput>;
|
|
19
19
|
export declare function useInvoiceMutation(): {
|
|
20
20
|
create: import("@tanstack/react-query").UseMutationResult<{
|
|
21
|
+
[x: string]: unknown;
|
|
21
22
|
id: string;
|
|
22
23
|
invoiceNumber: string;
|
|
23
24
|
bookingId: string;
|
|
@@ -35,8 +36,10 @@ export declare function useInvoiceMutation(): {
|
|
|
35
36
|
notes: string | null;
|
|
36
37
|
createdAt: string;
|
|
37
38
|
updatedAt: string;
|
|
39
|
+
invoiceType?: "invoice" | "proforma" | "credit_note" | undefined;
|
|
38
40
|
}, Error, CreateInvoiceInput, unknown>;
|
|
39
41
|
update: import("@tanstack/react-query").UseMutationResult<{
|
|
42
|
+
[x: string]: unknown;
|
|
40
43
|
id: string;
|
|
41
44
|
invoiceNumber: string;
|
|
42
45
|
bookingId: string;
|
|
@@ -54,6 +57,7 @@ export declare function useInvoiceMutation(): {
|
|
|
54
57
|
notes: string | null;
|
|
55
58
|
createdAt: string;
|
|
56
59
|
updatedAt: string;
|
|
60
|
+
invoiceType?: "invoice" | "proforma" | "credit_note" | undefined;
|
|
57
61
|
}, Error, {
|
|
58
62
|
id: string;
|
|
59
63
|
input: UpdateInvoiceInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-invoice-mutation.d.ts","sourceRoot":"","sources":["../../src/hooks/use-invoice-mutation.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,aAAa,EAA0C,MAAM,eAAe,CAAA;AAE1F,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,MAAM,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAA;IAChC,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACtB;AAED,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;AAE5D,wBAAgB,kBAAkB
|
|
1
|
+
{"version":3,"file":"use-invoice-mutation.d.ts","sourceRoot":"","sources":["../../src/hooks/use-invoice-mutation.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,aAAa,EAA0C,MAAM,eAAe,CAAA;AAE1F,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,MAAM,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAA;IAChC,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACtB;AAED,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;AAE5D,wBAAgB,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAqBU,MAAM;eAAS,kBAAkB;;;;;EAoC5E"}
|
|
@@ -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: "pending" | "
|
|
16
|
+
status: "pending" | "failed" | "completed" | "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: "pending" | "
|
|
11
|
+
status: "pending" | "failed" | "completed" | "refunded";
|
|
12
12
|
referenceNumber: string | null;
|
|
13
13
|
paymentDate: string;
|
|
14
14
|
notes: string | null;
|
|
@@ -3,6 +3,7 @@ export interface UseInvoiceOptions {
|
|
|
3
3
|
}
|
|
4
4
|
export declare function useInvoice(id: string | null | undefined, options?: UseInvoiceOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
5
5
|
data: {
|
|
6
|
+
[x: string]: unknown;
|
|
6
7
|
id: string;
|
|
7
8
|
invoiceNumber: string;
|
|
8
9
|
bookingId: string;
|
|
@@ -20,6 +21,7 @@ export declare function useInvoice(id: string | null | undefined, options?: UseI
|
|
|
20
21
|
notes: string | null;
|
|
21
22
|
createdAt: string;
|
|
22
23
|
updatedAt: string;
|
|
24
|
+
invoiceType?: "invoice" | "proforma" | "credit_note" | undefined;
|
|
23
25
|
};
|
|
24
26
|
}, Error>;
|
|
25
27
|
//# sourceMappingURL=use-invoice.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-invoice.d.ts","sourceRoot":"","sources":["../../src/hooks/use-invoice.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,GAAE,iBAAsB
|
|
1
|
+
{"version":3,"file":"use-invoice.d.ts","sourceRoot":"","sources":["../../src/hooks/use-invoice.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,GAAE,iBAAsB;;;;;;;;;;;;;;;;;;;;;;UAQxF"}
|
|
@@ -4,6 +4,7 @@ export interface UseInvoicesOptions extends FinanceInvoiceListFilters {
|
|
|
4
4
|
}
|
|
5
5
|
export declare function useInvoices(options?: UseInvoicesOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
6
6
|
data: {
|
|
7
|
+
[x: string]: unknown;
|
|
7
8
|
id: string;
|
|
8
9
|
invoiceNumber: string;
|
|
9
10
|
bookingId: string;
|
|
@@ -21,6 +22,7 @@ export declare function useInvoices(options?: UseInvoicesOptions): import("@tans
|
|
|
21
22
|
notes: string | null;
|
|
22
23
|
createdAt: string;
|
|
23
24
|
updatedAt: string;
|
|
25
|
+
invoiceType?: "invoice" | "proforma" | "credit_note" | undefined;
|
|
24
26
|
}[];
|
|
25
27
|
total: number;
|
|
26
28
|
limit: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-invoices.d.ts","sourceRoot":"","sources":["../../src/hooks/use-invoices.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAA;AAGjE,MAAM,WAAW,kBAAmB,SAAQ,yBAAyB;IACnE,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB
|
|
1
|
+
{"version":3,"file":"use-invoices.d.ts","sourceRoot":"","sources":["../../src/hooks/use-invoices.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAA;AAGjE,MAAM,WAAW,kBAAmB,SAAQ,yBAAyB;IACnE,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;UAQ3D"}
|
|
@@ -9,7 +9,7 @@ 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: "pending" | "
|
|
12
|
+
status: "pending" | "failed" | "completed" | "refunded";
|
|
13
13
|
paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill";
|
|
14
14
|
amountCents: number;
|
|
15
15
|
currency: string;
|
|
@@ -19,7 +19,7 @@ export declare function usePublicPaymentSessionMutation(): import("@tanstack/rea
|
|
|
19
19
|
invoiceId: string | null;
|
|
20
20
|
bookingPaymentScheduleId: string | null;
|
|
21
21
|
bookingGuaranteeId: string | null;
|
|
22
|
-
status: "pending" | "
|
|
22
|
+
status: "pending" | "failed" | "expired" | "cancelled" | "paid" | "requires_redirect" | "processing" | "authorized";
|
|
23
23
|
provider: string | null;
|
|
24
24
|
providerSessionId: string | null;
|
|
25
25
|
providerPaymentId: string | null;
|
|
@@ -10,7 +10,7 @@ export declare function usePublicPaymentSession(sessionId: string | null | undef
|
|
|
10
10
|
invoiceId: string | null;
|
|
11
11
|
bookingPaymentScheduleId: string | null;
|
|
12
12
|
bookingGuaranteeId: string | null;
|
|
13
|
-
status: "pending" | "
|
|
13
|
+
status: "pending" | "failed" | "expired" | "cancelled" | "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 useSupplierPaymentMutation(): {
|
|
|
18
18
|
amountCents: number;
|
|
19
19
|
currency: string;
|
|
20
20
|
paymentMethod: string;
|
|
21
|
-
status: "pending" | "
|
|
21
|
+
status: "pending" | "failed" | "completed" | "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: "pending" | "
|
|
34
|
+
status: "pending" | "failed" | "completed" | "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: "pending" | "
|
|
13
|
+
status: "pending" | "failed" | "completed" | "refunded";
|
|
14
14
|
referenceNumber: string | null;
|
|
15
15
|
paymentDate: string;
|
|
16
16
|
createdAt: string;
|
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 { getPublicBookingDocuments, getPublicBookingPaymentOptions, getPublicBookingPayments, getPublicFinanceDocumentByReference, getPublicPaymentSession, startPublicBookingGuaranteePaymentSession, startPublicBookingSchedulePaymentSession, validatePublicVoucher, } from "./operations.js";
|
|
3
|
+
export { getAdminBookingPayments, 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 { getBookingGuaranteesQueryOptions, getBookingPaymentSchedulesQueryOptions, getInvoiceCreditNotesQueryOptions, getInvoiceLineItemsQueryOptions, getInvoiceNotesQueryOptions, getInvoicePaymentsQueryOptions, getInvoiceQueryOptions, getInvoicesQueryOptions, getPublicBookingDocumentsQueryOptions, getPublicBookingPaymentOptionsQueryOptions, getPublicBookingPaymentsQueryOptions, getPublicFinanceDocumentByReferenceQueryOptions, getPublicPaymentSessionQueryOptions, getSupplierPaymentsQueryOptions, getVoucherQueryOptions, getVouchersQueryOptions, } from "./query-options.js";
|
|
6
|
+
export { getAdminBookingPaymentsQueryOptions, getBookingGuaranteesQueryOptions, getBookingPaymentSchedulesQueryOptions, getInvoiceCreditNotesQueryOptions, getInvoiceLineItemsQueryOptions, getInvoiceNotesQueryOptions, getInvoicePaymentsQueryOptions, getInvoiceQueryOptions, getInvoicesQueryOptions, getPublicBookingDocumentsQueryOptions, getPublicBookingPaymentOptionsQueryOptions, getPublicBookingPaymentsQueryOptions, getPublicFinanceDocumentByReferenceQueryOptions, getPublicPaymentSessionQueryOptions, getSupplierPaymentsQueryOptions, getVoucherQueryOptions, getVouchersQueryOptions, } 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,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,EAC/B,sBAAsB,EACtB,uBAAuB,GACxB,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,uBAAuB,EACvB,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,mCAAmC,EACnC,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,EAC/B,sBAAsB,EACtB,uBAAuB,GACxB,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 { getPublicBookingDocuments, getPublicBookingPaymentOptions, getPublicBookingPayments, getPublicFinanceDocumentByReference, getPublicPaymentSession, startPublicBookingGuaranteePaymentSession, startPublicBookingSchedulePaymentSession, validatePublicVoucher, } from "./operations.js";
|
|
3
|
+
export { getAdminBookingPayments, 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 { getBookingGuaranteesQueryOptions, getBookingPaymentSchedulesQueryOptions, getInvoiceCreditNotesQueryOptions, getInvoiceLineItemsQueryOptions, getInvoiceNotesQueryOptions, getInvoicePaymentsQueryOptions, getInvoiceQueryOptions, getInvoicesQueryOptions, getPublicBookingDocumentsQueryOptions, getPublicBookingPaymentOptionsQueryOptions, getPublicBookingPaymentsQueryOptions, getPublicFinanceDocumentByReferenceQueryOptions, getPublicPaymentSessionQueryOptions, getSupplierPaymentsQueryOptions, getVoucherQueryOptions, getVouchersQueryOptions, } from "./query-options.js";
|
|
6
|
+
export { getAdminBookingPaymentsQueryOptions, getBookingGuaranteesQueryOptions, getBookingPaymentSchedulesQueryOptions, getInvoiceCreditNotesQueryOptions, getInvoiceLineItemsQueryOptions, getInvoiceNotesQueryOptions, getInvoicePaymentsQueryOptions, getInvoiceQueryOptions, getInvoicesQueryOptions, getPublicBookingDocumentsQueryOptions, getPublicBookingPaymentOptionsQueryOptions, getPublicBookingPaymentsQueryOptions, getPublicFinanceDocumentByReferenceQueryOptions, getPublicPaymentSessionQueryOptions, getSupplierPaymentsQueryOptions, getVoucherQueryOptions, getVouchersQueryOptions, } from "./query-options.js";
|
|
7
7
|
export * from "./schemas.js";
|
package/dist/operations.d.ts
CHANGED
|
@@ -56,7 +56,31 @@ export declare function getPublicBookingPayments(client: FetchWithValidationOpti
|
|
|
56
56
|
invoiceId: string;
|
|
57
57
|
invoiceNumber: string;
|
|
58
58
|
invoiceType: "invoice" | "proforma" | "credit_note";
|
|
59
|
-
status: "pending" | "
|
|
59
|
+
status: "pending" | "failed" | "completed" | "refunded";
|
|
60
|
+
paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill";
|
|
61
|
+
amountCents: number;
|
|
62
|
+
currency: string;
|
|
63
|
+
paymentDate: string;
|
|
64
|
+
referenceNumber: string | null;
|
|
65
|
+
notes: string | null;
|
|
66
|
+
}[];
|
|
67
|
+
};
|
|
68
|
+
}>;
|
|
69
|
+
/**
|
|
70
|
+
* Admin variant — same response shape as `getPublicBookingPayments`,
|
|
71
|
+
* but hits the admin endpoint (`/v1/admin/finance/bookings/:id/payments`)
|
|
72
|
+
* so a staff actor can read it. The customer-portal continues to use
|
|
73
|
+
* the public path; the operator dashboard uses this one.
|
|
74
|
+
*/
|
|
75
|
+
export declare function getAdminBookingPayments(client: FetchWithValidationOptions, bookingId: string): Promise<{
|
|
76
|
+
data: {
|
|
77
|
+
bookingId: string;
|
|
78
|
+
payments: {
|
|
79
|
+
id: string;
|
|
80
|
+
invoiceId: string;
|
|
81
|
+
invoiceNumber: string;
|
|
82
|
+
invoiceType: "invoice" | "proforma" | "credit_note";
|
|
83
|
+
status: "pending" | "failed" | "completed" | "refunded";
|
|
60
84
|
paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill";
|
|
61
85
|
amountCents: number;
|
|
62
86
|
currency: string;
|
|
@@ -123,7 +147,7 @@ export declare function getPublicPaymentSession(client: FetchWithValidationOptio
|
|
|
123
147
|
invoiceId: string | null;
|
|
124
148
|
bookingPaymentScheduleId: string | null;
|
|
125
149
|
bookingGuaranteeId: string | null;
|
|
126
|
-
status: "pending" | "
|
|
150
|
+
status: "pending" | "failed" | "expired" | "cancelled" | "paid" | "requires_redirect" | "processing" | "authorized";
|
|
127
151
|
provider: string | null;
|
|
128
152
|
providerSessionId: string | null;
|
|
129
153
|
providerPaymentId: string | null;
|
|
@@ -153,7 +177,7 @@ export declare function startPublicBookingSchedulePaymentSession(client: FetchWi
|
|
|
153
177
|
invoiceId: string | null;
|
|
154
178
|
bookingPaymentScheduleId: string | null;
|
|
155
179
|
bookingGuaranteeId: string | null;
|
|
156
|
-
status: "pending" | "
|
|
180
|
+
status: "pending" | "failed" | "expired" | "cancelled" | "paid" | "requires_redirect" | "processing" | "authorized";
|
|
157
181
|
provider: string | null;
|
|
158
182
|
providerSessionId: string | null;
|
|
159
183
|
providerPaymentId: string | null;
|
|
@@ -183,7 +207,7 @@ export declare function startPublicBookingGuaranteePaymentSession(client: FetchW
|
|
|
183
207
|
invoiceId: string | null;
|
|
184
208
|
bookingPaymentScheduleId: string | null;
|
|
185
209
|
bookingGuaranteeId: string | null;
|
|
186
|
-
status: "pending" | "
|
|
210
|
+
status: "pending" | "failed" | "expired" | "cancelled" | "paid" | "requires_redirect" | "processing" | "authorized";
|
|
187
211
|
provider: string | null;
|
|
188
212
|
providerSessionId: string | null;
|
|
189
213
|
providerPaymentId: 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,gCAAgC,EACrC,KAAK,8BAA8B,EACnC,KAAK,0BAA0B,EAOhC,MAAM,cAAc,CAAA;AAErB,wBAAgB,mCAAmC,CACjD,MAAM,EAAE,0BAA0B,EAClC,KAAK,EAAE,gCAAgC;;;;;;;;;;;;;;;;;;;;;;GAOxC;AAED,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,0BAA0B,EAAE,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;GAM9F;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,0BAA0B,EAAE,SAAS,EAAE,MAAM;;;;;;;;;;;;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10,6 +10,15 @@ export function getPublicBookingDocuments(client, bookingId) {
|
|
|
10
10
|
export function getPublicBookingPayments(client, bookingId) {
|
|
11
11
|
return fetchWithValidation(`/v1/public/finance/bookings/${bookingId}/payments`, publicBookingFinancePaymentsResponse, client);
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Admin variant — same response shape as `getPublicBookingPayments`,
|
|
15
|
+
* but hits the admin endpoint (`/v1/admin/finance/bookings/:id/payments`)
|
|
16
|
+
* so a staff actor can read it. The customer-portal continues to use
|
|
17
|
+
* the public path; the operator dashboard uses this one.
|
|
18
|
+
*/
|
|
19
|
+
export function getAdminBookingPayments(client, bookingId) {
|
|
20
|
+
return fetchWithValidation(`/v1/admin/finance/bookings/${bookingId}/payments`, publicBookingFinancePaymentsResponse, client);
|
|
21
|
+
}
|
|
13
22
|
export function getPublicBookingPaymentOptions(client, bookingId, filters) {
|
|
14
23
|
return fetchWithValidation(withQueryParams(`/v1/public/finance/bookings/${bookingId}/payment-options`, filters), publicBookingPaymentOptionsResponse, client);
|
|
15
24
|
}
|
package/dist/query-keys.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
export interface FinanceInvoiceListFilters {
|
|
2
2
|
search?: string | undefined;
|
|
3
|
+
/**
|
|
4
|
+
* Filter to invoices for a specific booking. Drives the booking
|
|
5
|
+
* detail page's "Facturi" card. Server-side check is by exact
|
|
6
|
+
* `bookings.id`, no fuzzy matching.
|
|
7
|
+
*/
|
|
8
|
+
bookingId?: string | undefined;
|
|
9
|
+
/** Filter by invoice status (draft, sent, paid, …). */
|
|
10
|
+
status?: string | undefined;
|
|
3
11
|
limit?: number | undefined;
|
|
4
12
|
offset?: number | undefined;
|
|
5
13
|
}
|
|
@@ -43,6 +51,7 @@ export declare const financeQueryKeys: {
|
|
|
43
51
|
readonly publicFinanceDocumentLookup: (filters: PublicFinanceDocumentLookupFilters) => readonly ["voyant", "finance", "public-checkout", "document-lookup", PublicFinanceDocumentLookupFilters];
|
|
44
52
|
readonly publicBookingDocuments: (bookingId: string) => readonly ["voyant", "finance", "public-checkout", "booking-documents", string];
|
|
45
53
|
readonly publicBookingPayments: (bookingId: string) => readonly ["voyant", "finance", "public-checkout", "booking-payments", string];
|
|
54
|
+
readonly adminBookingPayments: (bookingId: string) => readonly ["voyant", "finance", "admin-booking-payments", string];
|
|
46
55
|
readonly publicBookingPaymentOptions: (bookingId: string, filters: PublicBookingPaymentOptionsFilters) => readonly ["voyant", "finance", "public-checkout", "booking-payment-options", string, PublicBookingPaymentOptionsFilters];
|
|
47
56
|
readonly publicPaymentSession: (sessionId: string) => readonly ["voyant", "finance", "public-checkout", "payment-session", string];
|
|
48
57
|
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,yBAAyB;IACxC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACrC,sBAAsB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3C,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAChC,KAAK,CAAC,EAAE,MAAM,GAA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,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACrC,sBAAsB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3C,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAChC,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,MAAM,WAAW,kCAAkC;IACjD,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC/B;AAED,eAAO,MAAM,gBAAgB;;;qCAIH,yBAAyB;2BAEnC,MAAM;oCACG,MAAM;mCACP,MAAM;sCACH,MAAM;gCAEZ,MAAM;kDAEY,MAAM;4CAEZ,MAAM;;6CAIL,iCAAiC;;oDAI1B,kCAAkC;iDAErC,MAAM;gDAEP,MAAM;+CAEP,MAAM;sDAEC,MAAM,WAAW,kCAAkC;+CAE1D,MAAM;;;qCAMhB,yBAAyB;2BAEnC,MAAM;CACZ,CAAA"}
|
package/dist/query-keys.js
CHANGED
|
@@ -15,6 +15,7 @@ export const financeQueryKeys = {
|
|
|
15
15
|
publicFinanceDocumentLookup: (filters) => [...financeQueryKeys.publicCheckout(), "document-lookup", filters],
|
|
16
16
|
publicBookingDocuments: (bookingId) => [...financeQueryKeys.publicCheckout(), "booking-documents", bookingId],
|
|
17
17
|
publicBookingPayments: (bookingId) => [...financeQueryKeys.publicCheckout(), "booking-payments", bookingId],
|
|
18
|
+
adminBookingPayments: (bookingId) => [...financeQueryKeys.all, "admin-booking-payments", bookingId],
|
|
18
19
|
publicBookingPaymentOptions: (bookingId, filters) => [...financeQueryKeys.publicCheckout(), "booking-payment-options", bookingId, filters],
|
|
19
20
|
publicPaymentSession: (sessionId) => [...financeQueryKeys.publicCheckout(), "payment-session", sessionId],
|
|
20
21
|
publicVoucherValidation: () => [...financeQueryKeys.publicCheckout(), "voucher-validation"],
|
package/dist/query-options.d.ts
CHANGED
|
@@ -86,7 +86,7 @@ export declare function getBookingGuaranteesQueryOptions(client: FetchWithValida
|
|
|
86
86
|
bookingPaymentScheduleId: string | null;
|
|
87
87
|
bookingItemId: string | null;
|
|
88
88
|
guaranteeType: "other" | "voucher" | "bank_transfer" | "credit_card" | "deposit" | "preauth" | "card_on_file" | "agency_letter";
|
|
89
|
-
status: "pending" | "active" | "
|
|
89
|
+
status: "pending" | "active" | "failed" | "expired" | "cancelled" | "released";
|
|
90
90
|
currency: string | null;
|
|
91
91
|
amountCents: number | null;
|
|
92
92
|
provider: string | null;
|
|
@@ -105,7 +105,7 @@ export declare function getBookingGuaranteesQueryOptions(client: FetchWithValida
|
|
|
105
105
|
bookingPaymentScheduleId: string | null;
|
|
106
106
|
bookingItemId: string | null;
|
|
107
107
|
guaranteeType: "other" | "voucher" | "bank_transfer" | "credit_card" | "deposit" | "preauth" | "card_on_file" | "agency_letter";
|
|
108
|
-
status: "pending" | "active" | "
|
|
108
|
+
status: "pending" | "active" | "failed" | "expired" | "cancelled" | "released";
|
|
109
109
|
currency: string | null;
|
|
110
110
|
amountCents: number | null;
|
|
111
111
|
provider: string | null;
|
|
@@ -125,7 +125,7 @@ export declare function getBookingGuaranteesQueryOptions(client: FetchWithValida
|
|
|
125
125
|
bookingPaymentScheduleId: string | null;
|
|
126
126
|
bookingItemId: string | null;
|
|
127
127
|
guaranteeType: "other" | "voucher" | "bank_transfer" | "credit_card" | "deposit" | "preauth" | "card_on_file" | "agency_letter";
|
|
128
|
-
status: "pending" | "active" | "
|
|
128
|
+
status: "pending" | "active" | "failed" | "expired" | "cancelled" | "released";
|
|
129
129
|
currency: string | null;
|
|
130
130
|
amountCents: number | null;
|
|
131
131
|
provider: string | null;
|
|
@@ -147,7 +147,7 @@ export declare function getBookingGuaranteesQueryOptions(client: FetchWithValida
|
|
|
147
147
|
bookingPaymentScheduleId: string | null;
|
|
148
148
|
bookingItemId: string | null;
|
|
149
149
|
guaranteeType: "other" | "voucher" | "bank_transfer" | "credit_card" | "deposit" | "preauth" | "card_on_file" | "agency_letter";
|
|
150
|
-
status: "pending" | "active" | "
|
|
150
|
+
status: "pending" | "active" | "failed" | "expired" | "cancelled" | "released";
|
|
151
151
|
currency: string | null;
|
|
152
152
|
amountCents: number | null;
|
|
153
153
|
provider: string | null;
|
|
@@ -165,6 +165,7 @@ export declare function getBookingGuaranteesQueryOptions(client: FetchWithValida
|
|
|
165
165
|
};
|
|
166
166
|
export declare function getInvoicesQueryOptions(client: FetchWithValidationOptions, options?: UseInvoicesOptions): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
167
167
|
data: {
|
|
168
|
+
[x: string]: unknown;
|
|
168
169
|
id: string;
|
|
169
170
|
invoiceNumber: string;
|
|
170
171
|
bookingId: string;
|
|
@@ -182,12 +183,14 @@ export declare function getInvoicesQueryOptions(client: FetchWithValidationOptio
|
|
|
182
183
|
notes: string | null;
|
|
183
184
|
createdAt: string;
|
|
184
185
|
updatedAt: string;
|
|
186
|
+
invoiceType?: "invoice" | "proforma" | "credit_note" | undefined;
|
|
185
187
|
}[];
|
|
186
188
|
total: number;
|
|
187
189
|
limit: number;
|
|
188
190
|
offset: number;
|
|
189
191
|
}, Error, {
|
|
190
192
|
data: {
|
|
193
|
+
[x: string]: unknown;
|
|
191
194
|
id: string;
|
|
192
195
|
invoiceNumber: string;
|
|
193
196
|
bookingId: string;
|
|
@@ -205,6 +208,7 @@ export declare function getInvoicesQueryOptions(client: FetchWithValidationOptio
|
|
|
205
208
|
notes: string | null;
|
|
206
209
|
createdAt: string;
|
|
207
210
|
updatedAt: string;
|
|
211
|
+
invoiceType?: "invoice" | "proforma" | "credit_note" | undefined;
|
|
208
212
|
}[];
|
|
209
213
|
total: number;
|
|
210
214
|
limit: number;
|
|
@@ -212,6 +216,7 @@ export declare function getInvoicesQueryOptions(client: FetchWithValidationOptio
|
|
|
212
216
|
}, readonly ["voyant", "finance", "invoices", "list", import("./query-keys.js").FinanceInvoiceListFilters]>, "queryFn"> & {
|
|
213
217
|
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
214
218
|
data: {
|
|
219
|
+
[x: string]: unknown;
|
|
215
220
|
id: string;
|
|
216
221
|
invoiceNumber: string;
|
|
217
222
|
bookingId: string;
|
|
@@ -229,6 +234,7 @@ export declare function getInvoicesQueryOptions(client: FetchWithValidationOptio
|
|
|
229
234
|
notes: string | null;
|
|
230
235
|
createdAt: string;
|
|
231
236
|
updatedAt: string;
|
|
237
|
+
invoiceType?: "invoice" | "proforma" | "credit_note" | undefined;
|
|
232
238
|
}[];
|
|
233
239
|
total: number;
|
|
234
240
|
limit: number;
|
|
@@ -238,6 +244,7 @@ export declare function getInvoicesQueryOptions(client: FetchWithValidationOptio
|
|
|
238
244
|
queryKey: readonly ["voyant", "finance", "invoices", "list", import("./query-keys.js").FinanceInvoiceListFilters] & {
|
|
239
245
|
[dataTagSymbol]: {
|
|
240
246
|
data: {
|
|
247
|
+
[x: string]: unknown;
|
|
241
248
|
id: string;
|
|
242
249
|
invoiceNumber: string;
|
|
243
250
|
bookingId: string;
|
|
@@ -255,6 +262,7 @@ export declare function getInvoicesQueryOptions(client: FetchWithValidationOptio
|
|
|
255
262
|
notes: string | null;
|
|
256
263
|
createdAt: string;
|
|
257
264
|
updatedAt: string;
|
|
265
|
+
invoiceType?: "invoice" | "proforma" | "credit_note" | undefined;
|
|
258
266
|
}[];
|
|
259
267
|
total: number;
|
|
260
268
|
limit: number;
|
|
@@ -271,7 +279,7 @@ export declare function getSupplierPaymentsQueryOptions(client: FetchWithValidat
|
|
|
271
279
|
amountCents: number;
|
|
272
280
|
currency: string;
|
|
273
281
|
paymentMethod: string;
|
|
274
|
-
status: "pending" | "
|
|
282
|
+
status: "pending" | "failed" | "completed" | "refunded";
|
|
275
283
|
referenceNumber: string | null;
|
|
276
284
|
paymentDate: string;
|
|
277
285
|
createdAt: string;
|
|
@@ -288,7 +296,7 @@ export declare function getSupplierPaymentsQueryOptions(client: FetchWithValidat
|
|
|
288
296
|
amountCents: number;
|
|
289
297
|
currency: string;
|
|
290
298
|
paymentMethod: string;
|
|
291
|
-
status: "pending" | "
|
|
299
|
+
status: "pending" | "failed" | "completed" | "refunded";
|
|
292
300
|
referenceNumber: string | null;
|
|
293
301
|
paymentDate: string;
|
|
294
302
|
createdAt: string;
|
|
@@ -306,7 +314,7 @@ export declare function getSupplierPaymentsQueryOptions(client: FetchWithValidat
|
|
|
306
314
|
amountCents: number;
|
|
307
315
|
currency: string;
|
|
308
316
|
paymentMethod: string;
|
|
309
|
-
status: "pending" | "
|
|
317
|
+
status: "pending" | "failed" | "completed" | "refunded";
|
|
310
318
|
referenceNumber: string | null;
|
|
311
319
|
paymentDate: string;
|
|
312
320
|
createdAt: string;
|
|
@@ -326,7 +334,7 @@ export declare function getSupplierPaymentsQueryOptions(client: FetchWithValidat
|
|
|
326
334
|
amountCents: number;
|
|
327
335
|
currency: string;
|
|
328
336
|
paymentMethod: string;
|
|
329
|
-
status: "pending" | "
|
|
337
|
+
status: "pending" | "failed" | "completed" | "refunded";
|
|
330
338
|
referenceNumber: string | null;
|
|
331
339
|
paymentDate: string;
|
|
332
340
|
createdAt: string;
|
|
@@ -341,6 +349,7 @@ export declare function getSupplierPaymentsQueryOptions(client: FetchWithValidat
|
|
|
341
349
|
};
|
|
342
350
|
export declare function getInvoiceQueryOptions(client: FetchWithValidationOptions, id: string | null | undefined, options?: UseInvoiceOptions): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
343
351
|
data: {
|
|
352
|
+
[x: string]: unknown;
|
|
344
353
|
id: string;
|
|
345
354
|
invoiceNumber: string;
|
|
346
355
|
bookingId: string;
|
|
@@ -358,9 +367,11 @@ export declare function getInvoiceQueryOptions(client: FetchWithValidationOption
|
|
|
358
367
|
notes: string | null;
|
|
359
368
|
createdAt: string;
|
|
360
369
|
updatedAt: string;
|
|
370
|
+
invoiceType?: "invoice" | "proforma" | "credit_note" | undefined;
|
|
361
371
|
};
|
|
362
372
|
}, Error, {
|
|
363
373
|
data: {
|
|
374
|
+
[x: string]: unknown;
|
|
364
375
|
id: string;
|
|
365
376
|
invoiceNumber: string;
|
|
366
377
|
bookingId: string;
|
|
@@ -378,10 +389,12 @@ export declare function getInvoiceQueryOptions(client: FetchWithValidationOption
|
|
|
378
389
|
notes: string | null;
|
|
379
390
|
createdAt: string;
|
|
380
391
|
updatedAt: string;
|
|
392
|
+
invoiceType?: "invoice" | "proforma" | "credit_note" | undefined;
|
|
381
393
|
};
|
|
382
394
|
}, readonly ["voyant", "finance", "invoices", "detail", string]>, "queryFn"> & {
|
|
383
395
|
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
384
396
|
data: {
|
|
397
|
+
[x: string]: unknown;
|
|
385
398
|
id: string;
|
|
386
399
|
invoiceNumber: string;
|
|
387
400
|
bookingId: string;
|
|
@@ -399,12 +412,14 @@ export declare function getInvoiceQueryOptions(client: FetchWithValidationOption
|
|
|
399
412
|
notes: string | null;
|
|
400
413
|
createdAt: string;
|
|
401
414
|
updatedAt: string;
|
|
415
|
+
invoiceType?: "invoice" | "proforma" | "credit_note" | undefined;
|
|
402
416
|
};
|
|
403
417
|
}, readonly ["voyant", "finance", "invoices", "detail", string], never> | undefined;
|
|
404
418
|
} & {
|
|
405
419
|
queryKey: readonly ["voyant", "finance", "invoices", "detail", string] & {
|
|
406
420
|
[dataTagSymbol]: {
|
|
407
421
|
data: {
|
|
422
|
+
[x: string]: unknown;
|
|
408
423
|
id: string;
|
|
409
424
|
invoiceNumber: string;
|
|
410
425
|
bookingId: string;
|
|
@@ -422,6 +437,7 @@ export declare function getInvoiceQueryOptions(client: FetchWithValidationOption
|
|
|
422
437
|
notes: string | null;
|
|
423
438
|
createdAt: string;
|
|
424
439
|
updatedAt: string;
|
|
440
|
+
invoiceType?: "invoice" | "proforma" | "credit_note" | undefined;
|
|
425
441
|
};
|
|
426
442
|
};
|
|
427
443
|
[dataTagErrorSymbol]: Error;
|
|
@@ -490,7 +506,7 @@ export declare function getInvoicePaymentsQueryOptions(client: FetchWithValidati
|
|
|
490
506
|
amountCents: number;
|
|
491
507
|
currency: string;
|
|
492
508
|
paymentMethod: string;
|
|
493
|
-
status: "pending" | "
|
|
509
|
+
status: "pending" | "failed" | "completed" | "refunded";
|
|
494
510
|
referenceNumber: string | null;
|
|
495
511
|
paymentDate: string;
|
|
496
512
|
notes: string | null;
|
|
@@ -503,7 +519,7 @@ export declare function getInvoicePaymentsQueryOptions(client: FetchWithValidati
|
|
|
503
519
|
amountCents: number;
|
|
504
520
|
currency: string;
|
|
505
521
|
paymentMethod: string;
|
|
506
|
-
status: "pending" | "
|
|
522
|
+
status: "pending" | "failed" | "completed" | "refunded";
|
|
507
523
|
referenceNumber: string | null;
|
|
508
524
|
paymentDate: string;
|
|
509
525
|
notes: string | null;
|
|
@@ -517,7 +533,7 @@ export declare function getInvoicePaymentsQueryOptions(client: FetchWithValidati
|
|
|
517
533
|
amountCents: number;
|
|
518
534
|
currency: string;
|
|
519
535
|
paymentMethod: string;
|
|
520
|
-
status: "pending" | "
|
|
536
|
+
status: "pending" | "failed" | "completed" | "refunded";
|
|
521
537
|
referenceNumber: string | null;
|
|
522
538
|
paymentDate: string;
|
|
523
539
|
notes: string | null;
|
|
@@ -533,7 +549,7 @@ export declare function getInvoicePaymentsQueryOptions(client: FetchWithValidati
|
|
|
533
549
|
amountCents: number;
|
|
534
550
|
currency: string;
|
|
535
551
|
paymentMethod: string;
|
|
536
|
-
status: "pending" | "
|
|
552
|
+
status: "pending" | "failed" | "completed" | "refunded";
|
|
537
553
|
referenceNumber: string | null;
|
|
538
554
|
paymentDate: string;
|
|
539
555
|
notes: string | null;
|
|
@@ -1019,7 +1035,7 @@ export declare function getPublicBookingPaymentsQueryOptions(client: FetchWithVa
|
|
|
1019
1035
|
invoiceId: string;
|
|
1020
1036
|
invoiceNumber: string;
|
|
1021
1037
|
invoiceType: "invoice" | "proforma" | "credit_note";
|
|
1022
|
-
status: "pending" | "
|
|
1038
|
+
status: "pending" | "failed" | "completed" | "refunded";
|
|
1023
1039
|
paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill";
|
|
1024
1040
|
amountCents: number;
|
|
1025
1041
|
currency: string;
|
|
@@ -1036,7 +1052,7 @@ export declare function getPublicBookingPaymentsQueryOptions(client: FetchWithVa
|
|
|
1036
1052
|
invoiceId: string;
|
|
1037
1053
|
invoiceNumber: string;
|
|
1038
1054
|
invoiceType: "invoice" | "proforma" | "credit_note";
|
|
1039
|
-
status: "pending" | "
|
|
1055
|
+
status: "pending" | "failed" | "completed" | "refunded";
|
|
1040
1056
|
paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill";
|
|
1041
1057
|
amountCents: number;
|
|
1042
1058
|
currency: string;
|
|
@@ -1054,7 +1070,7 @@ export declare function getPublicBookingPaymentsQueryOptions(client: FetchWithVa
|
|
|
1054
1070
|
invoiceId: string;
|
|
1055
1071
|
invoiceNumber: string;
|
|
1056
1072
|
invoiceType: "invoice" | "proforma" | "credit_note";
|
|
1057
|
-
status: "pending" | "
|
|
1073
|
+
status: "pending" | "failed" | "completed" | "refunded";
|
|
1058
1074
|
paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill";
|
|
1059
1075
|
amountCents: number;
|
|
1060
1076
|
currency: string;
|
|
@@ -1074,7 +1090,83 @@ export declare function getPublicBookingPaymentsQueryOptions(client: FetchWithVa
|
|
|
1074
1090
|
invoiceId: string;
|
|
1075
1091
|
invoiceNumber: string;
|
|
1076
1092
|
invoiceType: "invoice" | "proforma" | "credit_note";
|
|
1077
|
-
status: "pending" | "
|
|
1093
|
+
status: "pending" | "failed" | "completed" | "refunded";
|
|
1094
|
+
paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill";
|
|
1095
|
+
amountCents: number;
|
|
1096
|
+
currency: string;
|
|
1097
|
+
paymentDate: string;
|
|
1098
|
+
referenceNumber: string | null;
|
|
1099
|
+
notes: string | null;
|
|
1100
|
+
}[];
|
|
1101
|
+
};
|
|
1102
|
+
};
|
|
1103
|
+
[dataTagErrorSymbol]: Error;
|
|
1104
|
+
};
|
|
1105
|
+
};
|
|
1106
|
+
export declare function getAdminBookingPaymentsQueryOptions(client: FetchWithValidationOptions, bookingId: string | null | undefined): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
1107
|
+
data: {
|
|
1108
|
+
bookingId: string;
|
|
1109
|
+
payments: {
|
|
1110
|
+
id: string;
|
|
1111
|
+
invoiceId: string;
|
|
1112
|
+
invoiceNumber: string;
|
|
1113
|
+
invoiceType: "invoice" | "proforma" | "credit_note";
|
|
1114
|
+
status: "pending" | "failed" | "completed" | "refunded";
|
|
1115
|
+
paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill";
|
|
1116
|
+
amountCents: number;
|
|
1117
|
+
currency: string;
|
|
1118
|
+
paymentDate: string;
|
|
1119
|
+
referenceNumber: string | null;
|
|
1120
|
+
notes: string | null;
|
|
1121
|
+
}[];
|
|
1122
|
+
};
|
|
1123
|
+
}, Error, {
|
|
1124
|
+
data: {
|
|
1125
|
+
bookingId: string;
|
|
1126
|
+
payments: {
|
|
1127
|
+
id: string;
|
|
1128
|
+
invoiceId: string;
|
|
1129
|
+
invoiceNumber: string;
|
|
1130
|
+
invoiceType: "invoice" | "proforma" | "credit_note";
|
|
1131
|
+
status: "pending" | "failed" | "completed" | "refunded";
|
|
1132
|
+
paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill";
|
|
1133
|
+
amountCents: number;
|
|
1134
|
+
currency: string;
|
|
1135
|
+
paymentDate: string;
|
|
1136
|
+
referenceNumber: string | null;
|
|
1137
|
+
notes: string | null;
|
|
1138
|
+
}[];
|
|
1139
|
+
};
|
|
1140
|
+
}, readonly ["voyant", "finance", "admin-booking-payments", string]>, "queryFn"> & {
|
|
1141
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
1142
|
+
data: {
|
|
1143
|
+
bookingId: string;
|
|
1144
|
+
payments: {
|
|
1145
|
+
id: string;
|
|
1146
|
+
invoiceId: string;
|
|
1147
|
+
invoiceNumber: string;
|
|
1148
|
+
invoiceType: "invoice" | "proforma" | "credit_note";
|
|
1149
|
+
status: "pending" | "failed" | "completed" | "refunded";
|
|
1150
|
+
paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill";
|
|
1151
|
+
amountCents: number;
|
|
1152
|
+
currency: string;
|
|
1153
|
+
paymentDate: string;
|
|
1154
|
+
referenceNumber: string | null;
|
|
1155
|
+
notes: string | null;
|
|
1156
|
+
}[];
|
|
1157
|
+
};
|
|
1158
|
+
}, readonly ["voyant", "finance", "admin-booking-payments", string], never> | undefined;
|
|
1159
|
+
} & {
|
|
1160
|
+
queryKey: readonly ["voyant", "finance", "admin-booking-payments", string] & {
|
|
1161
|
+
[dataTagSymbol]: {
|
|
1162
|
+
data: {
|
|
1163
|
+
bookingId: string;
|
|
1164
|
+
payments: {
|
|
1165
|
+
id: string;
|
|
1166
|
+
invoiceId: string;
|
|
1167
|
+
invoiceNumber: string;
|
|
1168
|
+
invoiceType: "invoice" | "proforma" | "credit_note";
|
|
1169
|
+
status: "pending" | "failed" | "completed" | "refunded";
|
|
1078
1170
|
paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill";
|
|
1079
1171
|
amountCents: number;
|
|
1080
1172
|
currency: string;
|
|
@@ -1096,7 +1188,7 @@ export declare function getPublicPaymentSessionQueryOptions(client: FetchWithVal
|
|
|
1096
1188
|
invoiceId: string | null;
|
|
1097
1189
|
bookingPaymentScheduleId: string | null;
|
|
1098
1190
|
bookingGuaranteeId: string | null;
|
|
1099
|
-
status: "pending" | "
|
|
1191
|
+
status: "pending" | "failed" | "expired" | "cancelled" | "paid" | "requires_redirect" | "processing" | "authorized";
|
|
1100
1192
|
provider: string | null;
|
|
1101
1193
|
providerSessionId: string | null;
|
|
1102
1194
|
providerPaymentId: string | null;
|
|
@@ -1125,7 +1217,7 @@ export declare function getPublicPaymentSessionQueryOptions(client: FetchWithVal
|
|
|
1125
1217
|
invoiceId: string | null;
|
|
1126
1218
|
bookingPaymentScheduleId: string | null;
|
|
1127
1219
|
bookingGuaranteeId: string | null;
|
|
1128
|
-
status: "pending" | "
|
|
1220
|
+
status: "pending" | "failed" | "expired" | "cancelled" | "paid" | "requires_redirect" | "processing" | "authorized";
|
|
1129
1221
|
provider: string | null;
|
|
1130
1222
|
providerSessionId: string | null;
|
|
1131
1223
|
providerPaymentId: string | null;
|
|
@@ -1155,7 +1247,7 @@ export declare function getPublicPaymentSessionQueryOptions(client: FetchWithVal
|
|
|
1155
1247
|
invoiceId: string | null;
|
|
1156
1248
|
bookingPaymentScheduleId: string | null;
|
|
1157
1249
|
bookingGuaranteeId: string | null;
|
|
1158
|
-
status: "pending" | "
|
|
1250
|
+
status: "pending" | "failed" | "expired" | "cancelled" | "paid" | "requires_redirect" | "processing" | "authorized";
|
|
1159
1251
|
provider: string | null;
|
|
1160
1252
|
providerSessionId: string | null;
|
|
1161
1253
|
providerPaymentId: string | null;
|
|
@@ -1187,7 +1279,7 @@ export declare function getPublicPaymentSessionQueryOptions(client: FetchWithVal
|
|
|
1187
1279
|
invoiceId: string | null;
|
|
1188
1280
|
bookingPaymentScheduleId: string | null;
|
|
1189
1281
|
bookingGuaranteeId: string | null;
|
|
1190
|
-
status: "pending" | "
|
|
1282
|
+
status: "pending" | "failed" | "expired" | "cancelled" | "paid" | "requires_redirect" | "processing" | "authorized";
|
|
1191
1283
|
provider: string | null;
|
|
1192
1284
|
providerSessionId: string | null;
|
|
1193
1285
|
providerPaymentId: 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,2BAA2B,EAAE,MAAM,mCAAmC,CAAA;AACpF,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,0CAA0C,CAAA;AACjG,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,gCAAgC,EAAE,MAAM,yCAAyC,CAAA;AAC/F,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,+CAA+C,CAAA;AAC1G,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,wCAAwC,CAAA;AAC7F,OAAO,KAAK,EAAE,0CAA0C,EAAE,MAAM,qDAAqD,CAAA;AAC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EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC7B,OAAO,GAAE,iBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWhC"}
|
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 { getPublicBookingDocuments, getPublicBookingPaymentOptions, getPublicBookingPayments, getPublicFinanceDocumentByReference, getPublicPaymentSession, } from "./operations.js";
|
|
4
|
+
import { getAdminBookingPayments, getPublicBookingDocuments, getPublicBookingPaymentOptions, getPublicBookingPayments, getPublicFinanceDocumentByReference, getPublicPaymentSession, } from "./operations.js";
|
|
5
5
|
import { financeQueryKeys } from "./query-keys.js";
|
|
6
6
|
import { bookingGuaranteesResponse, bookingPaymentSchedulesResponse, invoiceCreditNotesResponse, invoiceLineItemsResponse, invoiceListResponse, invoiceNotesResponse, invoicePaymentsResponse, invoiceSingleResponse, supplierPaymentListResponse, voucherDetailResponse, voucherListResponse, } from "./schemas.js";
|
|
7
7
|
export function getBookingPaymentSchedulesQueryOptions(client, bookingId, options = {}) {
|
|
@@ -26,6 +26,10 @@ export function getInvoicesQueryOptions(client, options = {}) {
|
|
|
26
26
|
const params = new URLSearchParams();
|
|
27
27
|
if (filters.search)
|
|
28
28
|
params.set("search", filters.search);
|
|
29
|
+
if (filters.bookingId)
|
|
30
|
+
params.set("bookingId", filters.bookingId);
|
|
31
|
+
if (filters.status)
|
|
32
|
+
params.set("status", filters.status);
|
|
29
33
|
if (filters.limit !== undefined)
|
|
30
34
|
params.set("limit", String(filters.limit));
|
|
31
35
|
if (filters.offset !== undefined)
|
|
@@ -153,6 +157,17 @@ export function getPublicBookingPaymentsQueryOptions(client, bookingId, options
|
|
|
153
157
|
},
|
|
154
158
|
});
|
|
155
159
|
}
|
|
160
|
+
export function getAdminBookingPaymentsQueryOptions(client, bookingId) {
|
|
161
|
+
return queryOptions({
|
|
162
|
+
queryKey: financeQueryKeys.adminBookingPayments(bookingId ?? ""),
|
|
163
|
+
queryFn: async () => {
|
|
164
|
+
if (!bookingId) {
|
|
165
|
+
throw new Error("getAdminBookingPaymentsQueryOptions requires a bookingId");
|
|
166
|
+
}
|
|
167
|
+
return getAdminBookingPayments(client, bookingId);
|
|
168
|
+
},
|
|
169
|
+
});
|
|
170
|
+
}
|
|
156
171
|
export function getPublicPaymentSessionQueryOptions(client, sessionId, options = {}) {
|
|
157
172
|
const { enabled: _enabled = true } = options;
|
|
158
173
|
return queryOptions({
|
package/dist/schemas.d.ts
CHANGED
|
@@ -25,8 +25,8 @@ export declare const invoiceStatusSchema: z.ZodEnum<{
|
|
|
25
25
|
}>;
|
|
26
26
|
export declare const paymentStatusSchema: z.ZodEnum<{
|
|
27
27
|
pending: "pending";
|
|
28
|
-
completed: "completed";
|
|
29
28
|
failed: "failed";
|
|
29
|
+
completed: "completed";
|
|
30
30
|
refunded: "refunded";
|
|
31
31
|
}>;
|
|
32
32
|
export declare const creditNoteStatusSchema: z.ZodEnum<{
|
|
@@ -34,12 +34,22 @@ export declare const creditNoteStatusSchema: z.ZodEnum<{
|
|
|
34
34
|
issued: "issued";
|
|
35
35
|
applied: "applied";
|
|
36
36
|
}>;
|
|
37
|
+
export declare const invoiceTypeSchema: z.ZodEnum<{
|
|
38
|
+
invoice: "invoice";
|
|
39
|
+
proforma: "proforma";
|
|
40
|
+
credit_note: "credit_note";
|
|
41
|
+
}>;
|
|
37
42
|
export declare const invoiceRecordSchema: z.ZodObject<{
|
|
38
43
|
id: z.ZodString;
|
|
39
44
|
invoiceNumber: z.ZodString;
|
|
40
45
|
bookingId: z.ZodString;
|
|
41
46
|
personId: z.ZodNullable<z.ZodString>;
|
|
42
47
|
organizationId: z.ZodNullable<z.ZodString>;
|
|
48
|
+
invoiceType: z.ZodOptional<z.ZodEnum<{
|
|
49
|
+
invoice: "invoice";
|
|
50
|
+
proforma: "proforma";
|
|
51
|
+
credit_note: "credit_note";
|
|
52
|
+
}>>;
|
|
43
53
|
status: z.ZodEnum<{
|
|
44
54
|
void: "void";
|
|
45
55
|
draft: "draft";
|
|
@@ -59,7 +69,7 @@ export declare const invoiceRecordSchema: z.ZodObject<{
|
|
|
59
69
|
notes: z.ZodNullable<z.ZodString>;
|
|
60
70
|
createdAt: z.ZodString;
|
|
61
71
|
updatedAt: z.ZodString;
|
|
62
|
-
}, z.core.$
|
|
72
|
+
}, z.core.$loose>;
|
|
63
73
|
export type InvoiceRecord = z.infer<typeof invoiceRecordSchema>;
|
|
64
74
|
export declare const lineItemRecordSchema: z.ZodObject<{
|
|
65
75
|
id: z.ZodString;
|
|
@@ -81,8 +91,8 @@ export declare const paymentRecordSchema: z.ZodObject<{
|
|
|
81
91
|
paymentMethod: z.ZodString;
|
|
82
92
|
status: z.ZodEnum<{
|
|
83
93
|
pending: "pending";
|
|
84
|
-
completed: "completed";
|
|
85
94
|
failed: "failed";
|
|
95
|
+
completed: "completed";
|
|
86
96
|
refunded: "refunded";
|
|
87
97
|
}>;
|
|
88
98
|
referenceNumber: z.ZodNullable<z.ZodString>;
|
|
@@ -124,8 +134,8 @@ export declare const supplierPaymentRecordSchema: z.ZodObject<{
|
|
|
124
134
|
paymentMethod: z.ZodString;
|
|
125
135
|
status: z.ZodEnum<{
|
|
126
136
|
pending: "pending";
|
|
127
|
-
completed: "completed";
|
|
128
137
|
failed: "failed";
|
|
138
|
+
completed: "completed";
|
|
129
139
|
refunded: "refunded";
|
|
130
140
|
}>;
|
|
131
141
|
referenceNumber: z.ZodNullable<z.ZodString>;
|
|
@@ -217,10 +227,10 @@ export declare const guaranteeTypeSchema: z.ZodEnum<{
|
|
|
217
227
|
export declare const guaranteeStatusSchema: z.ZodEnum<{
|
|
218
228
|
pending: "pending";
|
|
219
229
|
active: "active";
|
|
230
|
+
failed: "failed";
|
|
220
231
|
expired: "expired";
|
|
221
232
|
cancelled: "cancelled";
|
|
222
233
|
released: "released";
|
|
223
|
-
failed: "failed";
|
|
224
234
|
}>;
|
|
225
235
|
export declare const bookingGuaranteeRecordSchema: z.ZodObject<{
|
|
226
236
|
id: z.ZodString;
|
|
@@ -240,10 +250,10 @@ export declare const bookingGuaranteeRecordSchema: z.ZodObject<{
|
|
|
240
250
|
status: z.ZodEnum<{
|
|
241
251
|
pending: "pending";
|
|
242
252
|
active: "active";
|
|
253
|
+
failed: "failed";
|
|
243
254
|
expired: "expired";
|
|
244
255
|
cancelled: "cancelled";
|
|
245
256
|
released: "released";
|
|
246
|
-
failed: "failed";
|
|
247
257
|
}>;
|
|
248
258
|
currency: z.ZodNullable<z.ZodString>;
|
|
249
259
|
amountCents: z.ZodNullable<z.ZodNumber>;
|
|
@@ -276,10 +286,10 @@ export declare const bookingGuaranteesResponse: z.ZodObject<{
|
|
|
276
286
|
status: z.ZodEnum<{
|
|
277
287
|
pending: "pending";
|
|
278
288
|
active: "active";
|
|
289
|
+
failed: "failed";
|
|
279
290
|
expired: "expired";
|
|
280
291
|
cancelled: "cancelled";
|
|
281
292
|
released: "released";
|
|
282
|
-
failed: "failed";
|
|
283
293
|
}>;
|
|
284
294
|
currency: z.ZodNullable<z.ZodString>;
|
|
285
295
|
amountCents: z.ZodNullable<z.ZodNumber>;
|
|
@@ -300,6 +310,11 @@ export declare const invoiceListResponse: z.ZodObject<{
|
|
|
300
310
|
bookingId: z.ZodString;
|
|
301
311
|
personId: z.ZodNullable<z.ZodString>;
|
|
302
312
|
organizationId: z.ZodNullable<z.ZodString>;
|
|
313
|
+
invoiceType: z.ZodOptional<z.ZodEnum<{
|
|
314
|
+
invoice: "invoice";
|
|
315
|
+
proforma: "proforma";
|
|
316
|
+
credit_note: "credit_note";
|
|
317
|
+
}>>;
|
|
303
318
|
status: z.ZodEnum<{
|
|
304
319
|
void: "void";
|
|
305
320
|
draft: "draft";
|
|
@@ -319,7 +334,7 @@ export declare const invoiceListResponse: z.ZodObject<{
|
|
|
319
334
|
notes: z.ZodNullable<z.ZodString>;
|
|
320
335
|
createdAt: z.ZodString;
|
|
321
336
|
updatedAt: z.ZodString;
|
|
322
|
-
}, z.core.$
|
|
337
|
+
}, z.core.$loose>>;
|
|
323
338
|
total: z.ZodNumber;
|
|
324
339
|
limit: z.ZodNumber;
|
|
325
340
|
offset: z.ZodNumber;
|
|
@@ -334,8 +349,8 @@ export declare const supplierPaymentListResponse: z.ZodObject<{
|
|
|
334
349
|
paymentMethod: z.ZodString;
|
|
335
350
|
status: z.ZodEnum<{
|
|
336
351
|
pending: "pending";
|
|
337
|
-
completed: "completed";
|
|
338
352
|
failed: "failed";
|
|
353
|
+
completed: "completed";
|
|
339
354
|
refunded: "refunded";
|
|
340
355
|
}>;
|
|
341
356
|
referenceNumber: z.ZodNullable<z.ZodString>;
|
|
@@ -354,6 +369,11 @@ export declare const invoiceSingleResponse: z.ZodObject<{
|
|
|
354
369
|
bookingId: z.ZodString;
|
|
355
370
|
personId: z.ZodNullable<z.ZodString>;
|
|
356
371
|
organizationId: z.ZodNullable<z.ZodString>;
|
|
372
|
+
invoiceType: z.ZodOptional<z.ZodEnum<{
|
|
373
|
+
invoice: "invoice";
|
|
374
|
+
proforma: "proforma";
|
|
375
|
+
credit_note: "credit_note";
|
|
376
|
+
}>>;
|
|
357
377
|
status: z.ZodEnum<{
|
|
358
378
|
void: "void";
|
|
359
379
|
draft: "draft";
|
|
@@ -373,7 +393,7 @@ export declare const invoiceSingleResponse: z.ZodObject<{
|
|
|
373
393
|
notes: z.ZodNullable<z.ZodString>;
|
|
374
394
|
createdAt: z.ZodString;
|
|
375
395
|
updatedAt: z.ZodString;
|
|
376
|
-
}, z.core.$
|
|
396
|
+
}, z.core.$loose>;
|
|
377
397
|
}, z.core.$strip>;
|
|
378
398
|
export declare const invoiceLineItemsResponse: z.ZodObject<{
|
|
379
399
|
data: z.ZodArray<z.ZodObject<{
|
|
@@ -397,8 +417,8 @@ export declare const invoicePaymentsResponse: z.ZodObject<{
|
|
|
397
417
|
paymentMethod: z.ZodString;
|
|
398
418
|
status: z.ZodEnum<{
|
|
399
419
|
pending: "pending";
|
|
400
|
-
completed: "completed";
|
|
401
420
|
failed: "failed";
|
|
421
|
+
completed: "completed";
|
|
402
422
|
refunded: "refunded";
|
|
403
423
|
}>;
|
|
404
424
|
referenceNumber: z.ZodNullable<z.ZodString>;
|
|
@@ -613,8 +633,8 @@ export declare const publicBookingFinancePaymentsResponse: z.ZodObject<{
|
|
|
613
633
|
}>;
|
|
614
634
|
status: z.ZodEnum<{
|
|
615
635
|
pending: "pending";
|
|
616
|
-
completed: "completed";
|
|
617
636
|
failed: "failed";
|
|
637
|
+
completed: "completed";
|
|
618
638
|
refunded: "refunded";
|
|
619
639
|
}>;
|
|
620
640
|
paymentMethod: z.ZodEnum<{
|
|
@@ -655,9 +675,9 @@ export declare const publicPaymentSessionResponse: z.ZodObject<{
|
|
|
655
675
|
bookingGuaranteeId: z.ZodNullable<z.ZodString>;
|
|
656
676
|
status: z.ZodEnum<{
|
|
657
677
|
pending: "pending";
|
|
678
|
+
failed: "failed";
|
|
658
679
|
expired: "expired";
|
|
659
680
|
cancelled: "cancelled";
|
|
660
|
-
failed: "failed";
|
|
661
681
|
paid: "paid";
|
|
662
682
|
requires_redirect: "requires_redirect";
|
|
663
683
|
processing: "processing";
|
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,mCAAmC,EACnC,kCAAkC,EAClC,iCAAiC,EACjC,kCAAkC,EAClC,iCAAiC,EACjC,sCAAsC,EACtC,iCAAiC,EACjC,+BAA+B,EAC/B,0BAA0B,EAC1B,+BAA+B,EAC/B,2BAA2B,EAC3B,6BAA6B,EAC9B,MAAM,mBAAm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,20 @@ export const invoiceStatusSchema = z.enum([
|
|
|
19
19
|
]);
|
|
20
20
|
export const paymentStatusSchema = z.enum(["pending", "completed", "failed", "refunded"]);
|
|
21
21
|
export const creditNoteStatusSchema = z.enum(["draft", "issued", "applied"]);
|
|
22
|
-
export const
|
|
22
|
+
export const invoiceTypeSchema = z.enum(["invoice", "proforma", "credit_note"]);
|
|
23
|
+
export const invoiceRecordSchema = z
|
|
24
|
+
.object({
|
|
23
25
|
id: z.string(),
|
|
24
26
|
invoiceNumber: z.string(),
|
|
25
27
|
bookingId: z.string(),
|
|
26
28
|
personId: z.string().nullable(),
|
|
27
29
|
organizationId: z.string().nullable(),
|
|
30
|
+
/**
|
|
31
|
+
* `invoice` (final), `proforma` (placeholder pending bank transfer),
|
|
32
|
+
* or `credit_note` (refund / cancellation). Drives the type badge
|
|
33
|
+
* + filename on the booking detail page.
|
|
34
|
+
*/
|
|
35
|
+
invoiceType: invoiceTypeSchema.optional(),
|
|
28
36
|
status: invoiceStatusSchema,
|
|
29
37
|
currency: z.string(),
|
|
30
38
|
subtotalCents: z.number().int(),
|
|
@@ -37,7 +45,11 @@ export const invoiceRecordSchema = z.object({
|
|
|
37
45
|
notes: z.string().nullable(),
|
|
38
46
|
createdAt: z.string(),
|
|
39
47
|
updatedAt: z.string(),
|
|
40
|
-
})
|
|
48
|
+
})
|
|
49
|
+
// Permissive on extra columns the server may return (e.g.
|
|
50
|
+
// `convertedFromInvoiceId`, `baseCurrency`). Adding them all to the
|
|
51
|
+
// schema invites churn; passthrough lets the UI use what it needs.
|
|
52
|
+
.passthrough();
|
|
41
53
|
export const lineItemRecordSchema = z.object({
|
|
42
54
|
id: z.string(),
|
|
43
55
|
invoiceId: z.string(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/finance-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"react": "^19.0.0",
|
|
42
42
|
"react-dom": "^19.0.0",
|
|
43
43
|
"zod": "^4.0.0",
|
|
44
|
-
"@voyantjs/finance": "0.
|
|
44
|
+
"@voyantjs/finance": "0.21.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@tanstack/react-query": "^5.96.2",
|
|
@@ -52,12 +52,12 @@
|
|
|
52
52
|
"typescript": "^6.0.2",
|
|
53
53
|
"vitest": "^4.1.2",
|
|
54
54
|
"zod": "^4.3.6",
|
|
55
|
-
"@voyantjs/finance": "0.
|
|
56
|
-
"@voyantjs/react": "0.
|
|
55
|
+
"@voyantjs/finance": "0.21.0",
|
|
56
|
+
"@voyantjs/react": "0.21.0",
|
|
57
57
|
"@voyantjs/voyant-typescript-config": "0.1.0"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@voyantjs/react": "0.
|
|
60
|
+
"@voyantjs/react": "0.21.0"
|
|
61
61
|
},
|
|
62
62
|
"files": [
|
|
63
63
|
"dist"
|