FactuGES_ERP/modules/customer-invoices/src/common/dto/response/create-customer-invoice.response.dto.ts

56 lines
1.2 KiB
TypeScript
Raw Normal View History

2025-09-12 16:23:36 +00:00
import {
AmountSchema,
MetadataSchema,
MoneySchema,
PercentageSchema,
QuantitySchema,
} from "@erp/core";
2025-09-24 17:30:35 +00:00
import { z } from "zod/v4";
2025-09-04 17:57:04 +00:00
export const CreateCustomerInvoiceResponseSchema = z.object({
id: z.uuid(),
company_id: z.uuid(),
invoice_number: z.string(),
status: z.string(),
series: z.string(),
invoice_date: z.string(),
operation_date: z.string(),
notes: z.string(),
language_code: z.string(),
currency_code: z.string(),
2025-09-12 16:23:36 +00:00
subtotal_amount: MoneySchema,
2025-09-04 17:57:04 +00:00
discount_percentage: PercentageSchema,
2025-09-12 16:23:36 +00:00
discount_amount: MoneySchema,
taxable_amount: MoneySchema,
taxes_amount: MoneySchema,
total_amount: MoneySchema,
2025-09-04 17:57:04 +00:00
items: z.array(
z.object({
id: z.uuid(),
position: z.string(),
description: z.string(),
quantity: QuantitySchema,
unit_amount: AmountSchema,
2025-09-12 16:23:36 +00:00
taxes: z.string(),
subtotal_amount: MoneySchema,
2025-09-04 17:57:04 +00:00
discount_percentage: PercentageSchema,
2025-09-12 16:23:36 +00:00
discount_amount: MoneySchema,
taxable_amount: MoneySchema,
taxes_amount: MoneySchema,
total_amount: MoneySchema,
2025-09-04 17:57:04 +00:00
})
),
metadata: MetadataSchema.optional(),
});
export type CreateCustomerInvoiceResponseDTO = z.infer<typeof CreateCustomerInvoiceResponseSchema>;