15 Commits
Author SHA1 Message Date
Malek TellissiandClaude Sonnet 4.6 4b99ffea15 Fix account-takeover: bind users to nextcloud_id, not email
Deploy / deploy (push) Successful in 16s
Matching users by email alone allows an attacker with a self-registered
Nextcloud account to hijack any Filament user. Now we look up by
nextcloud_id first; email is only used when creating a brand-new account,
and nextcloud_id is immediately written to the row so future logins
use the stable Nextcloud user ID.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-09-13 02:54:19 +02:00
Malek TellissiandClaude Sonnet 4.6 2937004118 Roles via Nextcloud groups: sms-admin/manager/viewer + fix OAuth instance_uri
Deploy / deploy (push) Successful in 29s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-09-13 01:48:24 +02:00
Malek TellissiandClaude Sonnet 4.6 d87383672c Add piece_weight calibration: enter Stück + Gramm per delivery, average auto-calculated
Deploy / deploy (push) Successful in 17s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-09-13 01:26:17 +02:00
Malek TellissiandClaude Sonnet 4.6 fb19e9a579 Introduce spice_stock_movements ledger for traceable stock changes
Deploy / deploy (push) Successful in 16s
Every delivery and batch now writes a signed movement entry instead of
directly incrementing/decrementing spice.quantity. The balance is always
the sum of all movements. Existing data is backfilled in the migration.
Rohstoff edit page shows the full movement history (Lagerbewegungen tab).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-09-12 22:34:10 +02:00
Malek TellissiandClaude Sonnet 4.6 a4f3254ebd Add address, phone, email, website fields to suppliers
Deploy / deploy (push) Successful in 16s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-09-12 21:38:53 +02:00
Malek TellissiandClaude Sonnet 4.6 a104924add Remove accidentally committed article_number migration (was rejected)
Deploy / deploy (push) Successful in 9s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-09-12 21:17:05 +02:00
Malek TellissiandClaude Sonnet 4.6 352f2a0aac Remove standalone BatchResource — chargen managed via product relation manager
Deploy / deploy (push) Successful in 14s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-09-12 21:16:52 +02:00
Malek TellissiandClaude Sonnet 4.6 5c034ec895 Add lot_prefix to products; compose LOT number from prefix + date suffix
Deploy / deploy (push) Successful in 14s
Products now have a configurable lot_prefix (e.g. "112"). In the batch form
the prefix is shown read-only next to the suffix input (JJMMTT), and the full
lot_number (e.g. "112-260912") is composed automatically and stored.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-09-12 20:35:37 +02:00
Malek TellissiandClaude Sonnet 4.6 4a98beeb45 Restructure batch origins: nested entries per ingredient with Supplier/Farmer selects
Deploy / deploy (push) Successful in 14s
Each BatchOrigin (spice) now has multiple BatchOriginEntry rows, replacing the flat
single-supplier/farmer fields. Lieferant and Landwirt are Select fields backed by
dedicated tables with inline create support. Migration preserves existing data.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-09-12 20:03:05 +02:00
Malek TellissiandClaude Sonnet 4.6 3301a1e9b2 Fix 500 on recipe save and surface errors as notifications
Deploy / deploy (push) Successful in 14s
- 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>
2026-09-12 18:19:31 +02:00
Malek TellissiandClaude Sonnet 4.6 3ebd9845b0 Add Shopify publish/sync per product variant
Deploy / deploy (push) Successful in 14s
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>
2026-09-12 17:20:26 +02:00
Malek TellissiandClaude Sonnet 4.6 a34bb29620 Auto-deduct spice inventory when batch is created/updated/deleted
Deploy / deploy (push) Successful in 14s
- 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>
2026-09-12 05:34:09 +02:00
Malek TellissiandClaude Sonnet 4.6 a7f5c4a83e Recipe versioning, inline recipe create, recipe summary, Shopify description
Deploy / deploy (push) Successful in 15s
- Add version + product_id to recipes table (migration)
- Recipe select shows version label (e.g. "Kurkuma v2")
- Creating recipe from product page pre-fills product name, auto-increments version
- Recipe ingredient summary shown read-only below the select
- Remove package_content field (redundant with recipe ingredients)
- Pull product description from Shopify body_html on import
- Update existing products with empty description on re-import

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-09-12 05:18:11 +02:00
Malek TellissiandClaude Sonnet 4.6 467d85dfec Add Shopify inventory sync and order webhook
Deploy / deploy (push) Successful in 14s
- Migration: shopify_variant_id on products_sizes, shopify_order_id on products_sales
- ShopifyService: paginated REST client (2024-10 API)
- shopify:map — one-time command to link variants by SKU
- shopify:sync — reconciliation command (Shopify is master)
- VerifyShopifyWebhook middleware: HMAC-SHA256 verification
- ShopifyWebhookController: idempotent orders/paid handler, FIFO inventory deduction
- Webhook route: POST /api/webhooks/shopify/orders-paid

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-09-11 02:53:49 +02:00
Malek Tellissi 400172cdde Erster Upload 2026-09-11 01:17:47 +02:00