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

54 lines
1.2 KiB
TypeScript
Raw Normal View History

2025-09-12 16:23:36 +00:00
import { MetadataSchema, MoneySchema, 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(),
2025-09-04 17:57:04 +00:00
invoice_date: z.string(),
2025-09-03 18:04:09 +00:00
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-11 15:14:51 +00:00
taxes: z.string(),
2025-09-12 16:23:36 +00:00
subtotal_amount: MoneySchema,
2025-09-04 10:02:24 +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 10:02:24 +00:00
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-12 16:23:36 +00:00
unit_amount: MoneySchema,
2025-09-07 19:55:12 +00:00
taxes: z.string(),
2025-09-12 16:23:36 +00:00
subtotal_amount: MoneySchema,
discount_percentage: PercentageSchema,
discount_amount: MoneySchema,
taxable_amount: MoneySchema,
taxes_amount: MoneySchema,
total_amount: MoneySchema,
2025-09-03 18:04:09 +00:00
})
),
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
>;