/**
 * ANNOTATED COPY — every line explained
 * Source: src/lib/demo-orders.ts
 * NOT used by the app — read this to learn how the real file works
 */
// Import project module (@/ alias = src/ folder in tsconfig)
import { Order } from '@/types';
// Import from a relative file in the same project
import { products } from './products';
// Import from a relative file in the same project
import { getDefaultCustomization, getCartItemKey } from './customization';
// (blank line — separates logical blocks for readability)
// Function declaration — reusable logic in this file
function orderItem(
  // Property or array item — trailing comma allowed in TypeScript
  productId: string,
  // Property or array item — trailing comma allowed in TypeScript
  quantity: number,
  // Line 8: customizationLabel: string
  customizationLabel: string
// Line 9: ) {
) {
  // Array.find — get first matching item or undefined
  const product = products.find((p) => p.id === productId)!;
  // Line 11: const customization = getDefaultCustomization(product.cat...
  const customization = getDefaultCustomization(product.category);
  // Return value from function
  return {
    // Property or array item — trailing comma allowed in TypeScript
    id: getCartItemKey(productId, customization),
    // Property or array item — trailing comma allowed in TypeScript
    product,
    // Property or array item — trailing comma allowed in TypeScript
    quantity,
    // Property or array item — trailing comma allowed in TypeScript
    customization,
    // Property or array item — trailing comma allowed in TypeScript
    customizationLabel,
  // Closing brace — end of block (function, if, object, JSX)
  };
// Closing brace — end of block (function, if, object, JSX)
}
// (blank line — separates logical blocks for readability)
// Line 21: const demoAddress = {
const demoAddress = {
  // Property or array item — trailing comma allowed in TypeScript
  street: 'Tingvallavägen 11',
  // Property or array item — trailing comma allowed in TypeScript
  city: 'Märsta',
  // Property or array item — trailing comma allowed in TypeScript
  state: 'Stockholm',
  // Property or array item — trailing comma allowed in TypeScript
  zip: '195 31',
// Closing brace — end of block (function, if, object, JSX)
};
// (blank line — separates logical blocks for readability)
// Named export constant — shared config/data imported elsewhere
export const DEMO_ORDERS: Order[] = [
  // Line 29: {
  {
    // Property or array item — trailing comma allowed in TypeScript
    id: 'KG-2026-0042',
    // Line 31: items: [
    items: [
      // Property or array item — trailing comma allowed in TypeScript
      orderItem('beef-steak', 2, '8 cuts · Karahi'),
      // Property or array item — trailing comma allowed in TypeScript
      orderItem('lamb-shoulder', 1, '8 cuts · Nihari'),
    // End of array literal
    ],
    // Property or array item — trailing comma allowed in TypeScript
    total: 647,
    // Property or array item — trailing comma allowed in TypeScript
    status: 'delivered',
    // Property or array item — trailing comma allowed in TypeScript
    createdAt: '2026-06-10T14:30:00.000Z',
    // Property or array item — trailing comma allowed in TypeScript
    deliveryAddress: demoAddress,
    // Property or array item — trailing comma allowed in TypeScript
    paymentMethod: 'card',
  // Closing brace — end of block (function, if, object, JSX)
  },
  // Line 41: {
  {
    // Property or array item — trailing comma allowed in TypeScript
    id: 'KG-2026-0051',
    // Line 43: items: [
    items: [
      // Property or array item — trailing comma allowed in TypeScript
      orderItem('chicken-whole', 2, '8 cuts · Karahi'),
      // Property or array item — trailing comma allowed in TypeScript
      orderItem('beef-mince', 1, '8 cuts · Qeema'),
      // Property or array item — trailing comma allowed in TypeScript
      orderItem('fish-prawns', 1, 'Standard cut'),
    // End of array literal
    ],
    // Property or array item — trailing comma allowed in TypeScript
    total: 556,
    // Property or array item — trailing comma allowed in TypeScript
    status: 'out-for-delivery',
    // Property or array item — trailing comma allowed in TypeScript
    createdAt: '2026-06-16T09:15:00.000Z',
    // Property or array item — trailing comma allowed in TypeScript
    deliveryAddress: demoAddress,
    // Property or array item — trailing comma allowed in TypeScript
    paymentMethod: 'swish',
  // Closing brace — end of block (function, if, object, JSX)
  },
  // Line 54: {
  {
    // Property or array item — trailing comma allowed in TypeScript
    id: 'KG-2026-0058',
    // Property or array item — trailing comma allowed in TypeScript
    items: [orderItem('lamb-leg', 1, '8 cuts · Steak'), orderItem('fish-salmon', 1, 'Standard cut')],
    // Property or array item — trailing comma allowed in TypeScript
    total: 418,
    // Property or array item — trailing comma allowed in TypeScript
    status: 'preparing',
    // Property or array item — trailing comma allowed in TypeScript
    createdAt: '2026-06-17T08:00:00.000Z',
    // Property or array item — trailing comma allowed in TypeScript
    deliveryAddress: demoAddress,
    // Property or array item — trailing comma allowed in TypeScript
    paymentMethod: 'card',
  // Closing brace — end of block (function, if, object, JSX)
  },
// End of array literal
];
