hububb-models 1.0.82 → 1.0.84
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.
@@ -1,5 +1,7 @@
|
|
1
1
|
import { infer, z } from "zod";
|
2
|
-
import { ReservationSchema, reservationCreateSchema } from "../schemas/reservation";
|
2
|
+
import { ReservationSchema, paymentCreateSchema, reservationCreateSchema } from "../schemas/reservation";
|
3
3
|
export type Reservation = z.infer<typeof ReservationSchema>;
|
4
4
|
export interface ReservationCreateSchema extends infer<typeof reservationCreateSchema> {
|
5
5
|
}
|
6
|
+
export interface PaymentCreateSchema extends infer<typeof paymentCreateSchema> {
|
7
|
+
}
|
@@ -273,3 +273,133 @@ export declare const reservationCreateSchema: import("zod").ZodObject<{
|
|
273
273
|
};
|
274
274
|
transactionReference: string;
|
275
275
|
}>;
|
276
|
+
export declare const paymentCreateSchema: import("zod").ZodObject<{
|
277
|
+
paymentData: import("zod").ZodObject<{
|
278
|
+
paymentMethod: import("zod").ZodObject<{
|
279
|
+
encryptedCardNumber: import("zod").ZodString;
|
280
|
+
encryptedExpiryMonth: import("zod").ZodString;
|
281
|
+
encryptedExpiryYear: import("zod").ZodString;
|
282
|
+
encryptedSecurityCode: import("zod").ZodString;
|
283
|
+
}, "strip", import("zod").ZodTypeAny, {
|
284
|
+
encryptedCardNumber: string;
|
285
|
+
encryptedExpiryMonth: string;
|
286
|
+
encryptedExpiryYear: string;
|
287
|
+
encryptedSecurityCode: string;
|
288
|
+
}, {
|
289
|
+
encryptedCardNumber: string;
|
290
|
+
encryptedExpiryMonth: string;
|
291
|
+
encryptedExpiryYear: string;
|
292
|
+
encryptedSecurityCode: string;
|
293
|
+
}>;
|
294
|
+
riskData: import("zod").ZodString;
|
295
|
+
}, "strip", import("zod").ZodTypeAny, {
|
296
|
+
paymentMethod: {
|
297
|
+
encryptedCardNumber: string;
|
298
|
+
encryptedExpiryMonth: string;
|
299
|
+
encryptedExpiryYear: string;
|
300
|
+
encryptedSecurityCode: string;
|
301
|
+
};
|
302
|
+
riskData: string;
|
303
|
+
}, {
|
304
|
+
paymentMethod: {
|
305
|
+
encryptedCardNumber: string;
|
306
|
+
encryptedExpiryMonth: string;
|
307
|
+
encryptedExpiryYear: string;
|
308
|
+
encryptedSecurityCode: string;
|
309
|
+
};
|
310
|
+
riskData: string;
|
311
|
+
}>;
|
312
|
+
booker: import("zod").ZodObject<{
|
313
|
+
firstName: import("zod").ZodString;
|
314
|
+
lastName: import("zod").ZodString;
|
315
|
+
email: import("zod").ZodString;
|
316
|
+
phone: import("zod").ZodString;
|
317
|
+
}, "strip", import("zod").ZodTypeAny, {
|
318
|
+
email: string;
|
319
|
+
firstName: string;
|
320
|
+
lastName: string;
|
321
|
+
phone: string;
|
322
|
+
}, {
|
323
|
+
email: string;
|
324
|
+
firstName: string;
|
325
|
+
lastName: string;
|
326
|
+
phone: string;
|
327
|
+
}>;
|
328
|
+
reservation: import("zod").ZodObject<Pick<{
|
329
|
+
arrival: import("zod").ZodString;
|
330
|
+
departure: import("zod").ZodString;
|
331
|
+
adults: import("zod").ZodNumber;
|
332
|
+
channelCode: import("zod").ZodLiteral<"Direct">;
|
333
|
+
guarenteeType: import("zod").ZodLiteral<"Prepayment">;
|
334
|
+
timeSlices: import("zod").ZodArray<import("zod").ZodObject<{
|
335
|
+
ratePlanId: import("zod").ZodString;
|
336
|
+
}, "strip", import("zod").ZodTypeAny, {
|
337
|
+
ratePlanId: string;
|
338
|
+
}, {
|
339
|
+
ratePlanId: string;
|
340
|
+
}>, "atleastone">;
|
341
|
+
prePaymentAmount: import("zod").ZodObject<{
|
342
|
+
amount: import("zod").ZodNumber;
|
343
|
+
currency: import("zod").ZodString;
|
344
|
+
}, "strip", import("zod").ZodTypeAny, {
|
345
|
+
currency: string;
|
346
|
+
amount: number;
|
347
|
+
}, {
|
348
|
+
currency: string;
|
349
|
+
amount: number;
|
350
|
+
}>;
|
351
|
+
}, "adults" | "arrival" | "departure">, "strip", import("zod").ZodTypeAny, {
|
352
|
+
adults: number;
|
353
|
+
arrival: string;
|
354
|
+
departure: string;
|
355
|
+
}, {
|
356
|
+
adults: number;
|
357
|
+
arrival: string;
|
358
|
+
departure: string;
|
359
|
+
}>;
|
360
|
+
amount: import("zod").ZodNumber;
|
361
|
+
}, "strip", import("zod").ZodTypeAny, {
|
362
|
+
amount: number;
|
363
|
+
booker: {
|
364
|
+
email: string;
|
365
|
+
firstName: string;
|
366
|
+
lastName: string;
|
367
|
+
phone: string;
|
368
|
+
};
|
369
|
+
reservation: {
|
370
|
+
adults: number;
|
371
|
+
arrival: string;
|
372
|
+
departure: string;
|
373
|
+
};
|
374
|
+
paymentData: {
|
375
|
+
paymentMethod: {
|
376
|
+
encryptedCardNumber: string;
|
377
|
+
encryptedExpiryMonth: string;
|
378
|
+
encryptedExpiryYear: string;
|
379
|
+
encryptedSecurityCode: string;
|
380
|
+
};
|
381
|
+
riskData: string;
|
382
|
+
};
|
383
|
+
}, {
|
384
|
+
amount: number;
|
385
|
+
booker: {
|
386
|
+
email: string;
|
387
|
+
firstName: string;
|
388
|
+
lastName: string;
|
389
|
+
phone: string;
|
390
|
+
};
|
391
|
+
reservation: {
|
392
|
+
adults: number;
|
393
|
+
arrival: string;
|
394
|
+
departure: string;
|
395
|
+
};
|
396
|
+
paymentData: {
|
397
|
+
paymentMethod: {
|
398
|
+
encryptedCardNumber: string;
|
399
|
+
encryptedExpiryMonth: string;
|
400
|
+
encryptedExpiryYear: string;
|
401
|
+
encryptedSecurityCode: string;
|
402
|
+
};
|
403
|
+
riskData: string;
|
404
|
+
};
|
405
|
+
}>;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.reservationCreateSchema = exports.ReservationSchema = void 0;
|
3
|
+
exports.paymentCreateSchema = exports.reservationCreateSchema = exports.ReservationSchema = void 0;
|
4
4
|
const zod_1 = require("zod");
|
5
5
|
const helpers_1 = require("../helpers");
|
6
6
|
const GuestSchema = (0, zod_1.object)({
|
@@ -76,3 +76,22 @@ exports.reservationCreateSchema = (0, zod_1.object)({
|
|
76
76
|
transactionReference: (0, zod_1.string)().min(1, "Transaction reference is required"),
|
77
77
|
amount: (0, zod_1.number)().positive("Amount must be a positive number"),
|
78
78
|
});
|
79
|
+
const paymentMethodSchema = (0, zod_1.object)({
|
80
|
+
encryptedCardNumber: (0, zod_1.string)().min(1, "Card number is required"),
|
81
|
+
encryptedExpiryMonth: (0, zod_1.string)().min(1, "Expiry month is required"),
|
82
|
+
encryptedExpiryYear: (0, zod_1.string)().min(1, "Expiry year is required"),
|
83
|
+
encryptedSecurityCode: (0, zod_1.string)().min(1, "Security code is required"),
|
84
|
+
});
|
85
|
+
exports.paymentCreateSchema = (0, zod_1.object)({
|
86
|
+
paymentData: (0, zod_1.object)({
|
87
|
+
paymentMethod: paymentMethodSchema,
|
88
|
+
riskData: (0, zod_1.string)().min(1, "Risk data is required"),
|
89
|
+
}),
|
90
|
+
booker: bookerSchema,
|
91
|
+
reservation: reservationSchema.pick({
|
92
|
+
arrival: true,
|
93
|
+
departure: true,
|
94
|
+
adults: true,
|
95
|
+
}),
|
96
|
+
amount: (0, zod_1.number)().positive("Amount must be a positive number"),
|
97
|
+
});
|