feat(shop): move linked fee configuration to product level
All checks were successful
Staging Build / build (push) Successful in 2m52s

This commit is contained in:
DanielS
2026-07-22 17:04:38 +02:00
parent 06cba405f3
commit f130f24c86
6 changed files with 51 additions and 39 deletions

View File

@@ -9,7 +9,7 @@ export async function getProducts() {
const supabase = await createClient()
const { data, error } = await supabase
.from('products')
.select('*, category:categories(*), modules:product_modules!product_modules_product_id_fkey(*)')
.select('*, category:categories(*), modules:product_modules(*)')
.order('created_at', { ascending: false })
if (error) throw error
@@ -90,7 +90,6 @@ export async function createProduct(
requirements: m.requirements || [],
exclusions: m.exclusions || [],
has_quantity: m.has_quantity ?? false,
linked_fee_product_id: m.linked_fee_product_id || null,
}))
const { error: modulesError } = await supabase
.from('product_modules')
@@ -128,7 +127,6 @@ export async function updateProduct(id: string, product: Partial<Product>, modul
requirements: m.requirements || [],
exclusions: m.exclusions || [],
has_quantity: m.has_quantity ?? false,
linked_fee_product_id: m.linked_fee_product_id || null,
}))
const { error: modulesError } = await supabase
.from('product_modules')

View File

@@ -18,6 +18,7 @@ export type Product = {
requirements?: string[]
exclusions?: string[]
allow_update_discount?: boolean
linked_fee_product_id?: string | null
}
export type Category = {
@@ -46,7 +47,6 @@ export type ProductModule = {
exclusions: string[] // UUID[] von Modulen, die nicht gleichzeitig aktiv sein dürfen
created_at: string
has_quantity?: boolean
linked_fee_product_id?: string | null
}
export type Profile = {