Uecko_ERP/modules/customer-invoices/src/common/dto/response/get-customer-invoice-by-id.response.dto.ts

45 lines
1.0 KiB
TypeScript
Raw Normal View History

2025-09-03 18:04:09 +00:00
import { AmountSchema, MetadataSchema, PercentageSchema, QuantitySchema } from "@erp/core";
2025-06-26 11:32:55 +00:00
import * as z from "zod/v4";
2025-08-12 11:23:50 +00:00
export const GetCustomerInvoiceByIdResponseSchema = z.object({
2025-06-26 11:32:55 +00:00
id: z.uuid(),
2025-09-03 18:04:09 +00:00
company_id: z.uuid(),
2025-06-26 11:32:55 +00:00
invoice_number: z.string(),
2025-09-03 18:04:09 +00:00
status: z.string(),
series: z.string(),
issue_date: z.string(),
operation_date: z.string(),
notes: z.string(),
2025-06-26 11:32:55 +00:00
language_code: z.string(),
2025-09-03 18:04:09 +00:00
currency_code: z.string(),
2025-09-04 10:02:24 +00:00
subtotal_amount: AmountSchema,
discount_percentage: PercentageSchema,
discount_amount: AmountSchema,
taxable_amount: AmountSchema,
tax_amount: AmountSchema,
total_amount: AmountSchema,
2025-09-03 18:04:09 +00:00
items: z.array(
z.object({
2025-09-04 10:02:24 +00:00
id: z.uuid(),
2025-09-03 18:04:09 +00:00
position: z.string(),
description: z.string(),
quantity: QuantitySchema,
2025-09-04 10:02:24 +00:00
unit_amount: AmountSchema,
discount_percentage: PercentageSchema,
2025-09-03 18:04:09 +00:00
total_amount: AmountSchema,
})
),
2025-06-26 11:32:55 +00:00
metadata: MetadataSchema.optional(),
});
2025-08-12 11:23:50 +00:00
export type GetCustomerInvoiceByIdResponseDTO = z.infer<
typeof GetCustomerInvoiceByIdResponseSchema
2025-06-26 11:32:55 +00:00
>;