diff --git a/portal/setup-wizard.html b/portal/setup-wizard.html index fab340a..01ba0d5 100644 --- a/portal/setup-wizard.html +++ b/portal/setup-wizard.html @@ -1539,13 +1539,17 @@ }); // Add items (already tagged with menu name by backend) (data.items || []).forEach(item => allItems.push(item)); - allMenus.push({ name: page.name }); + // Store menu with its schedule + const menuEntry = { name: page.name }; + if (result.menuSchedule) menuEntry.schedule = result.menuSchedule; + allMenus.push(menuEntry); totalProcessed++; // Update with progress + const scheduleNote = result.menuSchedule ? ` (${result.menuSchedule})` : ''; document.getElementById('conversation').innerHTML = ''; addMessage('ai', ` -

Extracted ${page.name}: ${data.items?.length || 0} items in ${data.categories?.length || 0} categories

+

Extracted ${page.name}${scheduleNote}: ${data.items?.length || 0} items in ${data.categories?.length || 0} categories

`); } else { document.getElementById('conversation').innerHTML = ''; @@ -1560,6 +1564,14 @@ } } + // Compute max business hours from all menu schedules + if (allMenus.some(m => m.schedule) && !businessInfo.hours) { + businessInfo.hours = allMenus + .filter(m => m.schedule) + .map(m => `${m.name}: ${m.schedule}`) + .join('; '); + } + // Build final combined data document.getElementById('conversation').innerHTML = ''; config.extractedData = { @@ -1577,8 +1589,10 @@ const totalItems = allItems.length; const totalCats = allCategories.length; + const schedSummary = allMenus.filter(m => m.schedule).map(m => `${m.name}: ${m.schedule}`).join(', '); addMessage('ai', `

Done! Found ${totalItems} items across ${totalCats} categories in ${allMenus.length} menus.

+ ${schedSummary ? `

${schedSummary}

` : ''} `); console.log('=== MULTI-PAGE EXTRACT RESULT ===', config.extractedData);