Implement order data model modernization and license transformation logic
This commit is contained in:
@@ -146,29 +146,11 @@ export function OrderWizard({
|
||||
|
||||
const handleSubmit = async () => {
|
||||
try {
|
||||
// Build multi-product order payload – submit each category item
|
||||
const items = categories
|
||||
.map(cat => {
|
||||
const sel = selections[cat.id]
|
||||
if (!sel?.productId) return null
|
||||
const prod = products.find(p => p.id === sel.productId)!
|
||||
return {
|
||||
category: cat.name,
|
||||
product_id: sel.productId,
|
||||
product_name: prod.name,
|
||||
base_price: prod.base_price,
|
||||
selected_modules: sel.moduleIds,
|
||||
}
|
||||
})
|
||||
.filter(Boolean)
|
||||
|
||||
await submitOrder({
|
||||
product_id: items[0]!.product_id, // primary (first category)
|
||||
selected_modules: items.flatMap(i => i!.selected_modules),
|
||||
total_amount: totalPrice,
|
||||
customer_details: customerData,
|
||||
// @ts-ignore extended payload
|
||||
items,
|
||||
selections,
|
||||
products,
|
||||
categories,
|
||||
customerProfile: customerData,
|
||||
})
|
||||
alert('Bestellung erfolgreich aufgegeben!')
|
||||
window.location.href = '/'
|
||||
@@ -178,6 +160,7 @@ export function OrderWizard({
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<div className="max-w-5xl mx-auto py-12 px-4">
|
||||
{/* Progress Stepper */}
|
||||
|
||||
Reference in New Issue
Block a user