// Weft Config for Order Form Test Artifact

import { WeftConfig } from '../../weft/core/types';

export const orderFormWeftConfig: WeftConfig = {
  artifact: {
    id: 'order-form-v1',
    name: 'Order Entry Form',
    generatedAt: '2026-03-08T10:00:00Z',
    intentHash: 'test-abc123',
    originalSpec: 'Create an order entry form that allows selecting products, adding them to an order, and submitting the order to the backend.'
  },
  
  mockData: {
    customers: [
      { id: 'C001', name: 'Acme Corp', creditLimit: 50000 },
      { id: 'C002', name: 'Globex Inc', creditLimit: 25000 }
    ],
    products: [
      { sku: 'WIDGET-A', name: 'Widget Alpha', price: 29.99, stock: 150 },
      { sku: 'GADGET-B', name: 'Gadget Beta', price: 149.99, stock: 42 },
      { sku: 'COMP-X', name: 'Component X', price: 9.99, stock: 500 }
    ]
  },
  
  apiStubs: [
    {
      method: 'POST',
      endpoint: '/api/orders',
      description: 'Create a new order',
      requestSchema: {
        customerId: 'string',
        items: 'OrderItem[]',
        notes: 'string?'
      },
      mockResponse: {
        success: true,
        orderId: 'ORD-{{timestamp}}',
        message: 'Order created successfully',
        estimatedDelivery: '{{date+3}}'
      },
      mockStatus: 201,
      mockDelay: 500
    },
    {
      method: 'GET',
      endpoint: '/api/products',
      description: 'List available products',
      mockResponse: {
        products: '{{mockData.products}}'
      },
      mockStatus: 200
    },
    {
      method: 'GET',
      endpoint: '/api/customers/{id}',
      description: 'Get customer details',
      mockResponse: {
        customer: {
          id: 'C001',
          name: 'Acme Corp',
          creditLimit: 50000,
          currentBalance: 12500
        }
      },
      mockStatus: 200
    }
  ],
  
  navigation: {
    onSuccess: '/orders/confirmation',
    onCancel: '/orders',
    onError: '/orders?error=true'
  }
};
