@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.
Files changed (37) hide show
  1. package/dist/hooks/index.d.ts +2 -0
  2. package/dist/hooks/index.d.ts.map +1 -1
  3. package/dist/hooks/index.js +2 -0
  4. package/dist/hooks/use-booking-guarantees.d.ts +82 -0
  5. package/dist/hooks/use-booking-guarantees.d.ts.map +1 -0
  6. package/dist/hooks/use-booking-guarantees.js +46 -0
  7. package/dist/hooks/use-booking-payment-schedules.d.ts +63 -0
  8. package/dist/hooks/use-booking-payment-schedules.d.ts.map +1 -0
  9. package/dist/hooks/use-booking-payment-schedules.js +46 -0
  10. package/dist/hooks/use-invoice-mutation.d.ts +2 -2
  11. package/dist/hooks/use-invoice-payment-mutation.d.ts +1 -1
  12. package/dist/hooks/use-invoice-payments.d.ts +1 -1
  13. package/dist/hooks/use-invoice.d.ts +1 -1
  14. package/dist/hooks/use-invoices.d.ts +1 -1
  15. package/dist/hooks/use-public-booking-documents.d.ts +3 -3
  16. package/dist/hooks/use-public-booking-payment-options.d.ts +3 -3
  17. package/dist/hooks/use-public-booking-payments.d.ts +2 -2
  18. package/dist/hooks/use-public-finance-document-by-reference.d.ts +3 -3
  19. package/dist/hooks/use-public-payment-session-mutation.d.ts +3 -3
  20. package/dist/hooks/use-public-payment-session.d.ts +3 -3
  21. package/dist/hooks/use-public-voucher-validation-mutation.d.ts +1 -1
  22. package/dist/hooks/use-supplier-payment-mutation.d.ts +2 -2
  23. package/dist/hooks/use-supplier-payments.d.ts +1 -1
  24. package/dist/index.d.ts +1 -1
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +1 -1
  27. package/dist/operations.d.ts +21 -21
  28. package/dist/query-keys.d.ts +2 -0
  29. package/dist/query-keys.d.ts.map +1 -1
  30. package/dist/query-keys.js +2 -0
  31. package/dist/query-options.d.ts +222 -72
  32. package/dist/query-options.d.ts.map +1 -1
  33. package/dist/query-options.js +15 -1
  34. package/dist/schemas.d.ts +202 -43
  35. package/dist/schemas.d.ts.map +1 -1
  36. package/dist/schemas.js +66 -0
  37. package/package.json +5 -5
@@ -5,7 +5,7 @@ export declare function getPublicFinanceDocumentByReference(client: FetchWithVal
5
5
  invoiceId: string;
6
6
  invoiceNumber: string;
7
7
  invoiceType: "invoice" | "proforma" | "credit_note";
8
- invoiceStatus: "draft" | "void" | "sent" | "partially_paid" | "paid" | "overdue";
8
+ invoiceStatus: "draft" | "sent" | "partially_paid" | "paid" | "overdue" | "void";
9
9
  currency: string;
10
10
  totalCents: number;
11
11
  paidCents: number;
@@ -13,8 +13,8 @@ export declare function getPublicFinanceDocumentByReference(client: FetchWithVal
13
13
  issueDate: string;
14
14
  dueDate: string;
15
15
  renditionId: string | null;
16
- documentStatus: "pending" | "failed" | "missing" | "ready" | "stale";
17
- format: "html" | "pdf" | "xml" | "json" | null;
16
+ documentStatus: "pending" | "failed" | "ready" | "stale" | "missing";
17
+ format: "json" | "pdf" | "html" | "xml" | null;
18
18
  language: string | null;
19
19
  generatedAt: string | null;
20
20
  fileSize: number | null;
@@ -30,7 +30,7 @@ export declare function getPublicBookingDocuments(client: FetchWithValidationOpt
30
30
  invoiceId: string;
31
31
  invoiceNumber: string;
32
32
  invoiceType: "invoice" | "proforma" | "credit_note";
33
- invoiceStatus: "draft" | "void" | "sent" | "partially_paid" | "paid" | "overdue";
33
+ invoiceStatus: "draft" | "sent" | "partially_paid" | "paid" | "overdue" | "void";
34
34
  currency: string;
35
35
  totalCents: number;
36
36
  paidCents: number;
@@ -38,8 +38,8 @@ export declare function getPublicBookingDocuments(client: FetchWithValidationOpt
38
38
  issueDate: string;
39
39
  dueDate: string;
40
40
  renditionId: string | null;
41
- documentStatus: "pending" | "failed" | "missing" | "ready" | "stale";
42
- format: "html" | "pdf" | "xml" | "json" | null;
41
+ documentStatus: "pending" | "failed" | "ready" | "stale" | "missing";
42
+ format: "json" | "pdf" | "html" | "xml" | null;
43
43
  language: string | null;
44
44
  generatedAt: string | null;
45
45
  fileSize: number | null;
@@ -56,8 +56,8 @@ export declare function getPublicBookingPayments(client: FetchWithValidationOpti
56
56
  invoiceId: string;
57
57
  invoiceNumber: string;
58
58
  invoiceType: "invoice" | "proforma" | "credit_note";
59
- status: "pending" | "completed" | "failed" | "refunded";
60
- paymentMethod: "credit_card" | "debit_card" | "wallet" | "voucher" | "direct_bill" | "cash" | "other" | "bank_transfer" | "cheque";
59
+ status: "completed" | "pending" | "failed" | "refunded";
60
+ paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill";
61
61
  amountCents: number;
62
62
  currency: string;
63
63
  paymentDate: string;
@@ -79,8 +79,8 @@ export declare function getPublicBookingPaymentOptions(client: FetchWithValidati
79
79
  id: string;
80
80
  label: string;
81
81
  provider: string | null;
82
- instrumentType: "credit_card" | "debit_card" | "bank_account" | "wallet" | "voucher" | "direct_bill" | "cash" | "other";
83
- status: "active" | "inactive" | "expired" | "revoked" | "failed_verification";
82
+ instrumentType: "other" | "voucher" | "wallet" | "credit_card" | "debit_card" | "cash" | "direct_bill" | "bank_account";
83
+ status: "expired" | "revoked" | "active" | "inactive" | "failed_verification";
84
84
  brand: string | null;
85
85
  last4: string | null;
86
86
  expiryMonth: number | null;
@@ -90,7 +90,7 @@ export declare function getPublicBookingPaymentOptions(client: FetchWithValidati
90
90
  schedules: {
91
91
  id: string;
92
92
  scheduleType: "other" | "deposit" | "installment" | "balance" | "hold";
93
- status: "pending" | "paid" | "expired" | "due" | "waived" | "cancelled";
93
+ status: "expired" | "cancelled" | "pending" | "paid" | "due" | "waived";
94
94
  dueDate: string;
95
95
  currency: string;
96
96
  amountCents: number;
@@ -117,13 +117,13 @@ export declare function getPublicBookingPaymentOptions(client: FetchWithValidati
117
117
  export declare function getPublicPaymentSession(client: FetchWithValidationOptions, sessionId: string): Promise<{
118
118
  data: {
119
119
  id: string;
120
- targetType: "invoice" | "other" | "booking_payment_schedule" | "booking_guarantee" | "booking" | "order";
120
+ targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee";
121
121
  targetId: string | null;
122
122
  bookingId: string | null;
123
123
  invoiceId: string | null;
124
124
  bookingPaymentScheduleId: string | null;
125
125
  bookingGuaranteeId: string | null;
126
- status: "pending" | "failed" | "paid" | "expired" | "cancelled" | "requires_redirect" | "processing" | "authorized";
126
+ status: "expired" | "cancelled" | "pending" | "failed" | "paid" | "requires_redirect" | "processing" | "authorized";
127
127
  provider: string | null;
128
128
  providerSessionId: string | null;
129
129
  providerPaymentId: string | null;
@@ -131,7 +131,7 @@ export declare function getPublicPaymentSession(client: FetchWithValidationOptio
131
131
  clientReference: string | null;
132
132
  currency: string;
133
133
  amountCents: number;
134
- paymentMethod: "credit_card" | "debit_card" | "wallet" | "voucher" | "direct_bill" | "cash" | "other" | "bank_transfer" | "cheque" | null;
134
+ paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
135
135
  payerEmail: string | null;
136
136
  payerName: string | null;
137
137
  redirectUrl: string | null;
@@ -146,13 +146,13 @@ export declare function getPublicPaymentSession(client: FetchWithValidationOptio
146
146
  export declare function startPublicBookingSchedulePaymentSession(client: FetchWithValidationOptions, bookingId: string, scheduleId: string, input: PublicStartPaymentSessionInput): Promise<{
147
147
  data: {
148
148
  id: string;
149
- targetType: "invoice" | "other" | "booking_payment_schedule" | "booking_guarantee" | "booking" | "order";
149
+ targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee";
150
150
  targetId: string | null;
151
151
  bookingId: string | null;
152
152
  invoiceId: string | null;
153
153
  bookingPaymentScheduleId: string | null;
154
154
  bookingGuaranteeId: string | null;
155
- status: "pending" | "failed" | "paid" | "expired" | "cancelled" | "requires_redirect" | "processing" | "authorized";
155
+ status: "expired" | "cancelled" | "pending" | "failed" | "paid" | "requires_redirect" | "processing" | "authorized";
156
156
  provider: string | null;
157
157
  providerSessionId: string | null;
158
158
  providerPaymentId: string | null;
@@ -160,7 +160,7 @@ export declare function startPublicBookingSchedulePaymentSession(client: FetchWi
160
160
  clientReference: string | null;
161
161
  currency: string;
162
162
  amountCents: number;
163
- paymentMethod: "credit_card" | "debit_card" | "wallet" | "voucher" | "direct_bill" | "cash" | "other" | "bank_transfer" | "cheque" | null;
163
+ paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
164
164
  payerEmail: string | null;
165
165
  payerName: string | null;
166
166
  redirectUrl: string | null;
@@ -175,13 +175,13 @@ export declare function startPublicBookingSchedulePaymentSession(client: FetchWi
175
175
  export declare function startPublicBookingGuaranteePaymentSession(client: FetchWithValidationOptions, bookingId: string, guaranteeId: string, input: PublicStartPaymentSessionInput): Promise<{
176
176
  data: {
177
177
  id: string;
178
- targetType: "invoice" | "other" | "booking_payment_schedule" | "booking_guarantee" | "booking" | "order";
178
+ targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee";
179
179
  targetId: string | null;
180
180
  bookingId: string | null;
181
181
  invoiceId: string | null;
182
182
  bookingPaymentScheduleId: string | null;
183
183
  bookingGuaranteeId: string | null;
184
- status: "pending" | "failed" | "paid" | "expired" | "cancelled" | "requires_redirect" | "processing" | "authorized";
184
+ status: "expired" | "cancelled" | "pending" | "failed" | "paid" | "requires_redirect" | "processing" | "authorized";
185
185
  provider: string | null;
186
186
  providerSessionId: string | null;
187
187
  providerPaymentId: string | null;
@@ -189,7 +189,7 @@ export declare function startPublicBookingGuaranteePaymentSession(client: FetchW
189
189
  clientReference: string | null;
190
190
  currency: string;
191
191
  amountCents: number;
192
- paymentMethod: "credit_card" | "debit_card" | "wallet" | "voucher" | "direct_bill" | "cash" | "other" | "bank_transfer" | "cheque" | null;
192
+ paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
193
193
  payerEmail: string | null;
194
194
  payerName: string | null;
195
195
  redirectUrl: string | null;
@@ -204,7 +204,7 @@ export declare function startPublicBookingGuaranteePaymentSession(client: FetchW
204
204
  export declare function validatePublicVoucher(client: FetchWithValidationOptions, input: PublicValidateVoucherInput): Promise<{
205
205
  data: {
206
206
  valid: boolean;
207
- reason: "inactive" | "expired" | "not_found" | "not_started" | "booking_mismatch" | "currency_mismatch" | "insufficient_balance" | null;
207
+ reason: "expired" | "inactive" | "not_found" | "not_started" | "booking_mismatch" | "currency_mismatch" | "insufficient_balance" | null;
208
208
  voucher: {
209
209
  id: string;
210
210
  code: string;
@@ -26,6 +26,8 @@ export declare const financeQueryKeys: {
26
26
  readonly payments: (invoiceId: string) => readonly ["voyant", "finance", "invoices", "detail", string, "payments"];
27
27
  readonly creditNotes: (invoiceId: string) => readonly ["voyant", "finance", "invoices", "detail", string, "credit-notes"];
28
28
  readonly notes: (invoiceId: string) => readonly ["voyant", "finance", "invoices", "detail", string, "notes"];
29
+ readonly bookingPaymentSchedules: (bookingId: string) => readonly ["voyant", "finance", "booking-payment-schedules", string];
30
+ readonly bookingGuarantees: (bookingId: string) => readonly ["voyant", "finance", "booking-guarantees", string];
29
31
  readonly supplierPayments: () => readonly ["voyant", "finance", "supplier-payments"];
30
32
  readonly supplierPaymentsList: (filters: FinanceSupplierPaymentListFilters) => readonly ["voyant", "finance", "supplier-payments", "list", FinanceSupplierPaymentListFilters];
31
33
  readonly publicCheckout: () => readonly ["voyant", "finance", "public-checkout"];
@@ -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;CAC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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;sDAEA,MAAM,WAAW,kCAAkC;+CAE1D,MAAM;;CAIhC,CAAA"}
@@ -7,6 +7,8 @@ export const financeQueryKeys = {
7
7
  payments: (invoiceId) => [...financeQueryKeys.invoice(invoiceId), "payments"],
8
8
  creditNotes: (invoiceId) => [...financeQueryKeys.invoice(invoiceId), "credit-notes"],
9
9
  notes: (invoiceId) => [...financeQueryKeys.invoice(invoiceId), "notes"],
10
+ bookingPaymentSchedules: (bookingId) => [...financeQueryKeys.all, "booking-payment-schedules", bookingId],
11
+ bookingGuarantees: (bookingId) => [...financeQueryKeys.all, "booking-guarantees", bookingId],
10
12
  supplierPayments: () => [...financeQueryKeys.all, "supplier-payments"],
11
13
  supplierPaymentsList: (filters) => [...financeQueryKeys.supplierPayments(), "list", filters],
12
14
  publicCheckout: () => [...financeQueryKeys.all, "public-checkout"],