Files
alrahma_sunday_school_api/apps/api/dist/modules/payments/payment.schemas.js
T
2026-06-11 03:22:12 -04:00

32 lines
1.3 KiB
JavaScript

"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