archetecture security fix

This commit is contained in:
root
2026-06-11 03:22:12 -04:00
parent 6def9993da
commit 9483750161
3126 changed files with 177194 additions and 37211 deletions
+32
View File
@@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.paymentParamSchema = exports.reservationParamSchema = exports.capturePaypalSchema = exports.refundSchema = exports.manualPaymentSchema = exports.chargeSchema = void 0;
const zod_1 = require("zod");
exports.chargeSchema = zod_1.z.object({
provider: zod_1.z.enum(['AMANPAY', 'PAYPAL']),
type: zod_1.z.enum(['CHARGE', 'DEPOSIT']).default('CHARGE'),
currency: zod_1.z.literal('MAD').default('MAD'),
successUrl: zod_1.z.string().url(),
failureUrl: zod_1.z.string().url(),
});
exports.manualPaymentSchema = zod_1.z.object({
amount: zod_1.z.number().int().positive(),
currency: zod_1.z.literal('MAD').default('MAD'),
type: zod_1.z.enum(['CHARGE', 'DEPOSIT']).default('CHARGE'),
paymentMethod: zod_1.z.enum(['CASH', 'CHECK', 'BANK_TRANSFER', 'CARD', 'PAYPAL']),
});
exports.refundSchema = zod_1.z.object({
amount: zod_1.z.number().int().positive().optional(),
reason: zod_1.z.string().optional(),
});
exports.capturePaypalSchema = zod_1.z.object({
paypalOrderId: zod_1.z.string(),
});
exports.reservationParamSchema = zod_1.z.object({
id: zod_1.z.string().min(1),
});
exports.paymentParamSchema = zod_1.z.object({
reservationId: zod_1.z.string().min(1),
paymentId: zod_1.z.string().min(1),
});
//# sourceMappingURL=payment.schemas.js.map