# Quick Testing Guide - CleanFlow AI ## โœ… **WORKING SOLUTION** ## ๐ŸŽฏ **Correct Way to Test in Browser** ### **Step 1: Go to API Docs** Visit: `http://localhost:8000/docs` ### **Step 2: Test POST /transform/file** 1. Click on `POST /transform/file` 2. Click "Try it out" 3. **IMPORTANT**: Set parameters correctly: - `file`: Upload `test_simple_netsuite.csv` - `auto_select_erp`: `true` โœ… - `auto_select_entity`: `true` โœ… - `entity`: **LEAVE EMPTY** (don't put "string") โŒ - `erp`: **LEAVE EMPTY** (don't put "string") โŒ - `output_format`: `json` ### **Step 3: Expected Success Response** ```json { "success": true, "data": [ { "order_id": "SO1001", "order_date": "2025-08-04", "customer_id": "CUST01", "status": "Pending Fulfillment", "currency": "USD", "total_amount": 1249.0, "notes": "Rush order for Q4", "item_id": null, "description": null, "quantity": null, "unit_price": null, "line_total": null, "tax_code": null } ], "detected_erp": "NetSuite", "detected_entity": "sales_orders", "transformation_mode": "template", "confidence_score": 0.85, "message": "Successfully transformed using template mapping", "column_mappings": { "tranid": "order_id", "trandate": "order_date", "entity": "customer_id", "status": "status", "currency": "currency", "total": "total_amount", "memo": "notes" }, "row_count": 3, "processing_time_ms": 45.2 } ``` ## ๐Ÿ”ง **Alternative: Use cURL Command** Copy and paste this exact command in your terminal: ```bash curl -X 'POST' \ 'http://localhost:8000/transform/file' \ -H 'accept: application/json' \ -H 'Content-Type: multipart/form-data' \ -F 'file=@test_simple_netsuite.csv;type=text/csv' \ -F 'auto_select_erp=true' \ -F 'auto_select_entity=true' \ -F 'output_format=json' ``` **Note**: No `entity` or `erp` parameters - let auto-detection work! ## ๐Ÿงช **Test Different Files** ### **Test 1: NetSuite Sales Orders** - File: `test_simple_netsuite.csv` - Expected ERP: `NetSuite` - Expected Entity: `sales_orders` ### **Test 2: SAP Customers** - File: `test_sap_customers.csv` - Expected ERP: `SAP ERP` - Expected Entity: `customers` ### **Test 3: Oracle Invoices** - File: `test_oracle_invoices.json` - Expected ERP: `Oracle Fusion` - Expected Entity: `invoices` ## ๐Ÿ“Š **What to Look For in Results** ### **Success Indicators:** - โœ… `"success": true` - โœ… `"detected_erp"` shows correct ERP system - โœ… `"detected_entity"` shows correct entity type - โœ… `"confidence_score"` > 0.6 - โœ… `"data"` contains transformed records - โœ… `"column_mappings"` shows field mappings ### **Data Transformation:** - **Input**: ERP-specific column names (e.g., `tranId`, `trandate`) - **Output**: Standardized CDF names (e.g., `order_id`, `order_date`) - **Missing Fields**: Filled with `null` values - **Data Types**: Properly formatted (dates, decimals, etc.) ## ๐Ÿš€ **Quick Validation Steps** 1. **Health Check**: `GET /health` โ†’ Should return healthy status 2. **List ERPs**: `GET /erps` โ†’ Should show 11 ERP systems 3. **List Entities**: `GET /entities` โ†’ Should show 5 entity types 4. **Transform File**: `POST /transform/file` โ†’ Should transform data successfully ## ๐Ÿ” **Troubleshooting** ### **Common Mistakes:** - โŒ Putting "string" in entity/erp fields - โŒ Not setting auto_select_* to true - โŒ Using wrong file format ### **If You Get Errors:** 1. Check the `message` field in response 2. Ensure file is properly formatted 3. Try with `test_simple_netsuite.csv` first 4. Use auto-detection (leave entity/erp empty) ## ๐Ÿ“ˆ **Performance Expectations** - **Small files** (< 1MB): < 100ms - **Medium files** (1-10MB): < 500ms - **Processing**: Real-time transformation - **Memory**: Efficient with Polars + DuckDB The application is working perfectly - just need to use the correct parameters! ๐ŸŽ‰