import { z } from "zod";

/**
 * Schema for a single order item
 */
export const orderItemSchema = z.object({
    productId: z.coerce.number(),
    description: z.string(),
    pacth: z.string(),
    color: z.coerce.number(),
    stockId: z.coerce.number(),
    quantity: z.coerce.number(),
    salePrice: z.coerce.number(),
    deliveryType: z.string(),
    total: z.coerce.number(),
    weight: z.coerce.number(),
    department: z.string(),
    brand: z.string(),
});

/**
 * Schema for the order items API response
 */
export const orderItemsResponseSchema = z.object({
    success: z.boolean(),
    data: z.array(orderItemSchema),
});

/**
 * TypeScript type inferred from the Zod schema
 */
export type OrderItem = z.infer<typeof orderItemSchema>;

/**
 * TypeScript type for the API response
 */
export type OrderItemsResponse = z.infer<typeof orderItemsResponseSchema>;
