52 lines
975 B
TypeScript

export interface AddToCartRequest {
productId: string;
quantity: number;
attributes?: CartItemAttributes;
}
export interface CartItemAttributes {
size?: string;
extraToppings?: string[];
}
export interface CartProduct {
id: string;
name: string;
price: number;
compareAtPrice: number;
imageUrl: string;
stockQuantity: number;
isTrackStock: boolean;
merchantId: string;
merchantName: string;
}
export interface CartItem {
id: string;
productId: string;
quantity: number;
attributes: Record<string, any>;
createdAt: string;
updatedAt: string;
product: CartProduct;
}
export interface MerchantCartGroup {
merchantId: string;
merchantName: string;
items: CartItem[];
subtotal: number;
}
export interface CartResponse {
[x: string]: any;
id: string;
customerId: string;
items: CartItem[];
groupedByMerchant: MerchantCartGroup[];
subtotal: number;
totalItems: number;
createdAt: string;
updatedAt: string;
}