@voyantjs/finance-react 0.4.5 → 0.6.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.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 +1 -1
- 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/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/operations.d.ts +20 -20
- 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 +210 -60
- package/dist/query-options.d.ts.map +1 -1
- package/dist/query-options.js +15 -1
- package/dist/schemas.d.ts +196 -37
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +66 -0
- package/package.json +5 -5
package/dist/query-options.js
CHANGED
|
@@ -3,7 +3,21 @@ import { queryOptions } from "@tanstack/react-query";
|
|
|
3
3
|
import { fetchWithValidation } from "./client.js";
|
|
4
4
|
import { getPublicBookingDocuments, getPublicBookingPaymentOptions, getPublicBookingPayments, getPublicFinanceDocumentByReference, getPublicPaymentSession, } from "./operations.js";
|
|
5
5
|
import { financeQueryKeys } from "./query-keys.js";
|
|
6
|
-
import { invoiceCreditNotesResponse, invoiceLineItemsResponse, invoiceListResponse, invoiceNotesResponse, invoicePaymentsResponse, invoiceSingleResponse, supplierPaymentListResponse, } from "./schemas.js";
|
|
6
|
+
import { bookingGuaranteesResponse, bookingPaymentSchedulesResponse, invoiceCreditNotesResponse, invoiceLineItemsResponse, invoiceListResponse, invoiceNotesResponse, invoicePaymentsResponse, invoiceSingleResponse, supplierPaymentListResponse, } from "./schemas.js";
|
|
7
|
+
export function getBookingPaymentSchedulesQueryOptions(client, bookingId, options = {}) {
|
|
8
|
+
const { enabled: _enabled = true } = options;
|
|
9
|
+
return queryOptions({
|
|
10
|
+
queryKey: financeQueryKeys.bookingPaymentSchedules(bookingId ?? ""),
|
|
11
|
+
queryFn: () => fetchWithValidation(`/v1/finance/bookings/${bookingId}/payment-schedules`, bookingPaymentSchedulesResponse, client),
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export function getBookingGuaranteesQueryOptions(client, bookingId, options = {}) {
|
|
15
|
+
const { enabled: _enabled = true } = options;
|
|
16
|
+
return queryOptions({
|
|
17
|
+
queryKey: financeQueryKeys.bookingGuarantees(bookingId ?? ""),
|
|
18
|
+
queryFn: () => fetchWithValidation(`/v1/finance/bookings/${bookingId}/guarantees`, bookingGuaranteesResponse, client),
|
|
19
|
+
});
|
|
20
|
+
}
|
|
7
21
|
export function getInvoicesQueryOptions(client, options = {}) {
|
|
8
22
|
const { enabled: _enabled = true, ...filters } = options;
|
|
9
23
|
return queryOptions({
|
package/dist/schemas.d.ts
CHANGED
|
@@ -16,8 +16,8 @@ export declare const successEnvelope: z.ZodObject<{
|
|
|
16
16
|
success: z.ZodBoolean;
|
|
17
17
|
}, z.core.$strip>;
|
|
18
18
|
export declare const invoiceStatusSchema: z.ZodEnum<{
|
|
19
|
-
draft: "draft";
|
|
20
19
|
void: "void";
|
|
20
|
+
draft: "draft";
|
|
21
21
|
sent: "sent";
|
|
22
22
|
partially_paid: "partially_paid";
|
|
23
23
|
paid: "paid";
|
|
@@ -41,8 +41,8 @@ export declare const invoiceRecordSchema: z.ZodObject<{
|
|
|
41
41
|
personId: z.ZodNullable<z.ZodString>;
|
|
42
42
|
organizationId: z.ZodNullable<z.ZodString>;
|
|
43
43
|
status: z.ZodEnum<{
|
|
44
|
-
draft: "draft";
|
|
45
44
|
void: "void";
|
|
45
|
+
draft: "draft";
|
|
46
46
|
sent: "sent";
|
|
47
47
|
partially_paid: "partially_paid";
|
|
48
48
|
paid: "paid";
|
|
@@ -134,6 +134,165 @@ export declare const supplierPaymentRecordSchema: z.ZodObject<{
|
|
|
134
134
|
createdAt: z.ZodString;
|
|
135
135
|
}, z.core.$strip>;
|
|
136
136
|
export type SupplierPaymentRecord = z.infer<typeof supplierPaymentRecordSchema>;
|
|
137
|
+
export declare const paymentScheduleTypeSchema: z.ZodEnum<{
|
|
138
|
+
other: "other";
|
|
139
|
+
deposit: "deposit";
|
|
140
|
+
installment: "installment";
|
|
141
|
+
balance: "balance";
|
|
142
|
+
hold: "hold";
|
|
143
|
+
}>;
|
|
144
|
+
export declare const paymentScheduleStatusSchema: z.ZodEnum<{
|
|
145
|
+
pending: "pending";
|
|
146
|
+
expired: "expired";
|
|
147
|
+
cancelled: "cancelled";
|
|
148
|
+
paid: "paid";
|
|
149
|
+
due: "due";
|
|
150
|
+
waived: "waived";
|
|
151
|
+
}>;
|
|
152
|
+
export declare const bookingPaymentScheduleRecordSchema: z.ZodObject<{
|
|
153
|
+
id: z.ZodString;
|
|
154
|
+
bookingId: z.ZodString;
|
|
155
|
+
bookingItemId: z.ZodNullable<z.ZodString>;
|
|
156
|
+
scheduleType: z.ZodEnum<{
|
|
157
|
+
other: "other";
|
|
158
|
+
deposit: "deposit";
|
|
159
|
+
installment: "installment";
|
|
160
|
+
balance: "balance";
|
|
161
|
+
hold: "hold";
|
|
162
|
+
}>;
|
|
163
|
+
status: z.ZodEnum<{
|
|
164
|
+
pending: "pending";
|
|
165
|
+
expired: "expired";
|
|
166
|
+
cancelled: "cancelled";
|
|
167
|
+
paid: "paid";
|
|
168
|
+
due: "due";
|
|
169
|
+
waived: "waived";
|
|
170
|
+
}>;
|
|
171
|
+
dueDate: z.ZodString;
|
|
172
|
+
currency: z.ZodString;
|
|
173
|
+
amountCents: z.ZodNumber;
|
|
174
|
+
notes: z.ZodNullable<z.ZodString>;
|
|
175
|
+
createdAt: z.ZodString;
|
|
176
|
+
updatedAt: z.ZodString;
|
|
177
|
+
}, z.core.$strip>;
|
|
178
|
+
export type BookingPaymentScheduleRecord = z.infer<typeof bookingPaymentScheduleRecordSchema>;
|
|
179
|
+
export declare const bookingPaymentSchedulesResponse: z.ZodObject<{
|
|
180
|
+
data: z.ZodArray<z.ZodObject<{
|
|
181
|
+
id: z.ZodString;
|
|
182
|
+
bookingId: z.ZodString;
|
|
183
|
+
bookingItemId: z.ZodNullable<z.ZodString>;
|
|
184
|
+
scheduleType: z.ZodEnum<{
|
|
185
|
+
other: "other";
|
|
186
|
+
deposit: "deposit";
|
|
187
|
+
installment: "installment";
|
|
188
|
+
balance: "balance";
|
|
189
|
+
hold: "hold";
|
|
190
|
+
}>;
|
|
191
|
+
status: z.ZodEnum<{
|
|
192
|
+
pending: "pending";
|
|
193
|
+
expired: "expired";
|
|
194
|
+
cancelled: "cancelled";
|
|
195
|
+
paid: "paid";
|
|
196
|
+
due: "due";
|
|
197
|
+
waived: "waived";
|
|
198
|
+
}>;
|
|
199
|
+
dueDate: z.ZodString;
|
|
200
|
+
currency: z.ZodString;
|
|
201
|
+
amountCents: z.ZodNumber;
|
|
202
|
+
notes: z.ZodNullable<z.ZodString>;
|
|
203
|
+
createdAt: z.ZodString;
|
|
204
|
+
updatedAt: z.ZodString;
|
|
205
|
+
}, z.core.$strip>>;
|
|
206
|
+
}, z.core.$strip>;
|
|
207
|
+
export declare const guaranteeTypeSchema: z.ZodEnum<{
|
|
208
|
+
other: "other";
|
|
209
|
+
voucher: "voucher";
|
|
210
|
+
bank_transfer: "bank_transfer";
|
|
211
|
+
credit_card: "credit_card";
|
|
212
|
+
deposit: "deposit";
|
|
213
|
+
preauth: "preauth";
|
|
214
|
+
card_on_file: "card_on_file";
|
|
215
|
+
agency_letter: "agency_letter";
|
|
216
|
+
}>;
|
|
217
|
+
export declare const guaranteeStatusSchema: z.ZodEnum<{
|
|
218
|
+
pending: "pending";
|
|
219
|
+
expired: "expired";
|
|
220
|
+
cancelled: "cancelled";
|
|
221
|
+
released: "released";
|
|
222
|
+
failed: "failed";
|
|
223
|
+
active: "active";
|
|
224
|
+
}>;
|
|
225
|
+
export declare const bookingGuaranteeRecordSchema: z.ZodObject<{
|
|
226
|
+
id: z.ZodString;
|
|
227
|
+
bookingId: z.ZodString;
|
|
228
|
+
bookingPaymentScheduleId: z.ZodNullable<z.ZodString>;
|
|
229
|
+
bookingItemId: z.ZodNullable<z.ZodString>;
|
|
230
|
+
guaranteeType: z.ZodEnum<{
|
|
231
|
+
other: "other";
|
|
232
|
+
voucher: "voucher";
|
|
233
|
+
bank_transfer: "bank_transfer";
|
|
234
|
+
credit_card: "credit_card";
|
|
235
|
+
deposit: "deposit";
|
|
236
|
+
preauth: "preauth";
|
|
237
|
+
card_on_file: "card_on_file";
|
|
238
|
+
agency_letter: "agency_letter";
|
|
239
|
+
}>;
|
|
240
|
+
status: z.ZodEnum<{
|
|
241
|
+
pending: "pending";
|
|
242
|
+
expired: "expired";
|
|
243
|
+
cancelled: "cancelled";
|
|
244
|
+
released: "released";
|
|
245
|
+
failed: "failed";
|
|
246
|
+
active: "active";
|
|
247
|
+
}>;
|
|
248
|
+
currency: z.ZodNullable<z.ZodString>;
|
|
249
|
+
amountCents: z.ZodNullable<z.ZodNumber>;
|
|
250
|
+
provider: z.ZodNullable<z.ZodString>;
|
|
251
|
+
referenceNumber: z.ZodNullable<z.ZodString>;
|
|
252
|
+
guaranteedAt: z.ZodNullable<z.ZodString>;
|
|
253
|
+
expiresAt: z.ZodNullable<z.ZodString>;
|
|
254
|
+
releasedAt: z.ZodNullable<z.ZodString>;
|
|
255
|
+
notes: z.ZodNullable<z.ZodString>;
|
|
256
|
+
createdAt: z.ZodString;
|
|
257
|
+
updatedAt: z.ZodString;
|
|
258
|
+
}, z.core.$strip>;
|
|
259
|
+
export type BookingGuaranteeRecord = z.infer<typeof bookingGuaranteeRecordSchema>;
|
|
260
|
+
export declare const bookingGuaranteesResponse: z.ZodObject<{
|
|
261
|
+
data: z.ZodArray<z.ZodObject<{
|
|
262
|
+
id: z.ZodString;
|
|
263
|
+
bookingId: z.ZodString;
|
|
264
|
+
bookingPaymentScheduleId: z.ZodNullable<z.ZodString>;
|
|
265
|
+
bookingItemId: z.ZodNullable<z.ZodString>;
|
|
266
|
+
guaranteeType: z.ZodEnum<{
|
|
267
|
+
other: "other";
|
|
268
|
+
voucher: "voucher";
|
|
269
|
+
bank_transfer: "bank_transfer";
|
|
270
|
+
credit_card: "credit_card";
|
|
271
|
+
deposit: "deposit";
|
|
272
|
+
preauth: "preauth";
|
|
273
|
+
card_on_file: "card_on_file";
|
|
274
|
+
agency_letter: "agency_letter";
|
|
275
|
+
}>;
|
|
276
|
+
status: z.ZodEnum<{
|
|
277
|
+
pending: "pending";
|
|
278
|
+
expired: "expired";
|
|
279
|
+
cancelled: "cancelled";
|
|
280
|
+
released: "released";
|
|
281
|
+
failed: "failed";
|
|
282
|
+
active: "active";
|
|
283
|
+
}>;
|
|
284
|
+
currency: z.ZodNullable<z.ZodString>;
|
|
285
|
+
amountCents: z.ZodNullable<z.ZodNumber>;
|
|
286
|
+
provider: z.ZodNullable<z.ZodString>;
|
|
287
|
+
referenceNumber: z.ZodNullable<z.ZodString>;
|
|
288
|
+
guaranteedAt: z.ZodNullable<z.ZodString>;
|
|
289
|
+
expiresAt: z.ZodNullable<z.ZodString>;
|
|
290
|
+
releasedAt: z.ZodNullable<z.ZodString>;
|
|
291
|
+
notes: z.ZodNullable<z.ZodString>;
|
|
292
|
+
createdAt: z.ZodString;
|
|
293
|
+
updatedAt: z.ZodString;
|
|
294
|
+
}, z.core.$strip>>;
|
|
295
|
+
}, z.core.$strip>;
|
|
137
296
|
export declare const invoiceListResponse: z.ZodObject<{
|
|
138
297
|
data: z.ZodArray<z.ZodObject<{
|
|
139
298
|
id: z.ZodString;
|
|
@@ -142,8 +301,8 @@ export declare const invoiceListResponse: z.ZodObject<{
|
|
|
142
301
|
personId: z.ZodNullable<z.ZodString>;
|
|
143
302
|
organizationId: z.ZodNullable<z.ZodString>;
|
|
144
303
|
status: z.ZodEnum<{
|
|
145
|
-
draft: "draft";
|
|
146
304
|
void: "void";
|
|
305
|
+
draft: "draft";
|
|
147
306
|
sent: "sent";
|
|
148
307
|
partially_paid: "partially_paid";
|
|
149
308
|
paid: "paid";
|
|
@@ -196,8 +355,8 @@ export declare const invoiceSingleResponse: z.ZodObject<{
|
|
|
196
355
|
personId: z.ZodNullable<z.ZodString>;
|
|
197
356
|
organizationId: z.ZodNullable<z.ZodString>;
|
|
198
357
|
status: z.ZodEnum<{
|
|
199
|
-
draft: "draft";
|
|
200
358
|
void: "void";
|
|
359
|
+
draft: "draft";
|
|
201
360
|
sent: "sent";
|
|
202
361
|
partially_paid: "partially_paid";
|
|
203
362
|
paid: "paid";
|
|
@@ -283,20 +442,20 @@ export declare const publicBookingPaymentOptionsResponse: z.ZodObject<{
|
|
|
283
442
|
label: z.ZodString;
|
|
284
443
|
provider: z.ZodNullable<z.ZodString>;
|
|
285
444
|
instrumentType: z.ZodEnum<{
|
|
445
|
+
other: "other";
|
|
446
|
+
voucher: "voucher";
|
|
447
|
+
wallet: "wallet";
|
|
286
448
|
credit_card: "credit_card";
|
|
287
449
|
debit_card: "debit_card";
|
|
288
|
-
bank_account: "bank_account";
|
|
289
|
-
wallet: "wallet";
|
|
290
|
-
voucher: "voucher";
|
|
291
|
-
direct_bill: "direct_bill";
|
|
292
450
|
cash: "cash";
|
|
293
|
-
|
|
451
|
+
direct_bill: "direct_bill";
|
|
452
|
+
bank_account: "bank_account";
|
|
294
453
|
}>;
|
|
295
454
|
status: z.ZodEnum<{
|
|
296
|
-
active: "active";
|
|
297
|
-
inactive: "inactive";
|
|
298
455
|
expired: "expired";
|
|
299
456
|
revoked: "revoked";
|
|
457
|
+
active: "active";
|
|
458
|
+
inactive: "inactive";
|
|
300
459
|
failed_verification: "failed_verification";
|
|
301
460
|
}>;
|
|
302
461
|
brand: z.ZodNullable<z.ZodString>;
|
|
@@ -316,11 +475,11 @@ export declare const publicBookingPaymentOptionsResponse: z.ZodObject<{
|
|
|
316
475
|
}>;
|
|
317
476
|
status: z.ZodEnum<{
|
|
318
477
|
pending: "pending";
|
|
319
|
-
paid: "paid";
|
|
320
478
|
expired: "expired";
|
|
479
|
+
cancelled: "cancelled";
|
|
480
|
+
paid: "paid";
|
|
321
481
|
due: "due";
|
|
322
482
|
waived: "waived";
|
|
323
|
-
cancelled: "cancelled";
|
|
324
483
|
}>;
|
|
325
484
|
dueDate: z.ZodString;
|
|
326
485
|
currency: z.ZodString;
|
|
@@ -360,8 +519,8 @@ export declare const publicBookingFinanceDocumentsResponse: z.ZodObject<{
|
|
|
360
519
|
credit_note: "credit_note";
|
|
361
520
|
}>;
|
|
362
521
|
invoiceStatus: z.ZodEnum<{
|
|
363
|
-
draft: "draft";
|
|
364
522
|
void: "void";
|
|
523
|
+
draft: "draft";
|
|
365
524
|
sent: "sent";
|
|
366
525
|
partially_paid: "partially_paid";
|
|
367
526
|
paid: "paid";
|
|
@@ -377,15 +536,15 @@ export declare const publicBookingFinanceDocumentsResponse: z.ZodObject<{
|
|
|
377
536
|
documentStatus: z.ZodEnum<{
|
|
378
537
|
pending: "pending";
|
|
379
538
|
failed: "failed";
|
|
380
|
-
missing: "missing";
|
|
381
539
|
ready: "ready";
|
|
382
540
|
stale: "stale";
|
|
541
|
+
missing: "missing";
|
|
383
542
|
}>;
|
|
384
543
|
format: z.ZodNullable<z.ZodEnum<{
|
|
385
|
-
|
|
544
|
+
json: "json";
|
|
386
545
|
pdf: "pdf";
|
|
546
|
+
html: "html";
|
|
387
547
|
xml: "xml";
|
|
388
|
-
json: "json";
|
|
389
548
|
}>>;
|
|
390
549
|
language: z.ZodNullable<z.ZodString>;
|
|
391
550
|
generatedAt: z.ZodNullable<z.ZodString>;
|
|
@@ -405,8 +564,8 @@ export declare const publicFinanceDocumentLookupResponse: z.ZodObject<{
|
|
|
405
564
|
credit_note: "credit_note";
|
|
406
565
|
}>;
|
|
407
566
|
invoiceStatus: z.ZodEnum<{
|
|
408
|
-
draft: "draft";
|
|
409
567
|
void: "void";
|
|
568
|
+
draft: "draft";
|
|
410
569
|
sent: "sent";
|
|
411
570
|
partially_paid: "partially_paid";
|
|
412
571
|
paid: "paid";
|
|
@@ -422,15 +581,15 @@ export declare const publicFinanceDocumentLookupResponse: z.ZodObject<{
|
|
|
422
581
|
documentStatus: z.ZodEnum<{
|
|
423
582
|
pending: "pending";
|
|
424
583
|
failed: "failed";
|
|
425
|
-
missing: "missing";
|
|
426
584
|
ready: "ready";
|
|
427
585
|
stale: "stale";
|
|
586
|
+
missing: "missing";
|
|
428
587
|
}>;
|
|
429
588
|
format: z.ZodNullable<z.ZodEnum<{
|
|
430
|
-
|
|
589
|
+
json: "json";
|
|
431
590
|
pdf: "pdf";
|
|
591
|
+
html: "html";
|
|
432
592
|
xml: "xml";
|
|
433
|
-
json: "json";
|
|
434
593
|
}>>;
|
|
435
594
|
language: z.ZodNullable<z.ZodString>;
|
|
436
595
|
generatedAt: z.ZodNullable<z.ZodString>;
|
|
@@ -459,15 +618,15 @@ export declare const publicBookingFinancePaymentsResponse: z.ZodObject<{
|
|
|
459
618
|
refunded: "refunded";
|
|
460
619
|
}>;
|
|
461
620
|
paymentMethod: z.ZodEnum<{
|
|
621
|
+
other: "other";
|
|
622
|
+
voucher: "voucher";
|
|
623
|
+
wallet: "wallet";
|
|
624
|
+
bank_transfer: "bank_transfer";
|
|
462
625
|
credit_card: "credit_card";
|
|
463
626
|
debit_card: "debit_card";
|
|
464
|
-
wallet: "wallet";
|
|
465
|
-
voucher: "voucher";
|
|
466
|
-
direct_bill: "direct_bill";
|
|
467
627
|
cash: "cash";
|
|
468
|
-
other: "other";
|
|
469
|
-
bank_transfer: "bank_transfer";
|
|
470
628
|
cheque: "cheque";
|
|
629
|
+
direct_bill: "direct_bill";
|
|
471
630
|
}>;
|
|
472
631
|
amountCents: z.ZodNumber;
|
|
473
632
|
currency: z.ZodString;
|
|
@@ -481,12 +640,12 @@ export declare const publicPaymentSessionResponse: z.ZodObject<{
|
|
|
481
640
|
data: z.ZodObject<{
|
|
482
641
|
id: z.ZodString;
|
|
483
642
|
targetType: z.ZodEnum<{
|
|
484
|
-
invoice: "invoice";
|
|
485
643
|
other: "other";
|
|
486
|
-
booking_payment_schedule: "booking_payment_schedule";
|
|
487
|
-
booking_guarantee: "booking_guarantee";
|
|
488
644
|
booking: "booking";
|
|
489
645
|
order: "order";
|
|
646
|
+
invoice: "invoice";
|
|
647
|
+
booking_payment_schedule: "booking_payment_schedule";
|
|
648
|
+
booking_guarantee: "booking_guarantee";
|
|
490
649
|
}>;
|
|
491
650
|
targetId: z.ZodNullable<z.ZodString>;
|
|
492
651
|
bookingId: z.ZodNullable<z.ZodString>;
|
|
@@ -495,10 +654,10 @@ export declare const publicPaymentSessionResponse: z.ZodObject<{
|
|
|
495
654
|
bookingGuaranteeId: z.ZodNullable<z.ZodString>;
|
|
496
655
|
status: z.ZodEnum<{
|
|
497
656
|
pending: "pending";
|
|
498
|
-
failed: "failed";
|
|
499
|
-
paid: "paid";
|
|
500
657
|
expired: "expired";
|
|
501
658
|
cancelled: "cancelled";
|
|
659
|
+
failed: "failed";
|
|
660
|
+
paid: "paid";
|
|
502
661
|
requires_redirect: "requires_redirect";
|
|
503
662
|
processing: "processing";
|
|
504
663
|
authorized: "authorized";
|
|
@@ -511,15 +670,15 @@ export declare const publicPaymentSessionResponse: z.ZodObject<{
|
|
|
511
670
|
currency: z.ZodString;
|
|
512
671
|
amountCents: z.ZodNumber;
|
|
513
672
|
paymentMethod: z.ZodNullable<z.ZodEnum<{
|
|
673
|
+
other: "other";
|
|
674
|
+
voucher: "voucher";
|
|
675
|
+
wallet: "wallet";
|
|
676
|
+
bank_transfer: "bank_transfer";
|
|
514
677
|
credit_card: "credit_card";
|
|
515
678
|
debit_card: "debit_card";
|
|
516
|
-
wallet: "wallet";
|
|
517
|
-
voucher: "voucher";
|
|
518
|
-
direct_bill: "direct_bill";
|
|
519
679
|
cash: "cash";
|
|
520
|
-
other: "other";
|
|
521
|
-
bank_transfer: "bank_transfer";
|
|
522
680
|
cheque: "cheque";
|
|
681
|
+
direct_bill: "direct_bill";
|
|
523
682
|
}>>;
|
|
524
683
|
payerEmail: z.ZodNullable<z.ZodString>;
|
|
525
684
|
payerName: z.ZodNullable<z.ZodString>;
|
|
@@ -536,8 +695,8 @@ export declare const publicVoucherValidationResponse: z.ZodObject<{
|
|
|
536
695
|
data: z.ZodObject<{
|
|
537
696
|
valid: z.ZodBoolean;
|
|
538
697
|
reason: z.ZodNullable<z.ZodEnum<{
|
|
539
|
-
inactive: "inactive";
|
|
540
698
|
expired: "expired";
|
|
699
|
+
inactive: "inactive";
|
|
541
700
|
not_found: "not_found";
|
|
542
701
|
not_started: "not_started";
|
|
543
702
|
booking_mismatch: "booking_mismatch";
|
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,mBAAmB,CAAA;A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AK,CAAC,OAAO,kCAAkC,CAAC,CAAA;AACnG,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAA;AACnG,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAA;AACjG,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AACnF,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAA;AAC5F,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAA;AACpF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAA"}
|
package/dist/schemas.js
CHANGED
|
@@ -92,6 +92,72 @@ export const supplierPaymentRecordSchema = z.object({
|
|
|
92
92
|
notes: z.string().nullable().optional(),
|
|
93
93
|
createdAt: z.string(),
|
|
94
94
|
});
|
|
95
|
+
export const paymentScheduleTypeSchema = z.enum([
|
|
96
|
+
"deposit",
|
|
97
|
+
"installment",
|
|
98
|
+
"balance",
|
|
99
|
+
"hold",
|
|
100
|
+
"other",
|
|
101
|
+
]);
|
|
102
|
+
export const paymentScheduleStatusSchema = z.enum([
|
|
103
|
+
"pending",
|
|
104
|
+
"due",
|
|
105
|
+
"paid",
|
|
106
|
+
"waived",
|
|
107
|
+
"cancelled",
|
|
108
|
+
"expired",
|
|
109
|
+
]);
|
|
110
|
+
export const bookingPaymentScheduleRecordSchema = z.object({
|
|
111
|
+
id: z.string(),
|
|
112
|
+
bookingId: z.string(),
|
|
113
|
+
bookingItemId: z.string().nullable(),
|
|
114
|
+
scheduleType: paymentScheduleTypeSchema,
|
|
115
|
+
status: paymentScheduleStatusSchema,
|
|
116
|
+
dueDate: z.string(),
|
|
117
|
+
currency: z.string(),
|
|
118
|
+
amountCents: z.number().int(),
|
|
119
|
+
notes: z.string().nullable(),
|
|
120
|
+
createdAt: z.string(),
|
|
121
|
+
updatedAt: z.string(),
|
|
122
|
+
});
|
|
123
|
+
export const bookingPaymentSchedulesResponse = arrayEnvelope(bookingPaymentScheduleRecordSchema);
|
|
124
|
+
export const guaranteeTypeSchema = z.enum([
|
|
125
|
+
"deposit",
|
|
126
|
+
"credit_card",
|
|
127
|
+
"preauth",
|
|
128
|
+
"card_on_file",
|
|
129
|
+
"bank_transfer",
|
|
130
|
+
"voucher",
|
|
131
|
+
"agency_letter",
|
|
132
|
+
"other",
|
|
133
|
+
]);
|
|
134
|
+
export const guaranteeStatusSchema = z.enum([
|
|
135
|
+
"pending",
|
|
136
|
+
"active",
|
|
137
|
+
"released",
|
|
138
|
+
"failed",
|
|
139
|
+
"cancelled",
|
|
140
|
+
"expired",
|
|
141
|
+
]);
|
|
142
|
+
export const bookingGuaranteeRecordSchema = z.object({
|
|
143
|
+
id: z.string(),
|
|
144
|
+
bookingId: z.string(),
|
|
145
|
+
bookingPaymentScheduleId: z.string().nullable(),
|
|
146
|
+
bookingItemId: z.string().nullable(),
|
|
147
|
+
guaranteeType: guaranteeTypeSchema,
|
|
148
|
+
status: guaranteeStatusSchema,
|
|
149
|
+
currency: z.string().nullable(),
|
|
150
|
+
amountCents: z.number().int().nullable(),
|
|
151
|
+
provider: z.string().nullable(),
|
|
152
|
+
referenceNumber: z.string().nullable(),
|
|
153
|
+
guaranteedAt: z.string().nullable(),
|
|
154
|
+
expiresAt: z.string().nullable(),
|
|
155
|
+
releasedAt: z.string().nullable(),
|
|
156
|
+
notes: z.string().nullable(),
|
|
157
|
+
createdAt: z.string(),
|
|
158
|
+
updatedAt: z.string(),
|
|
159
|
+
});
|
|
160
|
+
export const bookingGuaranteesResponse = arrayEnvelope(bookingGuaranteeRecordSchema);
|
|
95
161
|
export const invoiceListResponse = paginatedEnvelope(invoiceRecordSchema);
|
|
96
162
|
export const supplierPaymentListResponse = paginatedEnvelope(supplierPaymentRecordSchema);
|
|
97
163
|
export const invoiceSingleResponse = singleEnvelope(invoiceRecordSchema);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/finance-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"license": "FSL-1.1-Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"react": "^19.0.0",
|
|
36
36
|
"react-dom": "^19.0.0",
|
|
37
37
|
"zod": "^4.0.0",
|
|
38
|
-
"@voyantjs/finance": "0.
|
|
38
|
+
"@voyantjs/finance": "0.6.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@tanstack/react-query": "^5.96.2",
|
|
@@ -46,12 +46,12 @@
|
|
|
46
46
|
"typescript": "^6.0.2",
|
|
47
47
|
"vitest": "^4.1.2",
|
|
48
48
|
"zod": "^4.3.6",
|
|
49
|
-
"@voyantjs/finance": "0.
|
|
50
|
-
"@voyantjs/react": "0.
|
|
49
|
+
"@voyantjs/finance": "0.6.0",
|
|
50
|
+
"@voyantjs/react": "0.6.0",
|
|
51
51
|
"@voyantjs/voyant-typescript-config": "0.1.0"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@voyantjs/react": "0.
|
|
54
|
+
"@voyantjs/react": "0.6.0"
|
|
55
55
|
},
|
|
56
56
|
"files": [
|
|
57
57
|
"dist"
|