UNPKG

chargebee

Version:

A library for integrating with Chargebee.

503 lines (502 loc) 24.1 kB
"use strict"; // Generated Zod schemas: CreditNote // Actions: create, retrieve, pdf, refund, recordRefund, voidCreditNote, list, creditNotesForCustomer, delete, removeTaxWithheldRefund, importCreditNote // Do not edit manually – regenerate via sdk-generator Object.defineProperty(exports, "__esModule", { value: true }); exports.ImportCreditNoteCreditNoteBodySchema = exports.RemoveTaxWithheldRefundCreditNoteBodySchema = exports.DeleteCreditNoteBodySchema = exports.CreditNotesForCustomerCreditNoteBodySchema = exports.ListCreditNoteBodySchema = exports.VoidCreditNoteCreditNoteBodySchema = exports.RecordRefundCreditNoteBodySchema = exports.RefundCreditNoteBodySchema = exports.PdfCreditNoteBodySchema = exports.RetrieveCreditNoteBodySchema = exports.CreateCreditNoteBodySchema = void 0; const zod_1 = require("zod"); //CreditNote.create const CreateCreditNoteLineItemsSchema = zod_1.z.object({ reference_line_item_id: zod_1.z.array(zod_1.z.string().max(40).optional()).optional(), unit_amount: zod_1.z.array(zod_1.z.number().int().optional()).optional(), unit_amount_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(), quantity: zod_1.z.array(zod_1.z.number().int().optional()).optional(), quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(), amount: zod_1.z.array(zod_1.z.number().int().optional()).optional(), date_from: zod_1.z.array(zod_1.z.number().int().optional()).optional(), date_to: zod_1.z.array(zod_1.z.number().int().optional()).optional(), description: zod_1.z.array(zod_1.z.string().max(250).optional()).optional(), entity_type: zod_1.z .array(zod_1.z .enum([ 'adhoc', 'plan_item_price', 'addon_item_price', 'charge_item_price', 'plan', 'addon', ]) .optional()) .optional(), entity_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(), }); const CreateCreditNoteBodySchema = zod_1.z.looseObject({ reference_invoice_id: zod_1.z.string().max(50).optional(), customer_id: zod_1.z.string().max(50).optional(), total: zod_1.z.number().int().min(0).optional(), type: zod_1.z.enum(['adjustment', 'refundable', 'store']), reason_code: zod_1.z .enum([ 'product_unsatisfactory', 'service_unsatisfactory', 'order_change', 'order_cancellation', 'waiver', 'other', ]) .optional(), create_reason_code: zod_1.z.string().max(100).optional(), date: zod_1.z.number().int().optional(), customer_notes: zod_1.z.string().max(2000).optional(), currency_code: zod_1.z.string().max(3).optional(), comment: zod_1.z.string().max(300).optional(), line_items: CreateCreditNoteLineItemsSchema.optional(), }); exports.CreateCreditNoteBodySchema = CreateCreditNoteBodySchema; //CreditNote.retrieve const RetrieveCreditNoteSubscriptionIdSchema = zod_1.z.object({ is: zod_1.z.string().min(1).optional(), }); const RetrieveCreditNoteCustomerIdSchema = zod_1.z.object({ is: zod_1.z.string().min(1).optional(), }); const RetrieveCreditNoteLineItemSchema = zod_1.z.object({ subscription_id: RetrieveCreditNoteSubscriptionIdSchema.optional(), customer_id: RetrieveCreditNoteCustomerIdSchema.optional(), }); const RetrieveCreditNoteBodySchema = zod_1.z.looseObject({ line_items_limit: zod_1.z.number().int().min(1).max(300).optional(), line_items_offset: zod_1.z.string().max(1000).optional(), line_item: RetrieveCreditNoteLineItemSchema.optional(), }); exports.RetrieveCreditNoteBodySchema = RetrieveCreditNoteBodySchema; //CreditNote.pdf const PdfCreditNoteBodySchema = zod_1.z.looseObject({ disposition_type: zod_1.z.enum(['attachment', 'inline']).optional(), }); exports.PdfCreditNoteBodySchema = PdfCreditNoteBodySchema; //CreditNote.refund const RefundCreditNoteBodySchema = zod_1.z.looseObject({ refund_amount: zod_1.z.number().int().min(1).optional(), customer_notes: zod_1.z.string().max(2000).optional(), refund_reason_code: zod_1.z.string().max(100).optional(), }); exports.RefundCreditNoteBodySchema = RefundCreditNoteBodySchema; //CreditNote.recordRefund const RecordRefundCreditNoteTransactionSchema = zod_1.z.object({ id: zod_1.z.string().max(40).optional(), amount: zod_1.z.number().int().min(0).optional(), payment_method: zod_1.z.enum([ 'cash', 'check', 'chargeback', 'bank_transfer', 'other', 'app_store', 'play_store', 'custom', ]), reference_number: zod_1.z.string().max(100).optional(), custom_payment_method_id: zod_1.z.string().max(50).optional(), date: zod_1.z.number().int(), }); const RecordRefundCreditNoteBodySchema = zod_1.z.looseObject({ refund_reason_code: zod_1.z.string().max(100).optional(), comment: zod_1.z.string().max(300).optional(), transaction: RecordRefundCreditNoteTransactionSchema.optional(), }); exports.RecordRefundCreditNoteBodySchema = RecordRefundCreditNoteBodySchema; //CreditNote.voidCreditNote const VoidCreditNoteCreditNoteBodySchema = zod_1.z.looseObject({ comment: zod_1.z.string().max(300).optional(), }); exports.VoidCreditNoteCreditNoteBodySchema = VoidCreditNoteCreditNoteBodySchema; //CreditNote.list const ListCreditNoteIdSchema = zod_1.z.object({ is: zod_1.z.string().min(1).optional(), is_not: zod_1.z.string().min(1).optional(), starts_with: zod_1.z.string().min(1).optional(), in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), not_in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), }); const ListCreditNoteCustomerIdSchema = zod_1.z.object({ is: zod_1.z.string().min(1).optional(), is_not: zod_1.z.string().min(1).optional(), starts_with: zod_1.z.string().min(1).optional(), in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), not_in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), }); const ListCreditNoteSubscriptionIdSchema = zod_1.z.object({ is: zod_1.z.string().min(1).optional(), is_not: zod_1.z.string().min(1).optional(), starts_with: zod_1.z.string().min(1).optional(), is_present: zod_1.z.enum(['true', 'false']).optional(), in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), not_in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), }); const ListCreditNoteReferenceInvoiceIdSchema = zod_1.z.object({ is: zod_1.z.string().min(1).optional(), is_not: zod_1.z.string().min(1).optional(), starts_with: zod_1.z.string().min(1).optional(), is_present: zod_1.z.enum(['true', 'false']).optional(), in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), not_in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), }); const ListCreditNoteTypeSchema = zod_1.z.object({ is: zod_1.z.enum(['adjustment', 'refundable', 'store']).optional(), is_not: zod_1.z.enum(['adjustment', 'refundable', 'store']).optional(), in: zod_1.z.enum(['adjustment', 'refundable', 'store']).optional(), not_in: zod_1.z.enum(['adjustment', 'refundable', 'store']).optional(), }); const ListCreditNoteReasonCodeSchema = zod_1.z.object({ is: zod_1.z .enum([ 'write_off', 'subscription_change', 'subscription_cancellation', 'subscription_pause', 'chargeback', 'product_unsatisfactory', 'service_unsatisfactory', 'order_change', 'order_cancellation', 'waiver', 'other', 'fraudulent', ]) .optional(), is_not: zod_1.z .enum([ 'write_off', 'subscription_change', 'subscription_cancellation', 'subscription_pause', 'chargeback', 'product_unsatisfactory', 'service_unsatisfactory', 'order_change', 'order_cancellation', 'waiver', 'other', 'fraudulent', ]) .optional(), in: zod_1.z .enum([ 'write_off', 'subscription_change', 'subscription_cancellation', 'subscription_pause', 'chargeback', 'product_unsatisfactory', 'service_unsatisfactory', 'order_change', 'order_cancellation', 'waiver', 'other', 'fraudulent', ]) .optional(), not_in: zod_1.z .enum([ 'write_off', 'subscription_change', 'subscription_cancellation', 'subscription_pause', 'chargeback', 'product_unsatisfactory', 'service_unsatisfactory', 'order_change', 'order_cancellation', 'waiver', 'other', 'fraudulent', ]) .optional(), }); const ListCreditNoteCreateReasonCodeSchema = zod_1.z.object({ is: zod_1.z.string().min(1).optional(), is_not: zod_1.z.string().min(1).optional(), starts_with: zod_1.z.string().min(1).optional(), in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), not_in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), }); const ListCreditNoteStatusSchema = zod_1.z.object({ is: zod_1.z.enum(['adjusted', 'refunded', 'refund_due', 'voided']).optional(), is_not: zod_1.z.enum(['adjusted', 'refunded', 'refund_due', 'voided']).optional(), in: zod_1.z.enum(['adjusted', 'refunded', 'refund_due', 'voided']).optional(), not_in: zod_1.z.enum(['adjusted', 'refunded', 'refund_due', 'voided']).optional(), }); const ListCreditNoteDateSchema = zod_1.z.object({ after: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(), before: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(), on: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(), between: zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(), }); const ListCreditNoteTotalSchema = zod_1.z.object({ is: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(), is_not: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(), lt: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(), lte: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(), gt: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(), gte: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(), between: zod_1.z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')).optional(), }); const ListCreditNotePriceTypeSchema = zod_1.z.object({ is: zod_1.z.enum(['tax_exclusive', 'tax_inclusive']).optional(), is_not: zod_1.z.enum(['tax_exclusive', 'tax_inclusive']).optional(), in: zod_1.z.enum(['tax_exclusive', 'tax_inclusive']).optional(), not_in: zod_1.z.enum(['tax_exclusive', 'tax_inclusive']).optional(), }); const ListCreditNoteAmountAllocatedSchema = zod_1.z.object({ is: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(), is_not: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(), lt: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(), lte: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(), gt: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(), gte: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(), between: zod_1.z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')).optional(), }); const ListCreditNoteAmountRefundedSchema = zod_1.z.object({ is: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(), is_not: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(), lt: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(), lte: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(), gt: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(), gte: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(), between: zod_1.z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')).optional(), }); const ListCreditNoteAmountAvailableSchema = zod_1.z.object({ is: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(), is_not: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(), lt: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(), lte: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(), gt: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(), gte: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(), between: zod_1.z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')).optional(), }); const ListCreditNoteVoidedAtSchema = zod_1.z.object({ after: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(), before: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(), on: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(), between: zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(), }); const ListCreditNoteUpdatedAtSchema = zod_1.z.object({ after: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(), before: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(), on: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(), between: zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(), }); const ListCreditNoteSortBySchema = zod_1.z.looseObject({ asc: zod_1.z.enum(['date']).optional(), desc: zod_1.z.enum(['date']).optional(), }); const ListCreditNoteChannelSchema = zod_1.z.object({ is: zod_1.z.enum(['web', 'app_store', 'play_store']).optional(), is_not: zod_1.z.enum(['web', 'app_store', 'play_store']).optional(), in: zod_1.z.enum(['web', 'app_store', 'play_store']).optional(), not_in: zod_1.z.enum(['web', 'app_store', 'play_store']).optional(), }); const ListCreditNoteEinvoiceSchema = zod_1.z.object({ status: ListCreditNoteStatusSchema.optional(), }); const ListCreditNoteBodySchema = zod_1.z.looseObject({ limit: zod_1.z.number().int().min(1).max(100).optional(), offset: zod_1.z.string().max(1000).optional(), include_deleted: zod_1.z.boolean().default(false).optional(), id: ListCreditNoteIdSchema.optional(), customer_id: ListCreditNoteCustomerIdSchema.optional(), subscription_id: ListCreditNoteSubscriptionIdSchema.optional(), reference_invoice_id: ListCreditNoteReferenceInvoiceIdSchema.optional(), type: ListCreditNoteTypeSchema.optional(), reason_code: ListCreditNoteReasonCodeSchema.optional(), create_reason_code: ListCreditNoteCreateReasonCodeSchema.optional(), status: ListCreditNoteStatusSchema.optional(), date: ListCreditNoteDateSchema.optional(), total: ListCreditNoteTotalSchema.optional(), price_type: ListCreditNotePriceTypeSchema.optional(), amount_allocated: ListCreditNoteAmountAllocatedSchema.optional(), amount_refunded: ListCreditNoteAmountRefundedSchema.optional(), amount_available: ListCreditNoteAmountAvailableSchema.optional(), voided_at: ListCreditNoteVoidedAtSchema.optional(), updated_at: ListCreditNoteUpdatedAtSchema.optional(), sort_by: ListCreditNoteSortBySchema.optional(), channel: ListCreditNoteChannelSchema.optional(), einvoice: ListCreditNoteEinvoiceSchema.optional(), }); exports.ListCreditNoteBodySchema = ListCreditNoteBodySchema; //CreditNote.creditNotesForCustomer const CreditNotesForCustomerCreditNoteBodySchema = zod_1.z.looseObject({ limit: zod_1.z.number().int().min(1).max(100).optional(), offset: zod_1.z.string().max(1000).optional(), }); exports.CreditNotesForCustomerCreditNoteBodySchema = CreditNotesForCustomerCreditNoteBodySchema; //CreditNote.delete const DeleteCreditNoteBodySchema = zod_1.z.looseObject({ comment: zod_1.z.string().max(300).optional(), }); exports.DeleteCreditNoteBodySchema = DeleteCreditNoteBodySchema; //CreditNote.removeTaxWithheldRefund const RemoveTaxWithheldRefundCreditNoteTaxWithheldSchema = zod_1.z.object({ id: zod_1.z.string().max(40), }); const RemoveTaxWithheldRefundCreditNoteBodySchema = zod_1.z.looseObject({ tax_withheld: RemoveTaxWithheldRefundCreditNoteTaxWithheldSchema.optional(), }); exports.RemoveTaxWithheldRefundCreditNoteBodySchema = RemoveTaxWithheldRefundCreditNoteBodySchema; //CreditNote.importCreditNote const ImportCreditNoteCreditNoteLineItemsSchema = zod_1.z.object({ reference_line_item_id: zod_1.z.array(zod_1.z.string().max(40).optional()).optional(), id: zod_1.z.array(zod_1.z.string().max(40).optional()).optional(), date_from: zod_1.z.array(zod_1.z.number().int().optional()).optional(), date_to: zod_1.z.array(zod_1.z.number().int().optional()).optional(), subscription_id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(), description: zod_1.z.array(zod_1.z.string().max(250).optional()), unit_amount: zod_1.z.array(zod_1.z.number().int().optional()).optional(), quantity: zod_1.z.array(zod_1.z.number().int().optional()).optional(), amount: zod_1.z.array(zod_1.z.number().int().optional()).optional(), unit_amount_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(), quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(), amount_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(), entity_type: zod_1.z .array(zod_1.z .enum([ 'adhoc', 'plan_item_price', 'addon_item_price', 'charge_item_price', 'plan_setup', 'plan', 'addon', ]) .optional()) .optional(), entity_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(), item_level_discount1_entity_id: zod_1.z .array(zod_1.z.string().max(100).optional()) .optional(), item_level_discount1_amount: zod_1.z .array(zod_1.z.number().int().min(0).optional()) .optional(), item_level_discount2_entity_id: zod_1.z .array(zod_1.z.string().max(100).optional()) .optional(), item_level_discount2_amount: zod_1.z .array(zod_1.z.number().int().min(0).optional()) .optional(), tax1_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(), tax1_amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(), tax2_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(), tax2_amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(), tax3_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(), tax3_amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(), tax4_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(), tax4_amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(), tax5_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(), tax5_amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(), tax6_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(), tax6_amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(), tax7_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(), tax7_amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(), tax8_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(), tax8_amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(), tax9_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(), tax9_amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(), tax10_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(), tax10_amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(), }); const ImportCreditNoteCreditNoteLineItemTiersSchema = zod_1.z.object({ line_item_id: zod_1.z.array(zod_1.z.string().max(40).optional()), starting_unit: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(), ending_unit: zod_1.z.array(zod_1.z.number().int().optional()).optional(), quantity_used: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(), unit_amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(), starting_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(), ending_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(), quantity_used_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(), unit_amount_in_decimal: zod_1.z.array(zod_1.z.string().max(40).optional()).optional(), }); const ImportCreditNoteCreditNoteDiscountsSchema = zod_1.z.object({ line_item_id: zod_1.z.array(zod_1.z.string().max(40).optional()).optional(), entity_type: zod_1.z.array(zod_1.z .enum([ 'item_level_coupon', 'document_level_coupon', 'promotional_credits', 'item_level_discount', 'document_level_discount', ]) .optional()), entity_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(), description: zod_1.z.array(zod_1.z.string().max(250).optional()).optional(), amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()), }); const ImportCreditNoteCreditNoteTaxesSchema = zod_1.z.object({ name: zod_1.z.array(zod_1.z.string().max(100).optional()), rate: zod_1.z.array(zod_1.z.number().min(0).max(100).optional()), amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(), description: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(), juris_type: zod_1.z .array(zod_1.z .enum([ 'country', 'federal', 'state', 'county', 'city', 'special', 'unincorporated', 'other', ]) .optional()) .optional(), juris_name: zod_1.z.array(zod_1.z.string().max(250).optional()).optional(), juris_code: zod_1.z.array(zod_1.z.string().max(250).optional()).optional(), }); const ImportCreditNoteCreditNoteAllocationsSchema = zod_1.z.object({ invoice_id: zod_1.z.array(zod_1.z.string().max(50).optional()), allocated_amount: zod_1.z.array(zod_1.z.number().int().min(1).optional()), allocated_at: zod_1.z.array(zod_1.z.number().int().optional()), }); const ImportCreditNoteCreditNoteLinkedRefundsSchema = zod_1.z.object({ id: zod_1.z.array(zod_1.z.string().max(40).optional()).optional(), amount: zod_1.z.array(zod_1.z.number().int().min(1).optional()), payment_method: zod_1.z.array(zod_1.z .enum([ 'cash', 'check', 'bank_transfer', 'other', 'app_store', 'play_store', 'custom', ]) .optional()), date: zod_1.z.array(zod_1.z.number().int().optional()), reference_number: zod_1.z.array(zod_1.z.string().max(100).min(1).optional()).optional(), }); const ImportCreditNoteCreditNoteBodySchema = zod_1.z.looseObject({ id: zod_1.z.string().max(50), customer_id: zod_1.z.string().max(50).optional(), subscription_id: zod_1.z.string().max(50).optional(), reference_invoice_id: zod_1.z.string().max(50), type: zod_1.z.enum(['adjustment', 'refundable', 'store']), currency_code: zod_1.z.string().max(3).optional(), create_reason_code: zod_1.z.string().max(100), date: zod_1.z.number().int(), status: zod_1.z.enum(['adjusted', 'refunded', 'refund_due', 'voided']).optional(), total: zod_1.z.number().int().min(0).optional(), refunded_at: zod_1.z.number().int().optional(), voided_at: zod_1.z.number().int().optional(), sub_total: zod_1.z.number().int().min(0).optional(), round_off_amount: zod_1.z.number().int().min(-99).max(99).optional(), fractional_correction: zod_1.z.number().int().min(-50000).max(50000).optional(), vat_number_prefix: zod_1.z.string().max(10).optional(), line_items: ImportCreditNoteCreditNoteLineItemsSchema.optional(), line_item_tiers: ImportCreditNoteCreditNoteLineItemTiersSchema.optional(), discounts: ImportCreditNoteCreditNoteDiscountsSchema.optional(), taxes: ImportCreditNoteCreditNoteTaxesSchema.optional(), allocations: ImportCreditNoteCreditNoteAllocationsSchema.optional(), linked_refunds: ImportCreditNoteCreditNoteLinkedRefundsSchema.optional(), }); exports.ImportCreditNoteCreditNoteBodySchema = ImportCreditNoteCreditNoteBodySchema;