Order
E-commerce order with line items, shipping/billing addresses, status tracking, and totals.
ecommerce
Install
$ npx shadcn@latest add @open-types/order
Dependencies
Source
import type { Address } from "./address";
import type { CartItem } from "./cart-item";
import type { CurrencyCode } from "./product";
export type OrderStatus =
| "pending"
| "confirmed"
| "processing"
| "shipped"
| "delivered"
| "cancelled"
| "refunded";
export interface Order {
id: string;
items: CartItem[];
shippingAddress: Address;
billingAddress?: Address;
subtotal: number;
tax: number;
shippingCost?: number;
discount?: number;
total: number;
currency?: CurrencyCode;
status?: OrderStatus;
notes?: string;
createdAt: string;
updatedAt: string;
}
export type OrderCreate = Omit<Order, "id" | "createdAt" | "updatedAt">;
import type { Address } from "./address";
import type { CartItem } from "./cart-item";
import type { CurrencyCode } from "./product";
export type OrderStatus =
| "pending"
| "confirmed"
| "processing"
| "shipped"
| "delivered"
| "cancelled"
| "refunded";
export interface Order {
id: string;
items: CartItem[];
shippingAddress: Address;
billingAddress?: Address;
subtotal: number;
tax: number;
shippingCost?: number;
discount?: number;
total: number;
currency?: CurrencyCode;
status?: OrderStatus;
notes?: string;
createdAt: string;
updatedAt: string;
}
export type OrderCreate = Omit<Order, "id" | "createdAt" | "updatedAt">;