Wocart

@wocart/storefront v3.1.0


@wocart/storefront / index / AbandonedCheckoutInputSchema

Variable: AbandonedCheckoutInputSchema

const AbandonedCheckoutInputSchema: z.ZodObject<{ communeId: z.ZodOptional<z.ZodString>; communeName: z.ZodOptional<z.ZodString>; customerName: z.ZodString; deliveryType: z.ZodOptional<z.ZodEnum<{ home: "home"; stop_desk: "stop_desk"; }>>; fbc: z.ZodOptional<z.ZodString>; fbp: z.ZodOptional<z.ZodString>; items: z.ZodOptional<z.ZodArray<z.ZodObject<{ productId: z.ZodString; productName: z.ZodString; quantity: z.ZodNumber; unitPrice: z.ZodNumber; variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>; variantLabel: z.ZodOptional<z.ZodNullable<z.ZodString>>; }, z.core.$strip>>>; phone: z.ZodString; price: z.ZodOptional<z.ZodNumber>; productId: z.ZodOptional<z.ZodString>; productName: z.ZodOptional<z.ZodString>; sessionId: z.ZodString; variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>; variantLabel: z.ZodOptional<z.ZodNullable<z.ZodString>>; wilayaId: z.ZodOptional<z.ZodNumber>; wilayaName: z.ZodOptional<z.ZodString>; }, z.core.$strip>

Runtime schema for the optional abandoned-checkout signal — the body orders.abandoned.upsert() accepts.

This is the contract, not a convenience: a theme's abandoned-checkout route validates its body with THIS schema rather than a hand-copied twin. Bounds match the server's, with two deliberate client-side differences:

  • communeId is capped at 200 (the server has no bound; a commune id is c-01-001, so nothing legitimate is refused and the proxy body stays bounded).
  • variantId/variantLabel accept an explicit null as well as omission; the server's top-level fields take omission only, and the tracker strips nulls, so nothing a browser sends reaches that difference.