@voyantjs/finance 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,374 @@
1
+ import { z } from "zod";
2
+ export declare const publicFinanceInvoiceTypeSchema: z.ZodEnum<{
3
+ invoice: "invoice";
4
+ proforma: "proforma";
5
+ credit_note: "credit_note";
6
+ }>;
7
+ export declare const publicFinanceDocumentAvailabilitySchema: z.ZodEnum<{
8
+ pending: "pending";
9
+ failed: "failed";
10
+ ready: "ready";
11
+ stale: "stale";
12
+ missing: "missing";
13
+ }>;
14
+ export declare const publicFinanceDocumentFormatSchema: z.ZodEnum<{
15
+ json: "json";
16
+ pdf: "pdf";
17
+ html: "html";
18
+ xml: "xml";
19
+ }>;
20
+ export declare const publicPaymentOptionsQuerySchema: z.ZodObject<{
21
+ personId: z.ZodOptional<z.ZodString>;
22
+ organizationId: z.ZodOptional<z.ZodString>;
23
+ provider: z.ZodOptional<z.ZodString>;
24
+ instrumentType: z.ZodOptional<z.ZodEnum<{
25
+ other: "other";
26
+ voucher: "voucher";
27
+ wallet: "wallet";
28
+ credit_card: "credit_card";
29
+ debit_card: "debit_card";
30
+ cash: "cash";
31
+ direct_bill: "direct_bill";
32
+ bank_account: "bank_account";
33
+ }>>;
34
+ includeInactive: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
35
+ }, z.core.$strip>;
36
+ export declare const publicStartPaymentSessionSchema: z.ZodObject<{
37
+ provider: z.ZodNullable<z.ZodOptional<z.ZodString>>;
38
+ paymentMethod: z.ZodNullable<z.ZodOptional<z.ZodEnum<{
39
+ other: "other";
40
+ voucher: "voucher";
41
+ wallet: "wallet";
42
+ bank_transfer: "bank_transfer";
43
+ credit_card: "credit_card";
44
+ debit_card: "debit_card";
45
+ cash: "cash";
46
+ cheque: "cheque";
47
+ direct_bill: "direct_bill";
48
+ }>>>;
49
+ paymentInstrumentId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
50
+ payerPersonId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
51
+ payerOrganizationId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
52
+ payerEmail: z.ZodNullable<z.ZodOptional<z.ZodString>>;
53
+ payerName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
54
+ externalReference: z.ZodNullable<z.ZodOptional<z.ZodString>>;
55
+ idempotencyKey: z.ZodNullable<z.ZodOptional<z.ZodString>>;
56
+ clientReference: z.ZodNullable<z.ZodOptional<z.ZodString>>;
57
+ returnUrl: z.ZodNullable<z.ZodOptional<z.ZodString>>;
58
+ cancelUrl: z.ZodNullable<z.ZodOptional<z.ZodString>>;
59
+ callbackUrl: z.ZodNullable<z.ZodOptional<z.ZodString>>;
60
+ expiresAt: z.ZodNullable<z.ZodOptional<z.ZodString>>;
61
+ notes: z.ZodNullable<z.ZodOptional<z.ZodString>>;
62
+ providerPayload: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
63
+ metadata: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
64
+ }, z.core.$strip>;
65
+ export declare const publicValidateVoucherSchema: z.ZodObject<{
66
+ code: z.ZodString;
67
+ provider: z.ZodNullable<z.ZodOptional<z.ZodString>>;
68
+ bookingId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
69
+ currency: z.ZodNullable<z.ZodOptional<z.ZodString>>;
70
+ amountCents: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
71
+ }, z.core.$strip>;
72
+ export declare const publicPaymentAccountSchema: z.ZodObject<{
73
+ id: z.ZodString;
74
+ label: z.ZodString;
75
+ provider: z.ZodNullable<z.ZodString>;
76
+ instrumentType: z.ZodEnum<{
77
+ other: "other";
78
+ voucher: "voucher";
79
+ wallet: "wallet";
80
+ credit_card: "credit_card";
81
+ debit_card: "debit_card";
82
+ cash: "cash";
83
+ direct_bill: "direct_bill";
84
+ bank_account: "bank_account";
85
+ }>;
86
+ status: z.ZodEnum<{
87
+ expired: "expired";
88
+ revoked: "revoked";
89
+ active: "active";
90
+ inactive: "inactive";
91
+ failed_verification: "failed_verification";
92
+ }>;
93
+ brand: z.ZodNullable<z.ZodString>;
94
+ last4: z.ZodNullable<z.ZodString>;
95
+ expiryMonth: z.ZodNullable<z.ZodNumber>;
96
+ expiryYear: z.ZodNullable<z.ZodNumber>;
97
+ isDefault: z.ZodBoolean;
98
+ }, z.core.$strip>;
99
+ export declare const publicBookingPaymentScheduleSchema: z.ZodObject<{
100
+ id: z.ZodString;
101
+ scheduleType: z.ZodEnum<{
102
+ other: "other";
103
+ deposit: "deposit";
104
+ installment: "installment";
105
+ balance: "balance";
106
+ hold: "hold";
107
+ }>;
108
+ status: z.ZodEnum<{
109
+ expired: "expired";
110
+ cancelled: "cancelled";
111
+ pending: "pending";
112
+ paid: "paid";
113
+ due: "due";
114
+ waived: "waived";
115
+ }>;
116
+ dueDate: z.ZodString;
117
+ currency: z.ZodString;
118
+ amountCents: z.ZodNumber;
119
+ notes: z.ZodNullable<z.ZodString>;
120
+ }, z.core.$strip>;
121
+ export declare const publicBookingGuaranteeSchema: z.ZodObject<{
122
+ id: z.ZodString;
123
+ bookingPaymentScheduleId: z.ZodNullable<z.ZodString>;
124
+ guaranteeType: z.ZodString;
125
+ status: z.ZodString;
126
+ currency: z.ZodNullable<z.ZodString>;
127
+ amountCents: z.ZodNullable<z.ZodNumber>;
128
+ provider: z.ZodNullable<z.ZodString>;
129
+ referenceNumber: z.ZodNullable<z.ZodString>;
130
+ expiresAt: z.ZodNullable<z.ZodString>;
131
+ notes: z.ZodNullable<z.ZodString>;
132
+ }, z.core.$strip>;
133
+ export declare const publicBookingPaymentOptionsSchema: z.ZodObject<{
134
+ bookingId: z.ZodString;
135
+ accounts: z.ZodArray<z.ZodObject<{
136
+ id: z.ZodString;
137
+ label: z.ZodString;
138
+ provider: z.ZodNullable<z.ZodString>;
139
+ instrumentType: z.ZodEnum<{
140
+ other: "other";
141
+ voucher: "voucher";
142
+ wallet: "wallet";
143
+ credit_card: "credit_card";
144
+ debit_card: "debit_card";
145
+ cash: "cash";
146
+ direct_bill: "direct_bill";
147
+ bank_account: "bank_account";
148
+ }>;
149
+ status: z.ZodEnum<{
150
+ expired: "expired";
151
+ revoked: "revoked";
152
+ active: "active";
153
+ inactive: "inactive";
154
+ failed_verification: "failed_verification";
155
+ }>;
156
+ brand: z.ZodNullable<z.ZodString>;
157
+ last4: z.ZodNullable<z.ZodString>;
158
+ expiryMonth: z.ZodNullable<z.ZodNumber>;
159
+ expiryYear: z.ZodNullable<z.ZodNumber>;
160
+ isDefault: z.ZodBoolean;
161
+ }, z.core.$strip>>;
162
+ schedules: z.ZodArray<z.ZodObject<{
163
+ id: z.ZodString;
164
+ scheduleType: z.ZodEnum<{
165
+ other: "other";
166
+ deposit: "deposit";
167
+ installment: "installment";
168
+ balance: "balance";
169
+ hold: "hold";
170
+ }>;
171
+ status: z.ZodEnum<{
172
+ expired: "expired";
173
+ cancelled: "cancelled";
174
+ pending: "pending";
175
+ paid: "paid";
176
+ due: "due";
177
+ waived: "waived";
178
+ }>;
179
+ dueDate: z.ZodString;
180
+ currency: z.ZodString;
181
+ amountCents: z.ZodNumber;
182
+ notes: z.ZodNullable<z.ZodString>;
183
+ }, z.core.$strip>>;
184
+ guarantees: z.ZodArray<z.ZodObject<{
185
+ id: z.ZodString;
186
+ bookingPaymentScheduleId: z.ZodNullable<z.ZodString>;
187
+ guaranteeType: z.ZodString;
188
+ status: z.ZodString;
189
+ currency: z.ZodNullable<z.ZodString>;
190
+ amountCents: z.ZodNullable<z.ZodNumber>;
191
+ provider: z.ZodNullable<z.ZodString>;
192
+ referenceNumber: z.ZodNullable<z.ZodString>;
193
+ expiresAt: z.ZodNullable<z.ZodString>;
194
+ notes: z.ZodNullable<z.ZodString>;
195
+ }, z.core.$strip>>;
196
+ recommendedTarget: z.ZodNullable<z.ZodObject<{
197
+ targetType: z.ZodNullable<z.ZodEnum<{
198
+ booking_payment_schedule: "booking_payment_schedule";
199
+ booking_guarantee: "booking_guarantee";
200
+ }>>;
201
+ targetId: z.ZodNullable<z.ZodString>;
202
+ }, z.core.$strip>>;
203
+ }, z.core.$strip>;
204
+ export declare const publicPaymentSessionSchema: z.ZodObject<{
205
+ id: z.ZodString;
206
+ targetType: z.ZodEnum<{
207
+ other: "other";
208
+ booking: "booking";
209
+ order: "order";
210
+ invoice: "invoice";
211
+ booking_payment_schedule: "booking_payment_schedule";
212
+ booking_guarantee: "booking_guarantee";
213
+ }>;
214
+ targetId: z.ZodNullable<z.ZodString>;
215
+ bookingId: z.ZodNullable<z.ZodString>;
216
+ invoiceId: z.ZodNullable<z.ZodString>;
217
+ bookingPaymentScheduleId: z.ZodNullable<z.ZodString>;
218
+ bookingGuaranteeId: z.ZodNullable<z.ZodString>;
219
+ status: z.ZodEnum<{
220
+ expired: "expired";
221
+ cancelled: "cancelled";
222
+ pending: "pending";
223
+ failed: "failed";
224
+ paid: "paid";
225
+ requires_redirect: "requires_redirect";
226
+ processing: "processing";
227
+ authorized: "authorized";
228
+ }>;
229
+ provider: z.ZodNullable<z.ZodString>;
230
+ providerSessionId: z.ZodNullable<z.ZodString>;
231
+ providerPaymentId: z.ZodNullable<z.ZodString>;
232
+ externalReference: z.ZodNullable<z.ZodString>;
233
+ clientReference: z.ZodNullable<z.ZodString>;
234
+ currency: z.ZodString;
235
+ amountCents: z.ZodNumber;
236
+ paymentMethod: z.ZodNullable<z.ZodEnum<{
237
+ other: "other";
238
+ voucher: "voucher";
239
+ wallet: "wallet";
240
+ bank_transfer: "bank_transfer";
241
+ credit_card: "credit_card";
242
+ debit_card: "debit_card";
243
+ cash: "cash";
244
+ cheque: "cheque";
245
+ direct_bill: "direct_bill";
246
+ }>>;
247
+ payerEmail: z.ZodNullable<z.ZodString>;
248
+ payerName: z.ZodNullable<z.ZodString>;
249
+ redirectUrl: z.ZodNullable<z.ZodString>;
250
+ returnUrl: z.ZodNullable<z.ZodString>;
251
+ cancelUrl: z.ZodNullable<z.ZodString>;
252
+ expiresAt: z.ZodNullable<z.ZodString>;
253
+ completedAt: z.ZodNullable<z.ZodString>;
254
+ failureCode: z.ZodNullable<z.ZodString>;
255
+ failureMessage: z.ZodNullable<z.ZodString>;
256
+ }, z.core.$strip>;
257
+ export declare const publicFinanceBookingDocumentSchema: z.ZodObject<{
258
+ invoiceId: z.ZodString;
259
+ invoiceNumber: z.ZodString;
260
+ invoiceType: z.ZodEnum<{
261
+ invoice: "invoice";
262
+ proforma: "proforma";
263
+ credit_note: "credit_note";
264
+ }>;
265
+ invoiceStatus: z.ZodEnum<{
266
+ draft: "draft";
267
+ sent: "sent";
268
+ partially_paid: "partially_paid";
269
+ paid: "paid";
270
+ overdue: "overdue";
271
+ void: "void";
272
+ }>;
273
+ currency: z.ZodString;
274
+ totalCents: z.ZodNumber;
275
+ paidCents: z.ZodNumber;
276
+ balanceDueCents: z.ZodNumber;
277
+ issueDate: z.ZodString;
278
+ dueDate: z.ZodString;
279
+ renditionId: z.ZodNullable<z.ZodString>;
280
+ documentStatus: z.ZodEnum<{
281
+ pending: "pending";
282
+ failed: "failed";
283
+ ready: "ready";
284
+ stale: "stale";
285
+ missing: "missing";
286
+ }>;
287
+ format: z.ZodNullable<z.ZodEnum<{
288
+ json: "json";
289
+ pdf: "pdf";
290
+ html: "html";
291
+ xml: "xml";
292
+ }>>;
293
+ language: z.ZodNullable<z.ZodString>;
294
+ generatedAt: z.ZodNullable<z.ZodString>;
295
+ fileSize: z.ZodNullable<z.ZodNumber>;
296
+ checksum: z.ZodNullable<z.ZodString>;
297
+ downloadUrl: z.ZodNullable<z.ZodString>;
298
+ }, z.core.$strip>;
299
+ export declare const publicBookingFinanceDocumentsSchema: z.ZodObject<{
300
+ bookingId: z.ZodString;
301
+ documents: z.ZodArray<z.ZodObject<{
302
+ invoiceId: z.ZodString;
303
+ invoiceNumber: z.ZodString;
304
+ invoiceType: z.ZodEnum<{
305
+ invoice: "invoice";
306
+ proforma: "proforma";
307
+ credit_note: "credit_note";
308
+ }>;
309
+ invoiceStatus: z.ZodEnum<{
310
+ draft: "draft";
311
+ sent: "sent";
312
+ partially_paid: "partially_paid";
313
+ paid: "paid";
314
+ overdue: "overdue";
315
+ void: "void";
316
+ }>;
317
+ currency: z.ZodString;
318
+ totalCents: z.ZodNumber;
319
+ paidCents: z.ZodNumber;
320
+ balanceDueCents: z.ZodNumber;
321
+ issueDate: z.ZodString;
322
+ dueDate: z.ZodString;
323
+ renditionId: z.ZodNullable<z.ZodString>;
324
+ documentStatus: z.ZodEnum<{
325
+ pending: "pending";
326
+ failed: "failed";
327
+ ready: "ready";
328
+ stale: "stale";
329
+ missing: "missing";
330
+ }>;
331
+ format: z.ZodNullable<z.ZodEnum<{
332
+ json: "json";
333
+ pdf: "pdf";
334
+ html: "html";
335
+ xml: "xml";
336
+ }>>;
337
+ language: z.ZodNullable<z.ZodString>;
338
+ generatedAt: z.ZodNullable<z.ZodString>;
339
+ fileSize: z.ZodNullable<z.ZodNumber>;
340
+ checksum: z.ZodNullable<z.ZodString>;
341
+ downloadUrl: z.ZodNullable<z.ZodString>;
342
+ }, z.core.$strip>>;
343
+ }, z.core.$strip>;
344
+ export declare const publicVoucherValidationSchema: z.ZodObject<{
345
+ valid: z.ZodBoolean;
346
+ reason: z.ZodNullable<z.ZodEnum<{
347
+ expired: "expired";
348
+ inactive: "inactive";
349
+ not_found: "not_found";
350
+ not_started: "not_started";
351
+ booking_mismatch: "booking_mismatch";
352
+ currency_mismatch: "currency_mismatch";
353
+ insufficient_balance: "insufficient_balance";
354
+ }>>;
355
+ voucher: z.ZodNullable<z.ZodObject<{
356
+ id: z.ZodString;
357
+ code: z.ZodString;
358
+ label: z.ZodString;
359
+ provider: z.ZodNullable<z.ZodString>;
360
+ currency: z.ZodNullable<z.ZodString>;
361
+ amountCents: z.ZodNullable<z.ZodNumber>;
362
+ remainingAmountCents: z.ZodNullable<z.ZodNumber>;
363
+ expiresAt: z.ZodNullable<z.ZodString>;
364
+ }, z.core.$strip>>;
365
+ }, z.core.$strip>;
366
+ export type PublicPaymentOptionsQuery = z.infer<typeof publicPaymentOptionsQuerySchema>;
367
+ export type PublicBookingPaymentOptions = z.infer<typeof publicBookingPaymentOptionsSchema>;
368
+ export type PublicPaymentSession = z.infer<typeof publicPaymentSessionSchema>;
369
+ export type PublicFinanceBookingDocument = z.infer<typeof publicFinanceBookingDocumentSchema>;
370
+ export type PublicBookingFinanceDocuments = z.infer<typeof publicBookingFinanceDocumentsSchema>;
371
+ export type PublicStartPaymentSessionInput = z.infer<typeof publicStartPaymentSessionSchema>;
372
+ export type PublicValidateVoucherInput = z.infer<typeof publicValidateVoucherSchema>;
373
+ export type PublicVoucherValidationResult = z.infer<typeof publicVoucherValidationSchema>;
374
+ //# sourceMappingURL=validation-public.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation-public.d.ts","sourceRoot":"","sources":["../src/validation-public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAYvB,eAAO,MAAM,8BAA8B;;;;EAAiD,CAAA;AAC5F,eAAO,MAAM,uCAAuC;;;;;;EAMlD,CAAA;AACF,eAAO,MAAM,iCAAiC;;;;;EAAyC,CAAA;AAEvF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;iBAM1C,CAAA;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkB1C,CAAA;AAEF,eAAO,MAAM,2BAA2B;;;;;;iBAMtC,CAAA;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;iBAWrC,CAAA;AAEF,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;iBAQ7C,CAAA;AAEF,eAAO,MAAM,4BAA4B;;;;;;;;;;;iBAWvC,CAAA;AAEF,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAW5C,CAAA;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0BrC,CAAA;AAEF,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmB7C,CAAA;AAEF,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAG9C,CAAA;AAEF,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;iBAyBxC,CAAA;AAEF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAA;AACvF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAA;AAC3F,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAC7E,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAA;AAC7F,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAA;AAC/F,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"}
@@ -0,0 +1,166 @@
1
+ import { z } from "zod";
2
+ import { paymentInstrumentStatusSchema, paymentInstrumentTypeSchema, paymentMethodSchema, paymentScheduleStatusSchema, paymentScheduleTypeSchema, paymentSessionStatusSchema, paymentSessionTargetTypeSchema, } from "./validation-shared.js";
3
+ export const publicFinanceInvoiceTypeSchema = z.enum(["invoice", "proforma", "credit_note"]);
4
+ export const publicFinanceDocumentAvailabilitySchema = z.enum([
5
+ "missing",
6
+ "pending",
7
+ "ready",
8
+ "failed",
9
+ "stale",
10
+ ]);
11
+ export const publicFinanceDocumentFormatSchema = z.enum(["html", "pdf", "xml", "json"]);
12
+ export const publicPaymentOptionsQuerySchema = z.object({
13
+ personId: z.string().optional(),
14
+ organizationId: z.string().optional(),
15
+ provider: z.string().optional(),
16
+ instrumentType: paymentInstrumentTypeSchema.optional(),
17
+ includeInactive: z.coerce.boolean().default(false),
18
+ });
19
+ export const publicStartPaymentSessionSchema = z.object({
20
+ provider: z.string().max(255).optional().nullable(),
21
+ paymentMethod: paymentMethodSchema.optional().nullable(),
22
+ paymentInstrumentId: z.string().optional().nullable(),
23
+ payerPersonId: z.string().optional().nullable(),
24
+ payerOrganizationId: z.string().optional().nullable(),
25
+ payerEmail: z.string().email().optional().nullable(),
26
+ payerName: z.string().max(255).optional().nullable(),
27
+ externalReference: z.string().max(255).optional().nullable(),
28
+ idempotencyKey: z.string().max(255).optional().nullable(),
29
+ clientReference: z.string().max(255).optional().nullable(),
30
+ returnUrl: z.string().url().optional().nullable(),
31
+ cancelUrl: z.string().url().optional().nullable(),
32
+ callbackUrl: z.string().url().optional().nullable(),
33
+ expiresAt: z.string().optional().nullable(),
34
+ notes: z.string().optional().nullable(),
35
+ providerPayload: z.record(z.string(), z.unknown()).optional().nullable(),
36
+ metadata: z.record(z.string(), z.unknown()).optional().nullable(),
37
+ });
38
+ export const publicValidateVoucherSchema = z.object({
39
+ code: z.string().min(1).max(255),
40
+ provider: z.string().max(255).optional().nullable(),
41
+ bookingId: z.string().optional().nullable(),
42
+ currency: z.string().min(3).max(3).optional().nullable(),
43
+ amountCents: z.number().int().min(1).optional().nullable(),
44
+ });
45
+ export const publicPaymentAccountSchema = z.object({
46
+ id: z.string(),
47
+ label: z.string(),
48
+ provider: z.string().nullable(),
49
+ instrumentType: paymentInstrumentTypeSchema,
50
+ status: paymentInstrumentStatusSchema,
51
+ brand: z.string().nullable(),
52
+ last4: z.string().nullable(),
53
+ expiryMonth: z.number().int().nullable(),
54
+ expiryYear: z.number().int().nullable(),
55
+ isDefault: z.boolean(),
56
+ });
57
+ export const publicBookingPaymentScheduleSchema = z.object({
58
+ id: z.string(),
59
+ scheduleType: paymentScheduleTypeSchema,
60
+ status: paymentScheduleStatusSchema,
61
+ dueDate: z.string(),
62
+ currency: z.string(),
63
+ amountCents: z.number().int(),
64
+ notes: z.string().nullable(),
65
+ });
66
+ export const publicBookingGuaranteeSchema = z.object({
67
+ id: z.string(),
68
+ bookingPaymentScheduleId: z.string().nullable(),
69
+ guaranteeType: z.string(),
70
+ status: z.string(),
71
+ currency: z.string().nullable(),
72
+ amountCents: z.number().int().nullable(),
73
+ provider: z.string().nullable(),
74
+ referenceNumber: z.string().nullable(),
75
+ expiresAt: z.string().nullable(),
76
+ notes: z.string().nullable(),
77
+ });
78
+ export const publicBookingPaymentOptionsSchema = z.object({
79
+ bookingId: z.string(),
80
+ accounts: z.array(publicPaymentAccountSchema),
81
+ schedules: z.array(publicBookingPaymentScheduleSchema),
82
+ guarantees: z.array(publicBookingGuaranteeSchema),
83
+ recommendedTarget: z
84
+ .object({
85
+ targetType: z.enum(["booking_payment_schedule", "booking_guarantee"]).nullable(),
86
+ targetId: z.string().nullable(),
87
+ })
88
+ .nullable(),
89
+ });
90
+ export const publicPaymentSessionSchema = z.object({
91
+ id: z.string(),
92
+ targetType: paymentSessionTargetTypeSchema,
93
+ targetId: z.string().nullable(),
94
+ bookingId: z.string().nullable(),
95
+ invoiceId: z.string().nullable(),
96
+ bookingPaymentScheduleId: z.string().nullable(),
97
+ bookingGuaranteeId: z.string().nullable(),
98
+ status: paymentSessionStatusSchema,
99
+ provider: z.string().nullable(),
100
+ providerSessionId: z.string().nullable(),
101
+ providerPaymentId: z.string().nullable(),
102
+ externalReference: z.string().nullable(),
103
+ clientReference: z.string().nullable(),
104
+ currency: z.string(),
105
+ amountCents: z.number().int(),
106
+ paymentMethod: paymentMethodSchema.nullable(),
107
+ payerEmail: z.string().nullable(),
108
+ payerName: z.string().nullable(),
109
+ redirectUrl: z.string().nullable(),
110
+ returnUrl: z.string().nullable(),
111
+ cancelUrl: z.string().nullable(),
112
+ expiresAt: z.string().nullable(),
113
+ completedAt: z.string().nullable(),
114
+ failureCode: z.string().nullable(),
115
+ failureMessage: z.string().nullable(),
116
+ });
117
+ export const publicFinanceBookingDocumentSchema = z.object({
118
+ invoiceId: z.string(),
119
+ invoiceNumber: z.string(),
120
+ invoiceType: publicFinanceInvoiceTypeSchema,
121
+ invoiceStatus: z.enum(["draft", "sent", "partially_paid", "paid", "overdue", "void"]),
122
+ currency: z.string(),
123
+ totalCents: z.number().int(),
124
+ paidCents: z.number().int(),
125
+ balanceDueCents: z.number().int(),
126
+ issueDate: z.string(),
127
+ dueDate: z.string(),
128
+ renditionId: z.string().nullable(),
129
+ documentStatus: publicFinanceDocumentAvailabilitySchema,
130
+ format: publicFinanceDocumentFormatSchema.nullable(),
131
+ language: z.string().nullable(),
132
+ generatedAt: z.string().nullable(),
133
+ fileSize: z.number().int().nullable(),
134
+ checksum: z.string().nullable(),
135
+ downloadUrl: z.string().nullable(),
136
+ });
137
+ export const publicBookingFinanceDocumentsSchema = z.object({
138
+ bookingId: z.string(),
139
+ documents: z.array(publicFinanceBookingDocumentSchema),
140
+ });
141
+ export const publicVoucherValidationSchema = z.object({
142
+ valid: z.boolean(),
143
+ reason: z
144
+ .enum([
145
+ "not_found",
146
+ "inactive",
147
+ "not_started",
148
+ "expired",
149
+ "booking_mismatch",
150
+ "currency_mismatch",
151
+ "insufficient_balance",
152
+ ])
153
+ .nullable(),
154
+ voucher: z
155
+ .object({
156
+ id: z.string(),
157
+ code: z.string(),
158
+ label: z.string(),
159
+ provider: z.string().nullable(),
160
+ currency: z.string().nullable(),
161
+ amountCents: z.number().int().nullable(),
162
+ remainingAmountCents: z.number().int().nullable(),
163
+ expiresAt: z.string().nullable(),
164
+ })
165
+ .nullable(),
166
+ });
@@ -8,31 +8,31 @@ export declare const invoiceStatusSchema: z.ZodEnum<{
8
8
  void: "void";
9
9
  }>;
10
10
  export declare const paymentMethodSchema: z.ZodEnum<{
11
+ other: "other";
12
+ voucher: "voucher";
13
+ wallet: "wallet";
11
14
  bank_transfer: "bank_transfer";
12
15
  credit_card: "credit_card";
13
16
  debit_card: "debit_card";
14
17
  cash: "cash";
15
18
  cheque: "cheque";
16
- wallet: "wallet";
17
19
  direct_bill: "direct_bill";
18
- voucher: "voucher";
19
- other: "other";
20
20
  }>;
21
21
  export declare const paymentStatusSchema: z.ZodEnum<{
22
- pending: "pending";
23
22
  completed: "completed";
23
+ pending: "pending";
24
24
  failed: "failed";
25
25
  refunded: "refunded";
26
26
  }>;
27
27
  export declare const paymentSessionStatusSchema: z.ZodEnum<{
28
- paid: "paid";
28
+ expired: "expired";
29
+ cancelled: "cancelled";
29
30
  pending: "pending";
30
31
  failed: "failed";
32
+ paid: "paid";
31
33
  requires_redirect: "requires_redirect";
32
34
  processing: "processing";
33
35
  authorized: "authorized";
34
- cancelled: "cancelled";
35
- expired: "expired";
36
36
  }>;
37
37
  export declare const paymentSessionTargetTypeSchema: z.ZodEnum<{
38
38
  other: "other";
@@ -43,13 +43,13 @@ export declare const paymentSessionTargetTypeSchema: z.ZodEnum<{
43
43
  booking_guarantee: "booking_guarantee";
44
44
  }>;
45
45
  export declare const paymentInstrumentTypeSchema: z.ZodEnum<{
46
+ other: "other";
47
+ voucher: "voucher";
48
+ wallet: "wallet";
46
49
  credit_card: "credit_card";
47
50
  debit_card: "debit_card";
48
51
  cash: "cash";
49
- wallet: "wallet";
50
52
  direct_bill: "direct_bill";
51
- voucher: "voucher";
52
- other: "other";
53
53
  bank_account: "bank_account";
54
54
  }>;
55
55
  export declare const paymentInstrumentOwnerTypeSchema: z.ZodEnum<{
@@ -62,30 +62,30 @@ export declare const paymentInstrumentOwnerTypeSchema: z.ZodEnum<{
62
62
  }>;
63
63
  export declare const paymentInstrumentStatusSchema: z.ZodEnum<{
64
64
  expired: "expired";
65
+ revoked: "revoked";
65
66
  active: "active";
66
67
  inactive: "inactive";
67
- revoked: "revoked";
68
68
  failed_verification: "failed_verification";
69
69
  }>;
70
70
  export declare const paymentAuthorizationStatusSchema: z.ZodEnum<{
71
+ expired: "expired";
71
72
  pending: "pending";
72
73
  failed: "failed";
73
74
  authorized: "authorized";
74
- expired: "expired";
75
75
  partially_captured: "partially_captured";
76
76
  captured: "captured";
77
77
  voided: "voided";
78
78
  }>;
79
79
  export declare const paymentCaptureStatusSchema: z.ZodEnum<{
80
- pending: "pending";
81
80
  completed: "completed";
81
+ pending: "pending";
82
82
  failed: "failed";
83
83
  refunded: "refunded";
84
84
  voided: "voided";
85
85
  }>;
86
86
  export declare const captureModeSchema: z.ZodEnum<{
87
- automatic: "automatic";
88
87
  manual: "manual";
88
+ automatic: "automatic";
89
89
  }>;
90
90
  export declare const creditNoteStatusSchema: z.ZodEnum<{
91
91
  draft: "draft";
@@ -100,30 +100,30 @@ export declare const paymentScheduleTypeSchema: z.ZodEnum<{
100
100
  hold: "hold";
101
101
  }>;
102
102
  export declare const paymentScheduleStatusSchema: z.ZodEnum<{
103
- paid: "paid";
104
- pending: "pending";
105
- cancelled: "cancelled";
106
103
  expired: "expired";
104
+ cancelled: "cancelled";
105
+ pending: "pending";
106
+ paid: "paid";
107
107
  due: "due";
108
108
  waived: "waived";
109
109
  }>;
110
110
  export declare const guaranteeTypeSchema: z.ZodEnum<{
111
+ other: "other";
112
+ voucher: "voucher";
111
113
  bank_transfer: "bank_transfer";
112
114
  credit_card: "credit_card";
113
- voucher: "voucher";
114
- other: "other";
115
115
  deposit: "deposit";
116
116
  preauth: "preauth";
117
117
  card_on_file: "card_on_file";
118
118
  agency_letter: "agency_letter";
119
119
  }>;
120
120
  export declare const guaranteeStatusSchema: z.ZodEnum<{
121
+ expired: "expired";
122
+ cancelled: "cancelled";
121
123
  pending: "pending";
124
+ released: "released";
122
125
  failed: "failed";
123
- cancelled: "cancelled";
124
- expired: "expired";
125
126
  active: "active";
126
- released: "released";
127
127
  }>;
128
128
  export declare const taxScopeSchema: z.ZodEnum<{
129
129
  included: "included";
@@ -134,9 +134,9 @@ export declare const commissionRecipientTypeSchema: z.ZodEnum<{
134
134
  internal: "internal";
135
135
  supplier: "supplier";
136
136
  other: "other";
137
+ affiliate: "affiliate";
137
138
  channel: "channel";
138
139
  agency: "agency";
139
- affiliate: "affiliate";
140
140
  agent: "agent";
141
141
  }>;
142
142
  export declare const commissionModelSchema: z.ZodEnum<{
@@ -146,9 +146,9 @@ export declare const commissionModelSchema: z.ZodEnum<{
146
146
  net: "net";
147
147
  }>;
148
148
  export declare const commissionStatusSchema: z.ZodEnum<{
149
+ pending: "pending";
149
150
  paid: "paid";
150
151
  void: "void";
151
- pending: "pending";
152
152
  accrued: "accrued";
153
153
  payable: "payable";
154
154
  }>;