Compare commits

..

2 Commits

Author SHA1 Message Date
DanielS
db95e435c2 fix: auto add configured device to basket on step 3 transition
All checks were successful
Staging Build / build (push) Successful in 2m46s
2026-07-09 23:43:16 +02:00
DanielS
c3f97f8dca fix: add missing type and payment_method columns to orders table 2026-07-09 23:43:12 +02:00
2 changed files with 16 additions and 1 deletions

View File

@@ -501,7 +501,15 @@ export function OrderWizard({
})
}
const nextStep = () => setStep(s => s + 1)
const nextStep = () => {
if (step === 3 && allCategoriesFilled && productValidationErrors.length === 0) {
const hasProduct = Object.values(selections).some(sel => sel.productId || (sel.productIds && sel.productIds.length > 0))
if (hasProduct) {
addToBasket()
}
}
setStep(s => s + 1)
}
const prevStep = () => setStep(s => s - 1)
// Abrechnungsmodell wechseln (und Selektionen der Kategorien anpassen)

View File

@@ -0,0 +1,7 @@
-- Migration: Add missing type and payment_method columns to orders table
-- Purpose: Ensure physical columns type and payment_method exist on public.orders for checkout split support.
ALTER TABLE public.orders ADD COLUMN IF NOT EXISTS type TEXT NOT NULL DEFAULT 'purchase' CHECK (type IN ('purchase', 'subscription'));
ALTER TABLE public.orders ADD COLUMN IF NOT EXISTS payment_method TEXT;
NOTIFY pgrst, 'reload schema';