Selecting a Produkt auto-sets the current Rezeptur and pre-fills one
Herkunft row per Rohstoff. Changing the Rezeptur resets the rows.
Rohstoff is shown read-only (Hidden + Placeholder); user fills in
supplier, origin country, farmer and notes only.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When creating a new batch, the Herkunft-Repeater is automatically populated
with one row per Rohstoff from the product's current recipe. The Rohstoff
field is shown as a read-only label (Hidden spice_id + Placeholder name)
so the user only fills in supplier, origin country, farmer and notes.
Changing the recipe field updates the origin rows accordingly.
On edit, existing origin data is preserved unchanged.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The Filament table boot lifecycle (bootedInteractsWithTable) fires before
mount(), causing issues with typed $record properties on custom resource
pages. Replaced with a plain Page + Blade view rendering recipes directly.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
bootedInteractsWithTable() calls table() before mount() sets $this->record.
Accessing $this->record eagerly causes a TypeError on the uninitialized typed
property, which Filament/Livewire converts to a 404.
Deferred all $this->record accesses into closures so they only execute at
render time (after mount() has run).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix root cause: recipes_spices.amount_in_percent was decimal(4,2) which
overflows on 100% — widened to decimal(6,2) via migration
- Wrap afterSave() in try-catch so DB/logic errors show as a persistent
danger notification instead of a blank 500 page
- Same for CreateProduct: errors show as notification; also reads
recipe_spices from raw Livewire $this->data (not $data param which
excludes dehydrated(false) fields) so recipes actually save on create
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add "Aus Shopify laden" button on product edit page that pulls description
and variant prices/SKUs/GTINs from Shopify back into SMS
- Add ShopifyService::getProduct() for fetching a single product
- Add 'options' to createProduct() payload so Shopify properly creates variants
(without it Shopify ignores variant option values)
- Add request/response logging to createProduct() for diagnosing transfer issues
- Remove dead code from ProductResource (mutateFormData*, getRecord, getActions)
- Clean up imports in ProductResource
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
In Filament v3, $arguments is only injected when an action is executed
(clicked), not when it's rendered. Using $arguments in label(), icon(),
color() and visible() closures causes ErrorException: Undefined variable
$arguments on every Livewire update, including on the create page.
Simplified extraItemAction to static label/icon/color; all dynamic
logic (publish vs sync, guard for unsaved items) stays in action().
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Products imported before shopify_product_id column was added have null
there, but their variants already carry shopify_variant_id — that's
enough to know the product exists in Shopify. Running shopify:import
once will backfill shopify_product_id for all existing products.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
New header action on the product edit page creates the entire product
(title, description, all variants) in Shopify via API. The returned
shopify_product_id and per-variant shopify_variant_ids are stored
locally. After success the page reloads so status badges update.
Button is hidden once the product is already linked to Shopify.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Each size row in the product form now shows a Shopify status badge
(green ✓ Shopify / gray Lokal). For saved variants, an action button
appears: 'Zu Shopify' for local-only variants (creates via Shopify
API and stores the returned variant ID), 'Shopify sync' for linked
variants (pushes price/SKU/GTIN to Shopify).
Also fixes:
- gtin missing from ProductSize::$fillable (was silently not saved)
- shopify_product_id added to products table and stored on import
- sizes afterStateHydrated now loads ProductSize directly instead of
via the belongsToMany pivot (gets product_size_id, shopify_variant_id)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
belongsToMany sync() is wrong for products_sizes which is a full model
with its own id and a unique shopify_variant_id. The new approach:
- updateOrCreate per row (safe for repeated saves)
- strips non-digits from gtin, stores null when empty (fixes 500 on
unsignedBigInteger column with empty string in strict SQL mode)
- only deletes local-only sizes (whereNull shopify_variant_id) that
were removed — Shopify-imported sizes are never deleted here
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Route changed to /api/v1/{lot_number}. LotResource now includes
packing details, units_produced, quantity_g and recipe version.
CORS config added for public API access. README documents the
endpoint, example response and subdomain setup instructions.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The recipe name input is dropped from the product form — the version
number alone identifies a recipe. The product title is stored as the
internal name to satisfy the NOT NULL constraint. The history table
no longer shows the name column.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Each time the recipe name or spices are changed on the product edit
page, a new version is created instead of overwriting the current one.
Unchanged saves are skipped. A 'Rezept-Versionen' button opens a
sub-page (/produkt/{id}/rezept-versionen) listing all versions with
their spices and timestamps; the active version is highlighted in green.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces the recipe dropdown with an inline Section containing a name
field and a spice-repeater with percentage inputs. On save, the recipe
is created (version 1) or updated in place; spice pivot rows are synced
via sync(). SumEquals100 rule enforces that percentages add up to 100.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add size_id, units_produced, quantity_g to batches table
- quantity_g auto-calculated from units × packing size on save
- Batch model deducts spice quantities on create, reverses on delete,
recalculates on update when relevant fields change
- Batch form shows live total weight preview
- Chargen table shows units + grams produced
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Recipe select now has a create/edit modal (name + description)
- Batches RelationManager shows all LOT charges for the product below
the form, sorted newest first, with create/edit/delete actions
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add SKU and GTIN fields to product variant repeater
- Render EAN/UPC barcode live from GTIN input (picqer/php-barcode-generator)
- Pull variant price from Shopify API instead of defaulting to 0
- Sync sku/gtin through EditProduct and CreateProduct save logic
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Images are fetched from Shopify CDN, stored in storage/app/public/product-images/
as UUIDs, and saved in the Product.images array — matching Filament's FileUpload format.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Parses additional packaging formats from option1 and falls back to SKU
parsing for single-variant products with 'Default Title'.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fetches all products and variants from Shopify API, creates local
Products, Packings and ProductSizes with shopify_variant_id, and
fills ProductInventory rows to match Shopify's inventory_quantity.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
/shopify/install → redirects to Shopify OAuth
/shopify/callback → exchanges code for access token and displays it
To be removed after token is captured.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Log clear hint for 403 (IP whitelist), 401, 429, 5xx.
Commands exit with failure and print error when API returns no data.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>