import type { PriceCalculation } from '../../pricing/index.js';
import type { PromotionDiscount } from '../../promotions/index.js';
import type { Availability } from '../../inventory/index.js';

export interface CartItem {
  id: string;
  cartId: string;
  productId: string;
  variantId: string;
  quantity: number;
  createdAt: Date;
  updatedAt: Date;
}

export interface Cart {
  id: string;
  userId: string;
  promoCode: string | null;
  items: CartItem[];
  createdAt: Date;
  updatedAt: Date;
}

export interface CartItemInput {
  productId: string;
  variantId: string;
  quantity: number;
}

export interface CartItemView extends CartItem {
  pricing: PriceCalculation | null;
  availability: Availability;
  available: boolean;
}

export interface CartView {
  id: string;
  userId: string;
  items: CartItemView[];
  currency: 'EUR';
  netSubtotalCents: number;
  vatAmountCents: number;
  discount: PromotionDiscount | null;
  totalBeforeDiscountCents: number;
  totalCents: number;
  createdAt: Date;
  updatedAt: Date;
}
