chargebee
Version:
A library for integrating with Chargebee.
58 lines (57 loc) • 3.38 kB
JavaScript
"use strict";
// Generated Zod schemas: PaymentVoucher
// Actions: create, payment_vouchersForInvoice, payment_vouchersForCustomer
// Do not edit manually – regenerate via sdk-generator
Object.defineProperty(exports, "__esModule", { value: true });
exports.PaymentVouchersforcustomerPaymentVoucherBodySchema = exports.PaymentVouchersforinvoicePaymentVoucherBodySchema = exports.CreatePaymentVoucherBodySchema = void 0;
const zod_1 = require("zod");
//PaymentVoucher.create
const CreatePaymentVoucherVoucherPaymentSourceSchema = zod_1.z.object({
voucher_type: zod_1.z.enum(['boleto']),
});
const CreatePaymentVoucherInvoiceAllocationsSchema = zod_1.z.object({
invoice_id: zod_1.z.array(zod_1.z.string().max(50).optional()),
});
const CreatePaymentVoucherBodySchema = zod_1.z.looseObject({
customer_id: zod_1.z.string().max(50),
payment_source_id: zod_1.z.string().max(40).optional(),
voucher_payment_source: CreatePaymentVoucherVoucherPaymentSourceSchema.optional(),
invoice_allocations: CreatePaymentVoucherInvoiceAllocationsSchema.optional(),
});
exports.CreatePaymentVoucherBodySchema = CreatePaymentVoucherBodySchema;
//PaymentVoucher.payment_vouchersForInvoice
const PaymentVouchersforinvoicePaymentVoucherStatusSchema = zod_1.z.object({
is: zod_1.z.enum(['active', 'consumed', 'expired', 'failure']).optional(),
is_not: zod_1.z.enum(['active', 'consumed', 'expired', 'failure']).optional(),
in: zod_1.z.enum(['active', 'consumed', 'expired', 'failure']).optional(),
not_in: zod_1.z.enum(['active', 'consumed', 'expired', 'failure']).optional(),
});
const PaymentVouchersforinvoicePaymentVoucherSortBySchema = zod_1.z.looseObject({
asc: zod_1.z.enum(['date', 'updated_at']).optional(),
desc: zod_1.z.enum(['date', 'updated_at']).optional(),
});
const PaymentVouchersforinvoicePaymentVoucherBodySchema = zod_1.z.looseObject({
limit: zod_1.z.number().int().min(1).max(100).optional(),
offset: zod_1.z.string().max(1000).optional(),
status: PaymentVouchersforinvoicePaymentVoucherStatusSchema.optional(),
sort_by: PaymentVouchersforinvoicePaymentVoucherSortBySchema.optional(),
});
exports.PaymentVouchersforinvoicePaymentVoucherBodySchema = PaymentVouchersforinvoicePaymentVoucherBodySchema;
//PaymentVoucher.payment_vouchersForCustomer
const PaymentVouchersforcustomerPaymentVoucherStatusSchema = zod_1.z.object({
is: zod_1.z.enum(['active', 'consumed', 'expired', 'failure']).optional(),
is_not: zod_1.z.enum(['active', 'consumed', 'expired', 'failure']).optional(),
in: zod_1.z.enum(['active', 'consumed', 'expired', 'failure']).optional(),
not_in: zod_1.z.enum(['active', 'consumed', 'expired', 'failure']).optional(),
});
const PaymentVouchersforcustomerPaymentVoucherSortBySchema = zod_1.z.looseObject({
asc: zod_1.z.enum(['date', 'updated_at']).optional(),
desc: zod_1.z.enum(['date', 'updated_at']).optional(),
});
const PaymentVouchersforcustomerPaymentVoucherBodySchema = zod_1.z.looseObject({
limit: zod_1.z.number().int().min(1).max(100).optional(),
offset: zod_1.z.string().max(1000).optional(),
status: PaymentVouchersforcustomerPaymentVoucherStatusSchema.optional(),
sort_by: PaymentVouchersforcustomerPaymentVoucherSortBySchema.optional(),
});
exports.PaymentVouchersforcustomerPaymentVoucherBodySchema = PaymentVouchersforcustomerPaymentVoucherBodySchema;