@fayz-ai/plugin-inventory 0.9.4 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/RecipeGapsPanel.d.ts +14 -0
- package/dist/components/RecipeGapsPanel.d.ts.map +1 -0
- package/dist/data/mock.d.ts.map +1 -1
- package/dist/data/supabase.d.ts.map +1 -1
- package/dist/data/tables.d.ts +6 -0
- package/dist/data/tables.d.ts.map +1 -1
- package/dist/data/types.d.ts +23 -1
- package/dist/data/types.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2459 -237
- package/dist/index.js.map +1 -1
- package/dist/lib/agent-tools.d.ts +4 -0
- package/dist/lib/agent-tools.d.ts.map +1 -0
- package/dist/lib/movement-vocabulary.d.ts +30 -0
- package/dist/lib/movement-vocabulary.d.ts.map +1 -0
- package/dist/lib/recipe-cost.d.ts +22 -0
- package/dist/lib/recipe-cost.d.ts.map +1 -0
- package/dist/lib/stock-count.d.ts +19 -0
- package/dist/lib/stock-count.d.ts.map +1 -0
- package/dist/locales/en.d.ts.map +1 -1
- package/dist/locales/pt-BR.d.ts.map +1 -1
- package/dist/migrations/index.d.ts +7 -0
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/types.d.ts +114 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/views/InventoryPage.d.ts.map +1 -1
- package/dist/views/MovementHistoryView.d.ts +4 -1
- package/dist/views/MovementHistoryView.d.ts.map +1 -1
- package/dist/views/ProductCrudForm.d.ts.map +1 -1
- package/dist/views/ProductDetailView.d.ts +9 -0
- package/dist/views/ProductDetailView.d.ts.map +1 -0
- package/dist/views/ProductListView.d.ts +3 -2
- package/dist/views/ProductListView.d.ts.map +1 -1
- package/dist/views/ProductStockTab.d.ts +11 -0
- package/dist/views/ProductStockTab.d.ts.map +1 -0
- package/dist/views/RecipeDetailView.d.ts.map +1 -1
- package/dist/views/RecipeFormView.d.ts +3 -1
- package/dist/views/RecipeFormView.d.ts.map +1 -1
- package/dist/views/RecipesView.d.ts +3 -1
- package/dist/views/RecipesView.d.ts.map +1 -1
- package/dist/views/StockCountFormView.d.ts +7 -0
- package/dist/views/StockCountFormView.d.ts.map +1 -0
- package/dist/views/StockCountSessionView.d.ts +15 -0
- package/dist/views/StockCountSessionView.d.ts.map +1 -0
- package/dist/views/StockCountsView.d.ts +7 -0
- package/dist/views/StockCountsView.d.ts.map +1 -0
- package/dist/views/StockMovementView.d.ts.map +1 -1
- package/dist/views/productEntity.d.ts +4 -1
- package/dist/views/productEntity.d.ts.map +1 -1
- package/package.json +5 -4
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/context.tsx","../src/views/DashboardView.tsx","../src/views/productEntity.tsx","../src/views/ProductListView.tsx","../src/views/ProductCrudForm.tsx","../src/views/StockMovementView.tsx","../src/views/MovementHistoryView.tsx","../src/views/RecipesView.tsx","../src/views/RecipeFormView.tsx","../src/views/RecipeDetailView.tsx","../src/components/InventoryGeneralSettings.tsx","../src/components/InventoryOnboarding.tsx","../src/views/InventoryPage.tsx","../src/views/dashboardWidgets.tsx","../src/data/mock.ts","../src/data/tables.ts","../src/data/supabase.ts","../src/store.ts","../src/data/registries.ts","../src/locales/en.ts","../src/locales/pt-BR.ts","../src/locales/index.ts","../src/index.ts"],"names":["t","jsx","useTranslation","React","jsxs","SubpageHeader","useState","useEffect","useMemo","ArrowDownRight","ArrowUpRight","RefreshCw","ArrowRightLeft","Trash2","Plus","useLimitGuard","toast","invalidateLimit","name","SearchSelect","BookOpen","Package","Layers","Clock","Check","ctx","nextId","createStore"],"mappings":";;;;;;;;;AAkCA,IAAM,GAAA,GAAM,oBAAsF,eAAe,CAAA;AAE1G,IAAM,2BAA2B,GAAA,CAAI,eAAA;AACrC,IAAM,qBAAqB,GAAA,CAAI,SAAA;AAC/B,IAAM,uBAAuB,GAAA,CAAI,WAAA;AACjC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AAY,MAAA,EAAgB;AAAA,UAC1E,EAAE,OAAO,yBAAA,EAA0B;AAAA,UACnC,EAAE,OAAO,iCAAA;AAAkC,SAC7C;AAAA,QACA,UAAA,EAAY,EAAE,OAAA,EAAS,WAAA,EAAa,QAAQ,MAAA;AAAgB;AAC9D,KACF;AAAA,IACA,UAAA,EAAY,mBAAA;AAAA,IACZ,QAAA,EAAU;AAAA,MACR;AAAA,QACE,EAAA,EAAI,WAAA;AAAA,QACJ,KAAA,EAAO,WAAA;AAAA,QACP,IAAA,EAAM,SAAA;AAAA,QACN,YAAY,MAAM;AAChB,UAAA,MAAM,GAAA,GAAgB,MAAMA,MAAAA,CAAM,aAAA,CAAc,wBAAwB,CAAA;AACxE,UAAA,GAAA,CAAI,WAAA,GAAc,sBAAA;AAClB,UAAA,OAAO,GAAA;AAAA,QACT,CAAA,GAAG;AAAA,QACH,KAAA,EAAO,EAAA;AAAA,QACP,UAAA,EAAY,EAAE,OAAA,EAAS,WAAA,EAAa,QAAQ,MAAA;AAAgB;AAC9D,KACF;AAAA,IACA,OAAA,EAAS;AAAA,GACX;AACF","file":"index.js","sourcesContent":["import { createPluginContext, formatCurrency, type CurrencyConfig } from '@fayz-ai/admin'\nimport type { InventoryPluginLabels } from './index'\nimport type { InventoryDataProvider } from './data/types'\nimport type { InventoryUIState } from './store'\n\nexport interface InventoryModules {\n /** Product catalogue screens. Off when the host registers products elsewhere. */\n products: boolean\n recipes: boolean\n stockLocations: boolean\n batchTracking: boolean\n}\n\nexport type InventoryCurrency = CurrencyConfig\n\nexport interface ProductTypeOption {\n value: string\n label: string\n}\n\nexport interface LocationOption {\n id: string\n name: string\n isHQ?: boolean\n}\n\nexport interface ResolvedInventoryConfig {\n modules: InventoryModules\n labels: InventoryPluginLabels\n currency: InventoryCurrency\n productTypes: ProductTypeOption[]\n locations: LocationOption[]\n}\n\nconst ctx = createPluginContext<ResolvedInventoryConfig, InventoryDataProvider, InventoryUIState>('InventoryPage')\n\nexport const InventoryContextProvider = ctx.ContextProvider\nexport const useInventoryConfig = ctx.useConfig\nexport const useInventoryProvider = ctx.useProvider\nexport const useInventoryStore = ctx.useStore\n\nexport { formatCurrency }\n","import React from 'react'\nimport { DashboardCanvas } from '@fayz-ai/ui'\n\n/**\n * Inventory overview. KPIs and the activity panel are registered dashboard\n * widgets (see ./dashboardWidgets), rendered through the shared DashboardCanvas;\n * the stock-value KPI also surfaces on the global app home.\n */\nexport function DashboardView() {\n return <DashboardCanvas surface=\"plugin-home\" domain=\"inventory\" showHeader={false} className=\"space-y-6\" />\n}\n","import React from 'react'\nimport type { EntityDef, FieldDef } from '@fayz-ai/core'\nimport { formatCurrency, type InventoryCurrency, type ProductTypeOption } from '../context'\n\n// ---------------------------------------------------------------------------\n// The single source of truth for the Product entity — drives BOTH the generic\n// list (CrudListView columns + facet) and the generic form (CrudFormPage\n// sections). Persistence stays in the inventory provider/store; this only\n// describes fields, columns and layout.\n// ---------------------------------------------------------------------------\n\nconst TYPE_DESCRIPTION_KEYS: Record<string, string> = {\n ingredient: 'inventory.productForm.typeIngredient',\n sale: 'inventory.productForm.typeSale',\n intermediate: 'inventory.productForm.typeIntermediate',\n asset: 'inventory.productForm.typeAsset',\n}\n\ntype T = (key: string, params?: Record<string, string | number>) => string\n\nexport function buildProductEntity(\n t: T,\n productTypes: ProductTypeOption[],\n currency: InventoryCurrency,\n): EntityDef {\n const typeOptions = productTypes.map((pt) => ({\n label: pt.label,\n value: pt.value,\n description: TYPE_DESCRIPTION_KEYS[pt.value] ? t(TYPE_DESCRIPTION_KEYS[pt.value]) : undefined,\n }))\n const typeLabel = (v: unknown) => productTypes.find((p) => p.value === v)?.label ?? String(v ?? '')\n\n // Field order is chosen so the table columns come out as\n // Product · Type · Stock · Cost · Value while the form groups stay correct.\n const fields: FieldDef[] = [\n // — General Information (form) + Product column (table) —\n {\n key: 'name', label: t('inventory.productForm.name'), type: 'text', required: true,\n group: 'general', placeholder: t('inventory.productForm.namePlaceholder'),\n searchable: true, showInTable: true, sortable: true,\n renderCell: (_v, row: any) => (\n <div>\n <p className=\"font-medium\">{row.name}</p>\n {row.sku && <p className=\"text-xs text-muted-foreground\">{row.sku}</p>}\n </div>\n ),\n },\n { key: 'brand', label: t('inventory.productForm.brand'), type: 'text', group: 'general', placeholder: t('inventory.productForm.brandPlaceholder'), showInTable: false },\n { key: 'sku', label: t('inventory.productForm.sku'), type: 'text', group: 'general', placeholder: t('inventory.productForm.skuPlaceholder'), searchable: true, showInTable: false },\n { key: 'barcode', label: t('inventory.productForm.barcode'), type: 'text', group: 'general', placeholder: t('inventory.productForm.barcodePlaceholder'), searchable: true, showInTable: false },\n { key: 'description', label: t('inventory.productForm.description'), type: 'textarea', group: 'general', span: 2, placeholder: t('inventory.productForm.descriptionPlaceholder'), showInTable: false },\n\n // — Classification (form: segmented) + Type column (table: badge) —\n {\n key: 'productType', label: t('inventory.productForm.classification'), type: 'segmented',\n group: 'classification', span: 2, options: typeOptions,\n showInTable: true, sortable: false,\n renderCell: (v) => (\n <span className=\"inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium bg-muted text-muted-foreground\">\n {typeLabel(v)}\n </span>\n ),\n },\n\n // — Stock column (list only) — placed before Cost for the desired column order\n {\n key: 'currentQuantity', label: t('inventory.productList.stock'), type: 'number',\n showInForm: false, showInTable: true, sortable: true,\n renderCell: (_v, row: any) => (\n <span className={`text-right block ${row.currentQuantity <= row.minQuantity ? 'text-destructive font-medium' : ''}`}>\n {row.currentQuantity}\n </span>\n ),\n },\n\n // — Pricing (form) + Cost column (table) —\n {\n key: 'costPrice', label: t('inventory.productForm.costPrice'), type: 'currency',\n group: 'pricing', currency: currency.code, currencySymbol: currency.symbol, currencyLocale: currency.locale,\n showInTable: true, sortable: false,\n renderCell: (v) => <span className=\"text-right block text-muted-foreground\">{formatCurrency(Number(v) || 0, currency)}</span>,\n },\n\n // — Value column (list only): stock × cost —\n {\n key: 'value', label: t('inventory.productList.value'), type: 'number',\n showInForm: false, showInTable: true, sortable: false,\n renderCell: (_v, row: any) => (\n <span className=\"text-right block font-medium\">{formatCurrency((row.currentQuantity || 0) * (row.costPrice || 0), currency)}</span>\n ),\n },\n\n { key: 'salePrice', label: t('inventory.productForm.salePrice'), type: 'currency', group: 'pricing', currency: currency.code, currencySymbol: currency.symbol, currencyLocale: currency.locale, showInTable: false },\n {\n key: 'margin', label: t('inventory.productForm.margin'), type: 'computed', group: 'pricing', showInTable: false,\n compute: (vals) => {\n const cost = Number(vals.costPrice) || 0\n const sale = Number(vals.salePrice) || 0\n if (sale <= 0 || cost <= 0) return null\n const m = ((sale - cost) / cost) * 100\n return { display: `${m.toFixed(1)}%`, tone: m >= 0 ? 'positive' : 'negative' }\n },\n },\n\n // — Stock Levels (form only) —\n { key: 'minQuantity', label: t('inventory.productForm.minQuantity'), type: 'number', group: 'stock', min: 0, placeholder: '0', hint: t('inventory.productForm.minQuantityHint'), showInTable: false },\n { key: 'maxQuantity', label: t('inventory.productForm.maxQuantity'), type: 'number', group: 'stock', min: 0, placeholder: t('inventory.productForm.optional'), hint: t('inventory.productForm.maxQuantityHint'), showInTable: false },\n ]\n\n return {\n name: t('inventory.stock.product'),\n namePlural: t('inventory.nav.products'),\n icon: 'Package',\n displayField: 'name',\n fields,\n fieldGroups: [\n { id: 'general', label: t('inventory.productForm.generalInfo'), columns: 2, imageSlot: true },\n { id: 'classification', label: t('inventory.productForm.classification'), description: t('inventory.productForm.classificationDesc'), columns: 1 },\n { id: 'pricing', label: t('inventory.productForm.pricing'), columns: 3 },\n { id: 'stock', label: t('inventory.productForm.stockLevels'), description: t('inventory.productForm.stockLevelsDesc'), columns: 2 },\n ],\n facets: [{ field: 'productType', allLabel: t('crud.list.allFacet') }],\n }\n}\n","import React, { useEffect, useMemo, useState } from 'react'\nimport { CrudListView } from '@fayz-ai/admin'\nimport { useInventoryConfig, useInventoryStore } from '../context'\nimport { useTranslation } from '@fayz-ai/core'\nimport type { ProductType } from '../types'\nimport { buildProductEntity } from './productEntity'\n\n// Product list, rendered through the generic CrudListView (header · search ·\n// facet pills · table). One shared EntityDef (buildProductEntity) drives both\n// this list and the create/edit form. Data + routing stay in the inventory\n// store / module nav.\nexport function ProductListView({ onNew, onEdit }: {\n onNew?: () => void\n onEdit?: (id: string) => void\n}) {\n const t = useTranslation()\n const { currency, productTypes } = useInventoryConfig()\n const products = useInventoryStore((s) => s.products)\n const productsTotal = useInventoryStore((s) => s.productsTotal)\n const productsLoading = useInventoryStore((s) => s.productsLoading)\n const fetchProducts = useInventoryStore((s) => s.fetchProducts)\n\n const [search, setSearch] = useState('')\n const [typeFilter, setTypeFilter] = useState<string | undefined>()\n const [loadedOnce, setLoadedOnce] = useState(false)\n\n useEffect(() => {\n let active = true\n Promise.resolve(fetchProducts({ productType: typeFilter as ProductType | undefined, search: search || undefined }))\n .finally(() => { if (active) setLoadedOnce(true) })\n return () => { active = false }\n }, [typeFilter, search])\n\n const entity = useMemo(() => buildProductEntity(t, productTypes, currency), [t, productTypes, currency])\n const facets = useMemo(() => [{\n field: 'productType',\n allLabel: t('crud.list.allFacet'),\n options: productTypes.map((p) => ({ value: p.value, label: p.label })),\n }], [productTypes, t])\n\n return (\n <CrudListView\n entityDef={entity}\n items={loadedOnce ? products : null}\n total={productsTotal}\n search={search}\n onSearchChange={setSearch}\n searchPlaceholder={t('inventory.productList.searchPlaceholder')}\n facets={facets}\n activeFilters={{ productType: typeFilter }}\n onFacetChange={(_field, value) => setTypeFilter(value)}\n onNew={onNew}\n addLabel={t('inventory.productList.newProduct')}\n onRowClick={(row) => onEdit?.((row as { id: string }).id)}\n feature=\"inventory\"\n />\n )\n}\n","import React from 'react'\nimport { SubpageHeader, toast } from '@fayz-ai/ui'\nimport { useTranslation } from '@fayz-ai/core'\nimport { CrudFormPage, CrudFormSkeleton, useLimitGuard, invalidateLimit } from '@fayz-ai/admin'\nimport { useInventoryConfig, useInventoryStore, useInventoryProvider } from '../context'\nimport type { ProductType } from '../types'\nimport { buildProductEntity } from './productEntity'\n\n// ---------------------------------------------------------------------------\n// Product create/edit, rendered through the generic CRUD form. The sectioned\n// layout (General Information · Classification · Pricing+Margin · Stock Levels)\n// comes from the shared buildProductEntity (segmented/computed/currency field\n// types). Persistence still flows through the inventory provider/store, so the\n// metadata-JSON column mapping is unchanged.\n// ---------------------------------------------------------------------------\n\nexport function ProductCrudForm({ editId, onSaved }: { editId?: string; onSaved?: () => void }) {\n const t = useTranslation()\n const { productTypes, currency } = useInventoryConfig()\n const provider = useInventoryProvider()\n const createProduct = useInventoryStore((s) => s.createProduct)\n const guardProducts = useLimitGuard('products')\n const isEdit = !!editId\n\n const [initialData, setInitialData] = React.useState<Record<string, any> | null>(isEdit ? null : {})\n const [headerName, setHeaderName] = React.useState('')\n\n // Load the existing product for edit and map it to flat form values.\n React.useEffect(() => {\n if (!editId) return\n let cancelled = false\n ;(async () => {\n const p = await provider.getProductById(editId)\n if (cancelled) return\n setHeaderName(p?.name ?? '')\n setInitialData(\n p\n ? {\n name: p.name,\n brand: p.brand ?? '',\n sku: p.sku ?? '',\n barcode: p.barcode ?? '',\n description: p.description ?? '',\n productType: p.productType,\n costPrice: p.costPrice,\n salePrice: p.salePrice ?? 0,\n minQuantity: p.minQuantity,\n maxQuantity: p.maxQuantity ?? 0,\n }\n : {},\n )\n })()\n return () => { cancelled = true }\n }, [editId])\n\n const entity = React.useMemo(() => buildProductEntity(t, productTypes, currency), [t, productTypes, currency])\n\n async function save(values: Record<string, any>) {\n const name = String(values.name ?? '').trim()\n if (!name) { toast.error(t('common.formIncomplete')); throw new Error('name required') }\n const payload = {\n name,\n sku: values.sku || undefined,\n barcode: values.barcode || undefined,\n brand: values.brand || undefined,\n productType: (values.productType ?? productTypes[0]?.value) as ProductType,\n costPrice: Number(values.costPrice) || 0,\n salePrice: Number(values.salePrice) || undefined,\n minQuantity: Number(values.minQuantity) || 0,\n maxQuantity: Number(values.maxQuantity) || undefined,\n description: values.description || undefined,\n }\n if (isEdit && editId) {\n await provider.updateProduct(editId, payload)\n } else {\n // Plan quantity guard (client-side, before the provider call). Opens the\n // global UpgradeModal and aborts when the plan's product cap is reached.\n if ((await guardProducts()) === 'blocked') return\n await createProduct(payload)\n invalidateLimit('products')\n }\n onSaved?.()\n }\n\n const title = isEdit ? (headerName || t('inventory.productForm.editProduct')) : t('inventory.productForm.newProduct')\n const subtitle = isEdit ? undefined : t('inventory.productForm.addToCatalog')\n\n return (\n <div className=\"space-y-5\">\n <SubpageHeader title={title} subtitle={subtitle} onBack={onSaved} parentLabel={t('inventory.nav.products')} />\n {/* Enquanto o produto carrega, a forma do formulário — não o vazio. Sem\n isto a tela ficava só com o cabeçalho e uma área em branco, e o\n conteúdo aparecia de uma vez empurrando tudo. */}\n {!initialData && <CrudFormSkeleton hideBreadcrumb />}\n {initialData && (\n <CrudFormPage\n entityDef={entity}\n mode={isEdit ? 'edit' : 'create'}\n initialData={initialData}\n onSubmit={save}\n onCancel={() => onSaved?.()}\n namePlural={t('inventory.nav.products')}\n hideBreadcrumb\n />\n )}\n </div>\n )\n}\n","import React, { useState, useEffect, useMemo } from 'react'\nimport { Save, Plus, ArrowUpRight, ArrowDownRight, RefreshCw, ArrowRightLeft, Trash2, Package, Check, Eye } from 'lucide-react'\nimport { useInventoryConfig, useInventoryStore, useInventoryProvider, formatCurrency } from '../context'\nimport { cn } from '@fayz-ai/ui'\nimport { SubpageHeader } from '@fayz-ai/ui'\nimport { useTranslation } from '@fayz-ai/core'\nimport { SearchSelect, type SearchSelectOption } from '@fayz-ai/ui'\nimport { DatePicker } from '@fayz-ai/ui'\nimport type { MovementType, StockMovement, StockPosition } from '../types'\n\n// ---------------------------------------------------------------------------\n// Movement type config\n// ---------------------------------------------------------------------------\n\nconst MOVEMENT_TYPES: { value: MovementType; labelKey: string; icon: React.ElementType; color: string; activeColor: string; descKey: string }[] = [\n { value: 'entry', labelKey: 'inventory.stock.entryLabel', icon: ArrowDownRight, color: 'text-success', activeColor: 'border-success bg-success/10 text-success dark:bg-success/10', descKey: 'inventory.stock.entryDesc' },\n { value: 'exit', labelKey: 'inventory.stock.exitLabel', icon: ArrowUpRight, color: 'text-destructive', activeColor: 'border-destructive bg-destructive/10 text-destructive dark:bg-destructive/10', descKey: 'inventory.stock.exitDesc' },\n { value: 'adjustment', labelKey: 'inventory.stock.adjustmentLabel', icon: RefreshCw, color: 'text-info', activeColor: 'border-info bg-info/10 text-info dark:bg-info/10', descKey: 'inventory.stock.adjustmentDesc' },\n { value: 'transfer', labelKey: 'inventory.stock.transferLabel', icon: ArrowRightLeft, color: 'text-magic', activeColor: 'border-magic bg-magic/10 text-magic dark:bg-magic/10', descKey: 'inventory.stock.transferDesc' },\n { value: 'loss', labelKey: 'inventory.stock.lossLabel', icon: Trash2, color: 'text-warning', activeColor: 'border-warning bg-warning/10 text-warning dark:bg-warning/10', descKey: 'inventory.stock.lossDesc' },\n]\n\n// ---------------------------------------------------------------------------\n// Movement detail card (for viewing a recorded movement)\n// ---------------------------------------------------------------------------\n\nfunction MovementDetail({ movement, currency, onClose }: {\n movement: StockMovement\n currency: { code: string; locale: string; symbol: string }\n onClose: () => void\n}) {\n const t = useTranslation()\n const typeConfig = MOVEMENT_TYPES.find((mt) => mt.value === movement.movementType)\n const TypeIcon = typeConfig?.icon ?? Package\n\n return (\n <div className=\"space-y-4\">\n <SubpageHeader title={movement.productName ?? `#${movement.id.slice(0, 8)}`} onBack={onClose} parentLabel={t('inventory.nav.stock')} />\n\n <div className=\"rounded-lg border bg-card shadow-sm p-5 space-y-4\">\n {/* Type + Product hero */}\n <div className=\"flex items-center gap-3\">\n <div className={`flex h-10 w-10 items-center justify-center rounded-xl ${typeConfig?.activeColor ?? 'bg-muted'}`}>\n <TypeIcon className=\"h-5 w-5\" />\n </div>\n <div>\n <p className=\"text-lg font-bold\">{movement.productName ?? t('inventory.stock.unknownProduct')}</p>\n <p className=\"text-xs text-muted-foreground capitalize\">{movement.movementType} · {movement.movementDate}</p>\n </div>\n </div>\n\n {/* Key details grid */}\n <div className=\"grid gap-3 sm:grid-cols-3 pt-2 border-t\">\n <div>\n <p className=\"text-[10px] text-muted-foreground uppercase\">{t('inventory.stock.quantityLabel')}</p>\n <p className=\"text-sm font-semibold\">{movement.movementType === 'entry' ? '+' : '-'}{movement.quantity}</p>\n </div>\n <div>\n <p className=\"text-[10px] text-muted-foreground uppercase\">{t('inventory.stock.unitCostLabel')}</p>\n <p className=\"text-sm font-semibold\">{formatCurrency(movement.unitCost, currency)}</p>\n </div>\n <div>\n <p className=\"text-[10px] text-muted-foreground uppercase\">{t('inventory.stock.totalCost')}</p>\n <p className=\"text-sm font-semibold\">{formatCurrency(movement.totalCost, currency)}</p>\n </div>\n </div>\n\n {/* Optional details */}\n <div className=\"grid gap-3 sm:grid-cols-2 pt-2 border-t\">\n {movement.stockLocationName && (\n <div>\n <p className=\"text-[10px] text-muted-foreground uppercase\">{t('inventory.stock.locationLabel')}</p>\n <p className=\"text-sm\">{movement.stockLocationName}</p>\n </div>\n )}\n {movement.destinationLocationName && (\n <div>\n <p className=\"text-[10px] text-muted-foreground uppercase\">{t('inventory.stock.destination')}</p>\n <p className=\"text-sm\">{movement.destinationLocationName}</p>\n </div>\n )}\n {movement.supplierName && (\n <div>\n <p className=\"text-[10px] text-muted-foreground uppercase\">{t('inventory.stock.supplier')}</p>\n <p className=\"text-sm\">{movement.supplierName}</p>\n </div>\n )}\n {movement.documentNumber && (\n <div>\n <p className=\"text-[10px] text-muted-foreground uppercase\">{t('inventory.stock.document')}</p>\n <p className=\"text-sm\">{movement.documentNumber}</p>\n </div>\n )}\n {movement.reason && (\n <div>\n <p className=\"text-[10px] text-muted-foreground uppercase\">{t('inventory.stock.reasonLabel')}</p>\n <p className=\"text-sm\">{movement.reason}</p>\n </div>\n )}\n </div>\n\n {movement.notes && (\n <div className=\"pt-2 border-t\">\n <p className=\"text-[10px] text-muted-foreground uppercase\">{t('inventory.stock.notes')}</p>\n <p className=\"text-sm mt-0.5\">{movement.notes}</p>\n </div>\n )}\n\n <div className=\"pt-2 border-t\">\n <p className=\"text-[10px] text-muted-foreground\">{t('inventory.stock.recorded')} {new Date(movement.createdAt).toLocaleString()}</p>\n </div>\n </div>\n </div>\n )\n}\n\n// ---------------------------------------------------------------------------\n// Stock movement form\n// ---------------------------------------------------------------------------\n\nexport function StockMovementView({ defaultType, onSaved, viewMovement }: {\n defaultType: MovementType\n onSaved?: () => void\n viewMovement?: StockMovement\n}) {\n const t = useTranslation()\n const { currency, modules } = useInventoryConfig()\n const provider = useInventoryProvider()\n const products = useInventoryStore((s) => s.products)\n const locations = useInventoryStore((s) => s.locations)\n const fetchProducts = useInventoryStore((s) => s.fetchProducts)\n const fetchLocations = useInventoryStore((s) => s.fetchLocations)\n const createMovement = useInventoryStore((s) => s.createMovement)\n\n const [step, setStep] = useState(1)\n const [positions, setPositions] = useState<StockPosition[]>([])\n const [movementType, setMovementType] = useState<MovementType>(defaultType)\n const [productId, setProductId] = useState('')\n const [productLabel, setProductLabel] = useState('')\n const [quantity, setQuantity] = useState(1)\n const [unitCost, setUnitCost] = useState(0)\n const [locationId, setLocationId] = useState('')\n const [destLocationId, setDestLocationId] = useState('')\n const [reason, setReason] = useState('')\n const [documentNumber, setDocumentNumber] = useState('')\n const [notes, setNotes] = useState('')\n const [batchNumber, setBatchNumber] = useState('')\n const [expirationDate, setExpirationDate] = useState('')\n const [saving, setSaving] = useState(false)\n const [savedMovement, setSavedMovement] = useState<StockMovement | null>(null)\n\n useEffect(() => { fetchProducts({}); fetchLocations() }, [])\n\n // Build a map of locationId → total quantity from positions.\n // NOTE: these useMemo hooks must run before the early returns below, otherwise\n // saving (which flips savedMovement) renders fewer hooks → React error.\n const positionByLocation = useMemo(() => {\n const map: Record<string, number> = {}\n for (const pos of positions) {\n if (pos.stockLocationId) {\n map[pos.stockLocationId] = (map[pos.stockLocationId] ?? 0) + pos.quantity\n }\n }\n return map\n }, [positions])\n\n // Sort locations by stock position (highest first)\n const sortedLocations = useMemo(() => {\n return [...locations].sort((a, b) => (positionByLocation[b.id] ?? 0) - (positionByLocation[a.id] ?? 0))\n }, [locations, positionByLocation])\n\n // If viewing a movement detail\n if (viewMovement) {\n return <MovementDetail movement={viewMovement} currency={currency} onClose={() => onSaved?.()} />\n }\n\n // If just saved — show success with details\n if (savedMovement) {\n return <MovementDetail movement={savedMovement} currency={currency} onClose={() => onSaved?.()} />\n }\n\n const selectedProduct = products.find((p) => p.id === productId)\n const totalCost = quantity * unitCost\n const typeConfig = MOVEMENT_TYPES.find((t) => t.value === movementType)!\n const needsReason = movementType === 'adjustment' || movementType === 'loss'\n const needsDest = movementType === 'transfer'\n\n // Product search\n function searchProducts(query: string): SearchSelectOption[] {\n const q = query.toLowerCase()\n return products\n .filter((p) => p.name.toLowerCase().includes(q) || p.sku?.toLowerCase().includes(q) || p.barcode?.includes(q))\n .slice(0, 20)\n .map((p) => ({\n id: p.id,\n label: p.name,\n subtitle: [p.sku, `${t('inventory.stock.currentStock')} ${p.currentQuantity}`].filter(Boolean).join(' · '),\n group: p.productType,\n icon: <Package className=\"h-4 w-4 text-muted-foreground shrink-0\" />,\n data: p,\n }))\n }\n\n // Auto-fill cost when product selected + fetch positions\n function handleProductSelect(id: string, option: SearchSelectOption | null) {\n setProductId(id)\n setProductLabel(option?.label ?? '')\n if (option?.data?.costPrice && unitCost === 0) {\n setUnitCost(option.data.costPrice)\n }\n // Fetch stock positions per location for this product\n if (id) {\n provider.getPositions(id).then(setPositions).catch(() => setPositions([]))\n } else {\n setPositions([])\n }\n }\n\n const canProceedStep1 = !!productId\n const canProceedStep2 = quantity > 0 && (!needsReason || reason.trim()) && (!needsDest || destLocationId)\n const title = defaultType === 'entry' ? t('inventory.stock.entry') : defaultType === 'exit' ? t('inventory.stock.exit') : t('inventory.stock.movement')\n\n async function handleSave() {\n if (!productId || quantity <= 0) return\n setSaving(true)\n try {\n const movement = await createMovement({\n productId,\n quantity,\n movementType,\n unitCost: unitCost || undefined,\n stockLocationId: locationId || undefined,\n destinationLocationId: destLocationId || undefined,\n reason: reason || undefined,\n documentNumber: documentNumber || undefined,\n notes: notes || undefined,\n batchNumber: batchNumber || undefined,\n expirationDate: expirationDate || undefined,\n })\n setSavedMovement(movement)\n } finally {\n setSaving(false)\n }\n }\n\n return (\n <div className=\"space-y-6\">\n <SubpageHeader\n title={title}\n subtitle={t('inventory.stock.stepOf', { step: String(step) })}\n onBack={step > 1 ? () => setStep(step - 1) : onSaved}\n parentLabel={t('inventory.nav.stock')}\n />\n\n {/* Progress bar */}\n <div className=\"flex gap-1\">\n {[1, 2, 3].map((s) => (\n <div key={s} className={`h-1 flex-1 rounded-full transition-colors ${s <= step ? 'bg-primary' : 'bg-muted'}`} />\n ))}\n </div>\n\n {/* Step 1: What — Type + Product */}\n {step === 1 && (\n <div className=\"space-y-5\">\n {/* Movement type selector */}\n <div>\n <p className=\"text-xs font-medium text-muted-foreground mb-2\">{t('inventory.stock.movementType')}</p>\n <div className=\"grid gap-2 sm:grid-cols-5\">\n {MOVEMENT_TYPES.map((mt) => {\n const Icon = mt.icon\n const active = movementType === mt.value\n return (\n <button\n key={mt.value}\n onClick={() => setMovementType(mt.value)}\n className={`rounded-lg border-2 p-3 text-left transition-all ${active ? mt.activeColor : 'border-transparent bg-card hover:bg-muted/30'}`}\n >\n <Icon className=\"h-4 w-4 mb-1\" />\n <p className=\"text-xs font-medium\">{t(mt.labelKey)}</p>\n <p className=\"text-[9px] text-muted-foreground mt-0.5 hidden sm:block\">{t(mt.descKey)}</p>\n </button>\n )\n })}\n </div>\n </div>\n\n {/* Product search */}\n <SearchSelect\n value={productId}\n displayValue={productLabel}\n onChange={handleProductSelect}\n onSearch={searchProducts}\n label={t('inventory.stock.product')}\n required\n placeholder={t('inventory.stock.searchProduct')}\n minChars={1}\n debounce={150}\n renderOption={(opt) => (\n <>\n {opt.icon}\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm truncate\">{opt.label}</p>\n {opt.subtitle && <p className=\"text-[10px] text-muted-foreground\">{opt.subtitle}</p>}\n </div>\n </>\n )}\n />\n\n {selectedProduct && (\n <div className=\"rounded-lg bg-muted/30 px-4 py-3 flex items-center justify-between\">\n <div>\n <p className=\"text-sm font-medium\">{selectedProduct.name}</p>\n <p className=\"text-xs text-muted-foreground\">\n {t('inventory.stock.currentStock')} <span className=\"font-medium\">{selectedProduct.currentQuantity}</span>\n {selectedProduct.minQuantity > 0 && <> · Min: {selectedProduct.minQuantity}</>}\n {selectedProduct.costPrice > 0 && <> · Cost: {formatCurrency(selectedProduct.costPrice, currency)}</>}\n </p>\n </div>\n <span className=\"inline-flex items-center rounded-full px-2 py-0.5 text-[9px] font-medium bg-muted text-muted-foreground capitalize\">{selectedProduct.productType}</span>\n </div>\n )}\n\n <div className=\"flex justify-end\">\n <button\n onClick={() => setStep(2)}\n disabled={!canProceedStep1}\n className=\"inline-flex items-center gap-1.5 rounded-lg bg-primary border border-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 shadow-button-primary active:shadow-button-inset transition-colors disabled:opacity-50\"\n >\n {t('inventory.stock.next')}\n </button>\n </div>\n </div>\n )}\n\n {/* Step 2: How much — Quantity + Cost + Location */}\n {step === 2 && (\n <div className=\"space-y-5\">\n <div className=\"rounded-lg border bg-card shadow-sm p-5 space-y-4\">\n <div className=\"grid gap-4 sm:grid-cols-3\">\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{t('inventory.stock.quantity')}</label>\n <input\n type=\"number\"\n min={0.01}\n step={0.01}\n value={quantity}\n onChange={(e) => setQuantity(Number(e.target.value) || 0)}\n autoFocus\n className=\"w-full mt-1 rounded-input border border-input bg-card shadow-[inset_0_1px_0_rgb(0_0_0_/0.06)] px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring\"\n />\n </div>\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{t('inventory.stock.unitCost')}</label>\n <div className=\"flex items-center mt-1 rounded-input border border-input bg-card shadow-[inset_0_1px_0_rgb(0_0_0_/0.06)] focus-within:ring-2 focus-within:ring-primary/20\">\n <span className=\"pl-2.5 text-xs text-muted-foreground\">{currency.symbol}</span>\n <input type=\"number\" min={0} step={0.01} value={unitCost} onChange={(e) => setUnitCost(Number(e.target.value) || 0)} className=\"flex-1 bg-transparent px-2 py-2 text-sm outline-none\" />\n </div>\n </div>\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{t('inventory.stock.total')}</label>\n <p className=\"mt-1 px-3 py-2 text-lg font-bold\">{formatCurrency(totalCost, currency)}</p>\n </div>\n </div>\n\n {/* Location — radio-style selector with stock positions */}\n {modules.stockLocations && locations.length > 0 && (\n <div className=\"space-y-3\">\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{needsDest ? t('inventory.stock.fromLocation') : t('inventory.stock.locationLabel')}</label>\n <div className=\"flex flex-wrap gap-2 mt-1.5\">\n {sortedLocations.map((l) => {\n const qty = positionByLocation[l.id] ?? 0\n return (\n <button\n key={l.id}\n type=\"button\"\n onClick={() => setLocationId(l.id)}\n className={cn(\n 'rounded-lg border-2 px-3 py-2 text-sm font-medium transition-all flex items-center gap-2',\n locationId === l.id\n ? 'border-primary bg-primary/5 text-primary'\n : 'border-transparent bg-muted/30 text-muted-foreground hover:bg-muted/50',\n )}\n >\n <span>{l.name}</span>\n {productId && (\n <span className={cn(\n 'inline-flex items-center rounded-full px-1.5 py-0.5 text-[10px] font-semibold tabular-nums',\n qty > 0\n ? 'bg-success/10 text-success'\n : 'bg-muted text-muted-foreground',\n )}>\n {qty}\n </span>\n )}\n </button>\n )\n })}\n </div>\n </div>\n {needsDest && (\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{t('inventory.stock.toLocation')}</label>\n <div className=\"flex flex-wrap gap-2 mt-1.5\">\n {sortedLocations.filter((l) => l.id !== locationId).map((l) => {\n const qty = positionByLocation[l.id] ?? 0\n return (\n <button\n key={l.id}\n type=\"button\"\n onClick={() => setDestLocationId(l.id)}\n className={cn(\n 'rounded-lg border-2 px-3 py-2 text-sm font-medium transition-all flex items-center gap-2',\n destLocationId === l.id\n ? 'border-primary bg-primary/5 text-primary'\n : 'border-transparent bg-muted/30 text-muted-foreground hover:bg-muted/50',\n )}\n >\n <span>{l.name}</span>\n {productId && (\n <span className={cn(\n 'inline-flex items-center rounded-full px-1.5 py-0.5 text-[10px] font-semibold tabular-nums',\n qty > 0\n ? 'bg-success/10 text-success'\n : 'bg-muted text-muted-foreground',\n )}>\n {qty}\n </span>\n )}\n </button>\n )\n })}\n </div>\n </div>\n )}\n </div>\n )}\n\n {/* Reason (required for adjustment/loss) */}\n {needsReason && (\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{t('inventory.stock.reason')}</label>\n <input type=\"text\" value={reason} onChange={(e) => setReason(e.target.value)} placeholder={movementType === 'loss' ? t('inventory.stock.reasonLossPlaceholder') : t('inventory.stock.reasonAdjustPlaceholder')} className=\"w-full mt-1 rounded-input border border-input bg-card shadow-[inset_0_1px_0_rgb(0_0_0_/0.06)] px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring\" />\n </div>\n )}\n </div>\n\n <div className=\"flex justify-between\">\n <button onClick={() => setStep(1)} className=\"rounded-lg border px-4 py-2 text-sm font-medium hover:bg-muted bg-card shadow-button active:shadow-button-inset transition-colors\">{t('inventory.stock.back')}</button>\n <button onClick={() => setStep(3)} disabled={!canProceedStep2} className=\"inline-flex items-center gap-1.5 rounded-lg bg-primary border border-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 shadow-button-primary active:shadow-button-inset transition-colors disabled:opacity-50\">{t('inventory.stock.next')}</button>\n </div>\n </div>\n )}\n\n {/* Step 3: Review + Optional details + Save */}\n {step === 3 && (\n <div className=\"space-y-5\">\n {/* Summary card */}\n <div className=\"rounded-lg border bg-card shadow-sm p-5\">\n <div className=\"flex items-center gap-3 mb-4\">\n <div className={`flex h-10 w-10 items-center justify-center rounded-xl ${typeConfig.activeColor}`}>\n <typeConfig.icon className=\"h-5 w-5\" />\n </div>\n <div>\n <p className=\"font-semibold\">{productLabel}</p>\n <p className=\"text-xs text-muted-foreground capitalize\">{movementType} · {quantity} units · {formatCurrency(totalCost, currency)}</p>\n </div>\n </div>\n\n <div className=\"grid gap-2 sm:grid-cols-3 text-xs border-t pt-3\">\n <div><span className=\"text-muted-foreground\">{t('inventory.stock.quantityLabel')}:</span> <span className=\"font-medium\">{quantity}</span></div>\n <div><span className=\"text-muted-foreground\">{t('inventory.stock.unitCostLabel')}:</span> <span className=\"font-medium\">{formatCurrency(unitCost, currency)}</span></div>\n <div><span className=\"text-muted-foreground\">{t('inventory.stock.total')}:</span> <span className=\"font-bold\">{formatCurrency(totalCost, currency)}</span></div>\n </div>\n </div>\n\n {/* Optional details */}\n <div className=\"rounded-lg border bg-card shadow-sm p-5 space-y-4\">\n <p className=\"text-xs font-medium text-muted-foreground\">{t('inventory.stock.additionalDetails')}</p>\n <div className=\"grid gap-4 sm:grid-cols-2\">\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{t('inventory.stock.documentNumber')}</label>\n <input type=\"text\" value={documentNumber} onChange={(e) => setDocumentNumber(e.target.value)} placeholder={t('inventory.stock.documentPlaceholder')} className=\"w-full mt-1 rounded-input border border-input bg-card shadow-[inset_0_1px_0_rgb(0_0_0_/0.06)] px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring\" />\n </div>\n {modules.batchTracking && (\n <>\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{t('inventory.stock.batchNumber')}</label>\n <input type=\"text\" value={batchNumber} onChange={(e) => setBatchNumber(e.target.value)} placeholder={t('inventory.stock.batchPlaceholder')} className=\"w-full mt-1 rounded-input border border-input bg-card shadow-[inset_0_1px_0_rgb(0_0_0_/0.06)] px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring\" />\n </div>\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{t('inventory.stock.expirationDate')}</label>\n <DatePicker value={expirationDate} onChange={setExpirationDate} className=\"mt-1\" />\n </div>\n </>\n )}\n </div>\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{t('inventory.stock.notes')}</label>\n <textarea value={notes} onChange={(e) => setNotes(e.target.value)} rows={2} placeholder={t('inventory.stock.notesPlaceholder')} className=\"w-full mt-1 rounded-input border border-input bg-card shadow-[inset_0_1px_0_rgb(0_0_0_/0.06)] px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring resize-none\" />\n </div>\n </div>\n\n <div className=\"flex justify-between\">\n <button onClick={() => setStep(2)} className=\"rounded-lg border px-4 py-2 text-sm font-medium hover:bg-muted bg-card shadow-button active:shadow-button-inset transition-colors\">{t('inventory.stock.back')}</button>\n <button\n onClick={handleSave}\n disabled={saving}\n className=\"inline-flex items-center gap-1.5 rounded-lg bg-primary border border-primary px-5 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 shadow-button-primary active:shadow-button-inset transition-colors disabled:opacity-50\"\n >\n <Check className=\"h-3.5 w-3.5\" /> {saving ? t('inventory.stock.recording') : t('inventory.stock.recordMovement')}\n </button>\n </div>\n </div>\n )}\n </div>\n )\n}\n","import React, { useEffect, useState, useMemo } from 'react'\nimport { ArrowUpRight, ArrowDownRight, RefreshCw, ArrowRightLeft, Trash2 } from 'lucide-react'\nimport type { ColumnDef } from '@tanstack/react-table'\nimport { ListView } from '@fayz-ai/ui'\nimport { useInventoryStore, formatCurrency, useInventoryConfig } from '../context'\nimport { useTranslation } from '@fayz-ai/core'\nimport { SubpageHeader } from '@fayz-ai/ui'\nimport type { MovementType, StockMovement } from '../types'\n\nconst TYPE_ICONS: Record<MovementType, React.ElementType> = {\n entry: ArrowDownRight,\n exit: ArrowUpRight,\n adjustment: RefreshCw,\n transfer: ArrowRightLeft,\n loss: Trash2,\n}\n\nconst TYPE_COLORS: Record<MovementType, string> = {\n entry: 'text-success',\n exit: 'text-destructive',\n adjustment: 'text-info',\n transfer: 'text-magic',\n loss: 'text-warning',\n}\n\nexport function MovementHistoryView({ onViewDetail }: { onViewDetail?: (id: string) => void } = {}) {\n const t = useTranslation()\n const { currency } = useInventoryConfig()\n const movements = useInventoryStore((s) => s.movements)\n const movementsLoading = useInventoryStore((s) => s.movementsLoading)\n const fetchMovements = useInventoryStore((s) => s.fetchMovements)\n\n const [search, setSearch] = useState('')\n\n useEffect(() => { fetchMovements({ search: search || undefined }) }, [search])\n\n const columns: ColumnDef<StockMovement, any>[] = useMemo(() => [\n {\n accessorKey: 'movementDate', header: t('inventory.history.columnDate'),\n cell: ({ getValue }: any) => <span className=\"text-xs text-muted-foreground\">{getValue() as string}</span>,\n },\n {\n accessorKey: 'productName', header: t('inventory.history.columnProduct'),\n cell: ({ getValue }: any) => <span className=\"font-medium\">{(getValue() as string) ?? '—'}</span>,\n },\n {\n accessorKey: 'movementType', header: t('inventory.history.columnType'),\n cell: ({ getValue }: any) => {\n const type = getValue() as MovementType\n const Icon = TYPE_ICONS[type] ?? RefreshCw\n const color = TYPE_COLORS[type] ?? 'text-muted-foreground'\n return (\n <span className={`inline-flex items-center gap-1 ${color}`}>\n <Icon className=\"h-3 w-3\" />\n <span className=\"text-xs capitalize\">{type}</span>\n </span>\n )\n },\n },\n {\n id: 'location', header: t('inventory.history.columnLocation'),\n cell: ({ row }: any) => (\n <span className=\"text-xs text-muted-foreground\">\n {row.original.stockLocationName ?? '—'}\n {row.original.movementType === 'transfer' && row.original.destinationLocationName && (\n <span> → {row.original.destinationLocationName}</span>\n )}\n </span>\n ),\n },\n {\n accessorKey: 'quantity', header: t('inventory.history.columnQty'),\n cell: ({ row }: any) => (\n <span className=\"text-right block\">\n {row.original.movementType === 'entry' ? '+' : '-'}{row.original.quantity}\n </span>\n ),\n },\n {\n accessorKey: 'totalCost', header: t('inventory.history.columnTotal'),\n cell: ({ getValue }: any) => (\n <span className=\"text-right block text-muted-foreground\">{formatCurrency(getValue() as number, currency)}</span>\n ),\n },\n ], [currency, t])\n\n return (\n <div className=\"space-y-4\">\n <SubpageHeader title={t('inventory.history.title')} subtitle={t('inventory.history.subtitle')} />\n\n <ListView<StockMovement>\n columns={columns}\n data={movements}\n loading={movementsLoading}\n searchPlaceholder={t('inventory.history.searchPlaceholder')}\n search={search}\n onSearchChange={setSearch}\n searchDebounce={0}\n onRowClick={onViewDetail ? (row) => onViewDetail(row.id) : undefined}\n emptyMessage={t('inventory.history.noMovements')}\n />\n </div>\n )\n}\n","import React, { useEffect } from 'react'\nimport { BookOpen, Plus, Clock, Layers } from 'lucide-react'\nimport { useInventoryStore } from '../context'\nimport { useTranslation } from '@fayz-ai/core'\nimport { SubpageHeader } from '@fayz-ai/ui'\nimport { PermissionGate } from '@fayz-ai/admin'\n\nfunction RecipeSkeleton() {\n return (\n <div className=\"grid gap-3 sm:grid-cols-2 lg:grid-cols-3\">\n {[1, 2, 3, 4, 5, 6].map((i) => (\n <div key={i} className=\"rounded-lg border bg-card shadow-sm p-4 space-y-3\">\n <div className=\"flex items-center gap-3\">\n <div className=\"h-9 w-9 rounded-lg bg-muted/40 animate-pulse\" />\n <div className=\"flex-1 space-y-1.5\">\n <div className=\"h-4 w-2/3 rounded bg-muted/40 animate-pulse\" />\n <div className=\"h-3 w-1/2 rounded bg-muted/30 animate-pulse\" />\n </div>\n </div>\n <div className=\"flex gap-3\">\n <div className=\"h-3 w-20 rounded bg-muted/30 animate-pulse\" />\n <div className=\"h-3 w-16 rounded bg-muted/30 animate-pulse\" />\n </div>\n </div>\n ))}\n </div>\n )\n}\n\nexport function RecipesView({ onNew, onView }: { onNew?: () => void; onView?: (id: string) => void }) {\n const t = useTranslation()\n const recipes = useInventoryStore((s) => s.recipes)\n const recipesLoading = useInventoryStore((s) => s.recipesLoading)\n const fetchRecipes = useInventoryStore((s) => s.fetchRecipes)\n\n useEffect(() => { fetchRecipes() }, [])\n\n return (\n <div className=\"space-y-4\">\n <SubpageHeader\n title={t('inventory.recipes.title')}\n subtitle={t('inventory.recipes.productionFormulas', { count: String(recipes.length) })}\n actions={onNew && (\n <PermissionGate feature=\"inventory\" action=\"create\">\n <button onClick={onNew} className=\"inline-flex items-center gap-1.5 rounded-lg bg-primary border border-primary px-3 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 shadow-button-primary active:shadow-button-inset transition-colors\">\n <Plus className=\"h-3.5 w-3.5\" /> {t('inventory.recipes.newRecipe')}\n </button>\n </PermissionGate>\n )}\n />\n\n {recipesLoading ? (\n <RecipeSkeleton />\n ) : recipes.length === 0 ? (\n <div className=\"flex flex-col items-center justify-center py-16 text-center rounded-lg border-2 border-dashed border-muted\">\n <div className=\"flex h-12 w-12 items-center justify-center rounded-2xl bg-muted/30 mb-3\">\n <BookOpen className=\"h-5 w-5 text-muted-foreground/40\" />\n </div>\n <p className=\"text-sm text-muted-foreground\">{t('inventory.recipes.noRecipes')}</p>\n <p className=\"text-[10px] text-muted-foreground/60 mt-0.5\">{t('inventory.recipes.recipesDesc')}</p>\n {onNew && <button onClick={onNew} className=\"text-xs text-primary hover:underline mt-2\">{t('inventory.recipes.createFirst')}</button>}\n </div>\n ) : (\n <div className=\"grid gap-3 sm:grid-cols-2 lg:grid-cols-3\">\n {recipes.map((r) => (\n <div\n key={r.id}\n onClick={() => onView?.(r.id)}\n className=\"rounded-lg border bg-card p-4 hover:shadow-sm hover:border-primary/20 transition-all cursor-pointer group\"\n >\n <div className=\"flex items-center gap-3\">\n <div className=\"flex h-9 w-9 items-center justify-center rounded-lg bg-primary/10 text-primary shrink-0 group-hover:bg-primary/15 transition-colors\">\n <BookOpen className=\"h-4 w-4\" />\n </div>\n <div className=\"min-w-0\">\n <h3 className=\"text-sm font-semibold truncate\">{r.name}</h3>\n {r.productName && <p className=\"text-[10px] text-muted-foreground truncate\">{t('inventory.recipes.produces')} {r.productName}</p>}\n </div>\n </div>\n {r.description && (\n <p className=\"text-xs text-muted-foreground mt-2 line-clamp-2\">{r.description}</p>\n )}\n <div className=\"flex items-center gap-4 mt-3 pt-2.5 border-t\">\n {r.ingredientCount != null && (\n <span className=\"inline-flex items-center gap-1 text-[10px] text-muted-foreground\">\n <Layers className=\"h-3 w-3\" /> {t('inventory.recipes.ingredients', { count: String(r.ingredientCount) })}\n </span>\n )}\n {r.preparationTimeMinutes != null && (\n <span className=\"inline-flex items-center gap-1 text-[10px] text-muted-foreground\">\n <Clock className=\"h-3 w-3\" /> {r.preparationTimeMinutes} min\n </span>\n )}\n {r.yieldQuantity > 0 && (\n <span className=\"text-[10px] text-muted-foreground ml-auto\">\n {t('inventory.recipes.yield')} {r.yieldQuantity}{r.yieldUnitName ? ` ${r.yieldUnitName}` : ''}\n </span>\n )}\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n )\n}\n","import React, { useState } from 'react'\nimport { Plus, Trash2, GripVertical } from 'lucide-react'\nimport { useInventoryStore, useInventoryProvider } from '../context'\nimport { toast } from '@fayz-ai/ui'\nimport { SubpageHeader, useSaveBar } from '@fayz-ai/ui'\nimport { useTranslation } from '@fayz-ai/core'\nimport { SearchSelect } from '@fayz-ai/ui'\nimport { useLimitGuard, invalidateLimit } from '@fayz-ai/admin'\nimport type { CreateRecipeIngredientInput } from '../types'\n\ninterface FormIngredient {\n _id: string\n productId: string\n productName: string\n quantity: number\n unitId: string\n unitName: string\n notes: string\n}\n\nlet fid = 1\nfunction nextId() { return `ri${fid++}` }\n\nexport function RecipeFormView({ onSaved }: { onSaved?: (id?: string) => void }) {\n const t = useTranslation()\n const provider = useInventoryProvider()\n const createRecipe = useInventoryStore((s) => s.createRecipe)\n const guardRecipes = useLimitGuard('recipes')\n\n const [name, setName] = useState('')\n const [description, setDescription] = useState('')\n const [productId, setProductId] = useState('')\n const [productName, setProductName] = useState('')\n const [yieldQuantity, setYieldQuantity] = useState(1)\n const [prepTime, setPrepTime] = useState('')\n const [instructions, setInstructions] = useState('')\n const [ingredients, setIngredients] = useState<FormIngredient[]>([])\n const [saving, setSaving] = useState(false)\n\n function addIngredient() {\n setIngredients([...ingredients, { _id: nextId(), productId: '', productName: '', quantity: 1, unitId: '', unitName: '', notes: '' }])\n }\n\n function updateIngredient(id: string, data: Partial<FormIngredient>) {\n setIngredients(ingredients.map((ing) => ing._id === id ? { ...ing, ...data } : ing))\n }\n\n function removeIngredient(id: string) {\n setIngredients(ingredients.filter((ing) => ing._id !== id))\n }\n\n async function handleSave() {\n if (!name.trim() || !productId || ingredients.length === 0) { toast.error(t('common.formIncomplete')); return }\n // Plan quantity guard (client-side, before the provider call). Opens the\n // global UpgradeModal and aborts when the plan's recipe cap is reached.\n if ((await guardRecipes()) === 'blocked') return\n setSaving(true)\n try {\n const recipe = await createRecipe({\n name,\n description: description || undefined,\n productId,\n yieldQuantity,\n preparationTimeMinutes: prepTime ? parseInt(prepTime) : undefined,\n instructions: instructions || undefined,\n ingredients: ingredients.filter((i) => i.productId).map((i, idx) => ({\n productId: i.productId,\n quantity: i.quantity,\n unitId: i.unitId || undefined,\n displayOrder: idx,\n notes: i.notes || undefined,\n })),\n })\n invalidateLimit('recipes')\n onSaved?.(recipe.id)\n } finally { setSaving(false) }\n }\n\n const dirty = !!(name || description || productId || prepTime || instructions || ingredients.length > 0 || yieldQuantity !== 1)\n useSaveBar({\n dirty,\n saving,\n onSave: () => { void handleSave() },\n onDiscard: () => onSaved?.(),\n saveLabel: t('inventory.recipeForm.saveRecipe'),\n })\n\n async function searchProducts(query: string) {\n const result = await provider.getProducts({ search: query, pageSize: 10 })\n return result.data.map((p) => ({ id: p.id, label: p.name, subtitle: p.sku ?? p.productType, data: p }))\n }\n\n async function quickCreateProduct(name: string, type: 'ingredient' | 'sale' = 'ingredient') {\n try {\n const product = await provider.createProduct({ name, productType: type })\n toast.success(`Product \"${name}\" created`)\n return product\n } catch {\n toast.error('Failed to create product')\n return null\n }\n }\n\n return (\n <div className=\"space-y-5\">\n <SubpageHeader\n title={t('inventory.recipeForm.newRecipe')}\n subtitle={t('inventory.recipeForm.subtitle')}\n onBack={() => onSaved?.()}\n parentLabel={t('inventory.nav.recipes')}\n />\n\n <div className=\"grid gap-4 lg:grid-cols-3\">\n {/* Left: Recipe details */}\n <div className=\"rounded-lg border bg-card shadow-sm p-5 space-y-4\">\n <h3 className=\"text-sm font-semibold\">{t('inventory.recipeForm.recipeDetails')}</h3>\n\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{t('inventory.recipeForm.recipeName')} *</label>\n <input type=\"text\" value={name} onChange={(e) => setName(e.target.value)} placeholder={t('inventory.recipeForm.recipeNamePlaceholder')} autoFocus className=\"w-full mt-1 rounded-input border border-input bg-card shadow-[inset_0_1px_0_rgb(0_0_0_/0.06)] px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring\" />\n </div>\n\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{t('inventory.recipeForm.description')}</label>\n <textarea value={description} onChange={(e) => setDescription(e.target.value)} rows={2} placeholder={t('inventory.recipeForm.descriptionPlaceholder')} className=\"w-full mt-1 rounded-input border border-input bg-card shadow-[inset_0_1px_0_rgb(0_0_0_/0.06)] px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring resize-none\" />\n </div>\n\n <SearchSelect\n label={`${t('inventory.recipeForm.produces')} *`}\n value={productId}\n displayValue={productName}\n onChange={(id, opt) => { setProductId(id); setProductName(opt?.label ?? '') }}\n onSearch={searchProducts}\n placeholder={t('inventory.recipeForm.searchProduct')}\n allowCreate\n createLabel={t('inventory.recipeForm.createProduct')}\n onCreate={async (q) => {\n const p = await quickCreateProduct(q, 'sale')\n if (p) { setProductId(p.id); setProductName(p.name) }\n }}\n />\n\n <div className=\"grid grid-cols-2 gap-3\">\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{t('inventory.recipeForm.yieldQuantity')}</label>\n <input type=\"number\" min={0.01} step={0.01} value={yieldQuantity} onChange={(e) => setYieldQuantity(Number(e.target.value) || 1)} className=\"w-full mt-1 rounded-input border border-input bg-card shadow-[inset_0_1px_0_rgb(0_0_0_/0.06)] px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring\" />\n </div>\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{t('inventory.recipeForm.prepTime')}</label>\n <input type=\"number\" min={0} value={prepTime} onChange={(e) => setPrepTime(e.target.value)} placeholder=\"—\" className=\"w-full mt-1 rounded-input border border-input bg-card shadow-[inset_0_1px_0_rgb(0_0_0_/0.06)] px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring\" />\n </div>\n </div>\n\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{t('inventory.recipeForm.instructions')}</label>\n <textarea value={instructions} onChange={(e) => setInstructions(e.target.value)} rows={4} placeholder={t('inventory.recipeForm.instructionsPlaceholder')} className=\"w-full mt-1 rounded-input border border-input bg-card shadow-[inset_0_1px_0_rgb(0_0_0_/0.06)] px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring resize-none\" />\n </div>\n </div>\n\n {/* Right: Ingredients */}\n <div className=\"lg:col-span-2 rounded-lg border bg-card shadow-sm overflow-hidden flex flex-col\">\n <div className=\"flex items-center justify-between px-4 py-3 border-b\">\n <h3 className=\"text-sm font-semibold\">{t('inventory.recipeForm.ingredients')}</h3>\n <button onClick={addIngredient} className=\"inline-flex items-center gap-1.5 rounded-lg bg-primary border border-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90 shadow-button-primary active:shadow-button-inset transition-colors\">\n <Plus className=\"h-3 w-3\" /> {t('inventory.recipeForm.addIngredient')}\n </button>\n </div>\n\n <div className=\"flex-1\">\n {ingredients.length === 0 ? (\n <div className=\"py-12 text-center\">\n <p className=\"text-sm text-muted-foreground\">{t('inventory.recipeForm.noIngredients')}</p>\n <button onClick={addIngredient} className=\"text-xs text-primary hover:underline mt-1\">{t('inventory.recipeForm.addFirstIngredient')}</button>\n </div>\n ) : (\n <div className=\"divide-y\">\n {/* Header */}\n <div className=\"grid grid-cols-12 gap-2 px-4 py-2 text-[10px] font-medium text-muted-foreground uppercase tracking-wider bg-muted/20\">\n <div className=\"col-span-5\">{t('inventory.recipeForm.ingredient')}</div>\n <div className=\"col-span-2\">{t('inventory.recipeForm.quantity')}</div>\n <div className=\"col-span-4\">{t('inventory.recipeForm.notes')}</div>\n <div className=\"col-span-1\" />\n </div>\n {ingredients.map((ing, idx) => (\n <div key={ing._id} className=\"grid grid-cols-12 gap-2 px-4 py-2.5 items-center group\">\n <div className=\"col-span-5\">\n <SearchSelect\n value={ing.productId}\n displayValue={ing.productName}\n onChange={(id, opt) => updateIngredient(ing._id, { productId: id, productName: opt?.label ?? '' })}\n onSearch={searchProducts}\n placeholder={t('inventory.recipeForm.searchIngredient')}\n allowCreate\n createLabel={t('inventory.recipeForm.createIngredient')}\n onCreate={async (q) => {\n const p = await quickCreateProduct(q, 'ingredient')\n if (p) updateIngredient(ing._id, { productId: p.id, productName: p.name })\n }}\n />\n </div>\n <div className=\"col-span-2\">\n <input\n type=\"number\"\n min={0.01}\n step={0.01}\n value={ing.quantity}\n onChange={(e) => updateIngredient(ing._id, { quantity: Number(e.target.value) || 0 })}\n className=\"w-full rounded-input border border-input bg-card shadow-[inset_0_1px_0_rgb(0_0_0_/0.06)] px-2 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-ring\"\n />\n </div>\n <div className=\"col-span-4\">\n <input\n type=\"text\"\n value={ing.notes}\n onChange={(e) => updateIngredient(ing._id, { notes: e.target.value })}\n placeholder={t('inventory.recipeForm.notesPlaceholder')}\n className=\"w-full rounded-input border border-input bg-card shadow-[inset_0_1px_0_rgb(0_0_0_/0.06)] px-2 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-ring\"\n />\n </div>\n <div className=\"col-span-1 flex justify-end\">\n <button onClick={() => removeIngredient(ing._id)} className=\"p-1 text-muted-foreground opacity-0 group-hover:opacity-100 hover:text-destructive transition-all\">\n <Trash2 className=\"h-3.5 w-3.5\" />\n </button>\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n\n {/* Footer */}\n {ingredients.length > 0 && (\n <div className=\"px-4 py-3 border-t bg-muted/20 text-xs text-muted-foreground\">\n {t('inventory.recipeForm.ingredientsConfigured', { configured: String(ingredients.filter((i) => i.productId).length), total: String(ingredients.length) })}\n </div>\n )}\n </div>\n </div>\n </div>\n )\n}\n","import React, { useEffect, useState } from 'react'\nimport { BookOpen, Clock, Layers, Package } from 'lucide-react'\nimport type { ColumnDef } from '@tanstack/react-table'\nimport { useInventoryProvider } from '../context'\nimport { useTranslation } from '@fayz-ai/core'\nimport { Breadcrumb, DataTable } from '@fayz-ai/ui'\nimport type { Recipe, RecipeIngredient } from '../types'\n\nfunction DetailSkeleton() {\n return (\n <div className=\"space-y-5\">\n <div className=\"flex items-center gap-3\">\n <div className=\"h-12 w-12 rounded-xl bg-muted/40 animate-pulse\" />\n <div className=\"space-y-2 flex-1\">\n <div className=\"h-5 w-40 rounded bg-muted/40 animate-pulse\" />\n <div className=\"h-3 w-24 rounded bg-muted/30 animate-pulse\" />\n </div>\n </div>\n <div className=\"rounded-xl border divide-y\">\n {[1, 2, 3].map((i) => (\n <div key={i} className=\"flex items-center gap-3 px-4 py-3\">\n <div className=\"h-3 w-20 rounded bg-muted/30 animate-pulse\" />\n <div className=\"flex-1\" />\n <div className=\"h-3 w-16 rounded bg-muted/40 animate-pulse\" />\n </div>\n ))}\n </div>\n <div className=\"rounded-xl border p-4 space-y-2\">\n {[1, 2, 3, 4].map((i) => (\n <div key={i} className=\"flex items-center gap-3\">\n <div className=\"h-3.5 w-6 rounded bg-muted/30 animate-pulse\" />\n <div className=\"h-3.5 flex-1 rounded bg-muted/30 animate-pulse\" />\n <div className=\"h-3.5 w-12 rounded bg-muted/40 animate-pulse\" />\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nexport function RecipeDetailView({ recipeId, onBack }: { recipeId: string; onBack: () => void }) {\n const t = useTranslation()\n const provider = useInventoryProvider()\n const [recipe, setRecipe] = useState<Recipe | null>(null)\n const [ingredients, setIngredients] = useState<RecipeIngredient[]>([])\n const [loading, setLoading] = useState(true)\n\n useEffect(() => {\n setLoading(true)\n Promise.all([\n provider.getRecipeById(recipeId),\n provider.getRecipeIngredients(recipeId),\n ]).then(([r, ings]) => {\n setRecipe(r)\n setIngredients(ings.sort((a, b) => a.displayOrder - b.displayOrder))\n setLoading(false)\n })\n }, [recipeId])\n\n if (loading) {\n return (\n <div className=\"space-y-6\">\n <Breadcrumb parent={t('inventory.nav.recipes')} current={t('inventory.recipeDetail.loading')} onBack={onBack} />\n <DetailSkeleton />\n </div>\n )\n }\n\n if (!recipe) {\n return (\n <div className=\"space-y-6\">\n <Breadcrumb parent={t('inventory.nav.recipes')} onBack={onBack} />\n <div className=\"flex flex-col items-center justify-center py-16 text-center rounded-lg border-2 border-dashed border-muted\">\n <BookOpen className=\"h-8 w-8 text-muted-foreground/30 mb-2\" />\n <p className=\"text-sm text-muted-foreground\">{t('inventory.recipeDetail.notFound')}</p>\n <button onClick={onBack} className=\"text-xs text-primary hover:underline mt-1\">{t('inventory.recipeDetail.backToList')}</button>\n </div>\n </div>\n )\n }\n\n const ingredientColumns: ColumnDef<RecipeIngredient, any>[] = [\n {\n id: 'index', header: '#',\n cell: ({ row }) => <span className=\"text-xs text-muted-foreground\">{row.index + 1}</span>,\n },\n {\n accessorKey: 'productName', header: t('inventory.recipeDetail.ingredient'),\n cell: ({ getValue }) => <span className=\"font-medium\">{(getValue() as string) || '—'}</span>,\n },\n {\n accessorKey: 'quantity', header: () => <span className=\"block text-right\">{t('inventory.recipeDetail.quantity')}</span>,\n cell: ({ getValue }) => <span className=\"block text-right tabular-nums\">{getValue() as number}</span>,\n },\n {\n accessorKey: 'unitName', header: t('inventory.recipeDetail.unit'),\n cell: ({ getValue }) => <span className=\"text-xs text-muted-foreground\">{(getValue() as string) || '—'}</span>,\n },\n {\n accessorKey: 'notes', header: t('inventory.recipeDetail.notes'),\n cell: ({ getValue }) => <span className=\"text-xs text-muted-foreground\">{(getValue() as string) || '—'}</span>,\n },\n ]\n\n return (\n <div className=\"space-y-6\">\n {/* Breadcrumb */}\n <Breadcrumb parent={t('inventory.nav.recipes')} current={recipe.name} onBack={onBack} />\n\n {/* Hero */}\n <div className=\"flex items-start gap-4\">\n <div className=\"flex h-14 w-14 shrink-0 items-center justify-center rounded-2xl bg-primary/10 text-primary\">\n <BookOpen className=\"h-6 w-6\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <h1 className=\"text-2xl font-bold text-foreground\">{recipe.name}</h1>\n {recipe.description && <p className=\"text-muted-foreground mt-0.5 text-sm\">{recipe.description}</p>}\n <div className=\"flex items-center gap-3 mt-2\">\n {recipe.isActive ? (\n <span className=\"inline-flex items-center gap-1 text-[10px] text-success\"><span className=\"h-1.5 w-1.5 rounded-full bg-success\" /> {t('inventory.recipeDetail.active')}</span>\n ) : (\n <span className=\"inline-flex items-center gap-1 text-[10px] text-muted-foreground/50\"><span className=\"h-1.5 w-1.5 rounded-full bg-muted-foreground/30\" /> {t('inventory.recipeDetail.inactive')}</span>\n )}\n </div>\n </div>\n </div>\n\n <div className=\"border-t\" />\n\n <div className=\"grid gap-4 lg:grid-cols-3\">\n {/* Left: Info */}\n <div className=\"space-y-4\">\n {/* Metrics */}\n <div className=\"rounded-xl border divide-y\">\n {recipe.productName && (\n <div className=\"flex items-center gap-3 px-4 py-3\">\n <Package className=\"h-4 w-4 text-muted-foreground shrink-0\" />\n <span className=\"text-xs text-muted-foreground flex-1\">{t('inventory.recipeDetail.produces')}</span>\n <span className=\"text-sm font-medium\">{recipe.productName}</span>\n </div>\n )}\n <div className=\"flex items-center gap-3 px-4 py-3\">\n <Layers className=\"h-4 w-4 text-muted-foreground shrink-0\" />\n <span className=\"text-xs text-muted-foreground flex-1\">{t('inventory.recipeDetail.yield')}</span>\n <span className=\"text-sm font-medium\">{recipe.yieldQuantity}{recipe.yieldUnitName ? ` ${recipe.yieldUnitName}` : ''}</span>\n </div>\n {recipe.preparationTimeMinutes != null && (\n <div className=\"flex items-center gap-3 px-4 py-3\">\n <Clock className=\"h-4 w-4 text-muted-foreground shrink-0\" />\n <span className=\"text-xs text-muted-foreground flex-1\">{t('inventory.recipeDetail.prepTime')}</span>\n <span className=\"text-sm font-medium\">{recipe.preparationTimeMinutes} min</span>\n </div>\n )}\n <div className=\"flex items-center gap-3 px-4 py-3\">\n <Layers className=\"h-4 w-4 text-muted-foreground shrink-0\" />\n <span className=\"text-xs text-muted-foreground flex-1\">{t('inventory.recipeDetail.ingredientCount')}</span>\n <span className=\"text-sm font-medium\">{ingredients.length}</span>\n </div>\n </div>\n\n {/* Instructions */}\n {recipe.instructions && (\n <div>\n <h3 className=\"text-sm font-semibold text-foreground mb-1\">{t('inventory.recipeDetail.instructions')}</h3>\n <div className=\"rounded-xl border bg-card shadow-sm px-4 py-3\">\n <p className=\"text-xs text-muted-foreground whitespace-pre-wrap leading-relaxed\">{recipe.instructions}</p>\n </div>\n </div>\n )}\n\n {/* Dates */}\n <div className=\"flex items-center gap-4 text-[10px] text-muted-foreground/50\">\n <span>{t('inventory.recipeDetail.created')} {recipe.createdAt?.slice(0, 10)}</span>\n <span>{t('inventory.recipeDetail.updated')} {recipe.updatedAt?.slice(0, 10)}</span>\n </div>\n </div>\n\n {/* Right: Ingredients table */}\n <div className=\"lg:col-span-2\">\n <h3 className=\"text-sm font-semibold text-foreground mb-2\">{t('inventory.recipeDetail.ingredientsTitle')}</h3>\n {ingredients.length === 0 ? (\n <div className=\"rounded-xl border p-8 text-center\">\n <p className=\"text-xs text-muted-foreground\">{t('inventory.recipeDetail.noIngredients')}</p>\n </div>\n ) : (\n <DataTable columns={ingredientColumns} data={ingredients} variant=\"card\" />\n )}\n </div>\n </div>\n </div>\n )\n}\n","import React from 'react'\nimport { SettingsGroup, ToggleRow, useTenantPluginSettings } from '@fayz-ai/admin'\nimport { useTranslation } from '@fayz-ai/core'\n\n// Per-tenant defaults = the values that used to be hardcoded here. Persisted +\n// re-hydrated per tenant; behavioural consumption is a follow-up.\nconst INVENTORY_DEFAULTS = {\n lowStockAlerts: true,\n requireReason: true,\n autoDeduct: false,\n requireSku: false,\n allowNegative: false,\n lowStockEmail: false,\n expiryWarnings: true,\n}\n\nexport function InventoryGeneralSettings() {\n const t = useTranslation()\n const s = useTenantPluginSettings('inventory', INVENTORY_DEFAULTS)\n return (\n <div className=\"space-y-4\">\n <SettingsGroup title={t('inventory.settings.stockManagement')} description={t('inventory.settings.stockManagementDesc')}>\n <ToggleRow label={t('inventory.settings.lowStockAlerts')} description={t('inventory.settings.lowStockAlertsDesc')} checked={s.get('lowStockAlerts')} onChange={(v) => s.set('lowStockAlerts', v)} />\n <ToggleRow label={t('inventory.settings.requireReason')} description={t('inventory.settings.requireReasonDesc')} checked={s.get('requireReason')} onChange={(v) => s.set('requireReason', v)} />\n <ToggleRow label={t('inventory.settings.autoDeduct')} description={t('inventory.settings.autoDeductDesc')} checked={s.get('autoDeduct')} onChange={(v) => s.set('autoDeduct', v)} />\n </SettingsGroup>\n\n <SettingsGroup title={t('inventory.settings.products')} description={t('inventory.settings.productsDesc')}>\n <ToggleRow label={t('inventory.settings.requireSku')} description={t('inventory.settings.requireSkuDesc')} checked={s.get('requireSku')} onChange={(v) => s.set('requireSku', v)} />\n <ToggleRow label={t('inventory.settings.allowNegative')} description={t('inventory.settings.allowNegativeDesc')} checked={s.get('allowNegative')} onChange={(v) => s.set('allowNegative', v)} />\n </SettingsGroup>\n\n <SettingsGroup title={t('inventory.settings.notifications')} description={t('inventory.settings.notificationsDesc')}>\n <ToggleRow label={t('inventory.settings.lowStockEmail')} description={t('inventory.settings.lowStockEmailDesc')} checked={s.get('lowStockEmail')} onChange={(v) => s.set('lowStockEmail', v)} />\n <ToggleRow label={t('inventory.settings.expiryWarnings')} description={t('inventory.settings.expiryWarningsDesc')} checked={s.get('expiryWarnings')} onChange={(v) => s.set('expiryWarnings', v)} />\n </SettingsGroup>\n </div>\n )\n}\n","import React, { useState } from 'react'\nimport { Package, Ruler, MapPin, ChevronRight, Check } from 'lucide-react'\nimport { useTranslation } from '@fayz-ai/core'\nimport { Button } from '@fayz-ai/ui'\n\nconst STEPS = [\n { id: 'welcome', icon: Package, titleKey: 'inventory.onboarding.welcome', descKey: 'inventory.onboarding.description' },\n { id: 'units', icon: Ruler, titleKey: 'inventory.onboarding.units.title', descKey: 'inventory.onboarding.units.description' },\n { id: 'locations', icon: MapPin, titleKey: 'inventory.onboarding.locations.title', descKey: 'inventory.onboarding.locations.description' },\n]\n\nexport function InventoryOnboarding({ onComplete }: { onComplete: () => void }) {\n const t = useTranslation()\n const [step, setStep] = useState(0)\n const current = STEPS[step]\n const isLast = step === STEPS.length - 1\n const Icon = current.icon\n\n return (\n <div className=\"flex items-center justify-center py-12\">\n <div className=\"w-full max-w-lg\">\n <div className=\"flex items-center gap-1 mb-8\">\n {STEPS.map((_, i) => (\n <div key={i} className={`h-1 flex-1 rounded-full transition-colors ${i <= step ? 'bg-primary' : 'bg-muted'}`} />\n ))}\n </div>\n <div className=\"rounded-card border bg-card p-8 text-center space-y-6 shadow-sm\">\n <div className=\"flex justify-center\">\n <div className=\"flex h-16 w-16 items-center justify-center rounded-2xl bg-primary/10\">\n <Icon className=\"h-8 w-8 text-primary\" />\n </div>\n </div>\n <div>\n <h2 className=\"text-xl font-bold\">{t(current.titleKey)}</h2>\n <p className=\"text-sm text-muted-foreground mt-2 max-w-sm mx-auto\">{t(current.descKey)}</p>\n </div>\n <div className=\"flex items-center justify-center gap-3 pt-2\">\n {step > 0 && (\n <Button variant=\"outline\" size=\"lg\" onClick={() => setStep(step - 1)}>{t('common.back')}</Button>\n )}\n {isLast ? (\n <Button variant=\"default\" size=\"lg\" onClick={onComplete}>\n <Check className=\"h-4 w-4\" /> {t('inventory.onboarding.start')}\n </Button>\n ) : (\n <Button variant=\"default\" size=\"lg\" onClick={() => setStep(step + 1)}>\n {step === 0 ? t('inventory.onboarding.getStarted') : t('common.continue')} <ChevronRight className=\"h-4 w-4\" />\n </Button>\n )}\n </div>\n {step === 0 && (\n <button onClick={onComplete} className=\"text-xs text-muted-foreground hover:text-foreground transition-colors\">\n {t('inventory.onboarding.skip')}\n </button>\n )}\n </div>\n </div>\n </div>\n )\n}\n","import React, { useState, useMemo } from 'react'\nimport type { StoreApi } from 'zustand/vanilla'\nimport { ModulePage, PageTransition, type ModuleNavItem } from '@fayz-ai/ui'\nimport { InventoryContextProvider, type ResolvedInventoryConfig } from '../context'\nimport type { InventoryDataProvider } from '../data/types'\nimport type { InventoryUIState } from '../store'\nimport type { PluginRegistryDef, PluginQuickAction } from '@fayz-ai/core'\nimport { useModuleNavigation, ModuleActionBar, createViewRouter } from '@fayz-ai/admin'\nimport { useTranslation } from '@fayz-ai/core'\nimport { DashboardView } from './DashboardView'\nimport { ProductListView } from './ProductListView'\nimport { ProductCrudForm } from './ProductCrudForm'\nimport { StockMovementView } from './StockMovementView'\nimport { MovementHistoryView } from './MovementHistoryView'\nimport { RecipesView } from './RecipesView'\nimport { RecipeFormView } from './RecipeFormView'\nimport { RecipeDetailView } from './RecipeDetailView'\nimport { InventoryGeneralSettings } from '../components/InventoryGeneralSettings'\nimport { InventoryOnboarding } from '../components/InventoryOnboarding'\n\nfunction buildNav(config: ResolvedInventoryConfig, view: string, navigate: (v: string) => void, t: (key: string) => string): ModuleNavItem[] {\n const items: ModuleNavItem[] = [\n { id: 'dashboard', label: t('inventory.nav.dashboard'), icon: 'BarChart3', active: view === 'dashboard', onClick: () => navigate('dashboard') },\n ...(config.modules.products ? [{\n id: 'products', label: t('inventory.nav.products'), icon: 'Package', active: view.startsWith('products'),\n children: [\n { id: 'products-new', label: t('inventory.nav.new'), active: view === 'products-new', onClick: () => navigate('products-new') },\n { id: 'products-list', label: t('inventory.nav.list'), active: view === 'products-list', onClick: () => navigate('products-list') },\n ],\n } as ModuleNavItem] : []),\n {\n id: 'stock', label: t('inventory.nav.stock'), icon: 'ArrowUpCircle',\n children: [\n { id: 'stock-entry', label: t('inventory.nav.entry'), active: view === 'stock-entry', onClick: () => navigate('stock-entry') },\n { id: 'stock-exit', label: t('inventory.nav.exit'), active: view === 'stock-exit', onClick: () => navigate('stock-exit') },\n { id: 'stock-history', label: t('inventory.nav.history'), active: view === 'stock-history', onClick: () => navigate('stock-history') },\n ],\n },\n ]\n\n if (config.modules.recipes) {\n items.push({\n id: 'recipes', label: config.labels.recipes, icon: 'BookOpen',\n children: [\n { id: 'recipes-list', label: config.labels.recipesList, active: view === 'recipes-list' || view.startsWith('recipes-detail:'), onClick: () => navigate('recipes-list') },\n { id: 'recipes-new', label: config.labels.recipesNew, active: view === 'recipes-new', onClick: () => navigate('recipes-new') },\n ],\n })\n }\n\n return items\n}\n\nexport function InventoryPage({ config, provider, store, registries }: {\n config: ResolvedInventoryConfig\n provider: InventoryDataProvider\n store: StoreApi<InventoryUIState>\n registries?: PluginRegistryDef[]\n}) {\n const t = useTranslation()\n const { view, direction, navigate } = useModuleNavigation('/inventory', {\n dashboard: 0,\n 'products-list': 0, 'products-new': 1,\n 'stock-entry': 1, 'stock-exit': 1, 'stock-history': 0,\n 'recipes-list': 0, 'recipes-new': 1, 'recipes-detail': 1,\n settings: 1,\n }, 'dashboard')\n\n const [onboardingComplete, setOnboardingComplete] = useState(() => {\n try { return localStorage.getItem('saas-core:inventory-onboarded') === 'true' } catch { return false }\n })\n\n const isSettings = view === 'settings'\n const isSummary = view === 'dashboard' || view === ''\n const nav = buildNav(config, view, navigate, t)\n\n const quickActions = useMemo<PluginQuickAction[]>(() => {\n const actions: PluginQuickAction[] = [\n // Dropped with the catalogue module: offering \"new product\" while the\n // screen is gone would dead-end the user.\n ...(config.modules.products ? [{\n id: 'new-product',\n label: t('inventory.quickActions.newProduct'),\n icon: 'Package',\n description: t('inventory.quickActions.newProductDesc'),\n action: () => navigate('products-new'),\n } as PluginQuickAction] : []),\n {\n id: 'stock-entry',\n label: t('inventory.quickActions.stockEntry'),\n icon: 'ArrowUpRight',\n description: t('inventory.quickActions.stockEntryDesc'),\n action: () => navigate('stock-entry'),\n },\n {\n id: 'stock-exit',\n label: t('inventory.quickActions.stockExit'),\n icon: 'ArrowDownRight',\n description: t('inventory.quickActions.stockExitDesc'),\n action: () => navigate('stock-exit'),\n },\n ]\n return actions\n }, [])\n\n if (!onboardingComplete) {\n return (\n <InventoryContextProvider config={config} provider={provider} store={store}>\n <InventoryOnboarding onComplete={() => { setOnboardingComplete(true); try { localStorage.setItem('saas-core:inventory-onboarded', 'true') } catch {} }} />\n </InventoryContextProvider>\n )\n }\n\n if (isSettings && registries && registries.length > 0) {\n return (\n <InventoryContextProvider config={config} provider={provider} store={store}>\n <PageTransition transitionKey=\"settings\" direction={direction}>\n <div style={{ padding: '24px' }}>\n <div style={{ marginBottom: '16px' }}>\n <h1 style={{ fontSize: '20px', fontWeight: 600, margin: 0 }}>{t('inventory.settingsPage.title')}</h1>\n <p style={{ color: 'var(--muted-foreground, #6b7280)', margin: '4px 0 0', fontSize: '14px' }}>\n {t('inventory.settingsPage.subtitle')}\n </p>\n </div>\n <InventoryGeneralSettings />\n </div>\n </PageTransition>\n </InventoryContextProvider>\n )\n }\n\n const renderView = createViewRouter([\n // Routes go with the module, not just the nav entry: leaving them mounted\n // keeps a second product form reachable by URL.\n ...(config.modules.products ? [\n { id: 'products-list', render: () => <ProductListView onNew={() => navigate('products-new')} onEdit={(id: string) => navigate(`products-edit:${id}`)} /> },\n { id: 'products-new', render: () => <ProductCrudForm onSaved={() => navigate('products-list')} /> },\n { id: 'products-edit', render: ({ id }: { id?: string }) => <ProductCrudForm editId={id!} onSaved={() => navigate('products-list')} /> },\n ] : []),\n { id: 'stock-entry', render: () => <StockMovementView defaultType=\"entry\" onSaved={() => navigate('stock-history')} /> },\n { id: 'stock-exit', render: () => <StockMovementView defaultType=\"exit\" onSaved={() => navigate('stock-history')} /> },\n { id: 'stock-history', render: () => <MovementHistoryView onViewDetail={(id) => navigate(`stock-detail:${id}`)} /> },\n { id: 'stock-detail', render: ({ id }) => {\n const movement = store.getState().movements.find((m) => m.id === id)\n return movement\n ? <StockMovementView defaultType={movement.movementType} viewMovement={movement} onSaved={() => navigate('stock-history')} />\n : <MovementHistoryView onViewDetail={(mid) => navigate(`stock-detail:${mid}`)} />\n } },\n { id: 'recipes-list', render: () => <RecipesView onNew={() => navigate('recipes-new')} onView={(id) => navigate(`recipes-detail:${id}`)} /> },\n { id: 'recipes-new', render: () => <RecipeFormView onSaved={(id) => id ? navigate(`recipes-detail:${id}`) : navigate('recipes-list')} /> },\n { id: 'recipes-detail', render: ({ id }) => <RecipeDetailView recipeId={id!} onBack={() => navigate('recipes-list')} /> },\n { id: 'dashboard', render: () => <DashboardView /> },\n ], 'dashboard')\n\n return (\n <InventoryContextProvider config={config} provider={provider} store={store}>\n <ModulePage\n title={config.labels.pageTitle}\n subtitle={config.labels.pageSubtitle}\n nav={nav}\n showHeader={isSummary}\n viewKey={view}\n direction={direction}\n headerAction={\n <ModuleActionBar\n quickActions={quickActions}\n settingsPath={registries && registries.length > 0 ? '/settings/inventory' : undefined}\n settingsLabel=\"Inventory Settings\"\n />\n }\n >\n {renderView(view)}\n </ModulePage>\n </InventoryContextProvider>\n )\n}\n","import React, { useEffect } from 'react'\nimport { ArrowUpRight, ArrowDownRight } from 'lucide-react'\nimport type { StoreApi } from 'zustand'\nimport type { DashboardWidgetDef } from '@fayz-ai/core'\nimport { useTranslation } from '@fayz-ai/core'\nimport {\n KpiCard, Card, CardHeader, CardTitle, CardContent,\n defineKpiWidget, defineCustomWidget,\n} from '@fayz-ai/ui'\nimport { InventoryContextProvider, useInventoryConfig, useInventoryStore, formatCurrency, type ResolvedInventoryConfig } from '../context'\nimport type { InventoryDataProvider } from '../data/types'\nimport type { InventoryUIState } from '../store'\n\nfunction useEnsureSummary() {\n const fetchSummary = useInventoryStore((s) => s.fetchSummary)\n useEffect(() => { void fetchSummary() }, [])\n}\n\nfunction StockValueKpi() {\n const t = useTranslation()\n const { currency } = useInventoryConfig()\n const summary = useInventoryStore((s) => s.summary)\n useEnsureSummary()\n return (\n <KpiCard label={t('inventory.dashboard.stockValue')} icon=\"BarChart3\"\n value={formatCurrency(summary?.totalStockValue ?? 0, currency)} sub={t('inventory.dashboard.totalValue')} />\n )\n}\n\nfunction TotalProductsKpi() {\n const t = useTranslation()\n const summary = useInventoryStore((s) => s.summary)\n useEnsureSummary()\n return <KpiCard label={t('inventory.dashboard.totalProducts')} icon=\"Package\" value={String(summary?.totalProducts ?? 0)} sub={t('inventory.dashboard.activeItems')} />\n}\n\nfunction LowStockKpi() {\n const t = useTranslation()\n const summary = useInventoryStore((s) => s.summary)\n useEnsureSummary()\n return <KpiCard label={t('inventory.dashboard.lowStock')} icon=\"AlertTriangle\" value={String(summary?.lowStockCount ?? 0)} sub={t('inventory.dashboard.belowMinimum')} />\n}\n\nfunction OutOfStockKpi() {\n const t = useTranslation()\n const summary = useInventoryStore((s) => s.summary)\n useEnsureSummary()\n return <KpiCard label={t('inventory.dashboard.outOfStock')} icon=\"TrendingDown\" value={String(summary?.outOfStockCount ?? 0)} sub={t('inventory.dashboard.needRestocking')} />\n}\n\nfunction RecentActivityPanel() {\n const t = useTranslation()\n const summary = useInventoryStore((s) => s.summary)\n useEnsureSummary()\n return (\n <Card>\n <CardHeader><CardTitle>{t('inventory.dashboard.recentActivity')}</CardTitle></CardHeader>\n <CardContent>\n <div className=\"flex items-center gap-4 text-sm\">\n <div className=\"flex items-center gap-1.5\">\n <ArrowUpRight className=\"h-3.5 w-3.5 text-success\" />\n <span className=\"text-muted-foreground\">{t('inventory.dashboard.entries')}</span>\n <span className=\"font-medium\">{summary?.movementsByType?.entry ?? 0}</span>\n </div>\n <div className=\"flex items-center gap-1.5\">\n <ArrowDownRight className=\"h-3.5 w-3.5 text-destructive\" />\n <span className=\"text-muted-foreground\">{t('inventory.dashboard.exits')}</span>\n <span className=\"font-medium\">{summary?.movementsByType?.exit ?? 0}</span>\n </div>\n </div>\n <p className=\"mt-2 text-xs text-muted-foreground\">{t('inventory.dashboard.last7Days')}</p>\n </CardContent>\n </Card>\n )\n}\n\nexport function createInventoryDashboardWidgets(ctx: {\n config: ResolvedInventoryConfig\n provider: InventoryDataProvider\n store: StoreApi<InventoryUIState>\n}): DashboardWidgetDef[] {\n const withCtx = (Inner: React.ComponentType): React.ComponentType<unknown> => {\n const Wrapped = () => (\n <InventoryContextProvider config={ctx.config} provider={ctx.provider} store={ctx.store}>\n <Inner />\n </InventoryContextProvider>\n )\n Wrapped.displayName = `InventoryWidget(${Inner.displayName ?? Inner.name})`\n return Wrapped\n }\n\n return [\n // Stock value is inventory's headline KPI on the global home; the rest are\n // home-hidden by default (shown on the inventory plugin-home, addable via Customize).\n defineKpiWidget({ id: 'inventory.kpi.stock-value', title: 'inventory.dashboard.stockValue', domain: 'inventory', defaultOrder: 0, component: withCtx(StockValueKpi) }),\n defineKpiWidget({ id: 'inventory.kpi.total-products', title: 'inventory.dashboard.totalProducts', domain: 'inventory', defaultOrder: 1, defaultVisible: false, component: withCtx(TotalProductsKpi) }),\n defineKpiWidget({ id: 'inventory.kpi.low-stock', title: 'inventory.dashboard.lowStock', domain: 'inventory', defaultOrder: 2, defaultVisible: false, component: withCtx(LowStockKpi) }),\n defineKpiWidget({ id: 'inventory.kpi.out-of-stock', title: 'inventory.dashboard.outOfStock', domain: 'inventory', defaultOrder: 3, defaultVisible: false, component: withCtx(OutOfStockKpi) }),\n defineCustomWidget({ id: 'inventory.panel.recent-activity', title: 'inventory.dashboard.recentActivity', domain: 'inventory', span: 2, defaultOrder: 10, surfaces: ['plugin-home'], component: withCtx(RecentActivityPanel) }),\n ]\n}\n","import type { InventoryDataProvider } from './types'\nimport type {\n Product, StockMovement, StockPosition, StockLocation,\n Recipe, RecipeIngredient,\n CreateProductInput, CreateStockMovementInput, CreateRecipeInput,\n ProductQuery, MovementQuery,\n PaginatedResult, InventorySummary, MovementType,\n} from '../types'\n\nlet nextId = 1\nfunction uid(): string { return String(nextId++) }\nfunction now(): string { return new Date().toISOString() }\nfunction today(): string { return new Date().toISOString().slice(0, 10) }\n\nfunction paginate<T>(items: T[], page?: number, pageSize?: number): PaginatedResult<T> {\n const p = page ?? 1\n const ps = pageSize ?? 50\n const start = (p - 1) * ps\n return { data: items.slice(start, start + ps), total: items.length }\n}\n\ninterface MockStore {\n products: Product[]\n movements: StockMovement[]\n positions: StockPosition[]\n locations: StockLocation[]\n recipes: Recipe[]\n recipeIngredients: RecipeIngredient[]\n}\n\nfunction createStore(): MockStore {\n return {\n products: [],\n movements: [],\n positions: [],\n locations: [\n { id: uid(), name: 'Main Storage', description: 'Primary storage area', isActive: true, tenantId: 'mock-tenant', createdAt: now(), updatedAt: now() },\n ],\n recipes: [],\n recipeIngredients: [],\n }\n}\n\nexport function createMockInventoryProvider(): InventoryDataProvider {\n const store = createStore()\n const tenantId = 'mock-tenant'\n\n const provider: InventoryDataProvider = {\n // --- Products ---\n async getProducts(query: ProductQuery): Promise<PaginatedResult<Product>> {\n let results = [...store.products]\n if (query.productType) results = results.filter((p) => p.productType === query.productType)\n if (query.categoryId) results = results.filter((p) => p.categoryId === query.categoryId)\n if (query.isActive !== undefined) results = results.filter((p) => p.isActive === query.isActive)\n if (query.lowStockOnly) results = results.filter((p) => p.currentQuantity <= p.minQuantity)\n if (query.search) {\n const s = query.search.toLowerCase()\n results = results.filter((p) => p.name.toLowerCase().includes(s) || p.sku?.toLowerCase().includes(s) || p.barcode?.includes(s))\n }\n results.sort((a, b) => b.createdAt.localeCompare(a.createdAt))\n return paginate(results, query.page, query.pageSize)\n },\n\n async getProductById(id: string): Promise<Product | null> {\n return store.products.find((p) => p.id === id) ?? null\n },\n\n async createProduct(input: CreateProductInput): Promise<Product> {\n const product: Product = {\n id: uid(),\n name: input.name,\n description: input.description,\n sku: input.sku,\n barcode: input.barcode,\n brand: input.brand,\n categoryId: input.categoryId,\n productType: input.productType,\n purpose: input.purpose,\n currentQuantity: 0,\n minQuantity: input.minQuantity ?? 0,\n maxQuantity: input.maxQuantity,\n costPrice: input.costPrice ?? 0,\n salePrice: input.salePrice,\n measurementUnitId: input.measurementUnitId,\n isActive: true,\n supplierId: input.supplierId,\n defaultLocationId: input.defaultLocationId,\n imageUrl: input.imageUrl,\n metadata: input.metadata,\n tenantId,\n createdAt: now(),\n updatedAt: now(),\n }\n store.products.push(product)\n return product\n },\n\n async updateProduct(id: string, data: Partial<Product>): Promise<Product> {\n const product = store.products.find((p) => p.id === id)\n if (!product) throw new Error(`Product ${id} not found`)\n Object.assign(product, data, { updatedAt: now() })\n return product\n },\n\n // --- Stock Movements ---\n async getMovements(query: MovementQuery): Promise<PaginatedResult<StockMovement>> {\n let results = [...store.movements]\n if (query.productId) results = results.filter((m) => m.productId === query.productId)\n if (query.movementType) {\n const types = Array.isArray(query.movementType) ? query.movementType : [query.movementType]\n results = results.filter((m) => types.includes(m.movementType))\n }\n if (query.stockLocationId) results = results.filter((m) => m.stockLocationId === query.stockLocationId)\n if (query.dateRange) {\n results = results.filter((m) => m.movementDate >= query.dateRange!.from && m.movementDate <= query.dateRange!.to)\n }\n if (query.search) {\n const s = query.search.toLowerCase()\n results = results.filter((m) => m.productName?.toLowerCase().includes(s) || m.notes?.toLowerCase().includes(s))\n }\n results.sort((a, b) => b.movementDate.localeCompare(a.movementDate))\n return paginate(results, query.page, query.pageSize)\n },\n\n async createMovement(input: CreateStockMovementInput): Promise<StockMovement> {\n const product = store.products.find((p) => p.id === input.productId)\n const location = input.stockLocationId ? store.locations.find((l) => l.id === input.stockLocationId) : undefined\n const unitCost = input.unitCost ?? product?.costPrice ?? 0\n\n const movement: StockMovement = {\n id: uid(),\n productId: input.productId,\n productName: product?.name,\n quantity: input.quantity,\n movementType: input.movementType,\n unitCost,\n totalCost: unitCost * input.quantity,\n stockLocationId: input.stockLocationId,\n stockLocationName: location?.name,\n destinationLocationId: input.destinationLocationId,\n supplierId: input.supplierId,\n documentNumber: input.documentNumber,\n reason: input.reason,\n notes: input.notes,\n movementDate: input.movementDate ?? today(),\n tenantId,\n createdAt: now(),\n }\n store.movements.push(movement)\n\n // Update product quantity\n if (product) {\n if (input.movementType === 'entry') product.currentQuantity += input.quantity\n else if (input.movementType === 'exit' || input.movementType === 'loss') product.currentQuantity -= input.quantity\n // adjustment sets absolute, transfer moves between locations\n product.updatedAt = now()\n }\n\n return movement\n },\n\n // --- Stock Positions ---\n async getPositions(productId: string): Promise<StockPosition[]> {\n return store.positions.filter((p) => p.productId === productId)\n },\n\n // --- Stock Locations ---\n async getLocations(): Promise<StockLocation[]> {\n return store.locations.filter((l) => l.isActive)\n },\n\n async createLocation(data): Promise<StockLocation> {\n const location: StockLocation = {\n id: uid(),\n name: data.name,\n description: data.description,\n isActive: true,\n unitId: data.unitId,\n tenantId,\n createdAt: now(),\n updatedAt: now(),\n }\n store.locations.push(location)\n return location\n },\n\n // --- Recipes ---\n async getRecipes(): Promise<Recipe[]> {\n return store.recipes.filter((r) => r.isActive)\n },\n\n async getRecipeById(id: string): Promise<Recipe | null> {\n return store.recipes.find((r) => r.id === id) ?? null\n },\n\n async getRecipeIngredients(recipeId: string): Promise<RecipeIngredient[]> {\n return store.recipeIngredients.filter((ri) => ri.recipeId === recipeId).sort((a, b) => a.displayOrder - b.displayOrder)\n },\n\n async createRecipe(input: CreateRecipeInput): Promise<Recipe> {\n const product = store.products.find((p) => p.id === input.productId)\n const recipeId = uid()\n const recipe: Recipe = {\n id: recipeId,\n name: input.name,\n description: input.description,\n productId: input.productId,\n productName: product?.name,\n yieldQuantity: input.yieldQuantity,\n yieldUnitId: input.yieldUnitId,\n preparationTimeMinutes: input.preparationTimeMinutes,\n instructions: input.instructions,\n isActive: true,\n ingredientCount: input.ingredients.length,\n tenantId,\n createdAt: now(),\n updatedAt: now(),\n }\n store.recipes.push(recipe)\n\n for (const ing of input.ingredients) {\n const ingProduct = store.products.find((p) => p.id === ing.productId)\n store.recipeIngredients.push({\n id: uid(),\n recipeId,\n productId: ing.productId,\n productName: ingProduct?.name,\n quantity: ing.quantity,\n unitId: ing.unitId,\n displayOrder: ing.displayOrder ?? 0,\n notes: ing.notes,\n createdAt: now(),\n })\n }\n\n return recipe\n },\n\n // --- Summary ---\n async getSummary(): Promise<InventorySummary> {\n const active = store.products.filter((p) => p.isActive)\n const lowStock = active.filter((p) => p.currentQuantity <= p.minQuantity && p.currentQuantity > 0)\n const outOfStock = active.filter((p) => p.currentQuantity <= 0)\n const totalValue = active.reduce((sum, p) => sum + p.currentQuantity * p.costPrice, 0)\n\n const weekAgo = new Date()\n weekAgo.setDate(weekAgo.getDate() - 7)\n const weekAgoStr = weekAgo.toISOString().slice(0, 10)\n const recent = store.movements.filter((m) => m.movementDate >= weekAgoStr)\n\n const movementsByType: Record<MovementType, number> = { entry: 0, exit: 0, adjustment: 0, transfer: 0, loss: 0 }\n for (const m of recent) movementsByType[m.movementType]++\n\n return {\n totalProducts: active.length,\n lowStockCount: lowStock.length,\n outOfStockCount: outOfStock.length,\n totalStockValue: totalValue,\n recentMovementCount: recent.length,\n movementsByType,\n }\n },\n }\n\n return provider\n}\n","// Central physical-table-name registry for plugin-inventory.\nexport const T = {\n stockLocations: 'plg_inventory_stock_locations',\n stockMovements: 'plg_inventory_stock_movements',\n stockPositions: 'plg_inventory_stock_positions',\n recipes: 'plg_inventory_recipes',\n recipeIngredients: 'plg_inventory_recipe_ingredients',\n measurementUnits: 'plg_inventory_measurement_units',\n productCategories: 'plg_inventory_product_categories',\n} as const\n","import type { InventoryDataProvider } from './types'\nimport type {\n Product, StockMovement, StockPosition, StockLocation,\n Recipe, RecipeIngredient,\n CreateProductInput, CreateStockMovementInput, CreateRecipeInput,\n ProductQuery, MovementQuery,\n PaginatedResult, InventorySummary, MovementType,\n} from '../types'\nimport { getSupabaseClientOptional, getActiveTenantId } from '@fayz-ai/core'\nimport { getInventoryTenantId } from '../lib/tenant'\nimport { T } from './tables'\n\nfunction getTenantId(): string | undefined {\n // Local override wins; else use the app's active tenant so writes pass RLS.\n return getInventoryTenantId() ?? getActiveTenantId()\n}\n\nfunction snakeToCamel(obj: Record<string, unknown>): Record<string, unknown> {\n const result: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(obj)) {\n const camelKey = key.replace(/_([a-z])/g, (_, c) => c.toUpperCase())\n result[camelKey] = value\n }\n return result\n}\n\nfunction camelToSnake(obj: Record<string, unknown>): Record<string, unknown> {\n const result: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(obj)) {\n if (key.startsWith('_')) continue\n const snakeKey = key.replace(/[A-Z]/g, (c) => `_${c.toLowerCase()}`)\n result[snakeKey] = value\n }\n return result\n}\n\n/** Map a public.products row to our Product type */\nfunction mapProductRow(row: Record<string, any>): Product {\n const meta = row.metadata ?? {}\n return {\n id: row.id,\n name: row.name,\n description: row.description,\n sku: row.sku,\n barcode: meta.barcode,\n brand: meta.brand,\n productType: meta.productType ?? 'sale',\n currentQuantity: row.stock ?? 0,\n minQuantity: row.min_stock ?? 0,\n maxQuantity: meta.maxQuantity,\n costPrice: row.cost ?? 0,\n salePrice: row.price,\n isActive: row.is_active ?? true,\n imageUrl: row.image_url,\n metadata: meta,\n tenantId: row.tenant_id,\n createdAt: row.created_at,\n updatedAt: row.updated_at,\n }\n}\n\nexport function createSupabaseInventoryProvider(): InventoryDataProvider {\n // Lazy resolution — Supabase client may not exist at factory time\n // but will be available when methods are called (after createSaasApp initializes it)\n function getClients() {\n const supabase = getSupabaseClientOptional() as any\n if (!supabase) throw new Error('Supabase not initialized')\n return { core: supabase, pub: supabase }\n }\n\n const provider: InventoryDataProvider = {\n // --- Products (public.products) ---\n async getProducts(query: ProductQuery): Promise<PaginatedResult<Product>> {\n const { core, pub } = getClients()\n let qb = core.from('products').select('*', { count: 'exact' })\n if (query.search) qb = qb.ilike('name', `%${query.search}%`)\n // productType lives in the metadata JSON column → filter on metadata->>productType.\n if (query.productType) qb = qb.eq('metadata->>productType', query.productType)\n if (query.isActive !== undefined) qb = qb.eq('is_active', query.isActive)\n if (query.lowStockOnly) qb = qb.lte('stock', 0) // simplified\n const page = query.page ?? 1\n const pageSize = query.pageSize ?? 50\n qb = qb.range((page - 1) * pageSize, page * pageSize - 1).order('created_at', { ascending: false })\n const { data, count } = await qb\n return { data: (data ?? []).map(mapProductRow), total: count ?? 0 }\n },\n\n async getProductById(id: string): Promise<Product | null> {\n const { core } = getClients()\n const { data } = await core.from('products').select('*').eq('id', id).single()\n return data ? mapProductRow(data) : null\n },\n\n async createProduct(input: CreateProductInput): Promise<Product> {\n const { core } = getClients()\n const tenantId = getTenantId()\n const row: Record<string, unknown> = {\n tenant_id: tenantId,\n name: input.name,\n description: input.description,\n sku: input.sku,\n price: input.salePrice ?? 0,\n cost: input.costPrice ?? 0,\n stock: 0,\n min_stock: input.minQuantity ?? 0,\n is_active: true,\n image_url: input.imageUrl,\n metadata: { productType: input.productType, barcode: input.barcode, brand: input.brand, maxQuantity: input.maxQuantity },\n }\n const { data, error } = await core.from('products').insert(row).select().single()\n if (error) throw new Error(error.message)\n return mapProductRow(data!)\n },\n\n async updateProduct(id: string, partial: Partial<Product>): Promise<Product> {\n const { core } = getClients()\n const row: Record<string, unknown> = {}\n if (partial.name !== undefined) row.name = partial.name\n if (partial.description !== undefined) row.description = partial.description\n if (partial.sku !== undefined) row.sku = partial.sku\n if (partial.salePrice !== undefined) row.price = partial.salePrice\n if (partial.costPrice !== undefined) row.cost = partial.costPrice\n if (partial.minQuantity !== undefined) row.min_stock = partial.minQuantity\n if (partial.isActive !== undefined) row.is_active = partial.isActive\n if (partial.imageUrl !== undefined) row.image_url = partial.imageUrl\n if (partial.productType !== undefined || partial.barcode !== undefined || partial.brand !== undefined) {\n row.metadata = { productType: partial.productType, barcode: partial.barcode, brand: partial.brand }\n }\n const { data, error } = await core.from('products').update(row).eq('id', id).select().single()\n if (error) throw new Error(error.message)\n return mapProductRow(data!)\n },\n\n // --- Stock Movements (via view with product join — single query) ---\n async getMovements(query: MovementQuery): Promise<PaginatedResult<StockMovement>> {\n const { pub } = getClients()\n // Single query via v_stock_movements view (JOINs with public.products)\n let qb = pub.from('v_stock_movements').select('*', { count: 'exact' })\n if (query.productId) qb = qb.eq('product_id', query.productId)\n if (query.movementType) {\n const types = Array.isArray(query.movementType) ? query.movementType : [query.movementType]\n qb = qb.in('movement_type', types)\n }\n if (query.stockLocationId) qb = qb.eq('stock_location_id', query.stockLocationId)\n if (query.dateRange) qb = qb.gte('movement_date', query.dateRange.from).lte('movement_date', query.dateRange.to)\n if (query.search) qb = qb.ilike('product_name', `%${query.search}%`)\n const page = query.page ?? 1\n const pageSize = query.pageSize ?? 50\n qb = qb.range((page - 1) * pageSize, page * pageSize - 1).order('movement_date', { ascending: false })\n const { data, count } = await qb\n\n const movements = (data ?? []).map((r: any) => {\n const mov = snakeToCamel(r) as any\n mov.productName = r.product_name ?? mov.productName\n mov.productSku = r.product_sku ?? mov.productSku\n // View may include location names if the updated migration has been applied\n mov.stockLocationName = r.stock_location_name ?? mov.stockLocationName\n mov.destinationLocationName = r.destination_location_name ?? mov.destinationLocationName\n return mov as StockMovement\n })\n\n // Resolve location names if not provided by the view\n const needsLocationResolve = movements.some(\n (m: any) => (m.stockLocationId && !m.stockLocationName) || (m.destinationLocationId && !m.destinationLocationName)\n )\n if (needsLocationResolve) {\n const locationIds = new Set<string>()\n for (const m of movements) {\n if (m.stockLocationId && !m.stockLocationName) locationIds.add(m.stockLocationId)\n if (m.destinationLocationId && !m.destinationLocationName) locationIds.add(m.destinationLocationId)\n }\n if (locationIds.size > 0) {\n const { data: locs } = await pub.from(T.stockLocations).select('id, name').in('id', [...locationIds])\n const locMap = new Map((locs ?? []).map((l: any) => [l.id, l.name]))\n for (const m of movements) {\n if (m.stockLocationId && !m.stockLocationName) m.stockLocationName = locMap.get(m.stockLocationId)\n if (m.destinationLocationId && !m.destinationLocationName) m.destinationLocationName = locMap.get(m.destinationLocationId)\n }\n }\n }\n\n return { data: movements, total: count ?? 0 }\n },\n\n async createMovement(input: CreateStockMovementInput): Promise<StockMovement> {\n const { core, pub } = getClients()\n const tenantId = getTenantId()\n const unitCost = input.unitCost ?? 0\n const row = {\n ...camelToSnake(input as any),\n tenant_id: tenantId,\n unit_cost: unitCost,\n total_cost: unitCost * input.quantity,\n movement_date: input.movementDate ?? new Date().toISOString().slice(0, 10),\n }\n const { data, error } = await pub.from(T.stockMovements).insert(row).select().single()\n if (error) throw new Error(error.message)\n\n // Fetch product name + current stock for the response and stock update\n const { data: product } = await core.from('products').select('id, name, stock').eq('id', input.productId).single()\n\n // Update product stock\n if (product) {\n const delta = (input.movementType === 'entry') ? input.quantity : -(input.quantity)\n if (input.movementType !== 'adjustment' && input.movementType !== 'transfer') {\n await core.from('products').update({ stock: (product.stock ?? 0) + delta }).eq('id', input.productId)\n }\n }\n\n // Update stock_positions when a location is specified (best-effort — don't fail the movement)\n if (input.stockLocationId) {\n try {\n const posDelta = (input.movementType === 'entry') ? input.quantity : -(input.quantity)\n const { data: existing } = await pub.from(T.stockPositions)\n .select('id, quantity')\n .eq('product_id', input.productId)\n .eq('stock_location_id', input.stockLocationId)\n .maybeSingle()\n\n if (existing) {\n await pub.from(T.stockPositions)\n .update({ quantity: (existing.quantity ?? 0) + posDelta, unit_cost: input.unitCost ?? 0 })\n .eq('id', existing.id)\n } else {\n await pub.from(T.stockPositions).insert({\n tenant_id: tenantId,\n product_id: input.productId,\n stock_location_id: input.stockLocationId,\n quantity: Math.max(0, posDelta),\n unit_cost: input.unitCost ?? 0,\n batch_number: input.batchNumber ?? null,\n expiration_date: input.expirationDate ?? null,\n })\n }\n\n // For transfers, also update the destination position\n if (input.movementType === 'transfer' && input.destinationLocationId) {\n const { data: destExisting } = await pub.from(T.stockPositions)\n .select('id, quantity')\n .eq('product_id', input.productId)\n .eq('stock_location_id', input.destinationLocationId)\n .maybeSingle()\n\n if (destExisting) {\n await pub.from(T.stockPositions)\n .update({ quantity: (destExisting.quantity ?? 0) + input.quantity, unit_cost: input.unitCost ?? 0 })\n .eq('id', destExisting.id)\n } else {\n await pub.from(T.stockPositions).insert({\n tenant_id: tenantId,\n product_id: input.productId,\n stock_location_id: input.destinationLocationId,\n quantity: input.quantity,\n unit_cost: input.unitCost ?? 0,\n batch_number: input.batchNumber ?? null,\n expiration_date: input.expirationDate ?? null,\n })\n }\n }\n } catch {\n // stock_positions update is best-effort — log but don't fail the movement\n console.warn('Failed to update stock_positions — table may not exist yet')\n }\n }\n\n const movement = snakeToCamel(data) as any\n movement.productName = product?.name\n // Resolve location name\n if (input.stockLocationId) {\n const { data: loc } = await pub.from(T.stockLocations).select('name').eq('id', input.stockLocationId).single()\n movement.stockLocationName = loc?.name\n }\n if (input.destinationLocationId) {\n const { data: loc } = await pub.from(T.stockLocations).select('name').eq('id', input.destinationLocationId).single()\n movement.destinationLocationName = loc?.name\n }\n return movement as StockMovement\n },\n\n // --- Stock Positions ---\n async getPositions(productId: string): Promise<StockPosition[]> {\n const { pub } = getClients()\n const { data } = await pub.from(T.stockPositions).select('*').eq('product_id', productId)\n return (data ?? []).map((r: any) => snakeToCamel(r) as unknown as StockPosition)\n },\n\n // --- Stock Locations ---\n async getLocations(): Promise<StockLocation[]> {\n const { pub } = getClients()\n const { data } = await pub.from(T.stockLocations).select('*').eq('is_active', true).order('name')\n return (data ?? []).map((r: any) => snakeToCamel(r) as unknown as StockLocation)\n },\n\n async createLocation(input): Promise<StockLocation> {\n const { pub } = getClients()\n const tenantId = getTenantId()\n const { data } = await pub.from(T.stockLocations).insert({ ...camelToSnake(input as any), tenant_id: tenantId }).select().single()\n return snakeToCamel(data!) as unknown as StockLocation\n },\n\n // --- Recipes ---\n async getRecipes(): Promise<Recipe[]> {\n const { pub } = getClients()\n const { data } = await pub.from(T.recipes).select('*').eq('is_active', true).order('name')\n return (data ?? []).map((r: any) => snakeToCamel(r) as unknown as Recipe)\n },\n\n async getRecipeById(id: string): Promise<Recipe | null> {\n const { pub } = getClients()\n const { data } = await pub.from(T.recipes).select('*').eq('id', id).single()\n return data ? snakeToCamel(data) as unknown as Recipe : null\n },\n\n async getRecipeIngredients(recipeId: string): Promise<RecipeIngredient[]> {\n const { pub } = getClients()\n const { data } = await pub.from(T.recipeIngredients).select('*').eq('recipe_id', recipeId).order('display_order')\n return (data ?? []).map((r: any) => snakeToCamel(r) as unknown as RecipeIngredient)\n },\n\n async createRecipe(input: CreateRecipeInput): Promise<Recipe> {\n const { pub } = getClients()\n const tenantId = getTenantId()\n const { ingredients, ...recipeData } = input\n const { data: recipe } = await pub.from(T.recipes).insert({ ...camelToSnake(recipeData as any), tenant_id: tenantId }).select().single()\n if (recipe && ingredients.length > 0) {\n await pub.from(T.recipeIngredients).insert(\n ingredients.map((ing) => ({ ...camelToSnake(ing as any), recipe_id: recipe.id, tenant_id: tenantId }))\n )\n }\n return snakeToCamel(recipe!) as unknown as Recipe\n },\n\n // --- Summary ---\n async getSummary(): Promise<InventorySummary> {\n const { core, pub } = getClients()\n const { data: products } = await core.from('products').select('stock, min_stock, price, is_active').eq('is_active', true)\n const items = products ?? []\n const lowStock = items.filter((p: any) => p.stock > 0 && p.stock <= (p.min_stock ?? 0))\n const outOfStock = items.filter((p: any) => p.stock <= 0)\n const totalValue = items.reduce((sum: number, p: any) => sum + (p.stock ?? 0) * (p.price ?? 0), 0)\n\n const weekAgo = new Date()\n weekAgo.setDate(weekAgo.getDate() - 7)\n const { data: movements } = await pub.from(T.stockMovements).select('movement_type').gte('movement_date', weekAgo.toISOString().slice(0, 10))\n const movs = movements ?? []\n const movementsByType: Record<MovementType, number> = { entry: 0, exit: 0, adjustment: 0, transfer: 0, loss: 0 }\n for (const m of movs) movementsByType[m.movement_type as MovementType]++\n\n return {\n totalProducts: items.length,\n lowStockCount: lowStock.length,\n outOfStockCount: outOfStock.length,\n totalStockValue: totalValue,\n recentMovementCount: movs.length,\n movementsByType,\n }\n },\n }\n\n return provider\n}\n","import { createStore, type StoreApi } from 'zustand/vanilla'\nimport { dedup } from '@fayz-ai/admin'\nimport { toast } from '@fayz-ai/ui'\nimport type { InventoryDataProvider } from './data/types'\nimport type {\n Product, StockMovement, StockLocation, Recipe,\n InventorySummary, ProductQuery, MovementQuery,\n CreateProductInput, CreateStockMovementInput, CreateRecipeInput,\n} from './types'\n\nexport interface InventoryUIState {\n products: Product[]\n productsTotal: number\n productsLoading: boolean\n productQuery: ProductQuery\n\n movements: StockMovement[]\n movementsTotal: number\n movementsLoading: boolean\n\n locations: StockLocation[]\n locationsLoading: boolean\n\n recipes: Recipe[]\n recipesLoading: boolean\n\n summary: InventorySummary | null\n summaryLoading: boolean\n\n fetchSummary(): Promise<void>\n fetchProducts(query: ProductQuery): Promise<void>\n fetchMovements(query: MovementQuery): Promise<void>\n fetchLocations(): Promise<void>\n fetchRecipes(): Promise<void>\n createProduct(input: CreateProductInput): Promise<Product>\n createMovement(input: CreateStockMovementInput): Promise<StockMovement>\n createRecipe(input: CreateRecipeInput): Promise<Recipe>\n}\n\nexport function createInventoryStore(provider: InventoryDataProvider): StoreApi<InventoryUIState> {\n return createStore<InventoryUIState>((set, get) => ({\n products: [], productsTotal: 0, productsLoading: false, productQuery: {},\n movements: [], movementsTotal: 0, movementsLoading: false,\n locations: [], locationsLoading: false,\n recipes: [], recipesLoading: false,\n summary: null, summaryLoading: false,\n\n async fetchSummary() {\n return dedup('inv:summary', async () => {\n set({ summaryLoading: true })\n const summary = await provider.getSummary()\n set({ summary, summaryLoading: false })\n })\n },\n\n async fetchProducts(query) {\n const key = 'inv:products:' + JSON.stringify(query)\n return dedup(key, async () => {\n set({ productsLoading: true, productQuery: query })\n const result = await provider.getProducts(query)\n set({ products: result.data, productsTotal: result.total, productsLoading: false })\n })\n },\n\n async fetchMovements(query) {\n return dedup('inv:movements:' + JSON.stringify(query), async () => {\n set({ movementsLoading: true })\n const result = await provider.getMovements(query)\n set({ movements: result.data, movementsTotal: result.total, movementsLoading: false })\n })\n },\n\n async fetchLocations() {\n return dedup('inv:locations', async () => {\n set({ locationsLoading: true })\n const locations = await provider.getLocations()\n set({ locations, locationsLoading: false })\n })\n },\n\n async fetchRecipes() {\n set({ recipesLoading: true })\n const recipes = await provider.getRecipes()\n set({ recipes, recipesLoading: false })\n },\n\n async createProduct(input) {\n try {\n const product = await provider.createProduct(input)\n const query = get().productQuery\n const [result, summary] = await Promise.all([provider.getProducts(query), provider.getSummary()])\n set({ products: result.data, productsTotal: result.total, summary })\n toast.success('Product created')\n return product\n } catch (err: any) {\n toast.error('Failed to create product', { description: err?.message })\n throw err\n }\n },\n\n async createMovement(input) {\n try {\n const movement = await provider.createMovement(input)\n const [summary] = await Promise.all([provider.getSummary()])\n set({ summary })\n toast.success('Stock movement recorded')\n return movement\n } catch (err: any) {\n toast.error('Failed to record movement', { description: err?.message })\n throw err\n }\n },\n\n async createRecipe(input) {\n try {\n const recipe = await provider.createRecipe(input)\n const recipes = await provider.getRecipes()\n set({ recipes })\n toast.success('Recipe created')\n return recipe\n } catch (err: any) {\n toast.error('Failed to create recipe', { description: err?.message })\n throw err\n }\n },\n }))\n}\n","import type { PluginRegistryDef } from '@fayz-ai/core'\nimport type { EntityDef } from '@fayz-ai/core'\nimport { T } from './tables'\n\nconst supplierEntity: EntityDef = {\n name: 'Supplier',\n namePlural: 'Suppliers',\n icon: 'Building2',\n layout: 'person',\n displayField: 'name',\n defaultSort: 'name',\n fields: [\n { key: 'name', label: 'Name', type: 'text', required: true, showInTable: true, searchable: true },\n { key: 'phone', label: 'Phone', type: 'phone', showInTable: true },\n { key: 'email', label: 'Email', type: 'email', showInTable: true },\n { key: 'documentNumber', label: 'Tax ID', type: 'text', showInTable: true },\n // No address field: a supplier has as many as the operation needs (the\n // office that invoices, the warehouse the goods leave from). `layout:\n // 'person'` gives the record an \"Addresses\" tab backed by public.addresses,\n // which is the same relation clients and patients already use.\n { key: 'notes', label: 'Notes', type: 'textarea' },\n { key: 'isActive', label: 'Active', type: 'boolean', showInTable: true, defaultValue: true },\n ],\n data: {\n table: 'people',\n tenantScoped: true,\n filters: { kind: 'supplier' },\n defaults: { kind: 'supplier' },\n },\n}\n\nconst measurementUnitEntity: EntityDef = {\n name: 'Measurement Unit',\n namePlural: 'Measurement Units',\n icon: 'Ruler',\n displayField: 'name',\n defaultSort: 'name',\n fields: [\n { key: 'name', label: 'Name', type: 'text', required: true, showInTable: true },\n { key: 'abbreviation', label: 'Abbreviation', type: 'text', required: true, showInTable: true },\n { key: 'isActive', label: 'Active', type: 'boolean', showInTable: true, defaultValue: true },\n ],\n data: { table: T.measurementUnits, tenantScoped: true },\n}\n\nconst productCategoryEntity: EntityDef = {\n name: 'Product Category',\n namePlural: 'Product Categories',\n icon: 'Tag',\n displayField: 'name',\n defaultSort: 'name',\n fields: [\n { key: 'name', label: 'Name', type: 'text', required: true, showInTable: true },\n { key: 'parentId', label: 'Parent', type: 'text', showInTable: false },\n { key: 'isActive', label: 'Active', type: 'boolean', showInTable: true, defaultValue: true },\n ],\n data: { table: T.productCategories, tenantScoped: true },\n}\n\nconst stockLocationEntity: EntityDef = {\n name: 'Stock Location',\n namePlural: 'Stock Locations',\n icon: 'Warehouse',\n displayField: 'name',\n defaultSort: 'name',\n fields: [\n { key: 'name', label: 'Name', type: 'text', required: true, showInTable: true },\n { key: 'description', label: 'Description', type: 'textarea', showInTable: true },\n { key: 'isActive', label: 'Active', type: 'boolean', showInTable: true, defaultValue: true },\n ],\n data: { table: T.stockLocations, tenantScoped: true },\n}\n\nexport const inventoryRegistries: PluginRegistryDef[] = [\n // --- Editable ---\n {\n id: 'suppliers',\n entity: supplierEntity,\n icon: 'Building2',\n description: 'Manage your product and material suppliers',\n display: 'table',\n },\n {\n id: 'product-categories',\n entity: productCategoryEntity,\n icon: 'Tag',\n description: 'Product categories for organization',\n display: 'table',\n },\n {\n id: 'stock-locations',\n entity: stockLocationEntity,\n icon: 'Warehouse',\n description: 'Physical storage locations for inventory',\n display: 'table',\n },\n // --- Read-only (system / seeded) ---\n {\n id: 'measurement-units',\n entity: measurementUnitEntity,\n icon: 'Ruler',\n description: 'Standard units of measure',\n display: 'table',\n readOnly: true,\n seedData: [\n { id: 'mu-unit', name: 'Unit', abbreviation: 'un', isActive: true },\n { id: 'mu-box', name: 'Box', abbreviation: 'box', isActive: true },\n { id: 'mu-kg', name: 'Kilogram', abbreviation: 'kg', isActive: true },\n { id: 'mu-g', name: 'Gram', abbreviation: 'g', isActive: true },\n { id: 'mu-l', name: 'Liter', abbreviation: 'L', isActive: true },\n { id: 'mu-ml', name: 'Milliliter', abbreviation: 'mL', isActive: true },\n ],\n },\n]\n","// inventory.* — merged plugin-own + saas-core central i18n\nexport const en: Record<string, string> = {\n \"inventory.dashboard.activeItems\": \"Active items\",\n \"inventory.dashboard.belowMinimum\": \"Below minimum\",\n \"inventory.dashboard.entries\": \"Entries:\",\n \"inventory.dashboard.exits\": \"Exits:\",\n \"inventory.dashboard.last7Days\": \"Last 7 days\",\n \"inventory.dashboard.lowStock\": \"Low Stock\",\n \"inventory.dashboard.needRestocking\": \"Need restocking\",\n \"inventory.dashboard.outOfStock\": \"Out of Stock\",\n \"inventory.dashboard.quickActions\": \"Quick Actions\",\n \"inventory.dashboard.quickActionsDesc\": \"Use the sidebar to record stock entries, exits, or manage products.\",\n \"inventory.dashboard.recentActivity\": \"Recent Activity\",\n \"inventory.dashboard.stockValue\": \"Stock Value\",\n \"inventory.dashboard.totalProducts\": \"Total Products\",\n \"inventory.dashboard.totalValue\": \"Total inventory value\",\n \"inventory.history.noMovements\": \"No movements recorded\",\n \"inventory.history.searchPlaceholder\": \"Search movements...\",\n \"inventory.history.subtitle\": \"All stock movements\",\n \"inventory.history.title\": \"Stock History\",\n \"inventory.nav.dashboard\": \"Dashboard\",\n \"inventory.nav.entry\": \"Entry\",\n \"inventory.nav.exit\": \"Exit\",\n \"inventory.nav.history\": \"History\",\n \"inventory.nav.list\": \"List\",\n \"inventory.nav.new\": \"New\",\n \"inventory.nav.products\": \"Products\",\n \"inventory.nav.stock\": \"Stock\",\n \"inventory.page.newProduct\": \"New Product\",\n \"inventory.page.newProductDesc\": \"Add a product to your catalog\",\n \"inventory.page.settingsSubtitle\": \"Preferences, suppliers, categories, and units\",\n \"inventory.page.settingsTitle\": \"Inventory Settings\",\n \"inventory.page.stockEntry\": \"Stock Entry\",\n \"inventory.page.stockEntryDesc\": \"Record goods received\",\n \"inventory.page.stockExit\": \"Stock Exit\",\n \"inventory.page.stockExitDesc\": \"Record goods used or sold\",\n \"inventory.recipeDetail.active\": \"Active\",\n \"inventory.recipeDetail.backToList\": \"Back to list\",\n \"inventory.recipeDetail.inactive\": \"Inactive\",\n \"inventory.recipeDetail.ingredientCount\": \"Ingredients\",\n \"inventory.recipeDetail.ingredientsTitle\": \"Ingredients\",\n \"inventory.recipeDetail.instructions\": \"Instructions\",\n \"inventory.recipeDetail.noIngredients\": \"No ingredients defined\",\n \"inventory.recipeDetail.notFound\": \"Recipe not found\",\n \"inventory.recipeDetail.prepTime\": \"Prep time\",\n \"inventory.recipeDetail.produces\": \"Produces\",\n \"inventory.recipeDetail.recipes\": \"Recipes\",\n \"inventory.recipeDetail.yield\": \"Yield\",\n \"inventory.recipes.createFirst\": \"Create your first recipe\",\n \"inventory.recipes.ingredients\": \"Ingredients\",\n \"inventory.recipes.newRecipe\": \"New Recipe\",\n \"inventory.recipes.noRecipes\": \"No recipes yet\",\n \"inventory.recipes.produces\": \"Produces:\",\n \"inventory.recipes.productionFormulas\": \"{{count}} production formulas\",\n \"inventory.recipes.recipesDesc\": \"Recipes define how to produce products from ingredients\",\n \"inventory.recipes.title\": \"Recipes\",\n \"inventory.recipes.yield\": \"Yield\",\n \"inventory.stock.additionalDetails\": \"Additional details (optional)\",\n \"inventory.stock.adjustmentDesc\": \"Count correction\",\n \"inventory.stock.adjustmentLabel\": \"Adjustment\",\n \"inventory.stock.back\": \"Back\",\n \"inventory.stock.batchNumber\": \"Batch Number\",\n \"inventory.stock.currentStock\": \"Current Stock\",\n \"inventory.stock.destination\": \"Destination\",\n \"inventory.stock.document\": \"Document\",\n \"inventory.stock.documentNumber\": \"Document Number\",\n \"inventory.stock.entry\": \"Stock Entry\",\n \"inventory.stock.entryDesc\": \"Receiving goods\",\n \"inventory.stock.entryLabel\": \"Entry\",\n \"inventory.stock.exit\": \"Stock Exit\",\n \"inventory.stock.exitDesc\": \"Using or selling\",\n \"inventory.stock.exitLabel\": \"Exit\",\n \"inventory.stock.expirationDate\": \"Expiration Date\",\n \"inventory.stock.fromLocation\": \"From Location\",\n \"inventory.stock.locationLabel\": \"Location\",\n \"inventory.stock.lossDesc\": \"Waste or damage\",\n \"inventory.stock.lossLabel\": \"Loss\",\n \"inventory.stock.movement\": \"Stock Movement\",\n \"inventory.stock.movementDetails\": \"Movement Details\",\n \"inventory.stock.movementType\": \"Movement type\",\n \"inventory.stock.next\": \"Next\",\n \"inventory.stock.notes\": \"Notes\",\n \"inventory.stock.product\": \"Product\",\n \"inventory.stock.quantity\": \"Quantity *\",\n \"inventory.stock.quantityLabel\": \"Quantity\",\n \"inventory.stock.reason\": \"Reason *\",\n \"inventory.stock.reasonLabel\": \"Reason\",\n \"inventory.stock.recordMovement\": \"Record Movement\",\n \"inventory.stock.recorded\": \"Recorded\",\n \"inventory.stock.recording\": \"Recording...\",\n \"inventory.stock.searchProduct\": \"Search by name, SKU, or barcode...\",\n \"inventory.stock.stepOf\": \"Step {{step}} of 3\",\n \"inventory.stock.supplier\": \"Supplier\",\n \"inventory.stock.toLocation\": \"To Location *\",\n \"inventory.stock.total\": \"Total\",\n \"inventory.stock.totalCost\": \"Total Cost\",\n \"inventory.stock.transferDesc\": \"Between locations\",\n \"inventory.stock.transferLabel\": \"Transfer\",\n \"inventory.stock.unitCost\": \"Unit Cost\",\n \"inventory.stock.unitCostLabel\": \"Unit Cost\",\n \"inventory.onboarding.welcome\": \"Welcome to Inventory\",\n \"inventory.onboarding.description\": \"Track products, manage stock levels, and monitor movements across your business.\",\n \"inventory.onboarding.skip\": \"Skip setup\",\n \"inventory.onboarding.getStarted\": \"Get Started\",\n \"inventory.onboarding.units.title\": \"Measurement Units\",\n \"inventory.onboarding.units.description\": \"Default units (Unit, Box, Kg, L, etc.) are ready. Customize them anytime in Settings.\",\n \"inventory.onboarding.locations.title\": \"Stock Locations\",\n \"inventory.onboarding.locations.description\": \"A default storage location has been created. Add more for multi-location tracking.\",\n \"inventory.onboarding.start\": \"Start using Inventory\",\n \"inventory.quickActions.newProduct\": \"New Product\",\n \"inventory.quickActions.newProductDesc\": \"Add a product to your catalog\",\n \"inventory.quickActions.stockEntry\": \"Stock Entry\",\n \"inventory.quickActions.stockEntryDesc\": \"Record goods received\",\n \"inventory.quickActions.stockExit\": \"Stock Exit\",\n \"inventory.quickActions.stockExitDesc\": \"Record goods used or sold\",\n \"inventory.settingsPage.title\": \"Inventory Settings\",\n \"inventory.settingsPage.subtitle\": \"Manage units, categories, and stock locations\",\n \"inventory.settings.stockManagement\": \"Stock Management\",\n \"inventory.settings.stockManagementDesc\": \"How stock levels are tracked\",\n \"inventory.settings.lowStockAlerts\": \"Low stock alerts\",\n \"inventory.settings.lowStockAlertsDesc\": \"Show warnings when products fall below minimum quantity\",\n \"inventory.settings.requireReason\": \"Require reason for adjustments\",\n \"inventory.settings.requireReasonDesc\": \"Make reason mandatory for stock adjustments and losses\",\n \"inventory.settings.autoDeduct\": \"Auto-deduct on service\",\n \"inventory.settings.autoDeductDesc\": \"Automatically deduct products when a service is executed\",\n \"inventory.settings.products\": \"Products\",\n \"inventory.settings.productsDesc\": \"Product catalog behavior\",\n \"inventory.settings.requireSku\": \"Require SKU\",\n \"inventory.settings.requireSkuDesc\": \"Make SKU mandatory when creating products\",\n \"inventory.settings.allowNegative\": \"Allow negative stock\",\n \"inventory.settings.allowNegativeDesc\": \"Allow stock quantities to go below zero\",\n \"inventory.settings.notifications\": \"Notifications\",\n \"inventory.settings.notificationsDesc\": \"Alerts and reminders\",\n \"inventory.settings.lowStockEmail\": \"Low stock email alerts\",\n \"inventory.settings.lowStockEmailDesc\": \"Send email when products reach minimum quantity\",\n \"inventory.settings.expiryWarnings\": \"Expiry date warnings\",\n \"inventory.settings.expiryWarningsDesc\": \"Alert before products expire (batch tracking)\",\n \"inventory.productForm.newProduct\": \"New Product\",\n \"inventory.productForm.editProduct\": \"Edit Product\",\n \"inventory.productForm.updateDetails\": \"Update product details\",\n \"inventory.productForm.addToCatalog\": \"Add a product to your catalog\",\n \"inventory.productForm.cancel\": \"Cancel\",\n \"inventory.productForm.save\": \"Save\",\n \"inventory.productForm.saving\": \"Saving...\",\n \"inventory.productForm.generalInfo\": \"General Information\",\n \"inventory.productForm.name\": \"Name\",\n \"inventory.productForm.namePlaceholder\": \"Product name\",\n \"inventory.productForm.brand\": \"Brand\",\n \"inventory.productForm.brandPlaceholder\": \"Brand name\",\n \"inventory.productForm.sku\": \"SKU\",\n \"inventory.productForm.skuPlaceholder\": \"Internal code\",\n \"inventory.productForm.barcode\": \"Barcode\",\n \"inventory.productForm.barcodePlaceholder\": \"EAN / UPC\",\n \"inventory.productForm.description\": \"Description\",\n \"inventory.productForm.descriptionPlaceholder\": \"Additional information about the product\",\n \"inventory.productForm.classification\": \"Classification\",\n \"inventory.productForm.classificationDesc\": \"How this product is used in your business\",\n \"inventory.productForm.typeIngredient\": \"Raw material used in production or services\",\n \"inventory.productForm.typeSale\": \"Sold directly to customers\",\n \"inventory.productForm.typeIntermediate\": \"Produced internally from other items\",\n \"inventory.productForm.typeAsset\": \"Fixed asset for patrimony tracking\",\n \"inventory.productForm.pricing\": \"Pricing\",\n \"inventory.productForm.costPrice\": \"Cost Price\",\n \"inventory.productForm.salePrice\": \"Sale Price\",\n \"inventory.productForm.margin\": \"Margin\",\n \"inventory.productForm.stockLevels\": \"Stock Levels\",\n \"inventory.productForm.stockLevelsDesc\": \"Minimum and maximum thresholds for alerts\",\n \"inventory.productForm.minQuantity\": \"Minimum Quantity\",\n \"inventory.productForm.minQuantityHint\": \"Alert when stock falls below this\",\n \"inventory.productForm.maxQuantity\": \"Maximum Quantity\",\n \"inventory.productForm.maxQuantityHint\": \"Max capacity for this product\",\n \"inventory.productForm.optional\": \"Optional\",\n \"inventory.productList.title\": \"Products\",\n \"inventory.productList.subtitle\": \"{{count}} products\",\n \"inventory.productList.product\": \"Product\",\n \"inventory.productList.type\": \"Type\",\n \"inventory.productList.stock\": \"Stock\",\n \"inventory.productList.cost\": \"Cost\",\n \"inventory.productList.value\": \"Value\",\n \"inventory.productList.searchPlaceholder\": \"Search products...\",\n \"inventory.productList.newProduct\": \"New Product\",\n \"inventory.productList.empty\": \"No products yet\",\n \"inventory.productList.createFirst\": \"Create your first product\",\n \"inventory.stock.unknownProduct\": \"Unknown Product\",\n \"inventory.stock.reasonLossPlaceholder\": \"e.g. Expired, damaged\",\n \"inventory.stock.reasonAdjustPlaceholder\": \"e.g. Physical count correction\",\n \"inventory.stock.documentPlaceholder\": \"Invoice, receipt, PO...\",\n \"inventory.stock.batchPlaceholder\": \"e.g. LOT001\",\n \"inventory.stock.notesPlaceholder\": \"Additional notes...\",\n \"inventory.recipeDetail.loading\": \"Loading...\",\n \"inventory.recipeDetail.ingredient\": \"Ingredient\",\n \"inventory.recipeDetail.quantity\": \"Quantity\",\n \"inventory.recipeDetail.unit\": \"Unit\",\n \"inventory.recipeDetail.notes\": \"Notes\",\n \"inventory.recipeDetail.created\": \"Created\",\n \"inventory.recipeDetail.updated\": \"Updated\",\n \"inventory.recipeForm.newRecipe\": \"New Recipe\",\n \"inventory.recipeForm.subtitle\": \"Define a production formula\",\n \"inventory.recipeForm.cancel\": \"Cancel\",\n \"inventory.recipeForm.saveRecipe\": \"Save Recipe\",\n \"inventory.recipeForm.saving\": \"Saving...\",\n \"inventory.recipeForm.recipeDetails\": \"Recipe Details\",\n \"inventory.recipeForm.recipeName\": \"Recipe Name\",\n \"inventory.recipeForm.recipeNamePlaceholder\": \"e.g. Tomato Sauce\",\n \"inventory.recipeForm.description\": \"Description\",\n \"inventory.recipeForm.descriptionPlaceholder\": \"Brief description...\",\n \"inventory.recipeForm.produces\": \"Produces (Product)\",\n \"inventory.recipeForm.searchProduct\": \"Search product...\",\n \"inventory.recipeForm.createProduct\": \"Create product\",\n \"inventory.recipeForm.yieldQuantity\": \"Yield Quantity\",\n \"inventory.recipeForm.prepTime\": \"Prep Time (min)\",\n \"inventory.recipeForm.instructions\": \"Instructions\",\n \"inventory.recipeForm.instructionsPlaceholder\": \"Step-by-step preparation instructions...\",\n \"inventory.recipeForm.ingredients\": \"Ingredients\",\n \"inventory.recipeForm.addIngredient\": \"Add Ingredient\",\n \"inventory.recipeForm.noIngredients\": \"No ingredients added\",\n \"inventory.recipeForm.addFirstIngredient\": \"Add your first ingredient\",\n \"inventory.recipeForm.ingredient\": \"Ingredient\",\n \"inventory.recipeForm.quantity\": \"Quantity\",\n \"inventory.recipeForm.notes\": \"Notes\",\n \"inventory.recipeForm.searchIngredient\": \"Search ingredient...\",\n \"inventory.recipeForm.createIngredient\": \"Create ingredient\",\n \"inventory.recipeForm.notesPlaceholder\": \"e.g. diced, fresh\",\n \"inventory.recipeForm.ingredientsConfigured\": \"{{configured}} of {{total}} ingredients configured\",\n \"inventory.title\": \"Inventory\",\n \"inventory.stock.title\": \"Stock\",\n \"inventory.stock.minStock\": \"Min. Stock\",\n \"inventory.stock.adjust\": \"Adjust Stock\",\n \"inventory.stock.lowStock\": \"Low Stock\",\n \"inventory.products.title\": \"Products\",\n \"inventory.products.create\": \"New Product\",\n \"inventory.recipes.create\": \"New Recipe\",\n \"inventory.recipes.addIngredient\": \"Add Ingredient\",\n \"inventory.recipes.cost\": \"Cost\",\n \"inventory.recipes.loading\": \"Loading...\",\n \"inventory.suppliers.title\": \"Suppliers\",\n \"inventory.suppliers.create\": \"New Supplier\",\n \"inventory.movements.title\": \"Movements\",\n \"inventory.movements.in\": \"Stock In\",\n \"inventory.movements.out\": \"Stock Out\",\n \"inventory.settings.title\": \"Inventory Settings\",\n}\n","// inventory.* — merged plugin-own + saas-core central i18n\nexport const ptBR: Record<string, string> = {\n \"inventory.dashboard.activeItems\": \"Itens ativos\",\n \"inventory.dashboard.belowMinimum\": \"Abaixo do mínimo\",\n \"inventory.dashboard.entries\": \"Entradas:\",\n \"inventory.dashboard.exits\": \"Saídas:\",\n \"inventory.dashboard.last7Days\": \"Últimos 7 dias\",\n \"inventory.dashboard.lowStock\": \"Estoque Baixo\",\n \"inventory.dashboard.needRestocking\": \"Precisam reposição\",\n \"inventory.dashboard.outOfStock\": \"Sem Estoque\",\n \"inventory.dashboard.quickActions\": \"Ações Rápidas\",\n \"inventory.dashboard.quickActionsDesc\": \"Use a barra lateral para registrar entradas, saídas ou gerenciar produtos.\",\n \"inventory.dashboard.recentActivity\": \"Atividade Recente\",\n \"inventory.dashboard.stockValue\": \"Valor do Estoque\",\n \"inventory.dashboard.totalProducts\": \"Total de Produtos\",\n \"inventory.dashboard.totalValue\": \"Valor total do estoque\",\n \"inventory.history.noMovements\": \"Nenhuma movimentação registrada\",\n \"inventory.history.searchPlaceholder\": \"Buscar movimentações...\",\n \"inventory.history.subtitle\": \"Todas as movimentações de estoque\",\n \"inventory.history.title\": \"Histórico de Estoque\",\n \"inventory.nav.dashboard\": \"Painel\",\n \"inventory.nav.entry\": \"Entrada\",\n \"inventory.nav.exit\": \"Saída\",\n \"inventory.nav.history\": \"Histórico\",\n \"inventory.nav.list\": \"Lista\",\n \"inventory.nav.new\": \"Novo\",\n \"inventory.nav.products\": \"Produtos\",\n \"inventory.nav.stock\": \"Estoque\",\n \"inventory.page.newProduct\": \"Novo Produto\",\n \"inventory.page.newProductDesc\": \"Adicionar um produto ao seu catálogo\",\n \"inventory.page.settingsSubtitle\": \"Preferências, fornecedores, categorias e unidades\",\n \"inventory.page.settingsTitle\": \"Configurações de Estoque\",\n \"inventory.page.stockEntry\": \"Entrada de Estoque\",\n \"inventory.page.stockEntryDesc\": \"Registrar mercadorias recebidas\",\n \"inventory.page.stockExit\": \"Saída de Estoque\",\n \"inventory.page.stockExitDesc\": \"Registrar mercadorias usadas ou vendidas\",\n \"inventory.recipeDetail.active\": \"Ativa\",\n \"inventory.recipeDetail.backToList\": \"Voltar à lista\",\n \"inventory.recipeDetail.inactive\": \"Inativa\",\n \"inventory.recipeDetail.ingredientCount\": \"Ingredientes\",\n \"inventory.recipeDetail.ingredientsTitle\": \"Ingredientes\",\n \"inventory.recipeDetail.instructions\": \"Instruções\",\n \"inventory.recipeDetail.noIngredients\": \"Nenhum ingrediente definido\",\n \"inventory.recipeDetail.notFound\": \"Receita não encontrada\",\n \"inventory.recipeDetail.prepTime\": \"Tempo de preparo\",\n \"inventory.recipeDetail.produces\": \"Produz\",\n \"inventory.recipeDetail.recipes\": \"Receitas\",\n \"inventory.recipeDetail.yield\": \"Rendimento\",\n \"inventory.recipes.createFirst\": \"Crie sua primeira receita\",\n \"inventory.recipes.ingredients\": \"Ingredientes\",\n \"inventory.recipes.newRecipe\": \"Nova Receita\",\n \"inventory.recipes.noRecipes\": \"Nenhuma receita ainda\",\n \"inventory.recipes.produces\": \"Produz:\",\n \"inventory.recipes.productionFormulas\": \"{{count}} fórmulas de produção\",\n \"inventory.recipes.recipesDesc\": \"Receitas definem como produzir produtos a partir de ingredientes\",\n \"inventory.recipes.title\": \"Receitas\",\n \"inventory.recipes.yield\": \"Rendimento\",\n \"inventory.stock.additionalDetails\": \"Detalhes adicionais (opcional)\",\n \"inventory.stock.adjustmentDesc\": \"Correção de contagem\",\n \"inventory.stock.adjustmentLabel\": \"Ajuste\",\n \"inventory.stock.back\": \"Voltar\",\n \"inventory.stock.batchNumber\": \"Número do Lote\",\n \"inventory.stock.currentStock\": \"Estoque Atual\",\n \"inventory.stock.destination\": \"Destino\",\n \"inventory.stock.document\": \"Documento\",\n \"inventory.stock.documentNumber\": \"Número do Documento\",\n \"inventory.stock.entry\": \"Entrada de Estoque\",\n \"inventory.stock.entryDesc\": \"Recebimento de mercadorias\",\n \"inventory.stock.entryLabel\": \"Entrada\",\n \"inventory.stock.exit\": \"Saída de Estoque\",\n \"inventory.stock.exitDesc\": \"Uso ou venda\",\n \"inventory.stock.exitLabel\": \"Saída\",\n \"inventory.stock.expirationDate\": \"Data de Validade\",\n \"inventory.stock.fromLocation\": \"Local de Origem\",\n \"inventory.stock.locationLabel\": \"Local\",\n \"inventory.stock.lossDesc\": \"Desperdício ou dano\",\n \"inventory.stock.lossLabel\": \"Perda\",\n \"inventory.stock.movement\": \"Movimentação de Estoque\",\n \"inventory.stock.movementDetails\": \"Detalhes da Movimentação\",\n \"inventory.stock.movementType\": \"Tipo de movimentação\",\n \"inventory.stock.next\": \"Próximo\",\n \"inventory.stock.notes\": \"Observações\",\n \"inventory.stock.product\": \"Produto\",\n \"inventory.stock.quantity\": \"Quantidade *\",\n \"inventory.stock.quantityLabel\": \"Quantidade\",\n \"inventory.stock.reason\": \"Motivo *\",\n \"inventory.stock.reasonLabel\": \"Motivo\",\n \"inventory.stock.recordMovement\": \"Registrar Movimentação\",\n \"inventory.stock.recorded\": \"Registrado\",\n \"inventory.stock.recording\": \"Registrando...\",\n \"inventory.stock.searchProduct\": \"Buscar por nome, SKU ou código de barras...\",\n \"inventory.stock.stepOf\": \"Etapa {{step}} de 3\",\n \"inventory.stock.supplier\": \"Fornecedor\",\n \"inventory.stock.toLocation\": \"Local de Destino *\",\n \"inventory.stock.total\": \"Total\",\n \"inventory.stock.totalCost\": \"Custo Total\",\n \"inventory.stock.transferDesc\": \"Entre locais\",\n \"inventory.stock.transferLabel\": \"Transferência\",\n \"inventory.stock.unitCost\": \"Custo Unitário\",\n \"inventory.stock.unitCostLabel\": \"Custo Unitário\",\n \"inventory.onboarding.welcome\": \"Bem-vindo ao Estoque\",\n \"inventory.onboarding.description\": \"Acompanhe produtos, gerencie níveis de estoque e monitore movimentações do seu negócio.\",\n \"inventory.onboarding.skip\": \"Pular configuração\",\n \"inventory.onboarding.getStarted\": \"Começar\",\n \"inventory.onboarding.units.title\": \"Unidades de Medida\",\n \"inventory.onboarding.units.description\": \"Unidades padrão (Unidade, Caixa, Kg, L, etc.) estão prontas. Personalize-as a qualquer momento em Configurações.\",\n \"inventory.onboarding.locations.title\": \"Locais de Estoque\",\n \"inventory.onboarding.locations.description\": \"Um local de armazenamento padrão foi criado. Adicione mais para controle multi-local.\",\n \"inventory.onboarding.start\": \"Começar a usar Estoque\",\n \"inventory.quickActions.newProduct\": \"Novo Produto\",\n \"inventory.quickActions.newProductDesc\": \"Adicionar um produto ao catálogo\",\n \"inventory.quickActions.stockEntry\": \"Entrada de Estoque\",\n \"inventory.quickActions.stockEntryDesc\": \"Registrar mercadorias recebidas\",\n \"inventory.quickActions.stockExit\": \"Saída de Estoque\",\n \"inventory.quickActions.stockExitDesc\": \"Registrar mercadorias usadas ou vendidas\",\n \"inventory.settingsPage.title\": \"Configurações de Estoque\",\n \"inventory.settingsPage.subtitle\": \"Gerenciar unidades, categorias e locais de estoque\",\n \"inventory.settings.stockManagement\": \"Gestão de Estoque\",\n \"inventory.settings.stockManagementDesc\": \"Como os níveis de estoque são rastreados\",\n \"inventory.settings.lowStockAlerts\": \"Alertas de estoque baixo\",\n \"inventory.settings.lowStockAlertsDesc\": \"Mostrar avisos quando produtos ficarem abaixo da quantidade mínima\",\n \"inventory.settings.requireReason\": \"Exigir motivo para ajustes\",\n \"inventory.settings.requireReasonDesc\": \"Tornar obrigatório o motivo para ajustes e perdas de estoque\",\n \"inventory.settings.autoDeduct\": \"Auto-deduzir no serviço\",\n \"inventory.settings.autoDeductDesc\": \"Deduzir automaticamente produtos quando um serviço é executado\",\n \"inventory.settings.products\": \"Produtos\",\n \"inventory.settings.productsDesc\": \"Comportamento do catálogo de produtos\",\n \"inventory.settings.requireSku\": \"Exigir SKU\",\n \"inventory.settings.requireSkuDesc\": \"Tornar SKU obrigatório ao criar produtos\",\n \"inventory.settings.allowNegative\": \"Permitir estoque negativo\",\n \"inventory.settings.allowNegativeDesc\": \"Permitir que quantidades de estoque fiquem abaixo de zero\",\n \"inventory.settings.notifications\": \"Notificações\",\n \"inventory.settings.notificationsDesc\": \"Alertas e lembretes\",\n \"inventory.settings.lowStockEmail\": \"Alertas de estoque baixo por e-mail\",\n \"inventory.settings.lowStockEmailDesc\": \"Enviar e-mail quando produtos atingirem a quantidade mínima\",\n \"inventory.settings.expiryWarnings\": \"Avisos de validade\",\n \"inventory.settings.expiryWarningsDesc\": \"Alertar antes de produtos vencerem (rastreamento de lotes)\",\n \"inventory.productForm.newProduct\": \"Novo Produto\",\n \"inventory.productForm.editProduct\": \"Editar Produto\",\n \"inventory.productForm.updateDetails\": \"Atualizar detalhes do produto\",\n \"inventory.productForm.addToCatalog\": \"Adicionar um produto ao seu catálogo\",\n \"inventory.productForm.cancel\": \"Cancelar\",\n \"inventory.productForm.save\": \"Salvar\",\n \"inventory.productForm.saving\": \"Salvando...\",\n \"inventory.productForm.generalInfo\": \"Informações Gerais\",\n \"inventory.productForm.name\": \"Nome\",\n \"inventory.productForm.namePlaceholder\": \"Nome do produto\",\n \"inventory.productForm.brand\": \"Marca\",\n \"inventory.productForm.brandPlaceholder\": \"Nome da marca\",\n \"inventory.productForm.sku\": \"SKU\",\n \"inventory.productForm.skuPlaceholder\": \"Código interno\",\n \"inventory.productForm.barcode\": \"Código de Barras\",\n \"inventory.productForm.barcodePlaceholder\": \"EAN / UPC\",\n \"inventory.productForm.description\": \"Descrição\",\n \"inventory.productForm.descriptionPlaceholder\": \"Informações adicionais sobre o produto\",\n \"inventory.productForm.classification\": \"Classificação\",\n \"inventory.productForm.classificationDesc\": \"Como este produto é usado no seu negócio\",\n \"inventory.productForm.typeIngredient\": \"Matéria-prima usada na produção ou serviços\",\n \"inventory.productForm.typeSale\": \"Vendido diretamente aos clientes\",\n \"inventory.productForm.typeIntermediate\": \"Produzido internamente a partir de outros itens\",\n \"inventory.productForm.typeAsset\": \"Ativo fixo para controle patrimonial\",\n \"inventory.productForm.pricing\": \"Preços\",\n \"inventory.productForm.costPrice\": \"Preço de Custo\",\n \"inventory.productForm.salePrice\": \"Preço de Venda\",\n \"inventory.productForm.margin\": \"Margem\",\n \"inventory.productForm.stockLevels\": \"Níveis de Estoque\",\n \"inventory.productForm.stockLevelsDesc\": \"Limites mínimo e máximo para alertas\",\n \"inventory.productForm.minQuantity\": \"Quantidade Mínima\",\n \"inventory.productForm.minQuantityHint\": \"Alertar quando o estoque ficar abaixo deste valor\",\n \"inventory.productForm.maxQuantity\": \"Quantidade Máxima\",\n \"inventory.productForm.maxQuantityHint\": \"Capacidade máxima para este produto\",\n \"inventory.productForm.optional\": \"Opcional\",\n \"inventory.productList.title\": \"Produtos\",\n \"inventory.productList.subtitle\": \"{{count}} produtos\",\n \"inventory.productList.product\": \"Produto\",\n \"inventory.productList.type\": \"Tipo\",\n \"inventory.productList.stock\": \"Estoque\",\n \"inventory.productList.cost\": \"Custo\",\n \"inventory.productList.value\": \"Valor\",\n \"inventory.productList.searchPlaceholder\": \"Buscar produtos...\",\n \"inventory.productList.newProduct\": \"Novo Produto\",\n \"inventory.productList.empty\": \"Nenhum produto ainda\",\n \"inventory.productList.createFirst\": \"Crie seu primeiro produto\",\n \"inventory.stock.unknownProduct\": \"Produto Desconhecido\",\n \"inventory.stock.reasonLossPlaceholder\": \"ex. Vencido, danificado\",\n \"inventory.stock.reasonAdjustPlaceholder\": \"ex. Correção de contagem física\",\n \"inventory.stock.documentPlaceholder\": \"Nota fiscal, recibo, PO...\",\n \"inventory.stock.batchPlaceholder\": \"ex. LOT001\",\n \"inventory.stock.notesPlaceholder\": \"Observações adicionais...\",\n \"inventory.recipeDetail.loading\": \"Carregando...\",\n \"inventory.recipeDetail.ingredient\": \"Ingrediente\",\n \"inventory.recipeDetail.quantity\": \"Quantidade\",\n \"inventory.recipeDetail.unit\": \"Unidade\",\n \"inventory.recipeDetail.notes\": \"Observações\",\n \"inventory.recipeDetail.created\": \"Criado\",\n \"inventory.recipeDetail.updated\": \"Atualizado\",\n \"inventory.recipeForm.newRecipe\": \"Nova Receita\",\n \"inventory.recipeForm.subtitle\": \"Definir uma fórmula de produção\",\n \"inventory.recipeForm.cancel\": \"Cancelar\",\n \"inventory.recipeForm.saveRecipe\": \"Salvar Receita\",\n \"inventory.recipeForm.saving\": \"Salvando...\",\n \"inventory.recipeForm.recipeDetails\": \"Detalhes da Receita\",\n \"inventory.recipeForm.recipeName\": \"Nome da Receita\",\n \"inventory.recipeForm.recipeNamePlaceholder\": \"ex. Molho de Tomate\",\n \"inventory.recipeForm.description\": \"Descrição\",\n \"inventory.recipeForm.descriptionPlaceholder\": \"Breve descrição...\",\n \"inventory.recipeForm.produces\": \"Produz (Produto)\",\n \"inventory.recipeForm.searchProduct\": \"Buscar produto...\",\n \"inventory.recipeForm.createProduct\": \"Criar produto\",\n \"inventory.recipeForm.yieldQuantity\": \"Quantidade de Rendimento\",\n \"inventory.recipeForm.prepTime\": \"Tempo de Preparo (min)\",\n \"inventory.recipeForm.instructions\": \"Instruções\",\n \"inventory.recipeForm.instructionsPlaceholder\": \"Instruções de preparo passo a passo...\",\n \"inventory.recipeForm.ingredients\": \"Ingredientes\",\n \"inventory.recipeForm.addIngredient\": \"Adicionar Ingrediente\",\n \"inventory.recipeForm.noIngredients\": \"Nenhum ingrediente adicionado\",\n \"inventory.recipeForm.addFirstIngredient\": \"Adicione seu primeiro ingrediente\",\n \"inventory.recipeForm.ingredient\": \"Ingrediente\",\n \"inventory.recipeForm.quantity\": \"Quantidade\",\n \"inventory.recipeForm.notes\": \"Observações\",\n \"inventory.recipeForm.searchIngredient\": \"Buscar ingrediente...\",\n \"inventory.recipeForm.createIngredient\": \"Criar ingrediente\",\n \"inventory.recipeForm.notesPlaceholder\": \"ex. picado, fresco\",\n \"inventory.recipeForm.ingredientsConfigured\": \"{{configured}} de {{total}} ingredientes configurados\",\n \"inventory.title\": \"Estoque\",\n \"inventory.stock.title\": \"Estoque\",\n \"inventory.stock.minStock\": \"Estoque Mín.\",\n \"inventory.stock.adjust\": \"Ajustar Estoque\",\n \"inventory.stock.lowStock\": \"Estoque Baixo\",\n \"inventory.products.title\": \"Produtos\",\n \"inventory.products.create\": \"Novo Produto\",\n \"inventory.recipes.create\": \"Nova Receita\",\n \"inventory.recipes.addIngredient\": \"Adicionar Ingrediente\",\n \"inventory.recipes.cost\": \"Custo\",\n \"inventory.recipes.loading\": \"Carregando...\",\n \"inventory.suppliers.title\": \"Fornecedores\",\n \"inventory.suppliers.create\": \"Novo Fornecedor\",\n \"inventory.movements.title\": \"Movimentações\",\n \"inventory.movements.in\": \"Entrada\",\n \"inventory.movements.out\": \"Saída\",\n \"inventory.settings.title\": \"Configurações de Estoque\",\n}\n","import { en } from './en'\nimport { ptBR } from './pt-BR'\n\nexport const inventoryLocales: Record<string, Record<string, string>> = {\n en,\n 'pt-BR': ptBR,\n}\n","import React from 'react'\nimport type { PluginManifest, PluginScope, VerticalId } from '@fayz-ai/core'\nimport { InventoryPage } from './views/InventoryPage'\nimport { createInventoryDashboardWidgets } from './views/dashboardWidgets'\nimport type { ResolvedInventoryConfig } from './context'\nimport type { InventoryDataProvider } from './data/types'\nimport { createMockInventoryProvider } from './data/mock'\nimport { createSupabaseInventoryProvider } from './data/supabase'\nimport { createSafeDataProvider, registerTranslations } from '@fayz-ai/core'\nimport { createInventoryStore } from './store'\nimport { inventoryRegistries } from './data/registries'\nimport { inventoryLocales } from './locales'\nimport { InventoryGeneralSettings } from './components/InventoryGeneralSettings'\n\n// ---------------------------------------------------------------------------\n// Public types\n// ---------------------------------------------------------------------------\n\nexport interface InventoryPluginLabels {\n pageTitle: string\n pageSubtitle: string\n dashboard: string\n products: string\n productsNew: string\n productsList: string\n stock: string\n stockEntry: string\n stockExit: string\n stockHistory: string\n recipes: string\n recipesNew: string\n recipesList: string\n}\n\nexport interface InventoryPluginOptions {\n modules?: {\n recipes?: boolean\n stockLocations?: boolean\n batchTracking?: boolean\n /**\n * The product catalogue screens (list + form). Defaults on. Turn OFF when the\n * host already owns product registration elsewhere — an e-commerce app\n * manages products in the shop plugin, and two competing product CRUDs is\n * how the same product ends up entered twice, differently.\n * Stock entry/exit/history stay available either way.\n */\n products?: boolean\n }\n labels?: Partial<InventoryPluginLabels>\n productTypes?: Array<{ value: string; label: string }>\n currency?: { code?: string; locale?: string; symbol?: string }\n navPosition?: number\n navSection?: 'main' | 'secondary'\n scope?: PluginScope\n verticalId?: VerticalId\n dataProvider?: InventoryDataProvider\n locations?: Array<{ id: string; name: string; isHQ?: boolean }>\n}\n\n// ---------------------------------------------------------------------------\n// Defaults\n// ---------------------------------------------------------------------------\n\nconst DEFAULT_LABELS: InventoryPluginLabels = {\n pageTitle: 'Inventory',\n pageSubtitle: 'Product catalog and stock management',\n dashboard: 'Dashboard',\n products: 'Products',\n productsNew: 'New',\n productsList: 'List',\n stock: 'Stock',\n stockEntry: 'Entry',\n stockExit: 'Exit',\n stockHistory: 'History',\n recipes: 'Recipes',\n recipesNew: 'New',\n recipesList: 'List',\n}\n\nconst DEFAULT_CURRENCY = { code: 'BRL', locale: 'pt-BR', symbol: 'R$' }\n\nconst DEFAULT_PRODUCT_TYPES = [\n { value: 'ingredient', label: 'Ingredient' },\n { value: 'sale', label: 'For Sale' },\n { value: 'intermediate', label: 'Intermediate' },\n { value: 'asset', label: 'Asset' },\n]\n\n// ---------------------------------------------------------------------------\n// Config resolver\n// ---------------------------------------------------------------------------\n\nfunction resolveConfig(options?: InventoryPluginOptions): ResolvedInventoryConfig {\n return {\n modules: {\n products: options?.modules?.products !== false,\n recipes: options?.modules?.recipes !== false,\n stockLocations: options?.modules?.stockLocations !== false,\n batchTracking: options?.modules?.batchTracking ?? false,\n },\n labels: { ...DEFAULT_LABELS, ...options?.labels },\n currency: { ...DEFAULT_CURRENCY, ...options?.currency },\n productTypes: options?.productTypes ?? DEFAULT_PRODUCT_TYPES,\n locations: options?.locations ?? [],\n }\n}\n\n// ---------------------------------------------------------------------------\n// Factory\n// ---------------------------------------------------------------------------\n\nexport function createInventoryPlugin(options?: InventoryPluginOptions): PluginManifest {\n const config = resolveConfig(options)\n registerTranslations(inventoryLocales)\n const provider = options?.dataProvider ?? createSafeDataProvider(\n () => createSupabaseInventoryProvider(),\n () => createMockInventoryProvider(),\n )\n const store = createInventoryStore(provider)\n const dashboardWidgets = createInventoryDashboardWidgets({ config, provider, store })\n\n const PageComponent: React.FC<any> = () =>\n React.createElement(InventoryPage, { config, provider, store, registries: inventoryRegistries })\n\n return {\n id: 'inventory',\n name: config.labels.pageTitle,\n icon: 'Package',\n version: '1.0.0',\n scope: options?.scope ?? 'universal',\n verticalId: options?.verticalId,\n defaultEnabled: true,\n dependencies: [],\n declaredFeatures: [\n { id: 'inventory', label: config.labels.pageTitle, group: config.labels.pageTitle },\n ...(config.modules.recipes ? [{ id: 'inventory.recipes', label: config.labels.recipes ?? 'Recipes', group: config.labels.pageTitle }] : []),\n ],\n queryEntities: [\n {\n key: 'inventory:products',\n writable: true,\n entity: {\n name: 'Product',\n namePlural: 'Products',\n icon: 'Package',\n limitKey: 'products',\n permission: { feature: 'inventory', action: 'read' },\n fields: [\n { key: 'name', label: 'Name', type: 'text', required: true, searchable: true },\n { key: 'kind', label: 'Kind (sale/ingredient/asset)', type: 'text' },\n { key: 'price', label: 'Price', type: 'number' },\n { key: 'cost', label: 'Cost', type: 'number' },\n { key: 'sku', label: 'SKU', type: 'text', searchable: true },\n { key: 'isActive', label: 'Active', type: 'boolean' },\n { key: 'createdAt', label: 'Created at', type: 'text' },\n ],\n data: {\n table: 'products',\n tenantScoped: true,\n archetype: 'product',\n archetypeKind: 'sale',\n searchColumns: ['name', 'sku'],\n defaults: { kind: 'sale', status: 'active', is_active: true },\n },\n },\n },\n ],\n declaredLimits: [\n { key: 'products', label: 'Products', table: 'products' },\n ...(config.modules.recipes ? [{ key: 'recipes', label: config.labels.recipes ?? 'Recipes', table: 'plg_inventory_recipes' }] : []),\n ],\n navigation: [\n {\n section: options?.navSection ?? 'main',\n position: options?.navPosition ?? 4,\n label: config.labels.pageTitle,\n route: '/inventory',\n icon: 'Package',\n permission: { feature: 'inventory', action: 'read' as const },\n },\n ],\n routes: [\n {\n path: '/inventory',\n component: PageComponent,\n permission: { feature: 'inventory', action: 'read' as const },\n // Products live on this hand-built page, not a CRUD route, so nothing\n // would register them and a product the assistant just created would\n // resolve to no page at all.\n entityRoutes: ['product:sale', 'product'],\n },\n ],\n widgets: [],\n dashboardWidgets,\n aiTools: [\n {\n id: 'inventory.low-stock',\n name: 'getLowStock',\n description: 'Lists products with stock below minimum threshold.',\n icon: 'AlertTriangle',\n mode: 'read' as const,\n category: 'Inventory',\n parameters: {\n type: 'object' as const,\n properties: {\n threshold: { type: 'number' as const, description: 'Custom stock threshold' },\n },\n },\n suggestions: [\n { label: 'Which products are running low?' },\n { label: 'What ingredients need restocking?', verticalId: 'food' as const },\n { label: 'Show me a stock summary' },\n { label: 'What are my most used products?' },\n ],\n permission: { feature: 'inventory', action: 'read' as const },\n },\n ],\n registries: inventoryRegistries,\n settings: [\n {\n id: 'inventory',\n label: 'Inventory',\n icon: 'Package',\n component: (() => {\n const Tab: React.FC = () => React.createElement(InventoryGeneralSettings)\n Tab.displayName = 'InventorySettingsTab'\n return Tab\n })() as unknown as React.ComponentType<unknown>,\n order: 11,\n permission: { feature: 'inventory', action: 'read' as const },\n },\n ],\n locales: inventoryLocales,\n }\n}\n\nexport type { InventoryDataProvider } from './data/types'\nexport type { ResolvedInventoryConfig } from './context'\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/context.tsx","../src/views/DashboardView.tsx","../src/data/tables.ts","../src/lib/movement-vocabulary.ts","../src/views/ProductStockTab.tsx","../src/views/productEntity.tsx","../src/views/ProductListView.tsx","../src/views/ProductCrudForm.tsx","../src/views/ProductDetailView.tsx","../src/views/StockMovementView.tsx","../src/views/MovementHistoryView.tsx","../src/views/StockCountsView.tsx","../src/views/StockCountFormView.tsx","../src/lib/stock-count.ts","../src/views/StockCountSessionView.tsx","../src/lib/recipe-cost.ts","../src/lib/agent-tools.ts","../src/views/RecipesView.tsx","../src/views/RecipeFormView.tsx","../src/components/RecipeGapsPanel.tsx","../src/views/RecipeDetailView.tsx","../src/components/InventoryGeneralSettings.tsx","../src/components/InventoryOnboarding.tsx","../src/views/InventoryPage.tsx","../src/views/dashboardWidgets.tsx","../src/data/mock.ts","../src/data/supabase.ts","../src/store.ts","../src/data/registries.ts","../src/locales/en.ts","../src/locales/pt-BR.ts","../src/locales/index.ts","../src/index.ts"],"names":["jsx","t","jsxs","useTranslation","useState","useMemo","useEffect","useCallback","toast","React","SubpageHeader","MOVEMENT_TYPES","Package","ArrowDownRight","ArrowUpRight","RefreshCw","ArrowRightLeft","Trash2","Button","CrudListView","Fragment","ConfirmDialog","useRef","useLimitGuard","invalidateLimit","name","SearchSelect","Plus","DetailSkeleton","DataTable","AlertTriangle","Check","ctx","nextId","applyPositionDelta","createStore","PluginSettingsPanel"],"mappings":";;;;;;;;;AAkCA,IAAM,GAAA,GAAM,oBAAsF,eAAe,CAAA;AAE1G,IAAM,2BAA2B,GAAA,CAAI,eAAA;AACrC,IAAM,qBAAqB,GAAA,CAAI,SAAA;AAC/B,IAAM,uBAAuB,GAAA,CAAI,WAAA;AACjC,IAAM,oBAAoB,GAAA,CAAI,QAAA;AC/B9B,SAAS,aAAA,GAAgB;AAC9B,EAAA,uBAAO,GAAA,CAAC,mBAAgB,OAAA,EAAQ,aAAA,EAAc,QAAO,WAAA,EAAY,UAAA,EAAY,KAAA,EAAO,SAAA,EAAU,WAAA,EAAY,CAAA;AAC5G;;;ACTO,IAAM,CAAA,GAAI;AAAA,EACf,cAAA,EAAgB,+BAAA;AAAA,EAChB,cAAA,EAAgB,+BAAA;AAAA,EAChB,cAAA,EAAgB,+BAAA;AAAA,EAChB,OAAA,EAAS,uBAAA;AAAA,EACT,iBAAA,EAAmB,kCAAA;AAAA,EACnB,gBAAA,EAAkB,iCAAA;AAAA,EAClB,iBAAA,EAAmB,kCAAA;AAAA,EACnB,cAAA,EAAgB,+BAAA;AAAA,EAChB,YAAA,EAAc,6BAAA;AAAA,EACd,aAAA,EAAe,8BAAA;AAAA,EACf,UAAA,EAAY;AACd,CAAA;;;ACMO,IAAM,cAAA,GAA8C;AAAA,EACzD,EAAE,OAAO,OAAA,EAAS,QAAA,EAAU,gCAAgC,IAAA,EAAM,iBAAA,EAAmB,QAAQ,UAAA,EAAW;AAAA,EACxG,EAAE,OAAO,MAAA,EAAQ,QAAA,EAAU,+BAA+B,IAAA,EAAM,iBAAA,EAAmB,QAAQ,UAAA,EAAW;AAAA,EACtG,EAAE,OAAO,YAAA,EAAc,QAAA,EAAU,qCAAqC,IAAA,EAAM,OAAA,EAAS,QAAQ,KAAA,EAAM;AAAA,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ACF;AAAA,IACA,OAAA,EAAS;AAAA,GACX;AACF","file":"index.js","sourcesContent":["import { createPluginContext, formatCurrency, type CurrencyConfig } from '@fayz-ai/admin'\nimport type { InventoryPluginLabels } from './index'\nimport type { InventoryDataProvider } from './data/types'\nimport type { InventoryUIState } from './store'\n\nexport interface InventoryModules {\n /** Product catalogue screens. Off when the host registers products elsewhere. */\n products: boolean\n recipes: boolean\n stockLocations: boolean\n batchTracking: boolean\n}\n\nexport type InventoryCurrency = CurrencyConfig\n\nexport interface ProductTypeOption {\n value: string\n label: string\n}\n\nexport interface LocationOption {\n id: string\n name: string\n isHQ?: boolean\n}\n\nexport interface ResolvedInventoryConfig {\n modules: InventoryModules\n labels: InventoryPluginLabels\n currency: InventoryCurrency\n productTypes: ProductTypeOption[]\n locations: LocationOption[]\n}\n\nconst ctx = createPluginContext<ResolvedInventoryConfig, InventoryDataProvider, InventoryUIState>('InventoryPage')\n\nexport const InventoryContextProvider = ctx.ContextProvider\nexport const useInventoryConfig = ctx.useConfig\nexport const useInventoryProvider = ctx.useProvider\nexport const useInventoryStore = ctx.useStore\n\nexport { formatCurrency }\n","import React from 'react'\nimport { DashboardCanvas } from '@fayz-ai/ui'\n\n/**\n * Inventory overview. KPIs and the activity panel are registered dashboard\n * widgets (see ./dashboardWidgets), rendered through the shared DashboardCanvas;\n * the stock-value KPI also surfaces on the global app home.\n */\nexport function DashboardView() {\n return <DashboardCanvas surface=\"plugin-home\" domain=\"inventory\" showHeader={false} className=\"space-y-6\" />\n}\n","// Central physical-table-name registry for plugin-inventory.\nexport const T = {\n stockLocations: 'plg_inventory_stock_locations',\n stockMovements: 'plg_inventory_stock_movements',\n stockPositions: 'plg_inventory_stock_positions',\n recipes: 'plg_inventory_recipes',\n recipeIngredients: 'plg_inventory_recipe_ingredients',\n measurementUnits: 'plg_inventory_measurement_units',\n productCategories: 'plg_inventory_product_categories',\n productDetails: 'plg_inventory_product_details',\n recipeGroups: 'plg_inventory_recipe_groups',\n countSessions: 'plg_inventory_count_sessions',\n countItems: 'plg_inventory_count_items',\n} as const\n\n/** Slot key of plg_inventory_stock_positions — matches uq_..._slot (006). */\nexport const STOCK_POSITION_SLOT = 'tenant_id,product_id,stock_location_id,batch_number,expiration_date'\n","import type { MovementType } from '../types'\n\n/**\n * The one list of stock movement types.\n *\n * This used to be spelled out in three places — the MovementType union, the\n * form's picker and the history's icon/colour maps — which is three chances to\n * disagree. Importers make it four. Everything reads from here.\n */\nexport interface MovementTypeSpec {\n value: MovementType\n /** i18n key under the plugin's `inventory.movementType` namespace. */\n labelKey: string\n /** lucide icon name, resolved by the host's icon map. */\n icon: string\n /** Direction on stock: what the quantity does to the on-hand total. */\n effect: 'increase' | 'decrease' | 'set' | 'move'\n}\n\nexport const MOVEMENT_TYPES: readonly MovementTypeSpec[] = [\n { value: 'entry', labelKey: 'inventory.movementType.entry', icon: 'ArrowDownToLine', effect: 'increase' },\n { value: 'exit', labelKey: 'inventory.movementType.exit', icon: 'ArrowUpFromLine', effect: 'decrease' },\n { value: 'adjustment', labelKey: 'inventory.movementType.adjustment', icon: 'Scale', effect: 'set' },\n { value: 'transfer', labelKey: 'inventory.movementType.transfer', icon: 'ArrowLeftRight', effect: 'move' },\n { value: 'loss', labelKey: 'inventory.movementType.loss', icon: 'TriangleAlert', effect: 'decrease' },\n] as const\n\nexport const MOVEMENT_TYPE_VALUES: readonly MovementType[] = MOVEMENT_TYPES.map((m) => m.value)\n\nexport function movementTypeSpec(value: string): MovementTypeSpec | undefined {\n return MOVEMENT_TYPES.find((m) => m.value === value)\n}\n\n/**\n * Portuguese movement vocabulary used by pre-SDK apps (beautyplace and its\n * descendants). Lives next to the canonical list so a data import cannot drift\n * from what the UI can render — that is the whole reason it is here and not in\n * the importer.\n */\nexport const LEGACY_PT_MOVEMENT_TYPE: Readonly<Record<string, MovementType>> = {\n entrada: 'entry',\n saida: 'exit',\n 'saída': 'exit',\n ajuste: 'adjustment',\n transferencia: 'transfer',\n 'transferência': 'transfer',\n perda: 'loss',\n} as const\n\n/** Normalise any known spelling to a MovementType; undefined when unrecognised. */\nexport function normalizeMovementType(raw: string): MovementType | undefined {\n const v = raw.trim().toLowerCase()\n if ((MOVEMENT_TYPE_VALUES as readonly string[]).includes(v)) return v as MovementType\n return LEGACY_PT_MOVEMENT_TYPE[v]\n}\n","import React, { useCallback, useEffect, useMemo, useState } from 'react'\nimport { Undo2 } from 'lucide-react'\nimport type { ColumnDef } from '@tanstack/react-table'\nimport { Button, ConfirmDialog, DataTable, toast } from '@fayz-ai/ui'\nimport { useTranslation } from '@fayz-ai/core'\nimport { useInventoryConfig, useInventoryProvider, formatCurrency } from '../context'\nimport type { Product, StockMovement, StockPosition } from '../types'\nimport { movementTypeSpec } from '../lib/movement-vocabulary'\n\nfunction TableSkeleton() {\n return (\n <div className=\"rounded-card border p-4 space-y-2\">\n {[1, 2, 3].map((i) => (\n <div key={i} className=\"h-3.5 rounded bg-muted/30 animate-pulse\" />\n ))}\n </div>\n )\n}\n\nfunction EmptyLine({ message }: { message: string }) {\n return (\n <div className=\"rounded-card border p-8 text-center\">\n <p className=\"text-xs text-muted-foreground\">{message}</p>\n </div>\n )\n}\n\n/**\n * \"How much costela do I have, where, and where did it go\" — answered on the\n * product itself instead of by filtering the global ledger.\n */\nexport function ProductStockTab({ item, onChanged }: { item: Product; onChanged?: () => void }) {\n const t = useTranslation()\n const { currency } = useInventoryConfig()\n const provider = useInventoryProvider()\n\n const [positions, setPositions] = useState<StockPosition[]>([])\n const [movements, setMovements] = useState<StockMovement[]>([])\n const [loading, setLoading] = useState(true)\n const [confirming, setConfirming] = useState(false)\n const [undoing, setUndoing] = useState(false)\n\n const load = useCallback(async () => {\n setLoading(true)\n try {\n const [pos, history] = await Promise.all([\n provider.getPositions(item.id),\n provider.getMovements({ productId: item.id, pageSize: 100 }),\n ])\n setPositions(pos)\n setMovements(history.data)\n } finally {\n setLoading(false)\n }\n }, [item.id, provider])\n\n useEffect(() => { void load() }, [load])\n\n // Ordered by when it was RECORDED, not by movement date: undoing means taking\n // back the last thing someone typed, which a backdated entry would hide.\n const ordered = useMemo(\n () => [...movements].sort((a, b) => (b.createdAt ?? b.movementDate).localeCompare(a.createdAt ?? a.movementDate)),\n [movements],\n )\n const lastMovement = ordered[0]\n const onHand = useMemo(() => positions.reduce((sum, p) => sum + (p.quantity ?? 0), 0), [positions])\n\n const movementLabel = (m: StockMovement) => {\n const spec = movementTypeSpec(m.movementType)\n return spec ? t(spec.labelKey) : m.movementType\n }\n\n async function handleUndo() {\n if (!lastMovement) return\n setUndoing(true)\n try {\n await provider.reverseMovement(lastMovement.id)\n toast.success(t('inventory.productDetail.undone'))\n await load()\n onChanged?.()\n } catch (err: any) {\n toast.error(t('inventory.productDetail.undoFailed'), { description: err?.message })\n } finally {\n setUndoing(false)\n setConfirming(false)\n }\n }\n\n const positionColumns: ColumnDef<StockPosition, any>[] = useMemo(() => [\n {\n accessorKey: 'stockLocationName', header: t('inventory.stock.locationLabel'),\n cell: ({ getValue }: any) => <span className=\"font-medium\">{(getValue() as string) ?? '—'}</span>,\n },\n {\n accessorKey: 'batchNumber', header: t('inventory.stock.batchNumber'),\n cell: ({ getValue }: any) => <span className=\"text-xs text-muted-foreground\">{(getValue() as string) || '—'}</span>,\n },\n {\n accessorKey: 'expirationDate', header: t('inventory.stock.expirationDate'),\n cell: ({ getValue }: any) => <span className=\"text-xs text-muted-foreground\">{(getValue() as string) || '—'}</span>,\n },\n {\n accessorKey: 'unitCost', header: () => <span className=\"block text-right\">{t('inventory.stock.unitCostLabel')}</span>,\n cell: ({ getValue }: any) => <span className=\"block text-right text-muted-foreground\">{formatCurrency(Number(getValue()) || 0, currency)}</span>,\n },\n {\n accessorKey: 'quantity', header: () => <span className=\"block text-right\">{t('inventory.stock.quantityLabel')}</span>,\n cell: ({ getValue }: any) => <span className=\"block text-right font-medium tabular-nums\">{getValue() as number}</span>,\n },\n {\n id: 'total', header: () => <span className=\"block text-right\">{t('inventory.stock.totalCost')}</span>,\n cell: ({ row }: any) => (\n <span className=\"block text-right tabular-nums\">\n {formatCurrency((row.original.quantity ?? 0) * (row.original.unitCost ?? 0), currency)}\n </span>\n ),\n },\n ], [currency, t])\n\n const movementColumns: ColumnDef<StockMovement, any>[] = useMemo(() => [\n {\n accessorKey: 'movementDate', header: t('inventory.history.columnDate'),\n cell: ({ getValue }: any) => <span className=\"text-xs text-muted-foreground\">{getValue() as string}</span>,\n },\n {\n accessorKey: 'movementType', header: t('inventory.history.columnType'),\n cell: ({ row }: any) => <span className=\"text-xs\">{movementLabel(row.original)}</span>,\n },\n {\n accessorKey: 'stockLocationName', header: t('inventory.history.columnLocation'),\n cell: ({ row }: any) => (\n <span className=\"text-xs text-muted-foreground\">\n {row.original.stockLocationName ?? '—'}\n {row.original.movementType === 'transfer' && row.original.destinationLocationName && (\n <span> → {row.original.destinationLocationName}</span>\n )}\n </span>\n ),\n },\n {\n accessorKey: 'quantity', header: () => <span className=\"block text-right\">{t('inventory.history.columnQty')}</span>,\n cell: ({ row }: any) => (\n <span className=\"block text-right tabular-nums\">\n {row.original.movementType === 'entry' ? '+' : '-'}{row.original.quantity}\n </span>\n ),\n },\n {\n accessorKey: 'totalCost', header: () => <span className=\"block text-right\">{t('inventory.history.columnTotal')}</span>,\n cell: ({ getValue }: any) => <span className=\"block text-right text-muted-foreground\">{formatCurrency(Number(getValue()) || 0, currency)}</span>,\n },\n ], [currency, t])\n\n if (loading) return <TableSkeleton />\n\n return (\n <div className=\"space-y-6\">\n <section className=\"space-y-2\">\n <div className=\"flex items-baseline justify-between\">\n <h3 className=\"text-sm font-semibold text-foreground\">{t('inventory.productDetail.positionsTitle')}</h3>\n <p className=\"text-xs text-muted-foreground\">\n {t('inventory.productDetail.onHand')} <span className=\"font-medium text-foreground tabular-nums\">{onHand}</span>\n </p>\n </div>\n {positions.length === 0\n ? <EmptyLine message={t('inventory.productDetail.noPositions')} />\n : <DataTable columns={positionColumns} data={positions} variant=\"card\" />}\n </section>\n\n <section className=\"space-y-2\">\n <div className=\"flex items-center justify-between\">\n <h3 className=\"text-sm font-semibold text-foreground\">{t('inventory.productDetail.historyTitle')}</h3>\n {lastMovement && (\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"text-destructive hover:text-destructive\"\n onClick={() => setConfirming(true)}\n >\n <Undo2 className=\"mr-1.5 h-3.5 w-3.5\" />\n {t('inventory.productDetail.undoLast')}\n </Button>\n )}\n </div>\n {ordered.length === 0\n ? <EmptyLine message={t('inventory.history.noMovements')} />\n : <DataTable columns={movementColumns} data={ordered} variant=\"card\" />}\n </section>\n\n <ConfirmDialog\n open={confirming}\n variant=\"destructive\"\n title={t('inventory.productDetail.undoTitle')}\n description={lastMovement ? t('inventory.productDetail.undoDescription', {\n type: movementLabel(lastMovement),\n quantity: String(lastMovement.quantity),\n date: lastMovement.movementDate,\n }) : undefined}\n confirmLabel={t('inventory.productDetail.undoConfirm')}\n cancelLabel={t('inventory.productForm.cancel')}\n loading={undoing}\n onConfirm={() => void handleUndo()}\n onCancel={() => setConfirming(false)}\n />\n </div>\n )\n}\n","import React from 'react'\nimport type { EntityDef, FieldDef } from '@fayz-ai/core'\nimport { formatCurrency, type InventoryCurrency, type ProductTypeOption } from '../context'\nimport { T } from '../data/tables'\nimport { ProductStockTab } from './ProductStockTab'\n\n// ---------------------------------------------------------------------------\n// The single source of truth for the Product entity — drives BOTH the generic\n// list (CrudListView columns + facet) and the generic form (CrudFormPage\n// sections). Persistence stays in the inventory provider/store; this only\n// describes fields, columns and layout.\n// ---------------------------------------------------------------------------\n\nconst TYPE_DESCRIPTION_KEYS: Record<string, string> = {\n ingredient: 'inventory.productForm.typeIngredient',\n sale: 'inventory.productForm.typeSale',\n intermediate: 'inventory.productForm.typeIntermediate',\n asset: 'inventory.productForm.typeAsset',\n}\n\ntype T = (key: string, params?: Record<string, string | number>) => string\n\nexport function buildProductEntity(\n t: T,\n productTypes: ProductTypeOption[],\n currency: InventoryCurrency,\n /** Called by the Stock tab after it changes stock, so the page can refetch. */\n onStockChanged?: () => void,\n): EntityDef {\n const typeOptions = productTypes.map((pt) => ({\n label: pt.label,\n value: pt.value,\n description: TYPE_DESCRIPTION_KEYS[pt.value] ? t(TYPE_DESCRIPTION_KEYS[pt.value]) : undefined,\n }))\n const typeLabel = (v: unknown) => productTypes.find((p) => p.value === v)?.label ?? String(v ?? '')\n\n // Field order is chosen so the table columns come out as\n // Product · Type · Stock · Cost · Value while the form groups stay correct.\n const fields: FieldDef[] = [\n // — General Information (form) + Product column (table) —\n {\n key: 'name', label: t('inventory.productForm.name'), type: 'text', required: true,\n group: 'general', placeholder: t('inventory.productForm.namePlaceholder'),\n searchable: true, showInTable: true, sortable: true,\n renderCell: (_v, row: any) => (\n <div>\n <div className=\"flex items-center gap-1.5\">\n <p className={`font-medium ${row.isActive === false ? 'text-muted-foreground' : ''}`}>{row.name}</p>\n {/* Fora de linha tem de SER visível: sem esta marca, desativar um\n produto não mudava nada na tela e a ação parecia não ter feito\n nada. */}\n {row.isActive === false && (\n <span className=\"inline-flex items-center rounded-full bg-muted px-1.5 py-0.5 text-[9px] font-medium text-muted-foreground\">\n {t('inventory.productList.inactive')}\n </span>\n )}\n </div>\n {row.sku && <p className=\"text-xs text-muted-foreground\">{row.sku}</p>}\n </div>\n ),\n },\n { key: 'brand', label: t('inventory.productForm.brand'), type: 'text', group: 'general', placeholder: t('inventory.productForm.brandPlaceholder'), showInTable: false },\n { key: 'sku', label: t('inventory.productForm.sku'), type: 'text', group: 'general', placeholder: t('inventory.productForm.skuPlaceholder'), searchable: true, showInTable: false },\n { key: 'barcode', label: t('inventory.productForm.barcode'), type: 'text', group: 'general', placeholder: t('inventory.productForm.barcodePlaceholder'), searchable: true, showInTable: false },\n { key: 'description', label: t('inventory.productForm.description'), type: 'textarea', group: 'general', span: 2, placeholder: t('inventory.productForm.descriptionPlaceholder'), showInTable: false },\n\n // — Classification (form: segmented) + Type column (table: badge) —\n {\n key: 'productType', label: t('inventory.productForm.classification'), type: 'segmented',\n group: 'classification', span: 2, options: typeOptions,\n showInTable: true, sortable: false,\n renderCell: (v) => (\n <span className=\"inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium bg-muted text-muted-foreground\">\n {typeLabel(v)}\n </span>\n ),\n },\n\n // — Stock column (list only) — placed before Cost for the desired column order\n {\n key: 'currentQuantity', label: t('inventory.productList.stock'), type: 'number',\n showInForm: false, showInTable: true, sortable: true,\n renderCell: (_v, row: any) => (\n <span className={`text-right block ${row.currentQuantity <= row.minQuantity ? 'text-destructive font-medium' : ''}`}>\n {row.currentQuantity}\n </span>\n ),\n },\n\n // — Pricing (form) + Cost column (table) —\n {\n key: 'costPrice', label: t('inventory.productForm.costPrice'), type: 'currency',\n group: 'pricing', currency: currency.code, currencySymbol: currency.symbol, currencyLocale: currency.locale,\n showInTable: true, sortable: false,\n renderCell: (v) => <span className=\"text-right block text-muted-foreground\">{formatCurrency(Number(v) || 0, currency)}</span>,\n },\n\n // — Value column (list only): stock × cost —\n {\n key: 'value', label: t('inventory.productList.value'), type: 'number',\n showInForm: false, showInTable: true, sortable: false,\n renderCell: (_v, row: any) => (\n <span className=\"text-right block font-medium\">{formatCurrency((row.currentQuantity || 0) * (row.costPrice || 0), currency)}</span>\n ),\n },\n\n { key: 'salePrice', label: t('inventory.productForm.salePrice'), type: 'currency', group: 'pricing', currency: currency.code, currencySymbol: currency.symbol, currencyLocale: currency.locale, showInTable: false },\n {\n key: 'margin', label: t('inventory.productForm.margin'), type: 'computed', group: 'pricing', showInTable: false,\n compute: (vals) => {\n const cost = Number(vals.costPrice) || 0\n const sale = Number(vals.salePrice) || 0\n if (sale <= 0 || cost <= 0) return null\n const m = ((sale - cost) / cost) * 100\n return { display: `${m.toFixed(1)}%`, tone: m >= 0 ? 'positive' : 'negative' }\n },\n },\n\n // — Stock Levels (form only) —\n { key: 'minQuantity', label: t('inventory.productForm.minQuantity'), type: 'number', group: 'stock', min: 0, placeholder: '0', hint: t('inventory.productForm.minQuantityHint'), showInTable: false },\n { key: 'maxQuantity', label: t('inventory.productForm.maxQuantity'), type: 'number', group: 'stock', min: 0, placeholder: t('inventory.productForm.optional'), hint: t('inventory.productForm.maxQuantityHint'), showInTable: false },\n\n // — Organisation (form only) — the four links that used to be accepted by\n // CreateProductInput and then silently dropped; they persist in\n // plg_inventory_product_details since migration 005.\n {\n key: 'categoryId', label: t('inventory.productForm.category'), type: 'relation', group: 'organization',\n relation: { table: T.productCategories, labelField: 'name' },\n placeholder: t('inventory.productForm.optional'), showInTable: false,\n },\n {\n key: 'measurementUnitId', label: t('inventory.productForm.measurementUnit'), type: 'relation', group: 'organization',\n relation: { table: T.measurementUnits, labelField: 'name' },\n hint: t('inventory.productForm.measurementUnitHint'),\n placeholder: t('inventory.productForm.optional'), showInTable: false,\n },\n {\n key: 'supplierId', label: t('inventory.productForm.supplier'), type: 'relation', group: 'organization',\n relation: { table: 'people', labelField: 'name', filter: { kind: 'supplier' } },\n placeholder: t('inventory.productForm.optional'), showInTable: false,\n },\n {\n key: 'defaultLocationId', label: t('inventory.productForm.defaultLocation'), type: 'relation', group: 'organization',\n relation: { table: T.stockLocations, labelField: 'name' },\n placeholder: t('inventory.productForm.optional'), showInTable: false,\n },\n ]\n\n return {\n name: t('inventory.stock.product'),\n namePlural: t('inventory.nav.products'),\n icon: 'Package',\n displayField: 'name',\n fields,\n fieldGroups: [\n { id: 'general', label: t('inventory.productForm.generalInfo'), columns: 2, imageSlot: true },\n { id: 'classification', label: t('inventory.productForm.classification'), description: t('inventory.productForm.classificationDesc'), columns: 1 },\n { id: 'pricing', label: t('inventory.productForm.pricing'), columns: 3 },\n { id: 'stock', label: t('inventory.productForm.stockLevels'), description: t('inventory.productForm.stockLevelsDesc'), columns: 2 },\n { id: 'organization', label: t('inventory.productForm.organization'), description: t('inventory.productForm.organizationDesc'), columns: 2 },\n ],\n facets: [{ field: 'productType', allLabel: t('crud.list.allFacet') }],\n detailTabs: [\n {\n id: 'stock',\n label: t('inventory.productDetail.stockTab'),\n icon: 'Warehouse',\n component: ProductStockTab as never,\n props: { onChanged: onStockChanged },\n },\n ],\n }\n}\n","import React, { useCallback, useEffect, useMemo, useState } from 'react'\nimport { CircleCheck, CircleSlash } from 'lucide-react'\nimport { CrudListView, usePermissionOptional, type CrudBulkAction } from '@fayz-ai/admin'\nimport { toast } from '@fayz-ai/ui'\nimport { useInventoryConfig, useInventoryProvider, useInventoryStore } from '../context'\nimport { useTranslation } from '@fayz-ai/core'\nimport type { Product, ProductType } from '../types'\nimport { buildProductEntity } from './productEntity'\n\n// Product list, rendered through the generic CrudListView (header · search ·\n// facet pills · table). One shared EntityDef (buildProductEntity) drives both\n// this list and the create/edit form. Data + routing stay in the inventory\n// store / module nav.\nexport function ProductListView({ onNew, onOpen }: {\n onNew?: () => void\n /** Opens the product's own page. Editing starts there, not from the row. */\n onOpen?: (id: string) => void\n}) {\n const t = useTranslation()\n const can = usePermissionOptional()\n const provider = useInventoryProvider()\n const { currency, productTypes } = useInventoryConfig()\n const products = useInventoryStore((s) => s.products)\n const productsTotal = useInventoryStore((s) => s.productsTotal)\n const productsLoading = useInventoryStore((s) => s.productsLoading)\n const fetchProducts = useInventoryStore((s) => s.fetchProducts)\n\n const [search, setSearch] = useState('')\n const [typeFilter, setTypeFilter] = useState<string | undefined>()\n const [activeFilter, setActiveFilter] = useState<string | undefined>()\n const [loadedOnce, setLoadedOnce] = useState(false)\n const [bulkBusy, setBulkBusy] = useState(false)\n\n // Held in one place: a bulk write has to reload the SAME slice, or the list\n // comes back showing rows the filters exclude.\n const query = useMemo(() => ({\n productType: typeFilter as ProductType | undefined,\n search: search || undefined,\n isActive: activeFilter === undefined ? undefined : activeFilter === 'true',\n }), [typeFilter, search, activeFilter])\n\n useEffect(() => {\n let active = true\n Promise.resolve(fetchProducts(query))\n .finally(() => { if (active) setLoadedOnce(true) })\n return () => { active = false }\n }, [query])\n\n const entity = useMemo(() => buildProductEntity(t, productTypes, currency), [t, productTypes, currency])\n const facets = useMemo(() => [\n {\n field: 'productType',\n allLabel: t('crud.list.allFacet'),\n options: productTypes.map((p) => ({ value: p.value, label: p.label })),\n },\n {\n field: 'isActive',\n label: t('inventory.productList.filterStatus'),\n allLabel: t('inventory.productList.filterAllStatuses'),\n options: [\n { value: 'true', label: t('inventory.productList.filterActive') },\n { value: 'false', label: t('inventory.productList.filterInactive') },\n ],\n },\n ], [productTypes, t])\n\n // --- Bulk: turn products on and off --------------------------------------\n // There is no delete in the provider — a product with stock history cannot\n // just vanish — so \"off the shelf\" is `isActive: false`, which is reversible.\n const runBulk = useCallback(async (rows: Product[], isActive: boolean) => {\n const targets = rows.filter((p) => (p.isActive ?? true) !== isActive)\n if (targets.length === 0) {\n toast.error(t('inventory.productList.bulkNothingToDo'))\n return\n }\n setBulkBusy(true)\n let done = 0\n let failed = 0\n for (const product of targets) {\n try {\n await provider.updateProduct(product.id, { isActive })\n done++\n } catch (err: unknown) {\n failed++\n console.warn('[inventory] updateProduct failed', product.id, err)\n }\n }\n setBulkBusy(false)\n await fetchProducts(query)\n if (done > 0) toast.success(t(isActive ? 'inventory.productList.bulkActivated' : 'inventory.productList.bulkDeactivated', { count: String(done) }))\n if (failed > 0) toast.error(t('inventory.productList.bulkFailed', { count: String(failed) }))\n }, [provider, fetchProducts, query, t])\n\n const bulkActions = useMemo<CrudBulkAction<Product>[] | undefined>(() => {\n if (!can('inventory', 'edit')) return undefined\n return [\n {\n id: 'deactivate',\n label: t('inventory.productList.bulkDeactivate'),\n icon: CircleSlash,\n disabled: bulkBusy,\n onSelect: (rows) => void runBulk(rows, false),\n },\n {\n id: 'activate',\n label: t('inventory.productList.bulkActivate'),\n icon: CircleCheck,\n overflow: true,\n disabled: bulkBusy,\n onSelect: (rows) => void runBulk(rows, true),\n },\n ]\n }, [can, bulkBusy, runBulk, t])\n\n return (\n <CrudListView<Product>\n entityDef={entity}\n items={loadedOnce ? products : null}\n total={productsTotal}\n search={search}\n onSearchChange={setSearch}\n searchPlaceholder={t('inventory.productList.searchPlaceholder')}\n facets={facets}\n activeFilters={{ productType: typeFilter, isActive: activeFilter }}\n onFacetChange={(field, value) => {\n if (field === 'isActive') setActiveFilter(value)\n else setTypeFilter(value)\n }}\n bulkActions={bulkActions}\n onNew={onNew}\n // O produto É alcançável pelo agente: o plugin o publica em\n // `queryEntities` com `writable: true`, então `createRecord` resolve o\n // alvo e a porta leva a algum lugar. Ver CrudListView.aiCreate.\n aiCreate={{\n hint: t('inventory.productList.askPlaceholder'),\n description: t('inventory.productList.aiHint'),\n intro: {\n role: 'operations',\n persona: t('inventory.productList.askPersona'),\n pitch: t('inventory.productList.askPitch'),\n description: t('inventory.productList.askDescription'),\n suggestions: [0, 1, 2].map((i) => ({ label: t(`inventory.productList.askSuggestion.${i}`) })),\n },\n }}\n addLabel={t('inventory.productList.newProduct')}\n onRowClick={(row) => onOpen?.((row as { id: string }).id)}\n feature=\"inventory\"\n />\n )\n}\n","import React from 'react'\nimport { SubpageHeader, toast } from '@fayz-ai/ui'\nimport { useTranslation } from '@fayz-ai/core'\nimport { CrudFormPage, CrudFormSkeleton, useLimitGuard, invalidateLimit } from '@fayz-ai/admin'\nimport { useInventoryConfig, useInventoryStore, useInventoryProvider } from '../context'\nimport type { ProductType } from '../types'\nimport { buildProductEntity } from './productEntity'\n\n// ---------------------------------------------------------------------------\n// Product create/edit, rendered through the generic CRUD form. The sectioned\n// layout (General Information · Classification · Pricing+Margin · Stock Levels)\n// comes from the shared buildProductEntity (segmented/computed/currency field\n// types). Persistence still flows through the inventory provider/store, so the\n// metadata-JSON column mapping is unchanged.\n// ---------------------------------------------------------------------------\n\nexport function ProductCrudForm({ editId, onSaved }: { editId?: string; onSaved?: () => void }) {\n const t = useTranslation()\n const { productTypes, currency } = useInventoryConfig()\n const provider = useInventoryProvider()\n const createProduct = useInventoryStore((s) => s.createProduct)\n const guardProducts = useLimitGuard('products')\n const isEdit = !!editId\n\n const [initialData, setInitialData] = React.useState<Record<string, any> | null>(isEdit ? null : {})\n const [headerName, setHeaderName] = React.useState('')\n\n // Load the existing product for edit and map it to flat form values.\n React.useEffect(() => {\n if (!editId) return\n let cancelled = false\n ;(async () => {\n const p = await provider.getProductById(editId)\n if (cancelled) return\n setHeaderName(p?.name ?? '')\n setInitialData(\n p\n ? {\n name: p.name,\n brand: p.brand ?? '',\n sku: p.sku ?? '',\n barcode: p.barcode ?? '',\n description: p.description ?? '',\n productType: p.productType,\n costPrice: p.costPrice,\n salePrice: p.salePrice ?? 0,\n minQuantity: p.minQuantity,\n maxQuantity: p.maxQuantity ?? 0,\n categoryId: p.categoryId ?? '',\n measurementUnitId: p.measurementUnitId ?? '',\n supplierId: p.supplierId ?? '',\n defaultLocationId: p.defaultLocationId ?? '',\n }\n : {},\n )\n })()\n return () => { cancelled = true }\n }, [editId])\n\n const entity = React.useMemo(() => buildProductEntity(t, productTypes, currency), [t, productTypes, currency])\n\n async function save(values: Record<string, any>) {\n const name = String(values.name ?? '').trim()\n if (!name) { toast.error(t('common.formIncomplete')); throw new Error('name required') }\n const payload = {\n name,\n sku: values.sku || undefined,\n barcode: values.barcode || undefined,\n brand: values.brand || undefined,\n productType: (values.productType ?? productTypes[0]?.value) as ProductType,\n costPrice: Number(values.costPrice) || 0,\n salePrice: Number(values.salePrice) || undefined,\n minQuantity: Number(values.minQuantity) || 0,\n maxQuantity: Number(values.maxQuantity) || undefined,\n description: values.description || undefined,\n // Always sent, even when empty: an empty string clears the link, and\n // `undefined` would leave the previous value in place on edit.\n categoryId: values.categoryId ?? '',\n measurementUnitId: values.measurementUnitId ?? '',\n supplierId: values.supplierId ?? '',\n defaultLocationId: values.defaultLocationId ?? '',\n }\n if (isEdit && editId) {\n await provider.updateProduct(editId, payload)\n } else {\n // Plan quantity guard (client-side, before the provider call). Opens the\n // global UpgradeModal and aborts when the plan's product cap is reached.\n if ((await guardProducts()) === 'blocked') return\n await createProduct(payload)\n invalidateLimit('products')\n }\n onSaved?.()\n }\n\n const title = isEdit ? (headerName || t('inventory.productForm.editProduct')) : t('inventory.productForm.newProduct')\n const subtitle = isEdit ? undefined : t('inventory.productForm.addToCatalog')\n\n return (\n <div className=\"space-y-5\">\n <SubpageHeader title={title} subtitle={subtitle} onBack={onSaved} parentLabel={t('inventory.nav.products')} />\n {/* Enquanto o produto carrega, a forma do formulário — não o vazio. Sem\n isto a tela ficava só com o cabeçalho e uma área em branco, e o\n conteúdo aparecia de uma vez empurrando tudo. */}\n {!initialData && <CrudFormSkeleton hideBreadcrumb />}\n {initialData && (\n <CrudFormPage\n entityDef={entity}\n mode={isEdit ? 'edit' : 'create'}\n initialData={initialData}\n onSubmit={save}\n onCancel={() => onSaved?.()}\n namePlural={t('inventory.nav.products')}\n hideBreadcrumb\n />\n )}\n </div>\n )\n}\n","import React, { useCallback, useEffect, useMemo, useState } from 'react'\nimport { Package } from 'lucide-react'\nimport { CrudDetailPage } from '@fayz-ai/admin'\nimport { SubpageHeader } from '@fayz-ai/ui'\nimport { useTranslation } from '@fayz-ai/core'\nimport { useInventoryConfig, useInventoryProvider } from '../context'\nimport type { Product } from '../types'\nimport { buildProductEntity } from './productEntity'\n\nfunction DetailSkeleton() {\n return (\n <div className=\"space-y-5\">\n <div className=\"flex items-center gap-4\">\n <div className=\"h-20 w-20 rounded-2xl bg-muted/40 animate-pulse\" />\n <div className=\"space-y-2 flex-1\">\n <div className=\"h-6 w-56 rounded bg-muted/40 animate-pulse\" />\n <div className=\"h-3 w-32 rounded bg-muted/30 animate-pulse\" />\n </div>\n </div>\n <div className=\"rounded-card border p-4 space-y-2\">\n {[1, 2, 3, 4].map((i) => <div key={i} className=\"h-3.5 rounded bg-muted/30 animate-pulse\" />)}\n </div>\n </div>\n )\n}\n\n/** The product's own page — overview plus the tabs the entity declares. */\nexport function ProductDetailView({ productId, initialTab, onBack, onEdit }: {\n productId: string\n initialTab?: string\n onBack: () => void\n onEdit?: () => void\n}) {\n const t = useTranslation()\n const { currency, productTypes } = useInventoryConfig()\n const provider = useInventoryProvider()\n\n const [product, setProduct] = useState<Product | null>(null)\n const [loading, setLoading] = useState(true)\n const [reloadKey, setReloadKey] = useState(0)\n\n // Handed to the Stock tab: undoing a movement changes the on-hand shown here.\n const reload = useCallback(() => setReloadKey((k) => k + 1), [])\n\n useEffect(() => {\n let active = true\n setLoading(true)\n provider.getProductById(productId)\n .then((p) => { if (active) setProduct(p) })\n .finally(() => { if (active) setLoading(false) })\n return () => { active = false }\n }, [productId, provider, reloadKey])\n\n const entity = useMemo(\n () => buildProductEntity(t, productTypes, currency, reload),\n [t, productTypes, currency, reload],\n )\n\n if (loading) {\n return (\n <div className=\"space-y-6\">\n <SubpageHeader title={t('inventory.nav.products')} onBack={onBack} />\n <DetailSkeleton />\n </div>\n )\n }\n\n if (!product) {\n return (\n <div className=\"space-y-6\">\n <SubpageHeader title={t('inventory.nav.products')} onBack={onBack} />\n <div className=\"flex flex-col items-center justify-center py-16 text-center rounded-lg border-2 border-dashed border-muted\">\n <Package className=\"h-8 w-8 text-muted-foreground/30 mb-2\" />\n <p className=\"text-sm text-muted-foreground\">{t('inventory.productDetail.notFound')}</p>\n <button onClick={onBack} className=\"text-xs text-primary hover:underline mt-1\">\n {t('inventory.productDetail.backToList')}\n </button>\n </div>\n </div>\n )\n }\n\n return (\n <CrudDetailPage\n entityDef={entity}\n item={product as unknown as Record<string, any>}\n namePlural={t('inventory.nav.products')}\n basePath=\"/inventory/products\"\n initialTab={initialTab}\n onBack={onBack}\n onEdit={onEdit}\n feature=\"inventory\"\n />\n )\n}\n","import React, { useState, useEffect, useMemo } from 'react'\nimport { Save, Plus, ArrowUpRight, ArrowDownRight, RefreshCw, ArrowRightLeft, Trash2, Package, Check, Eye, Building2 } from 'lucide-react'\nimport { useInventoryConfig, useInventoryStore, useInventoryProvider, formatCurrency } from '../context'\nimport { cn } from '@fayz-ai/ui'\nimport { SubpageHeader } from '@fayz-ai/ui'\nimport { useTranslation } from '@fayz-ai/core'\nimport { SearchSelect, type SearchSelectOption } from '@fayz-ai/ui'\nimport { DatePicker } from '@fayz-ai/ui'\nimport type { MovementType, StockMovement, StockPosition, Supplier } from '../types'\nimport { MOVEMENT_TYPE_VALUES } from '../lib/movement-vocabulary'\n\n// ---------------------------------------------------------------------------\n// Movement type config\n// ---------------------------------------------------------------------------\n\n// Presentation only. Typed as a Record so TypeScript refuses to compile if a\n// MovementType is ever added to the union and not given a card here — the array\n// this used to be would just have silently omitted it from the picker.\nconst MOVEMENT_TYPE_PRESENTATION: Record<MovementType, { labelKey: string; icon: React.ElementType; color: string; activeColor: string; descKey: string }> = {\n entry: { labelKey: 'inventory.stock.entryLabel', icon: ArrowDownRight, color: 'text-success', activeColor: 'border-success bg-success/10 text-success dark:bg-success/10', descKey: 'inventory.stock.entryDesc' },\n exit: { labelKey: 'inventory.stock.exitLabel', icon: ArrowUpRight, color: 'text-destructive', activeColor: 'border-destructive bg-destructive/10 text-destructive dark:bg-destructive/10', descKey: 'inventory.stock.exitDesc' },\n adjustment: { labelKey: 'inventory.stock.adjustmentLabel', icon: RefreshCw, color: 'text-info', activeColor: 'border-info bg-info/10 text-info dark:bg-info/10', descKey: 'inventory.stock.adjustmentDesc' },\n transfer: { labelKey: 'inventory.stock.transferLabel', icon: ArrowRightLeft, color: 'text-magic', activeColor: 'border-magic bg-magic/10 text-magic dark:bg-magic/10', descKey: 'inventory.stock.transferDesc' },\n loss: { labelKey: 'inventory.stock.lossLabel', icon: Trash2, color: 'text-warning', activeColor: 'border-warning bg-warning/10 text-warning dark:bg-warning/10', descKey: 'inventory.stock.lossDesc' },\n}\n\n// Order comes from the canonical vocabulary, so the picker and any importer\n// agree on both the set and its order.\nconst MOVEMENT_TYPES = MOVEMENT_TYPE_VALUES.map((value) => ({ value, ...MOVEMENT_TYPE_PRESENTATION[value] }))\n\n// ---------------------------------------------------------------------------\n// Movement detail card (for viewing a recorded movement)\n// ---------------------------------------------------------------------------\n\nfunction MovementDetail({ movement, currency, onClose }: {\n movement: StockMovement\n currency: { code: string; locale: string; symbol: string }\n onClose: () => void\n}) {\n const t = useTranslation()\n const typeConfig = MOVEMENT_TYPES.find((mt) => mt.value === movement.movementType)\n const TypeIcon = typeConfig?.icon ?? Package\n\n return (\n <div className=\"space-y-4\">\n <SubpageHeader title={movement.productName ?? `#${movement.id.slice(0, 8)}`} onBack={onClose} parentLabel={t('inventory.nav.stock')} />\n\n <div className=\"rounded-card border bg-card shadow-sm p-5 space-y-4\">\n {/* Type + Product hero */}\n <div className=\"flex items-center gap-3\">\n <div className={`flex h-10 w-10 items-center justify-center rounded-xl ${typeConfig?.activeColor ?? 'bg-muted'}`}>\n <TypeIcon className=\"h-5 w-5\" />\n </div>\n <div>\n <p className=\"text-lg font-bold\">{movement.productName ?? t('inventory.stock.unknownProduct')}</p>\n <p className=\"text-xs text-muted-foreground capitalize\">{movement.movementType} · {movement.movementDate}</p>\n </div>\n </div>\n\n {/* Key details grid */}\n <div className=\"grid gap-3 sm:grid-cols-3 pt-2 border-t\">\n <div>\n <p className=\"text-[10px] text-muted-foreground uppercase\">{t('inventory.stock.quantityLabel')}</p>\n <p className=\"text-sm font-semibold\">{movement.movementType === 'entry' ? '+' : '-'}{movement.quantity}</p>\n </div>\n <div>\n <p className=\"text-[10px] text-muted-foreground uppercase\">{t('inventory.stock.unitCostLabel')}</p>\n <p className=\"text-sm font-semibold\">{formatCurrency(movement.unitCost, currency)}</p>\n </div>\n <div>\n <p className=\"text-[10px] text-muted-foreground uppercase\">{t('inventory.stock.totalCost')}</p>\n <p className=\"text-sm font-semibold\">{formatCurrency(movement.totalCost, currency)}</p>\n </div>\n </div>\n\n {/* Optional details */}\n <div className=\"grid gap-3 sm:grid-cols-2 pt-2 border-t\">\n {movement.stockLocationName && (\n <div>\n <p className=\"text-[10px] text-muted-foreground uppercase\">{t('inventory.stock.locationLabel')}</p>\n <p className=\"text-sm\">{movement.stockLocationName}</p>\n </div>\n )}\n {movement.destinationLocationName && (\n <div>\n <p className=\"text-[10px] text-muted-foreground uppercase\">{t('inventory.stock.destination')}</p>\n <p className=\"text-sm\">{movement.destinationLocationName}</p>\n </div>\n )}\n {movement.supplierName && (\n <div>\n <p className=\"text-[10px] text-muted-foreground uppercase\">{t('inventory.stock.supplier')}</p>\n <p className=\"text-sm\">{movement.supplierName}</p>\n </div>\n )}\n {movement.documentNumber && (\n <div>\n <p className=\"text-[10px] text-muted-foreground uppercase\">{t('inventory.stock.document')}</p>\n <p className=\"text-sm\">{movement.documentNumber}</p>\n </div>\n )}\n {movement.reason && (\n <div>\n <p className=\"text-[10px] text-muted-foreground uppercase\">{t('inventory.stock.reasonLabel')}</p>\n <p className=\"text-sm\">{movement.reason}</p>\n </div>\n )}\n </div>\n\n {movement.notes && (\n <div className=\"pt-2 border-t\">\n <p className=\"text-[10px] text-muted-foreground uppercase\">{t('inventory.stock.notes')}</p>\n <p className=\"text-sm mt-0.5\">{movement.notes}</p>\n </div>\n )}\n\n <div className=\"pt-2 border-t\">\n <p className=\"text-[10px] text-muted-foreground\">{t('inventory.stock.recorded')} {new Date(movement.createdAt).toLocaleString()}</p>\n </div>\n </div>\n </div>\n )\n}\n\n// ---------------------------------------------------------------------------\n// Stock movement form\n// ---------------------------------------------------------------------------\n\nexport function StockMovementView({ defaultType, onSaved, viewMovement }: {\n defaultType: MovementType\n onSaved?: () => void\n viewMovement?: StockMovement\n}) {\n const t = useTranslation()\n const { currency, modules } = useInventoryConfig()\n const provider = useInventoryProvider()\n const products = useInventoryStore((s) => s.products)\n const locations = useInventoryStore((s) => s.locations)\n const fetchProducts = useInventoryStore((s) => s.fetchProducts)\n const fetchLocations = useInventoryStore((s) => s.fetchLocations)\n const createMovement = useInventoryStore((s) => s.createMovement)\n\n const [step, setStep] = useState(1)\n const [positions, setPositions] = useState<StockPosition[]>([])\n const [movementType, setMovementType] = useState<MovementType>(defaultType)\n const [productId, setProductId] = useState('')\n const [productLabel, setProductLabel] = useState('')\n const [quantity, setQuantity] = useState(1)\n const [unitCost, setUnitCost] = useState(0)\n const [locationId, setLocationId] = useState('')\n const [destLocationId, setDestLocationId] = useState('')\n const [reason, setReason] = useState('')\n const [documentNumber, setDocumentNumber] = useState('')\n const [notes, setNotes] = useState('')\n const [batchNumber, setBatchNumber] = useState('')\n const [expirationDate, setExpirationDate] = useState('')\n const [suppliers, setSuppliers] = useState<Supplier[]>([])\n const [supplierId, setSupplierId] = useState('')\n const [supplierLabel, setSupplierLabel] = useState('')\n const [saving, setSaving] = useState(false)\n const [savedMovement, setSavedMovement] = useState<StockMovement | null>(null)\n\n useEffect(() => { fetchProducts({}); fetchLocations() }, [])\n\n // Only an entry has a supplier — goods leaving never came from one.\n useEffect(() => {\n if (movementType !== 'entry' || suppliers.length > 0) return\n provider.getSuppliers().then(setSuppliers).catch(() => setSuppliers([]))\n }, [movementType])\n\n // Build a map of locationId → total quantity from positions.\n // NOTE: these useMemo hooks must run before the early returns below, otherwise\n // saving (which flips savedMovement) renders fewer hooks → React error.\n const positionByLocation = useMemo(() => {\n const map: Record<string, number> = {}\n for (const pos of positions) {\n if (pos.stockLocationId) {\n map[pos.stockLocationId] = (map[pos.stockLocationId] ?? 0) + pos.quantity\n }\n }\n return map\n }, [positions])\n\n // Sort locations by stock position (highest first)\n const sortedLocations = useMemo(() => {\n return [...locations].sort((a, b) => (positionByLocation[b.id] ?? 0) - (positionByLocation[a.id] ?? 0))\n }, [locations, positionByLocation])\n\n // If viewing a movement detail\n if (viewMovement) {\n return <MovementDetail movement={viewMovement} currency={currency} onClose={() => onSaved?.()} />\n }\n\n // If just saved — show success with details\n if (savedMovement) {\n return <MovementDetail movement={savedMovement} currency={currency} onClose={() => onSaved?.()} />\n }\n\n const selectedProduct = products.find((p) => p.id === productId)\n const totalCost = quantity * unitCost\n const typeConfig = MOVEMENT_TYPES.find((t) => t.value === movementType)!\n const needsReason = movementType === 'adjustment' || movementType === 'loss'\n const needsDest = movementType === 'transfer'\n\n // Product search\n function searchProducts(query: string): SearchSelectOption[] {\n const q = query.toLowerCase()\n return products\n .filter((p) => p.name.toLowerCase().includes(q) || p.sku?.toLowerCase().includes(q) || p.barcode?.includes(q))\n .slice(0, 20)\n .map((p) => ({\n id: p.id,\n label: p.name,\n subtitle: [p.sku, `${t('inventory.stock.currentStock')} ${p.currentQuantity}`].filter(Boolean).join(' · '),\n group: p.productType,\n icon: <Package className=\"h-4 w-4 text-muted-foreground shrink-0\" />,\n data: p,\n }))\n }\n\n // Auto-fill cost when product selected + fetch positions\n function handleProductSelect(id: string, option: SearchSelectOption | null) {\n setProductId(id)\n setProductLabel(option?.label ?? '')\n if (option?.data?.costPrice && unitCost === 0) {\n setUnitCost(option.data.costPrice)\n }\n // Fetch stock positions per location for this product\n if (id) {\n provider.getPositions(id).then(setPositions).catch(() => setPositions([]))\n } else {\n setPositions([])\n }\n }\n\n function searchSuppliers(query: string): SearchSelectOption[] {\n const q = query.toLowerCase()\n return suppliers\n .filter((s) => s.name.toLowerCase().includes(q) || s.documentNumber?.toLowerCase().includes(q))\n .slice(0, 20)\n .map((s) => ({\n id: s.id,\n label: s.name,\n subtitle: s.documentNumber ?? s.phone,\n icon: <Building2 className=\"h-4 w-4 text-muted-foreground shrink-0\" />,\n }))\n }\n\n const canProceedStep1 = !!productId\n const canProceedStep2 = quantity > 0 && (!needsReason || reason.trim()) && (!needsDest || destLocationId)\n const title = defaultType === 'entry' ? t('inventory.stock.entry') : defaultType === 'exit' ? t('inventory.stock.exit') : t('inventory.stock.movement')\n\n async function handleSave() {\n if (!productId || quantity <= 0) return\n setSaving(true)\n try {\n const movement = await createMovement({\n productId,\n quantity,\n movementType,\n unitCost: unitCost || undefined,\n stockLocationId: locationId || undefined,\n destinationLocationId: destLocationId || undefined,\n reason: reason || undefined,\n documentNumber: documentNumber || undefined,\n notes: notes || undefined,\n batchNumber: batchNumber || undefined,\n expirationDate: expirationDate || undefined,\n supplierId: movementType === 'entry' ? supplierId || undefined : undefined,\n })\n setSavedMovement(movement)\n } finally {\n setSaving(false)\n }\n }\n\n return (\n <div className=\"space-y-6\">\n <SubpageHeader\n title={title}\n subtitle={t('inventory.stock.stepOf', { step: String(step) })}\n onBack={step > 1 ? () => setStep(step - 1) : onSaved}\n parentLabel={t('inventory.nav.stock')}\n />\n\n {/* Progress bar */}\n <div className=\"flex gap-1\">\n {[1, 2, 3].map((s) => (\n <div key={s} className={`h-1 flex-1 rounded-full transition-colors ${s <= step ? 'bg-primary' : 'bg-muted'}`} />\n ))}\n </div>\n\n {/* Step 1: What — Type + Product */}\n {step === 1 && (\n <div className=\"space-y-5\">\n {/* Movement type selector */}\n <div>\n <p className=\"text-xs font-medium text-muted-foreground mb-2\">{t('inventory.stock.movementType')}</p>\n <div className=\"grid gap-2 sm:grid-cols-5\">\n {MOVEMENT_TYPES.map((mt) => {\n const Icon = mt.icon\n const active = movementType === mt.value\n return (\n <button\n key={mt.value}\n onClick={() => setMovementType(mt.value)}\n className={`rounded-lg border-2 p-3 text-left transition-all ${active ? mt.activeColor : 'border-transparent bg-card hover:bg-muted/30'}`}\n >\n <Icon className=\"h-4 w-4 mb-1\" />\n <p className=\"text-xs font-medium\">{t(mt.labelKey)}</p>\n <p className=\"text-[9px] text-muted-foreground mt-0.5 hidden sm:block\">{t(mt.descKey)}</p>\n </button>\n )\n })}\n </div>\n </div>\n\n {/* Product search */}\n <SearchSelect\n value={productId}\n displayValue={productLabel}\n onChange={handleProductSelect}\n onSearch={searchProducts}\n label={t('inventory.stock.product')}\n required\n placeholder={t('inventory.stock.searchProduct')}\n minChars={1}\n debounce={150}\n renderOption={(opt) => (\n <>\n {opt.icon}\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm truncate\">{opt.label}</p>\n {opt.subtitle && <p className=\"text-[10px] text-muted-foreground\">{opt.subtitle}</p>}\n </div>\n </>\n )}\n />\n\n {selectedProduct && (\n <div className=\"rounded-lg bg-muted/30 px-4 py-3 flex items-center justify-between\">\n <div>\n <p className=\"text-sm font-medium\">{selectedProduct.name}</p>\n <p className=\"text-xs text-muted-foreground\">\n {t('inventory.stock.currentStock')} <span className=\"font-medium\">{selectedProduct.currentQuantity}</span>\n {selectedProduct.minQuantity > 0 && <> · Min: {selectedProduct.minQuantity}</>}\n {selectedProduct.costPrice > 0 && <> · Cost: {formatCurrency(selectedProduct.costPrice, currency)}</>}\n </p>\n </div>\n <span className=\"inline-flex items-center rounded-full px-2 py-0.5 text-[9px] font-medium bg-muted text-muted-foreground capitalize\">{selectedProduct.productType}</span>\n </div>\n )}\n\n <div className=\"flex justify-end\">\n <button\n onClick={() => setStep(2)}\n disabled={!canProceedStep1}\n className=\"inline-flex items-center gap-1.5 rounded-button bg-primary border border-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 shadow-button-primary active:shadow-button-inset transition-colors disabled:opacity-50\"\n >\n {t('inventory.stock.next')}\n </button>\n </div>\n </div>\n )}\n\n {/* Step 2: How much — Quantity + Cost + Location */}\n {step === 2 && (\n <div className=\"space-y-5\">\n <div className=\"rounded-card border bg-card shadow-sm p-5 space-y-4\">\n <div className=\"grid gap-4 sm:grid-cols-3\">\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{t('inventory.stock.quantity')}</label>\n <input\n type=\"number\"\n min={0.01}\n step={0.01}\n value={quantity}\n onChange={(e) => setQuantity(Number(e.target.value) || 0)}\n autoFocus\n className=\"w-full mt-1 rounded-input border border-input bg-card shadow-[inset_0_1px_0_rgb(0_0_0_/0.06)] px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring\"\n />\n </div>\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{t('inventory.stock.unitCost')}</label>\n <div className=\"flex items-center mt-1 rounded-input border border-input bg-card shadow-[inset_0_1px_0_rgb(0_0_0_/0.06)] focus-within:ring-2 focus-within:ring-primary/20\">\n <span className=\"pl-2.5 text-xs text-muted-foreground\">{currency.symbol}</span>\n <input type=\"number\" min={0} step={0.01} value={unitCost} onChange={(e) => setUnitCost(Number(e.target.value) || 0)} className=\"flex-1 bg-transparent px-2 py-2 text-sm outline-none\" />\n </div>\n </div>\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{t('inventory.stock.total')}</label>\n <p className=\"mt-1 px-3 py-2 text-lg font-bold\">{formatCurrency(totalCost, currency)}</p>\n </div>\n </div>\n\n {/* Location — radio-style selector with stock positions */}\n {modules.stockLocations && locations.length > 0 && (\n <div className=\"space-y-3\">\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{needsDest ? t('inventory.stock.fromLocation') : t('inventory.stock.locationLabel')}</label>\n <div className=\"flex flex-wrap gap-2 mt-1.5\">\n {sortedLocations.map((l) => {\n const qty = positionByLocation[l.id] ?? 0\n return (\n <button\n key={l.id}\n type=\"button\"\n onClick={() => setLocationId(l.id)}\n className={cn(\n 'rounded-button border-2 px-3 py-2 text-sm font-medium transition-all flex items-center gap-2',\n locationId === l.id\n ? 'border-primary bg-primary/5 text-primary'\n : 'border-transparent bg-muted/30 text-muted-foreground hover:bg-muted/50',\n )}\n >\n <span>{l.name}</span>\n {productId && (\n <span className={cn(\n 'inline-flex items-center rounded-full px-1.5 py-0.5 text-[10px] font-semibold tabular-nums',\n qty > 0\n ? 'bg-success/10 text-success'\n : 'bg-muted text-muted-foreground',\n )}>\n {qty}\n </span>\n )}\n </button>\n )\n })}\n </div>\n </div>\n {needsDest && (\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{t('inventory.stock.toLocation')}</label>\n <div className=\"flex flex-wrap gap-2 mt-1.5\">\n {sortedLocations.filter((l) => l.id !== locationId).map((l) => {\n const qty = positionByLocation[l.id] ?? 0\n return (\n <button\n key={l.id}\n type=\"button\"\n onClick={() => setDestLocationId(l.id)}\n className={cn(\n 'rounded-button border-2 px-3 py-2 text-sm font-medium transition-all flex items-center gap-2',\n destLocationId === l.id\n ? 'border-primary bg-primary/5 text-primary'\n : 'border-transparent bg-muted/30 text-muted-foreground hover:bg-muted/50',\n )}\n >\n <span>{l.name}</span>\n {productId && (\n <span className={cn(\n 'inline-flex items-center rounded-full px-1.5 py-0.5 text-[10px] font-semibold tabular-nums',\n qty > 0\n ? 'bg-success/10 text-success'\n : 'bg-muted text-muted-foreground',\n )}>\n {qty}\n </span>\n )}\n </button>\n )\n })}\n </div>\n </div>\n )}\n </div>\n )}\n\n {/* Reason (required for adjustment/loss) */}\n {needsReason && (\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{t('inventory.stock.reason')}</label>\n <input type=\"text\" value={reason} onChange={(e) => setReason(e.target.value)} placeholder={movementType === 'loss' ? t('inventory.stock.reasonLossPlaceholder') : t('inventory.stock.reasonAdjustPlaceholder')} className=\"w-full mt-1 rounded-input border border-input bg-card shadow-[inset_0_1px_0_rgb(0_0_0_/0.06)] px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring\" />\n </div>\n )}\n </div>\n\n <div className=\"flex justify-between\">\n <button onClick={() => setStep(1)} className=\"rounded-lg border px-4 py-2 text-sm font-medium hover:bg-muted bg-card shadow-button active:shadow-button-inset transition-colors\">{t('inventory.stock.back')}</button>\n <button onClick={() => setStep(3)} disabled={!canProceedStep2} className=\"inline-flex items-center gap-1.5 rounded-button bg-primary border border-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 shadow-button-primary active:shadow-button-inset transition-colors disabled:opacity-50\">{t('inventory.stock.next')}</button>\n </div>\n </div>\n )}\n\n {/* Step 3: Review + Optional details + Save */}\n {step === 3 && (\n <div className=\"space-y-5\">\n {/* Summary card */}\n <div className=\"rounded-card border bg-card shadow-sm p-5\">\n <div className=\"flex items-center gap-3 mb-4\">\n <div className={`flex h-10 w-10 items-center justify-center rounded-xl ${typeConfig.activeColor}`}>\n <typeConfig.icon className=\"h-5 w-5\" />\n </div>\n <div>\n <p className=\"font-semibold\">{productLabel}</p>\n <p className=\"text-xs text-muted-foreground capitalize\">{movementType} · {quantity} units · {formatCurrency(totalCost, currency)}</p>\n </div>\n </div>\n\n <div className=\"grid gap-2 sm:grid-cols-3 text-xs border-t pt-3\">\n <div><span className=\"text-muted-foreground\">{t('inventory.stock.quantityLabel')}:</span> <span className=\"font-medium\">{quantity}</span></div>\n <div><span className=\"text-muted-foreground\">{t('inventory.stock.unitCostLabel')}:</span> <span className=\"font-medium\">{formatCurrency(unitCost, currency)}</span></div>\n <div><span className=\"text-muted-foreground\">{t('inventory.stock.total')}:</span> <span className=\"font-bold\">{formatCurrency(totalCost, currency)}</span></div>\n </div>\n </div>\n\n {/* Optional details */}\n <div className=\"rounded-card border bg-card shadow-sm p-5 space-y-4\">\n <p className=\"text-xs font-medium text-muted-foreground\">{t('inventory.stock.additionalDetails')}</p>\n <div className=\"grid gap-4 sm:grid-cols-2\">\n {movementType === 'entry' && (\n <SearchSelect\n value={supplierId}\n displayValue={supplierLabel}\n onChange={(id, option) => { setSupplierId(id); setSupplierLabel(option?.label ?? '') }}\n onSearch={searchSuppliers}\n label={t('inventory.stock.supplier')}\n placeholder={t('inventory.stock.searchSupplier')}\n noResultsLabel={t('inventory.stock.noSuppliers')}\n minChars={1}\n debounce={150}\n />\n )}\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{t('inventory.stock.documentNumber')}</label>\n <input type=\"text\" value={documentNumber} onChange={(e) => setDocumentNumber(e.target.value)} placeholder={t('inventory.stock.documentPlaceholder')} className=\"w-full mt-1 rounded-input border border-input bg-card shadow-[inset_0_1px_0_rgb(0_0_0_/0.06)] px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring\" />\n </div>\n {modules.batchTracking && (\n <>\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{t('inventory.stock.batchNumber')}</label>\n <input type=\"text\" value={batchNumber} onChange={(e) => setBatchNumber(e.target.value)} placeholder={t('inventory.stock.batchPlaceholder')} className=\"w-full mt-1 rounded-input border border-input bg-card shadow-[inset_0_1px_0_rgb(0_0_0_/0.06)] px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring\" />\n </div>\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{t('inventory.stock.expirationDate')}</label>\n <DatePicker value={expirationDate} onChange={setExpirationDate} className=\"mt-1\" />\n </div>\n </>\n )}\n </div>\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{t('inventory.stock.notes')}</label>\n <textarea value={notes} onChange={(e) => setNotes(e.target.value)} rows={2} placeholder={t('inventory.stock.notesPlaceholder')} className=\"w-full mt-1 rounded-input border border-input bg-card shadow-[inset_0_1px_0_rgb(0_0_0_/0.06)] px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring resize-none\" />\n </div>\n </div>\n\n <div className=\"flex justify-between\">\n <button onClick={() => setStep(2)} className=\"rounded-lg border px-4 py-2 text-sm font-medium hover:bg-muted bg-card shadow-button active:shadow-button-inset transition-colors\">{t('inventory.stock.back')}</button>\n <button\n onClick={handleSave}\n disabled={saving}\n className=\"inline-flex items-center gap-1.5 rounded-button bg-primary border border-primary px-5 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 shadow-button-primary active:shadow-button-inset transition-colors disabled:opacity-50\"\n >\n <Check className=\"h-3.5 w-3.5\" /> {saving ? t('inventory.stock.recording') : t('inventory.stock.recordMovement')}\n </button>\n </div>\n </div>\n )}\n </div>\n )\n}\n","import React, { useEffect, useState, useMemo } from 'react'\nimport { ArrowUpRight, ArrowDownRight, RefreshCw, ArrowRightLeft, Trash2 } from 'lucide-react'\nimport type { ColumnDef } from '@tanstack/react-table'\nimport { ListView, Button } from '@fayz-ai/ui'\nimport { useInventoryStore, formatCurrency, useInventoryConfig } from '../context'\nimport { useTranslation } from '@fayz-ai/core'\nimport { SubpageHeader } from '@fayz-ai/ui'\nimport type { MovementType, StockMovement } from '../types'\nimport { movementTypeSpec } from '../lib/movement-vocabulary'\n\nconst TYPE_ICONS: Record<MovementType, React.ElementType> = {\n entry: ArrowDownRight,\n exit: ArrowUpRight,\n adjustment: RefreshCw,\n transfer: ArrowRightLeft,\n loss: Trash2,\n}\n\n/** Translated label for a movement type; falls back to the raw value. */\nfunction movementTypeLabel(type: MovementType, t: (k: string) => string): string {\n const spec = movementTypeSpec(type)\n return spec ? t(spec.labelKey) : type\n}\n\nconst TYPE_COLORS: Record<MovementType, string> = {\n entry: 'text-success',\n exit: 'text-destructive',\n adjustment: 'text-info',\n transfer: 'text-magic',\n loss: 'text-warning',\n}\n\nexport function MovementHistoryView({ onViewDetail, onNew, onNewExit }: {\n onViewDetail?: (id: string) => void\n /** Record an entry. This screen is where you already are when the goods arrive. */\n onNew?: () => void\n onNewExit?: () => void\n} = {}) {\n const t = useTranslation()\n const { currency } = useInventoryConfig()\n const movements = useInventoryStore((s) => s.movements)\n const movementsLoading = useInventoryStore((s) => s.movementsLoading)\n const fetchMovements = useInventoryStore((s) => s.fetchMovements)\n\n const [search, setSearch] = useState('')\n\n useEffect(() => { fetchMovements({ search: search || undefined }) }, [search])\n\n const columns: ColumnDef<StockMovement, any>[] = useMemo(() => [\n {\n accessorKey: 'movementDate', header: t('inventory.history.columnDate'),\n cell: ({ getValue }: any) => <span className=\"text-xs text-muted-foreground\">{getValue() as string}</span>,\n },\n {\n accessorKey: 'productName', header: t('inventory.history.columnProduct'),\n cell: ({ getValue }: any) => <span className=\"font-medium\">{(getValue() as string) ?? '—'}</span>,\n },\n {\n accessorKey: 'movementType', header: t('inventory.history.columnType'),\n cell: ({ getValue }: any) => {\n const type = getValue() as MovementType\n const Icon = TYPE_ICONS[type] ?? RefreshCw\n const color = TYPE_COLORS[type] ?? 'text-muted-foreground'\n return (\n <span className={`inline-flex items-center gap-1 ${color}`}>\n <Icon className=\"h-3 w-3\" />\n <span className=\"text-xs\">{movementTypeLabel(type, t)}</span>\n </span>\n )\n },\n },\n {\n id: 'location', header: t('inventory.history.columnLocation'),\n cell: ({ row }: any) => (\n <span className=\"text-xs text-muted-foreground\">\n {row.original.stockLocationName ?? '—'}\n {row.original.movementType === 'transfer' && row.original.destinationLocationName && (\n <span> → {row.original.destinationLocationName}</span>\n )}\n </span>\n ),\n },\n {\n accessorKey: 'quantity', header: t('inventory.history.columnQty'),\n cell: ({ row }: any) => (\n <span className=\"text-right block\">\n {row.original.movementType === 'entry' ? '+' : '-'}{row.original.quantity}\n </span>\n ),\n },\n {\n accessorKey: 'totalCost', header: t('inventory.history.columnTotal'),\n cell: ({ getValue }: any) => (\n <span className=\"text-right block text-muted-foreground\">{formatCurrency(getValue() as number, currency)}</span>\n ),\n },\n ], [currency, t])\n\n return (\n <div className=\"space-y-4\">\n <SubpageHeader title={t('inventory.history.title')} subtitle={t('inventory.history.subtitle')} />\n\n <ListView<StockMovement>\n columns={columns}\n data={movements}\n loading={movementsLoading}\n searchPlaceholder={t('inventory.history.searchPlaceholder')}\n search={search}\n onSearchChange={setSearch}\n searchDebounce={0}\n onRowClick={onViewDetail ? (row) => onViewDetail(row.id) : undefined}\n newLabel={onNew ? t('inventory.history.newEntry') : undefined}\n onNew={onNew}\n headerActions={onNewExit ? (\n <Button variant=\"outline\" size=\"sm\" onClick={onNewExit}>\n <ArrowUpRight className=\"mr-1.5 h-3.5 w-3.5\" />\n {t('inventory.history.newExit')}\n </Button>\n ) : undefined}\n emptyMessage={t('inventory.history.noMovements')}\n emptyActionLabel={onNew ? t('inventory.history.newEntry') : undefined}\n onEmptyAction={onNew}\n />\n </div>\n )\n}\n","import React, { useCallback, useEffect, useMemo, useState } from 'react'\nimport { CrudListView } from '@fayz-ai/admin'\nimport { useTranslation } from '@fayz-ai/core'\nimport type { EntityDef } from '@fayz-ai/core'\nimport { useInventoryProvider } from '../context'\nimport type { CountSessionStatus, StockCountSession } from '../types'\n\nconst STATUS_TONE: Record<CountSessionStatus, string> = {\n open: 'bg-muted text-muted-foreground',\n counting: 'bg-info-soft text-info-soft-foreground',\n closed: 'bg-success-soft text-success-soft-foreground',\n cancelled: 'bg-muted text-muted-foreground line-through',\n}\n\nfunction buildCountEntity(t: (key: string, params?: Record<string, string>) => string): EntityDef {\n return {\n name: t('inventory.counts.entity'),\n namePlural: t('inventory.counts.title'),\n icon: 'ClipboardList',\n displayField: 'label',\n fields: [\n {\n key: 'label', label: t('inventory.counts.colReference'), type: 'text', searchable: true,\n renderCell: (_v, row: any) => (\n <div>\n <p className=\"font-medium\">{row.label}</p>\n <p className=\"text-xs text-muted-foreground\">{row.stockLocationName ?? '—'}</p>\n </div>\n ),\n },\n {\n key: 'openedAt', label: t('inventory.counts.colOpened'), type: 'text',\n renderCell: (_v, row: any) => (\n <span className=\"text-xs text-muted-foreground\">{row.openedAt?.slice(0, 10) ?? '—'}</span>\n ),\n },\n {\n key: 'status', label: t('inventory.counts.colStatus'), type: 'text',\n renderCell: (_v, row: any) => (\n <span className={`inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium ${STATUS_TONE[row.status as CountSessionStatus]}`}>\n {t(`inventory.counts.status.${row.status}`)}\n </span>\n ),\n },\n {\n key: 'progress', label: t('inventory.counts.colProgress'), type: 'text',\n renderCell: (_v, row: any) => (\n <span className=\"block text-right tabular-nums text-muted-foreground\">\n {t('inventory.counts.progress', { counted: String(row.countedCount ?? 0), total: String(row.itemCount ?? 0) })}\n </span>\n ),\n },\n {\n key: 'divergentCount', label: t('inventory.counts.colDivergent'), type: 'number',\n renderCell: (_v, row: any) => (\n <span className={`block text-right tabular-nums ${row.divergentCount ? 'font-medium text-warning-soft-foreground' : 'text-muted-foreground'}`}>\n {row.divergentCount ?? 0}\n </span>\n ),\n },\n ],\n }\n}\n\n/** The counts a tenant has run — and the way into a new one. */\nexport function StockCountsView({ onNew, onOpen }: {\n onNew?: () => void\n onOpen?: (id: string) => void\n}) {\n const t = useTranslation()\n const provider = useInventoryProvider()\n\n const [sessions, setSessions] = useState<StockCountSession[]>([])\n const [loadedOnce, setLoadedOnce] = useState(false)\n const [search, setSearch] = useState('')\n\n const load = useCallback(async () => {\n setSessions(await provider.getCountSessions())\n setLoadedOnce(true)\n }, [provider])\n\n useEffect(() => { void load() }, [load])\n\n const rows = useMemo(() => {\n const term = search.trim().toLowerCase()\n return sessions\n .map((session) => ({\n ...session,\n label: session.reference || `${session.stockLocationName ?? ''} · ${session.openedAt.slice(0, 10)}`.trim(),\n }))\n .filter((row) => !term || row.label.toLowerCase().includes(term))\n }, [sessions, search])\n\n const entity = useMemo(() => buildCountEntity(t), [t])\n\n return (\n <CrudListView\n entityDef={entity}\n items={loadedOnce ? (rows as unknown as Array<{ id: string }>) : null}\n total={rows.length}\n search={search}\n onSearchChange={setSearch}\n searchPlaceholder={t('inventory.counts.searchPlaceholder')}\n onNew={onNew}\n addLabel={t('inventory.counts.newCount')}\n onRowClick={(row) => onOpen?.((row as { id: string }).id)}\n emptyMessage={t('inventory.counts.empty')}\n onRefresh={() => load()}\n feature=\"inventory\"\n />\n )\n}\n","import React, { useEffect, useState } from 'react'\nimport { Button, SubpageHeader, Switch, toast } from '@fayz-ai/ui'\nimport { useTranslation } from '@fayz-ai/core'\nimport { useInventoryProvider } from '../context'\nimport type { ProductCategory, StockLocation } from '../types'\n\nconst FIELD =\n 'w-full mt-1 rounded-input border border-input bg-card shadow-[inset_0_1px_0_rgb(0_0_0_/0.06)] px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring'\n\n/** Opening a count is four decisions: where, what, blind, and what to call it. */\nexport function StockCountFormView({ onOpened, onCancel }: {\n onOpened: (sessionId: string) => void\n onCancel: () => void\n}) {\n const t = useTranslation()\n const provider = useInventoryProvider()\n\n const [locations, setLocations] = useState<StockLocation[]>([])\n const [categories, setCategories] = useState<ProductCategory[]>([])\n const [locationId, setLocationId] = useState('')\n const [categoryId, setCategoryId] = useState('')\n const [reference, setReference] = useState('')\n const [blind, setBlind] = useState(true)\n const [notes, setNotes] = useState('')\n const [saving, setSaving] = useState(false)\n\n useEffect(() => {\n let active = true\n void Promise.all([provider.getLocations(), provider.getCategories()]).then(([locs, cats]) => {\n if (!active) return\n setLocations(locs)\n setCategories(cats)\n if (locs.length === 1) setLocationId(locs[0].id)\n })\n return () => { active = false }\n }, [provider])\n\n async function handleOpen() {\n if (!locationId) return\n setSaving(true)\n try {\n const session = await provider.openCountSession({\n stockLocationId: locationId,\n categoryId: categoryId || undefined,\n reference: reference.trim() || undefined,\n blind,\n notes: notes.trim() || undefined,\n })\n onOpened(session.id)\n } catch (err: any) {\n toast.error(t('inventory.counts.openFailed'), { description: err?.message })\n } finally {\n setSaving(false)\n }\n }\n\n return (\n <div className=\"space-y-6\">\n <SubpageHeader title={t('inventory.counts.title')} onBack={onCancel} />\n\n <div className=\"rounded-card border bg-card shadow-sm p-5 space-y-4 max-w-2xl\">\n <div>\n <h2 className=\"text-sm font-semibold\">{t('inventory.counts.formTitle')}</h2>\n <p className=\"text-xs text-muted-foreground\">{t('inventory.counts.formSubtitle')}</p>\n </div>\n\n <div className=\"grid gap-4 sm:grid-cols-2\">\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{t('inventory.counts.location')}</label>\n <select className={FIELD} value={locationId} onChange={(e) => setLocationId(e.target.value)}>\n <option value=\"\">{t('inventory.counts.pickLocation')}</option>\n {locations.map((l) => <option key={l.id} value={l.id}>{l.name}</option>)}\n </select>\n </div>\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{t('inventory.counts.category')}</label>\n <select className={FIELD} value={categoryId} onChange={(e) => setCategoryId(e.target.value)}>\n <option value=\"\">{t('inventory.counts.allCategories')}</option>\n {categories.map((c) => <option key={c.id} value={c.id}>{c.name}</option>)}\n </select>\n </div>\n </div>\n\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{t('inventory.counts.reference')}</label>\n <input\n type=\"text\" className={FIELD} value={reference}\n onChange={(e) => setReference(e.target.value)}\n placeholder={t('inventory.counts.referencePlaceholder')}\n />\n </div>\n\n <div className=\"rounded-lg bg-muted/30 px-4 py-3 flex items-start justify-between gap-4\">\n <div>\n <p className=\"text-sm font-medium\">{t('inventory.counts.blind')}</p>\n <p className=\"text-xs text-muted-foreground\">{t('inventory.counts.blindHint')}</p>\n </div>\n <Switch checked={blind} onCheckedChange={setBlind} size=\"md\" />\n </div>\n\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{t('inventory.counts.notes')}</label>\n <textarea\n className={FIELD} rows={2} value={notes}\n onChange={(e) => setNotes(e.target.value)}\n placeholder={t('inventory.counts.notesPlaceholder')}\n />\n </div>\n\n <div className=\"flex justify-end gap-2\">\n <Button variant=\"outline\" onClick={onCancel}>{t('inventory.counts.cancel')}</Button>\n <Button onClick={() => void handleOpen()} disabled={!locationId || saving}>\n {saving ? t('inventory.counts.opening') : t('inventory.counts.open')}\n </Button>\n </div>\n </div>\n </div>\n )\n}\n","import type { StockCountItem } from '../types'\n\n// ---------------------------------------------------------------------------\n// Count variance — pure arithmetic, no data access.\n//\n// The one rule everything here enforces: an UNCOUNTED line is not a line that\n// counted zero. `countedQuantity` undefined means nobody looked at the shelf,\n// so it has no variance, it is never divergent, and the close must never emit\n// an adjustment for it. Counting zero is a real answer and is stored as 0.\n// ---------------------------------------------------------------------------\n\nexport function isCounted(item: Pick<StockCountItem, 'countedQuantity'>): boolean {\n return item.countedQuantity !== undefined && item.countedQuantity !== null\n}\n\n/** counted − system, or null when the line was never counted. */\nexport function lineVariance(\n item: Pick<StockCountItem, 'systemQuantity' | 'countedQuantity'>,\n): number | null {\n if (!isCounted(item)) return null\n return (Number(item.countedQuantity) || 0) - (Number(item.systemQuantity) || 0)\n}\n\nexport function isDivergent(\n item: Pick<StockCountItem, 'systemQuantity' | 'countedQuantity'>,\n): boolean {\n const variance = lineVariance(item)\n return variance !== null && variance !== 0\n}\n\nexport interface CountSummary {\n total: number\n counted: number\n uncounted: number\n divergent: number\n /** Net units gained or lost across the divergent lines. */\n variance: number\n /** The same, valued at each line's unit cost — what the close costs. */\n varianceValue: number\n}\n\nexport function summarizeCount(items: StockCountItem[]): CountSummary {\n let counted = 0\n let divergent = 0\n let variance = 0\n let varianceValue = 0\n for (const item of items) {\n const delta = lineVariance(item)\n if (delta === null) continue\n counted += 1\n if (delta === 0) continue\n divergent += 1\n variance += delta\n varianceValue += delta * (Number(item.unitCost) || 0)\n }\n return {\n total: items.length,\n counted,\n uncounted: items.length - counted,\n divergent,\n variance,\n varianceValue,\n }\n}\n\n/** The lines the close will act on, in the order it will act on them. */\nexport function divergentLines(items: StockCountItem[]): StockCountItem[] {\n return items.filter(isDivergent)\n}\n","import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport { Button, ConfirmDialog, SubpageHeader, toast } from '@fayz-ai/ui'\nimport { useTranslation } from '@fayz-ai/core'\nimport { useInventoryConfig, useInventoryProvider, formatCurrency } from '../context'\nimport type { StockCountItem, StockCountSession } from '../types'\nimport { lineVariance, summarizeCount } from '../lib/stock-count'\n\n/**\n * The counting screen — used standing up, on a phone, in a cold room. One row\n * per product, one big number field, Enter moves to the next line.\n *\n * A blind session hides the system quantity AND the per-line variance until the\n * count is closed. Showing the variance the instant a number is typed would let\n * the counter retype until it reads zero, which is the same rubber stamp blind\n * mode exists to prevent.\n */\nexport function StockCountSessionView({ sessionId, onBack }: {\n sessionId: string\n onBack: () => void\n}) {\n const t = useTranslation()\n const { currency } = useInventoryConfig()\n const provider = useInventoryProvider()\n\n const [session, setSession] = useState<StockCountSession | null>(null)\n const [items, setItems] = useState<StockCountItem[]>([])\n const [drafts, setDrafts] = useState<Record<string, string>>({})\n const [loading, setLoading] = useState(true)\n const [closing, setClosing] = useState(false)\n const [confirmingClose, setConfirmingClose] = useState(false)\n const [confirmingCancel, setConfirmingCancel] = useState(false)\n const inputs = useRef<Array<HTMLInputElement | null>>([])\n\n const load = useCallback(async () => {\n setLoading(true)\n try {\n const [head, lines] = await Promise.all([\n provider.getCountSession(sessionId),\n provider.getCountItems(sessionId),\n ])\n setSession(head)\n setItems(lines)\n setDrafts(Object.fromEntries(\n lines.map((l) => [l.id, l.countedQuantity === undefined ? '' : String(l.countedQuantity)]),\n ))\n } finally {\n setLoading(false)\n }\n }, [provider, sessionId])\n\n useEffect(() => { void load() }, [load])\n\n const summary = useMemo(() => summarizeCount(items), [items])\n const closed = session?.status === 'closed' || session?.status === 'cancelled'\n const hideVariance = (session?.blind ?? false) && !closed\n\n async function commit(item: StockCountItem, raw: string) {\n const trimmed = raw.trim()\n const next = trimmed === '' ? null : Number(trimmed)\n if (next !== null && !Number.isFinite(next)) return\n const current = item.countedQuantity ?? null\n if (next === current) return\n try {\n const saved = await provider.saveCountEntry(item.id, next)\n setItems((prev) => prev.map((i) => (i.id === item.id ? { ...i, ...saved } : i)))\n if (session?.status === 'open') setSession({ ...session, status: 'counting' })\n } catch (err: any) {\n toast.error(t('inventory.counts.saveFailed'), { description: err?.message })\n }\n }\n\n async function handleClose() {\n setClosing(true)\n try {\n const result = await provider.closeCountSession(\n sessionId,\n t('inventory.counts.adjustmentReason', { reference: session?.reference ?? '' }),\n )\n toast.success(\n result.alreadyClosed\n ? t('inventory.counts.alreadyClosed')\n : t('inventory.counts.closed', { count: String(result.adjustmentsCreated) }),\n )\n await load()\n } catch (err: any) {\n toast.error(t('inventory.counts.closeFailed'), { description: err?.message })\n } finally {\n setClosing(false)\n setConfirmingClose(false)\n }\n }\n\n async function handleCancel() {\n try {\n await provider.cancelCountSession(sessionId)\n toast.success(t('inventory.counts.cancelled'))\n await load()\n } catch (err: any) {\n toast.error(t('inventory.counts.cancelFailed'), { description: err?.message })\n } finally {\n setConfirmingCancel(false)\n }\n }\n\n if (loading) {\n return (\n <div className=\"space-y-6\">\n <SubpageHeader title={t('inventory.counts.title')} onBack={onBack} />\n <div className=\"rounded-card border p-4 space-y-2\">\n {[1, 2, 3, 4].map((i) => <div key={i} className=\"h-8 rounded bg-muted/30 animate-pulse\" />)}\n </div>\n </div>\n )\n }\n\n if (!session) {\n return (\n <div className=\"space-y-6\">\n <SubpageHeader title={t('inventory.counts.title')} onBack={onBack} />\n <div className=\"rounded-card border p-8 text-center\">\n <p className=\"text-sm text-muted-foreground\">{t('inventory.counts.notFound')}</p>\n </div>\n </div>\n )\n }\n\n return (\n <div className=\"space-y-5\">\n <SubpageHeader title={t('inventory.counts.title')} onBack={onBack} />\n\n <div className=\"rounded-card border bg-card shadow-sm p-4 flex flex-wrap items-center justify-between gap-4\">\n <div className=\"min-w-0\">\n <p className=\"text-sm font-semibold truncate\">\n {session.reference || session.stockLocationName || t('inventory.counts.entity')}\n </p>\n <p className=\"text-xs text-muted-foreground\">\n {session.stockLocationName ?? '—'}\n {session.categoryName && <> · {session.categoryName}</>}\n {' '}· {t(`inventory.counts.status.${session.status}`)}\n {session.blind && <> · {t('inventory.counts.blind')}</>}\n </p>\n </div>\n <div className=\"flex items-center gap-5 text-xs\">\n <div>\n <p className=\"text-muted-foreground\">{t('inventory.counts.counted')}</p>\n <p className=\"font-semibold tabular-nums\">{summary.counted}/{summary.total}</p>\n </div>\n {!hideVariance && (\n <>\n <div>\n <p className=\"text-muted-foreground\">{t('inventory.counts.divergent')}</p>\n <p className=\"font-semibold tabular-nums\">{summary.divergent}</p>\n </div>\n <div>\n <p className=\"text-muted-foreground\">{t('inventory.counts.varianceValue')}</p>\n <p className={`font-semibold tabular-nums ${summary.varianceValue < 0 ? 'text-destructive' : ''}`}>\n {formatCurrency(summary.varianceValue, currency)}\n </p>\n </div>\n </>\n )}\n </div>\n {!closed && (\n <div className=\"flex items-center gap-2\">\n <Button variant=\"outline\" size=\"sm\" onClick={() => setConfirmingCancel(true)}>\n {t('inventory.counts.cancelCount')}\n </Button>\n <Button size=\"sm\" onClick={() => setConfirmingClose(true)}>\n {t('inventory.counts.close')}\n </Button>\n </div>\n )}\n </div>\n\n <div className=\"rounded-card border bg-card shadow-sm divide-y\">\n {items.map((item, index) => {\n const variance = lineVariance(item)\n return (\n <div key={item.id} className=\"flex items-center gap-3 px-4 py-3\">\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm font-medium truncate\">{item.productName ?? item.productId}</p>\n <p className=\"text-xs text-muted-foreground\">\n {item.productSku ? `${item.productSku} · ` : ''}\n {hideVariance\n ? t('inventory.counts.blindLine')\n : `${t('inventory.counts.systemQty')} ${item.systemQuantity}`}\n </p>\n </div>\n\n {!hideVariance && (\n <span className={`w-16 shrink-0 text-right text-sm tabular-nums ${\n variance === null ? 'text-muted-foreground'\n : variance === 0 ? 'text-muted-foreground'\n : variance > 0 ? 'text-success' : 'text-destructive'\n }`}>\n {variance === null ? '—' : variance > 0 ? `+${variance}` : variance}\n </span>\n )}\n\n <input\n ref={(el) => { inputs.current[index] = el }}\n type=\"number\"\n inputMode=\"decimal\"\n step=\"0.01\"\n disabled={closed}\n value={drafts[item.id] ?? ''}\n placeholder={t('inventory.counts.notCounted')}\n onChange={(e) => setDrafts((d) => ({ ...d, [item.id]: e.target.value }))}\n onBlur={() => void commit(item, drafts[item.id] ?? '')}\n onKeyDown={(e) => {\n if (e.key !== 'Enter') return\n e.preventDefault()\n inputs.current[index + 1]?.focus()\n }}\n className=\"w-28 shrink-0 rounded-input border border-input bg-card px-3 py-2.5 text-right text-base font-medium tabular-nums shadow-[inset_0_1px_0_rgb(0_0_0_/0.06)] focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-60\"\n />\n </div>\n )\n })}\n {items.length === 0 && (\n <p className=\"px-4 py-8 text-center text-xs text-muted-foreground\">{t('inventory.counts.noItems')}</p>\n )}\n </div>\n\n <ConfirmDialog\n open={confirmingClose}\n title={t('inventory.counts.closeTitle')}\n description={t('inventory.counts.closeDescription', {\n divergent: String(summary.divergent),\n uncounted: String(summary.uncounted),\n })}\n confirmLabel={t('inventory.counts.closeConfirm')}\n cancelLabel={t('inventory.counts.cancel')}\n loading={closing}\n onConfirm={() => void handleClose()}\n onCancel={() => setConfirmingClose(false)}\n />\n\n <ConfirmDialog\n open={confirmingCancel}\n variant=\"destructive\"\n title={t('inventory.counts.cancelTitle')}\n description={t('inventory.counts.cancelDescription')}\n confirmLabel={t('inventory.counts.cancelConfirm')}\n cancelLabel={t('inventory.counts.cancel')}\n onConfirm={() => void handleCancel()}\n onCancel={() => setConfirmingCancel(false)}\n />\n </div>\n )\n}\n","import type { IngredientCostBasis } from '../types'\n\n// ---------------------------------------------------------------------------\n// Recipe cost and CMV — pure arithmetic, no data access.\n//\n// THE UNIT ASSUMPTION, STATED OUT LOUD.\n//\n// The legacy implementation (beautyplace src/hooks/useRecipeCost.ts) multiplied\n// quantity × price with no conversion at all: it assumes the quantity written\n// on a recipe line is already expressed in the ingredient product's own unit.\n// We keep that assumption, because nothing in the data can contradict it — a\n// recipe line has no unit of its own that we could convert FROM.\n//\n// The one case we do better on is the one a kitchen actually hits: a product\n// bought in boxes and consumed in grams. When a product declares a purchase\n// unit distinct from the unit it is counted in, `products.cost` is the cost of\n// that purchase unit, and `conversionFactor` says how many counted units fit in\n// it — so the per-unit cost is cost ÷ factor. Without a declared purchase unit\n// the factor means nothing and we do exactly what the legacy app did.\n//\n// Artorius has purchase_unit_id NULL and conversion_factor 1 on all 43 rows, so\n// today both branches agree; the branch is the hedge, not a behaviour change.\n// ---------------------------------------------------------------------------\n\n/** Above this the dish eats the margin — the line the legacy app drew. */\nexport const CMV_ALERT_THRESHOLD = 35\n\nexport interface CostableLine {\n quantity: number\n costBasis?: IngredientCostBasis | null\n}\n\nexport interface CostedLine<T> {\n line: T\n /** Cost of one unit as the recipe counts it. */\n unitCost: number\n /** unitCost × quantity. */\n cost: number\n}\n\nexport function ingredientUnitCost(basis?: IngredientCostBasis | null): number {\n if (!basis) return 0\n const cost = Number(basis.cost) || 0\n if (!basis.purchaseUnitId) return cost\n const factor = Number(basis.conversionFactor) || 0\n return factor > 0 ? cost / factor : cost\n}\n\nexport function lineCost(line: CostableLine): number {\n return ingredientUnitCost(line.costBasis) * (Number(line.quantity) || 0)\n}\n\nexport function costLines<T extends CostableLine>(lines: T[]): CostedLine<T>[] {\n return lines.map((line) => {\n const unitCost = ingredientUnitCost(line.costBasis)\n return { line, unitCost, cost: unitCost * (Number(line.quantity) || 0) }\n })\n}\n\nexport function recipeCost(lines: CostableLine[]): number {\n return lines.reduce((sum, line) => sum + lineCost(line), 0)\n}\n\n/** Cost as a percentage of the sale price. Null when there is no price to divide by. */\nexport function cmvPercent(cost: number, salePrice?: number | null): number | null {\n const price = Number(salePrice) || 0\n if (price <= 0) return null\n return ((Number(cost) || 0) / price) * 100\n}\n\nexport function isCmvHigh(cmv: number | null | undefined): boolean {\n return typeof cmv === 'number' && cmv > CMV_ALERT_THRESHOLD\n}\n","import type { PluginAITool } from '@fayz-ai/core'\n\n/**\n * The assistant's ficha-técnica tool. A SERVER-PLANE write (a pool RPC), so it\n * works from any page and any channel and persists straight to the tenant's\n * recipes — the same pattern agenda/financial/forms use.\n *\n * `role: 'finance'` is explicit and load-bearing: the plugin's\n * `defaultAgentRole` is 'operations', and cost per dish is the finance\n * colleague's job (Selma, \"Gerente Administrativa\" in resto-saas). Without it\n * the tool would land on the operations colleague instead.\n *\n * The recipes screen publishes the ingredient CATALOGUE through\n * `useAgentSurface`, so the model sends real product ids; the RPC still\n * resolves names for whatever it names without one.\n */\n\nconst INGREDIENT_SHAPE =\n 'An ingredient line: { product_id?, name, quantity, notes? }. ' +\n 'Prefer product_id from the catalogue in the screen context; send `name` too so an ' +\n 'unmatched line can still be shown to the user. quantity is a number in the ' +\n \"ingredient's own unit — the catalogue lists that unit.\"\n\nexport const upsertRecipeTool: PluginAITool = {\n id: 'inventory.upsertRecipe',\n name: 'upsertRecipe',\n description:\n 'Creates or edits a ficha técnica (recipe) for a menu item: what it is made of, how much it yields and how it is prepared. ' +\n 'Persisted server-side, so it works from ANY page. ' +\n 'Omit recipeId to CREATE (name required); pass recipeId to EDIT. ' +\n 'Propose the WHOLE recipe in a single call — ingredients, quantities, yield and preparation together. Do NOT interview the user ingredient by ingredient. ' +\n 'Use the ingredient catalogue in the screen context to pick real product ids; name anything else in `name` and it will come back flagged for the user to pick or create. ' +\n 'The user confirms before it is saved.',\n icon: 'BookOpen',\n mode: 'persist',\n role: 'finance',\n limitKey: 'recipes',\n permission: { feature: 'inventory.recipes', action: 'create' },\n execution: { plane: 'server', kind: 'rpc', rpc: 'agent_inventory_upsert_recipe' },\n category: 'Inventory',\n suggestions: [\n { label: 'Monte a ficha técnica do cupim defumado com queijo, 400g' },\n { label: 'Quais itens do cardápio ainda não têm ficha técnica?' },\n ],\n parameters: {\n type: 'object',\n properties: {\n recipeId: { type: 'string', description: 'Existing recipe id to EDIT. Omit to create a new one.' },\n name: { type: 'string', description: 'Recipe name — required when creating.' },\n product_id: { type: 'string', description: 'Id of the product this recipe produces, from the screen context.' },\n product_name: { type: 'string', description: 'Name of the produced product, when its id is unknown. Resolved against the catalogue.' },\n description: { type: 'string', description: 'Optional short description.' },\n yield_quantity: { type: 'number', description: 'How many units one batch yields. Defaults to 1.' },\n preparation_time_minutes: { type: 'number', description: 'Preparation time in minutes.' },\n instructions: { type: 'string', description: 'Step-by-step preparation.' },\n ingredients: {\n type: 'array',\n description: `The FULL ingredient list — REPLACES every existing line. Each item: ${INGREDIENT_SHAPE}`,\n items: { type: 'object', description: INGREDIENT_SHAPE },\n },\n },\n },\n}\n\nexport const RECIPE_SURFACE_INSTRUCTIONS = [\n 'Você está na tela de FICHAS TÉCNICAS. Para montar ou editar uma ficha use a tool upsertRecipe (ela persiste no backend).',\n 'O catálogo de insumos (id, nome, unidade, custo) e os itens do cardápio sem ficha estão no JSON da tela em contexto — use os ids de lá em vez de inventar.',\n 'Proponha a ficha inteira numa única chamada: ingredientes, quantidades, rendimento e preparo juntos. Não pergunte ingrediente a ingrediente.',\n 'Insumo que não existir no catálogo: mande mesmo assim em `name` — ele volta marcado para o usuário escolher ou cadastrar.',\n].join(' ')\n","import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport { CrudListView, PermissionGate, QuickActionsButton, askAI, useAgentSurface } from '@fayz-ai/admin'\nimport { useDataChanged, useTranslation } from '@fayz-ai/core'\nimport type { EntityDef, PluginQuickAction } from '@fayz-ai/core'\nimport { useInventoryConfig, useInventoryProvider, formatCurrency } from '../context'\nimport type { InventoryCurrency } from '../context'\nimport type { Product, Recipe, RecipeIngredient } from '../types'\nimport { CMV_ALERT_THRESHOLD, cmvPercent, isCmvHigh, recipeCost } from '../lib/recipe-cost'\nimport { RECIPE_SURFACE_INSTRUCTIONS } from '../lib/agent-tools'\n\n// ---------------------------------------------------------------------------\n// \"Which menu items still lack a ficha técnica?\" — the question this screen\n// actually answers, which is why it is driven from PRODUCTS and not from the\n// recipes that happen to exist. A sellable product with no recipe is a row too.\n// ---------------------------------------------------------------------------\n\ninterface RecipeRow {\n /** Recipe id, or `product:<id>` for a menu item with no ficha yet. */\n id: string\n recipeId?: string\n productId?: string\n productName: string\n /** Shown under the product when the ficha is named something else. */\n recipeName?: string\n ingredientCount: number\n yieldLabel: string\n prepLabel: string\n cost: number | null\n salePrice?: number\n cmv: number | null\n missing: boolean\n}\n\n/** A menu item: something the tenant sells, whether or not it is typed as such. */\nfunction isSellable(product: Product): boolean {\n return product.productType === 'sale' || (product.salePrice ?? 0) > 0\n}\n\nfunction buildRecipeEntity(t: (key: string, params?: Record<string, string>) => string, currency: InventoryCurrency): EntityDef {\n const money = (value: number | null | undefined) =>\n value == null ? '—' : formatCurrency(value, currency)\n\n return {\n name: t('inventory.recipes.entity'),\n namePlural: t('inventory.recipes.title'),\n icon: 'BookOpen',\n displayField: 'productName',\n fields: [\n {\n key: 'productName', label: t('inventory.recipes.colProduct'), type: 'text', searchable: true,\n renderCell: (_v, row: any) => (\n <div>\n <p className=\"font-medium\">{row.productName}</p>\n {row.missing\n ? <span className=\"mt-0.5 inline-flex items-center rounded-full bg-warning-soft px-2 py-0.5 text-[10px] font-medium text-warning-soft-foreground\">{t('inventory.recipes.noSheet')}</span>\n : row.recipeName && row.recipeName !== row.productName\n ? <p className=\"text-xs text-muted-foreground\">{row.recipeName}</p>\n : null}\n </div>\n ),\n },\n {\n key: 'ingredientCount', label: t('inventory.recipes.colIngredients'), type: 'number',\n renderCell: (_v, row: any) => (\n <span className=\"block text-right tabular-nums\">{row.missing ? '—' : row.ingredientCount}</span>\n ),\n },\n {\n key: 'yieldLabel', label: t('inventory.recipes.colYield'), type: 'text',\n renderCell: (_v, row: any) => <span className=\"text-xs text-muted-foreground\">{row.yieldLabel || '—'}</span>,\n },\n {\n key: 'prepLabel', label: t('inventory.recipes.colPrep'), type: 'text',\n renderCell: (_v, row: any) => <span className=\"text-xs text-muted-foreground\">{row.prepLabel || '—'}</span>,\n },\n {\n key: 'cost', label: t('inventory.recipes.colCost'), type: 'currency',\n renderCell: (_v, row: any) => (\n <span className=\"block text-right tabular-nums text-muted-foreground\">{money(row.cost)}</span>\n ),\n },\n {\n key: 'salePrice', label: t('inventory.recipes.colSale'), type: 'currency',\n renderCell: (_v, row: any) => (\n <span className=\"block text-right tabular-nums\">{money(row.salePrice ?? null)}</span>\n ),\n },\n {\n key: 'cmv', label: t('inventory.recipes.colCmv'), type: 'number',\n renderCell: (_v, row: any) => (\n row.cmv == null\n ? <span className=\"block text-right text-muted-foreground\">—</span>\n : <span className={`block text-right tabular-nums font-medium ${isCmvHigh(row.cmv) ? 'text-destructive' : 'text-success'}`}>\n {row.cmv.toFixed(1)}%\n </span>\n ),\n },\n ],\n }\n}\n\nexport function RecipesView({ onNew, onView, onNewForProduct }: {\n onNew?: () => void\n onView?: (id: string) => void\n /** Starts a ficha for a menu item that has none. */\n onNewForProduct?: (productId: string) => void\n}) {\n const t = useTranslation()\n const { currency } = useInventoryConfig()\n const provider = useInventoryProvider()\n\n const [recipes, setRecipes] = useState<Recipe[]>([])\n const [lines, setLines] = useState<RecipeIngredient[]>([])\n const [products, setProducts] = useState<Product[]>([])\n const [loadedOnce, setLoadedOnce] = useState(false)\n const [search, setSearch] = useState('')\n\n // A menu is menu-sized; one page is the whole answer and beats a query per row.\n const load = useCallback(async (): Promise<Recipe[]> => {\n const [recipeList, allLines, productPage] = await Promise.all([\n provider.getRecipes(),\n provider.getAllRecipeIngredients(),\n provider.getProducts({ pageSize: 500 }),\n ])\n setRecipes(recipeList)\n setLines(allLines)\n setProducts(productPage.data)\n setLoadedOnce(true)\n return recipeList\n }, [provider])\n\n useEffect(() => { void load() }, [load])\n\n // The assistant's write is a server-plane RPC, so nothing local knows it\n // happened — the data bus is how this screen learns, and landing on the new\n // recipe is what makes \"criar com IA\" end somewhere the user can read.\n const knownRecipeIds = useRef<Set<string>>(new Set())\n useEffect(() => { knownRecipeIds.current = new Set(recipes.map((r) => r.id)) }, [recipes])\n\n useDataChanged({}, () => {\n void (async () => {\n const before = knownRecipeIds.current\n const after = await load()\n const created = after.find((r) => !before.has(r.id))\n if (created && onView) onView(created.id)\n })()\n })\n\n const rows = useMemo<RecipeRow[]>(() => {\n const linesByRecipe = new Map<string, RecipeIngredient[]>()\n for (const line of lines) {\n const bucket = linesByRecipe.get(line.recipeId)\n if (bucket) bucket.push(line)\n else linesByRecipe.set(line.recipeId, [line])\n }\n const productById = new Map(products.map((p) => [p.id, p]))\n\n const built: RecipeRow[] = recipes.map((recipe) => {\n const own = linesByRecipe.get(recipe.id) ?? []\n const cost = recipeCost(own)\n const product = recipe.productId ? productById.get(recipe.productId) : undefined\n const salePrice = recipe.productSalePrice ?? product?.salePrice\n return {\n id: recipe.id,\n recipeId: recipe.id,\n productId: recipe.productId,\n productName: recipe.productName ?? product?.name ?? recipe.name,\n recipeName: recipe.name,\n ingredientCount: own.length || recipe.ingredientCount || 0,\n yieldLabel: recipe.yieldQuantity ? `${recipe.yieldQuantity}${recipe.yieldUnitName ? ` ${recipe.yieldUnitName}` : ''}` : '',\n prepLabel: recipe.preparationTimeMinutes != null ? `${recipe.preparationTimeMinutes} min` : '',\n cost,\n salePrice,\n cmv: cmvPercent(cost, salePrice),\n missing: false,\n } as RecipeRow\n })\n\n const covered = new Set(recipes.map((r) => r.productId).filter(Boolean) as string[])\n for (const product of products) {\n if (!isSellable(product) || covered.has(product.id)) continue\n built.push({\n id: `product:${product.id}`,\n productId: product.id,\n productName: product.name,\n ingredientCount: 0,\n yieldLabel: '',\n prepLabel: '',\n cost: null,\n salePrice: product.salePrice,\n cmv: null,\n missing: true,\n })\n }\n\n // Missing fichas first — they are the reason to open this screen.\n return built.sort((a, b) =>\n a.missing === b.missing ? a.productName.localeCompare(b.productName) : a.missing ? -1 : 1)\n }, [recipes, lines, products])\n\n const visibleRows = useMemo(() => {\n const term = search.trim().toLowerCase()\n return term ? rows.filter((r) => r.productName.toLowerCase().includes(term)) : rows\n }, [rows, search])\n\n const entity = useMemo(() => buildRecipeEntity(t, currency), [t, currency])\n\n // The model needs real ids and real costs, not a guess at the catalogue.\n const surfaceState = useRef({ rows, products })\n surfaceState.current = { rows, products }\n const surface = useMemo(() => ({\n id: 'inventory.recipes',\n pluginId: 'inventory',\n role: 'finance' as const,\n instructions: RECIPE_SURFACE_INSTRUCTIONS,\n describe: () => {\n const { rows: current, products: catalogue } = surfaceState.current\n return {\n title: 'Fichas técnicas',\n state: {\n ingredients: catalogue\n .filter((p) => !isSellable(p) || (p.costPrice ?? 0) > 0)\n .slice(0, 200)\n .map((p) => ({ id: p.id, name: p.name, unit: p.measurementUnitName, cost: p.costPrice })),\n menuItemsWithoutRecipe: current\n .filter((r) => r.missing)\n .map((r) => ({ productId: r.productId, name: r.productName, salePrice: r.salePrice })),\n recipes: current\n .filter((r) => !r.missing)\n .map((r) => ({ id: r.recipeId, product: r.productName, cost: r.cost, cmv: r.cmv })),\n cmvAlertThreshold: CMV_ALERT_THRESHOLD,\n },\n }\n },\n tools: [],\n }), [])\n useAgentSurface(surface)\n\n const createActions = useMemo<PluginQuickAction[]>(() => [\n {\n id: 'with-ai',\n label: t('assistant.askAI'),\n description: t('inventory.recipes.aiHint'),\n icon: 'WandSparkles',\n highlight: true,\n action: () => askAI({\n hint: t('inventory.recipes.askPlaceholder'),\n intro: {\n role: 'finance',\n persona: t('inventory.recipes.askPersona'),\n pitch: t('inventory.recipes.askPitch'),\n description: t('inventory.recipes.askDescription'),\n suggestions: [0, 1, 2].map((i) => ({ label: t(`inventory.recipes.askSuggestion.${i}`) })),\n },\n }),\n },\n ...(onNew ? [{\n id: 'by-hand',\n label: t('inventory.recipes.newByHand'),\n description: t('inventory.recipes.newByHandHint'),\n icon: 'SlidersHorizontal',\n action: onNew,\n } as PluginQuickAction] : []),\n ], [t, onNew])\n\n return (\n <CrudListView\n entityDef={entity}\n items={loadedOnce ? (visibleRows as unknown as Array<{ id: string }>) : null}\n total={visibleRows.length}\n search={search}\n onSearchChange={setSearch}\n searchPlaceholder={t('inventory.recipes.searchPlaceholder')}\n headerActions={\n <PermissionGate feature=\"inventory\" action=\"create\">\n <QuickActionsButton variant=\"default\" label={t('inventory.recipes.newRecipe')} actions={createActions} />\n </PermissionGate>\n }\n onRowClick={(row) => {\n const target = row as unknown as RecipeRow\n if (target.missing && target.productId) onNewForProduct?.(target.productId)\n else if (target.recipeId) onView?.(target.recipeId)\n }}\n emptyMessage={t('inventory.recipes.noRecipes')}\n onRefresh={() => load().then(() => undefined)}\n feature=\"inventory\"\n />\n )\n}\n","import React, { useEffect, useState } from 'react'\nimport { Plus, Trash2, GripVertical } from 'lucide-react'\nimport { useInventoryStore, useInventoryProvider } from '../context'\nimport { toast } from '@fayz-ai/ui'\nimport { SubpageHeader, useSaveBar } from '@fayz-ai/ui'\nimport { useTranslation } from '@fayz-ai/core'\nimport { SearchSelect } from '@fayz-ai/ui'\nimport { useLimitGuard, invalidateLimit } from '@fayz-ai/admin'\nimport type { CreateRecipeIngredientInput } from '../types'\n\ninterface FormIngredient {\n _id: string\n productId: string\n productName: string\n quantity: number\n unitId: string\n unitName: string\n notes: string\n}\n\nlet fid = 1\nfunction nextId() { return `ri${fid++}` }\n\nexport function RecipeFormView({ onSaved, productId: initialProductId }: {\n onSaved?: (id?: string) => void\n /** Menu item this ficha is for, when the list started it from a missing row. */\n productId?: string\n}) {\n const t = useTranslation()\n const provider = useInventoryProvider()\n const createRecipe = useInventoryStore((s) => s.createRecipe)\n const guardRecipes = useLimitGuard('recipes')\n\n const [name, setName] = useState('')\n const [description, setDescription] = useState('')\n const [productId, setProductId] = useState(initialProductId ?? '')\n const [productName, setProductName] = useState('')\n\n // Named by the product it produces — the ficha the row was asking for.\n useEffect(() => {\n if (!initialProductId) return\n let active = true\n void provider.getProductById(initialProductId).then((product) => {\n if (!active || !product) return\n setProductId(product.id)\n setProductName(product.name)\n setName((current) => current || product.name)\n })\n return () => { active = false }\n }, [initialProductId, provider])\n\n const [yieldQuantity, setYieldQuantity] = useState(1)\n const [prepTime, setPrepTime] = useState('')\n const [instructions, setInstructions] = useState('')\n const [ingredients, setIngredients] = useState<FormIngredient[]>([])\n const [saving, setSaving] = useState(false)\n\n function addIngredient() {\n setIngredients([...ingredients, { _id: nextId(), productId: '', productName: '', quantity: 1, unitId: '', unitName: '', notes: '' }])\n }\n\n function updateIngredient(id: string, data: Partial<FormIngredient>) {\n setIngredients(ingredients.map((ing) => ing._id === id ? { ...ing, ...data } : ing))\n }\n\n function removeIngredient(id: string) {\n setIngredients(ingredients.filter((ing) => ing._id !== id))\n }\n\n async function handleSave() {\n if (!name.trim() || !productId || ingredients.length === 0) { toast.error(t('common.formIncomplete')); return }\n // Plan quantity guard (client-side, before the provider call). Opens the\n // global UpgradeModal and aborts when the plan's recipe cap is reached.\n if ((await guardRecipes()) === 'blocked') return\n setSaving(true)\n try {\n const recipe = await createRecipe({\n name,\n description: description || undefined,\n productId,\n yieldQuantity,\n preparationTimeMinutes: prepTime ? parseInt(prepTime) : undefined,\n instructions: instructions || undefined,\n ingredients: ingredients.filter((i) => i.productId).map((i, idx) => ({\n productId: i.productId,\n quantity: i.quantity,\n unitId: i.unitId || undefined,\n displayOrder: idx,\n notes: i.notes || undefined,\n })),\n })\n invalidateLimit('recipes')\n onSaved?.(recipe.id)\n } finally { setSaving(false) }\n }\n\n const dirty = !!(name || description || productId || prepTime || instructions || ingredients.length > 0 || yieldQuantity !== 1)\n useSaveBar({\n dirty,\n saving,\n onSave: () => { void handleSave() },\n onDiscard: () => onSaved?.(),\n saveLabel: t('inventory.recipeForm.saveRecipe'),\n })\n\n async function searchProducts(query: string) {\n const result = await provider.getProducts({ search: query, pageSize: 10 })\n return result.data.map((p) => ({ id: p.id, label: p.name, subtitle: p.sku ?? p.productType, data: p }))\n }\n\n async function quickCreateProduct(name: string, type: 'ingredient' | 'sale' = 'ingredient') {\n try {\n const product = await provider.createProduct({ name, productType: type })\n toast.success(`Product \"${name}\" created`)\n return product\n } catch {\n toast.error('Failed to create product')\n return null\n }\n }\n\n return (\n <div className=\"space-y-5\">\n <SubpageHeader\n title={t('inventory.recipeForm.newRecipe')}\n subtitle={t('inventory.recipeForm.subtitle')}\n onBack={() => onSaved?.()}\n parentLabel={t('inventory.nav.recipes')}\n />\n\n <div className=\"grid gap-4 lg:grid-cols-3\">\n {/* Left: Recipe details */}\n <div className=\"rounded-card border bg-card shadow-sm p-5 space-y-4\">\n <h3 className=\"text-sm font-semibold\">{t('inventory.recipeForm.recipeDetails')}</h3>\n\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{t('inventory.recipeForm.recipeName')} *</label>\n <input type=\"text\" value={name} onChange={(e) => setName(e.target.value)} placeholder={t('inventory.recipeForm.recipeNamePlaceholder')} autoFocus className=\"w-full mt-1 rounded-input border border-input bg-card shadow-[inset_0_1px_0_rgb(0_0_0_/0.06)] px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring\" />\n </div>\n\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{t('inventory.recipeForm.description')}</label>\n <textarea value={description} onChange={(e) => setDescription(e.target.value)} rows={2} placeholder={t('inventory.recipeForm.descriptionPlaceholder')} className=\"w-full mt-1 rounded-input border border-input bg-card shadow-[inset_0_1px_0_rgb(0_0_0_/0.06)] px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring resize-none\" />\n </div>\n\n <SearchSelect\n label={`${t('inventory.recipeForm.produces')} *`}\n value={productId}\n displayValue={productName}\n onChange={(id, opt) => { setProductId(id); setProductName(opt?.label ?? '') }}\n onSearch={searchProducts}\n placeholder={t('inventory.recipeForm.searchProduct')}\n allowCreate\n createLabel={t('inventory.recipeForm.createProduct')}\n onCreate={async (q) => {\n const p = await quickCreateProduct(q, 'sale')\n if (p) { setProductId(p.id); setProductName(p.name) }\n }}\n />\n\n <div className=\"grid grid-cols-2 gap-3\">\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{t('inventory.recipeForm.yieldQuantity')}</label>\n <input type=\"number\" min={0.01} step={0.01} value={yieldQuantity} onChange={(e) => setYieldQuantity(Number(e.target.value) || 1)} className=\"w-full mt-1 rounded-input border border-input bg-card shadow-[inset_0_1px_0_rgb(0_0_0_/0.06)] px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring\" />\n </div>\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{t('inventory.recipeForm.prepTime')}</label>\n <input type=\"number\" min={0} value={prepTime} onChange={(e) => setPrepTime(e.target.value)} placeholder=\"—\" className=\"w-full mt-1 rounded-input border border-input bg-card shadow-[inset_0_1px_0_rgb(0_0_0_/0.06)] px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring\" />\n </div>\n </div>\n\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">{t('inventory.recipeForm.instructions')}</label>\n <textarea value={instructions} onChange={(e) => setInstructions(e.target.value)} rows={4} placeholder={t('inventory.recipeForm.instructionsPlaceholder')} className=\"w-full mt-1 rounded-input border border-input bg-card shadow-[inset_0_1px_0_rgb(0_0_0_/0.06)] px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring resize-none\" />\n </div>\n </div>\n\n {/* Right: Ingredients */}\n <div className=\"lg:col-span-2 rounded-card border bg-card shadow-sm overflow-hidden flex flex-col\">\n <div className=\"flex items-center justify-between px-4 py-3 border-b\">\n <h3 className=\"text-sm font-semibold\">{t('inventory.recipeForm.ingredients')}</h3>\n <button onClick={addIngredient} className=\"inline-flex items-center gap-1.5 rounded-button bg-primary border border-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90 shadow-button-primary active:shadow-button-inset transition-colors\">\n <Plus className=\"h-3 w-3\" /> {t('inventory.recipeForm.addIngredient')}\n </button>\n </div>\n\n <div className=\"flex-1\">\n {ingredients.length === 0 ? (\n <div className=\"py-12 text-center\">\n <p className=\"text-sm text-muted-foreground\">{t('inventory.recipeForm.noIngredients')}</p>\n <button onClick={addIngredient} className=\"text-xs text-primary hover:underline mt-1\">{t('inventory.recipeForm.addFirstIngredient')}</button>\n </div>\n ) : (\n <div className=\"divide-y\">\n {/* Header */}\n <div className=\"grid grid-cols-12 gap-2 px-4 py-2 text-[10px] font-medium text-muted-foreground uppercase tracking-wider bg-muted/20\">\n <div className=\"col-span-5\">{t('inventory.recipeForm.ingredient')}</div>\n <div className=\"col-span-2\">{t('inventory.recipeForm.quantity')}</div>\n <div className=\"col-span-4\">{t('inventory.recipeForm.notes')}</div>\n <div className=\"col-span-1\" />\n </div>\n {ingredients.map((ing, idx) => (\n <div key={ing._id} className=\"grid grid-cols-12 gap-2 px-4 py-2.5 items-center group\">\n <div className=\"col-span-5\">\n <SearchSelect\n value={ing.productId}\n displayValue={ing.productName}\n onChange={(id, opt) => updateIngredient(ing._id, { productId: id, productName: opt?.label ?? '' })}\n onSearch={searchProducts}\n placeholder={t('inventory.recipeForm.searchIngredient')}\n allowCreate\n createLabel={t('inventory.recipeForm.createIngredient')}\n onCreate={async (q) => {\n const p = await quickCreateProduct(q, 'ingredient')\n if (p) updateIngredient(ing._id, { productId: p.id, productName: p.name })\n }}\n />\n </div>\n <div className=\"col-span-2\">\n <input\n type=\"number\"\n min={0.01}\n step={0.01}\n value={ing.quantity}\n onChange={(e) => updateIngredient(ing._id, { quantity: Number(e.target.value) || 0 })}\n className=\"w-full rounded-input border border-input bg-card shadow-[inset_0_1px_0_rgb(0_0_0_/0.06)] px-2 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-ring\"\n />\n </div>\n <div className=\"col-span-4\">\n <input\n type=\"text\"\n value={ing.notes}\n onChange={(e) => updateIngredient(ing._id, { notes: e.target.value })}\n placeholder={t('inventory.recipeForm.notesPlaceholder')}\n className=\"w-full rounded-input border border-input bg-card shadow-[inset_0_1px_0_rgb(0_0_0_/0.06)] px-2 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-ring\"\n />\n </div>\n <div className=\"col-span-1 flex justify-end\">\n <button onClick={() => removeIngredient(ing._id)} className=\"p-1 text-muted-foreground opacity-0 group-hover:opacity-100 hover:text-destructive transition-all\">\n <Trash2 className=\"h-3.5 w-3.5\" />\n </button>\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n\n {/* Footer */}\n {ingredients.length > 0 && (\n <div className=\"px-4 py-3 border-t bg-muted/20 text-xs text-muted-foreground\">\n {t('inventory.recipeForm.ingredientsConfigured', { configured: String(ingredients.filter((i) => i.productId).length), total: String(ingredients.length) })}\n </div>\n )}\n </div>\n </div>\n </div>\n )\n}\n","import React, { useState } from 'react'\nimport { AlertTriangle } from 'lucide-react'\nimport { SearchSelect, toast } from '@fayz-ai/ui'\nimport { useTranslation } from '@fayz-ai/core'\nimport { useInventoryProvider } from '../context'\nimport type { Product, Recipe, RecipeGaps } from '../types'\n\n/**\n * What the assistant proposed and could not match to the catalogue, offered\n * back for the user to pick or create. Without this the AI path dead-ends on\n * \"she mentioned bacon and it is not in the recipe\" — the recovery loop is what\n * made the legacy feature usable.\n */\nexport function RecipeGapsPanel({ recipe, gaps, onResolved }: {\n recipe: Recipe\n gaps: RecipeGaps\n onResolved: () => void | Promise<void>\n}) {\n const t = useTranslation()\n const provider = useInventoryProvider()\n const [busy, setBusy] = useState(false)\n\n const unmatched = gaps.unmatchedIngredients ?? []\n if (unmatched.length === 0 && !gaps.productHint) return null\n\n async function searchProducts(query: string) {\n const result = await provider.getProducts({ search: query, pageSize: 10 })\n return result.data.map((p) => ({ id: p.id, label: p.name, subtitle: p.sku ?? p.productType, data: p }))\n }\n\n async function quickCreate(name: string, productType: 'ingredient' | 'sale'): Promise<Product | null> {\n try {\n return await provider.createProduct({ name, productType })\n } catch (err: any) {\n toast.error(t('inventory.recipeGaps.createFailed'), { description: err?.message })\n return null\n }\n }\n\n function remainingGaps(index: number): RecipeGaps {\n return { ...gaps, unmatchedIngredients: unmatched.filter((_, i) => i !== index) }\n }\n\n async function linkIngredient(index: number, productId: string) {\n const gap = unmatched[index]\n setBusy(true)\n try {\n await provider.addRecipeIngredient(recipe.id, {\n productId,\n quantity: Number(gap?.quantity) > 0 ? Number(gap.quantity) : 1,\n notes: gap?.notes,\n })\n await provider.updateRecipe(recipe.id, { metadata: remainingGaps(index) as Record<string, unknown> })\n await onResolved()\n } catch (err: any) {\n toast.error(t('inventory.recipeGaps.linkFailed'), { description: err?.message })\n } finally {\n setBusy(false)\n }\n }\n\n async function linkProduct(productId: string) {\n setBusy(true)\n try {\n const { productHint: _dropped, ...rest } = gaps\n await provider.updateRecipe(recipe.id, { productId, metadata: rest as Record<string, unknown> })\n await onResolved()\n } catch (err: any) {\n toast.error(t('inventory.recipeGaps.linkFailed'), { description: err?.message })\n } finally {\n setBusy(false)\n }\n }\n\n return (\n <div className=\"rounded-card border border-warning/40 bg-warning/5 p-4 space-y-3\">\n <div className=\"flex items-start gap-2\">\n <AlertTriangle className=\"h-4 w-4 text-warning shrink-0 mt-px\" />\n <div>\n <h3 className=\"text-sm font-semibold text-foreground\">{t('inventory.recipeGaps.title')}</h3>\n <p className=\"text-xs text-muted-foreground\">{t('inventory.recipeGaps.description')}</p>\n </div>\n </div>\n\n <div className={`space-y-2 ${busy ? 'opacity-60 pointer-events-none' : ''}`}>\n {gaps.productHint && (\n <div className=\"grid gap-2 sm:grid-cols-2 items-center\">\n <p className=\"text-xs\">\n <span className=\"text-muted-foreground\">{t('inventory.recipeGaps.produces')}</span>{' '}\n <strong className=\"text-foreground\">{gaps.productHint}</strong>\n </p>\n <SearchSelect\n value=\"\"\n onChange={(id) => { if (id) void linkProduct(id) }}\n onSearch={searchProducts}\n placeholder={t('inventory.recipeForm.searchProduct')}\n allowCreate\n createLabel={t('inventory.recipeForm.createProduct')}\n onCreate={async (q) => {\n const p = await quickCreate(q, 'sale')\n if (p) await linkProduct(p.id)\n }}\n />\n </div>\n )}\n\n {unmatched.map((gap, index) => (\n <div key={`${gap.name}-${index}`} className=\"grid gap-2 sm:grid-cols-2 items-center\">\n <p className=\"text-xs\">\n <strong className=\"text-foreground\">{gap.name || t('inventory.recipeGaps.unnamed')}</strong>\n {Number(gap.quantity) > 0 && <span className=\"text-muted-foreground\"> · {gap.quantity}</span>}\n {gap.notes && <span className=\"text-muted-foreground\"> · {gap.notes}</span>}\n </p>\n <SearchSelect\n value=\"\"\n onChange={(id) => { if (id) void linkIngredient(index, id) }}\n onSearch={searchProducts}\n placeholder={t('inventory.recipeForm.searchIngredient')}\n allowCreate\n createLabel={t('inventory.recipeForm.createIngredient')}\n onCreate={async (q) => {\n const p = await quickCreate(q, 'ingredient')\n if (p) await linkIngredient(index, p.id)\n }}\n />\n </div>\n ))}\n </div>\n </div>\n )\n}\n","import React, { useEffect, useMemo, useState } from 'react'\nimport { AlertTriangle, BookOpen, Clock, Coins, Layers, Package } from 'lucide-react'\nimport type { ColumnDef } from '@tanstack/react-table'\nimport { useInventoryConfig, useInventoryProvider, formatCurrency } from '../context'\nimport { useTranslation } from '@fayz-ai/core'\nimport { DataTable, SubpageHeader } from '@fayz-ai/ui'\nimport type { Recipe, RecipeGaps, RecipeIngredient } from '../types'\nimport { CMV_ALERT_THRESHOLD, cmvPercent, ingredientUnitCost, isCmvHigh, recipeCost } from '../lib/recipe-cost'\nimport { RecipeGapsPanel } from '../components/RecipeGapsPanel'\n\n/** What the assistant could not resolve, as the RPC stored it. */\nfunction readGaps(recipe: Recipe | null): RecipeGaps {\n const meta = recipe?.metadata as RecipeGaps | undefined\n return {\n unmatchedIngredients: Array.isArray(meta?.unmatchedIngredients) ? meta!.unmatchedIngredients : undefined,\n productHint: typeof meta?.productHint === 'string' ? meta.productHint : undefined,\n }\n}\n\nfunction DetailSkeleton() {\n return (\n <div className=\"space-y-5\">\n <div className=\"flex items-center gap-3\">\n <div className=\"h-12 w-12 rounded-xl bg-muted/40 animate-pulse\" />\n <div className=\"space-y-2 flex-1\">\n <div className=\"h-5 w-40 rounded bg-muted/40 animate-pulse\" />\n <div className=\"h-3 w-24 rounded bg-muted/30 animate-pulse\" />\n </div>\n </div>\n <div className=\"rounded-xl border divide-y\">\n {[1, 2, 3].map((i) => (\n <div key={i} className=\"flex items-center gap-3 px-4 py-3\">\n <div className=\"h-3 w-20 rounded bg-muted/30 animate-pulse\" />\n <div className=\"flex-1\" />\n <div className=\"h-3 w-16 rounded bg-muted/40 animate-pulse\" />\n </div>\n ))}\n </div>\n <div className=\"rounded-xl border p-4 space-y-2\">\n {[1, 2, 3, 4].map((i) => (\n <div key={i} className=\"flex items-center gap-3\">\n <div className=\"h-3.5 w-6 rounded bg-muted/30 animate-pulse\" />\n <div className=\"h-3.5 flex-1 rounded bg-muted/30 animate-pulse\" />\n <div className=\"h-3.5 w-12 rounded bg-muted/40 animate-pulse\" />\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nexport function RecipeDetailView({ recipeId, onBack }: { recipeId: string; onBack: () => void }) {\n const t = useTranslation()\n const { currency } = useInventoryConfig()\n const provider = useInventoryProvider()\n const [recipe, setRecipe] = useState<Recipe | null>(null)\n const [ingredients, setIngredients] = useState<RecipeIngredient[]>([])\n const [loading, setLoading] = useState(true)\n\n const load = React.useCallback(async () => {\n const [r, ings] = await Promise.all([\n provider.getRecipeById(recipeId),\n provider.getRecipeIngredients(recipeId),\n ])\n setRecipe(r)\n setIngredients(ings.sort((a, b) => a.displayOrder - b.displayOrder))\n }, [recipeId, provider])\n\n useEffect(() => {\n setLoading(true)\n void load().finally(() => setLoading(false))\n }, [load])\n\n const totalCost = useMemo(() => recipeCost(ingredients), [ingredients])\n const cmv = useMemo(() => cmvPercent(totalCost, recipe?.productSalePrice), [totalCost, recipe?.productSalePrice])\n const gaps = useMemo(() => readGaps(recipe), [recipe])\n\n if (loading) {\n return (\n <div className=\"space-y-6\">\n <SubpageHeader\n title={t('inventory.recipeDetail.loading')}\n icon=\"BookOpen\"\n onBack={onBack}\n parentLabel={t('inventory.nav.recipes')}\n />\n <DetailSkeleton />\n </div>\n )\n }\n\n if (!recipe) {\n return (\n <div className=\"space-y-6\">\n <SubpageHeader\n title={t('inventory.recipeDetail.notFound')}\n icon=\"BookOpen\"\n onBack={onBack}\n parentLabel={t('inventory.nav.recipes')}\n />\n <div className=\"flex flex-col items-center justify-center py-16 text-center rounded-lg border-2 border-dashed border-muted\">\n <BookOpen className=\"h-8 w-8 text-muted-foreground/30 mb-2\" />\n <p className=\"text-sm text-muted-foreground\">{t('inventory.recipeDetail.notFound')}</p>\n <button onClick={onBack} className=\"text-xs text-primary hover:underline mt-1\">{t('inventory.recipeDetail.backToList')}</button>\n </div>\n </div>\n )\n }\n\n const ingredientColumns: ColumnDef<RecipeIngredient, any>[] = [\n {\n id: 'index', header: '#',\n cell: ({ row }) => <span className=\"text-xs text-muted-foreground\">{row.index + 1}</span>,\n },\n {\n accessorKey: 'productName', header: t('inventory.recipeDetail.ingredient'),\n cell: ({ getValue }) => <span className=\"font-medium\">{(getValue() as string) || '—'}</span>,\n },\n {\n accessorKey: 'quantity', header: () => <span className=\"block text-right\">{t('inventory.recipeDetail.quantity')}</span>,\n cell: ({ getValue }) => <span className=\"block text-right tabular-nums\">{getValue() as number}</span>,\n },\n {\n accessorKey: 'unitName', header: t('inventory.recipeDetail.unit'),\n cell: ({ getValue }) => <span className=\"text-xs text-muted-foreground\">{(getValue() as string) || '—'}</span>,\n },\n {\n accessorKey: 'notes', header: t('inventory.recipeDetail.notes'),\n cell: ({ getValue }) => <span className=\"text-xs text-muted-foreground\">{(getValue() as string) || '—'}</span>,\n },\n {\n id: 'unitCost', header: () => <span className=\"block text-right\">{t('inventory.recipeDetail.unitCost')}</span>,\n cell: ({ row }) => (\n <span className=\"block text-right text-muted-foreground tabular-nums\">\n {formatCurrency(ingredientUnitCost(row.original.costBasis), currency)}\n </span>\n ),\n },\n {\n id: 'cost', header: () => <span className=\"block text-right\">{t('inventory.recipeDetail.cost')}</span>,\n cell: ({ row }) => (\n <span className=\"block text-right font-medium tabular-nums\">\n {formatCurrency(ingredientUnitCost(row.original.costBasis) * (row.original.quantity || 0), currency)}\n </span>\n ),\n },\n ]\n\n return (\n <div className=\"space-y-6\">\n {/* O mesmo cabeçalho de subpágina de todas as outras telas: o título, o\n caminho de volta e o estado à direita. O herói desenhado à mão que\n vivia aqui repetia o nome logo abaixo do rastro e escolhia a própria\n altura — duas gramáticas de topo dentro do mesmo app. */}\n <SubpageHeader\n title={recipe.name}\n subtitle={recipe.description}\n icon=\"BookOpen\"\n onBack={onBack}\n parentLabel={t('inventory.nav.recipes')}\n actions={\n recipe.isActive ? (\n <span className=\"inline-flex items-center gap-1 text-[10px] text-success\">\n <span className=\"h-1.5 w-1.5 rounded-full bg-success\" /> {t('inventory.recipeDetail.active')}\n </span>\n ) : (\n <span className=\"inline-flex items-center gap-1 text-[10px] text-muted-foreground/50\">\n <span className=\"h-1.5 w-1.5 rounded-full bg-muted-foreground/30\" /> {t('inventory.recipeDetail.inactive')}\n </span>\n )\n }\n />\n\n <RecipeGapsPanel recipe={recipe} gaps={gaps} onResolved={load} />\n\n <div className=\"grid gap-4 lg:grid-cols-3\">\n {/* Left, and wide: the ingredients ARE the recipe. The list that gets\n read is the one that gets the room — it was squeezed into a third of\n the page while four numbers took the other two. */}\n <div className=\"lg:col-span-2\">\n <h3 className=\"text-sm font-semibold text-foreground mb-2\">{t('inventory.recipeDetail.ingredientsTitle')}</h3>\n {ingredients.length === 0 ? (\n <div className=\"rounded-xl border p-8 text-center\">\n <p className=\"text-xs text-muted-foreground\">{t('inventory.recipeDetail.noIngredients')}</p>\n </div>\n ) : (\n <DataTable columns={ingredientColumns} data={ingredients} variant=\"card\" />\n )}\n </div>\n\n {/* Right: the facts about the recipe, beside the list they describe. */}\n <div className=\"space-y-4\">\n {/* Metrics */}\n <div className=\"rounded-xl border divide-y\">\n {recipe.productName && (\n <div className=\"flex items-center gap-3 px-4 py-3\">\n <Package className=\"h-4 w-4 text-muted-foreground shrink-0\" />\n <span className=\"text-xs text-muted-foreground flex-1\">{t('inventory.recipeDetail.produces')}</span>\n <span className=\"text-sm font-medium\">{recipe.productName}</span>\n </div>\n )}\n <div className=\"flex items-center gap-3 px-4 py-3\">\n <Layers className=\"h-4 w-4 text-muted-foreground shrink-0\" />\n <span className=\"text-xs text-muted-foreground flex-1\">{t('inventory.recipeDetail.yield')}</span>\n <span className=\"text-sm font-medium\">{recipe.yieldQuantity}{recipe.yieldUnitName ? ` ${recipe.yieldUnitName}` : ''}</span>\n </div>\n {recipe.preparationTimeMinutes != null && (\n <div className=\"flex items-center gap-3 px-4 py-3\">\n <Clock className=\"h-4 w-4 text-muted-foreground shrink-0\" />\n <span className=\"text-xs text-muted-foreground flex-1\">{t('inventory.recipeDetail.prepTime')}</span>\n <span className=\"text-sm font-medium\">{recipe.preparationTimeMinutes} min</span>\n </div>\n )}\n <div className=\"flex items-center gap-3 px-4 py-3\">\n <Layers className=\"h-4 w-4 text-muted-foreground shrink-0\" />\n <span className=\"text-xs text-muted-foreground flex-1\">{t('inventory.recipeDetail.ingredientCount')}</span>\n <span className=\"text-sm font-medium\">{ingredients.length}</span>\n </div>\n <div className=\"flex items-center gap-3 px-4 py-3\">\n <Coins className=\"h-4 w-4 text-muted-foreground shrink-0\" />\n <span className=\"text-xs text-muted-foreground flex-1\">{t('inventory.recipeDetail.totalCost')}</span>\n <span className=\"text-sm font-medium tabular-nums\">{formatCurrency(totalCost, currency)}</span>\n </div>\n {recipe.yieldQuantity > 1 && (\n <div className=\"flex items-center gap-3 px-4 py-3\">\n <Coins className=\"h-4 w-4 text-muted-foreground shrink-0\" />\n <span className=\"text-xs text-muted-foreground flex-1\">{t('inventory.recipeDetail.costPerYield')}</span>\n <span className=\"text-sm font-medium tabular-nums\">{formatCurrency(totalCost / recipe.yieldQuantity, currency)}</span>\n </div>\n )}\n {recipe.productSalePrice != null && recipe.productSalePrice > 0 && (\n <div className=\"flex items-center gap-3 px-4 py-3\">\n <Package className=\"h-4 w-4 text-muted-foreground shrink-0\" />\n <span className=\"text-xs text-muted-foreground flex-1\">{t('inventory.recipeDetail.salePrice')}</span>\n <span className=\"text-sm font-medium tabular-nums\">{formatCurrency(recipe.productSalePrice, currency)}</span>\n </div>\n )}\n <div className=\"flex items-center gap-3 px-4 py-3\">\n <Coins className=\"h-4 w-4 text-muted-foreground shrink-0\" />\n <span className=\"text-xs text-muted-foreground flex-1\">{t('inventory.recipeDetail.cmv')}</span>\n {cmv == null ? (\n <span className=\"text-xs text-muted-foreground\">{t('inventory.recipeDetail.cmvUnknown')}</span>\n ) : (\n <span className={`text-sm font-medium tabular-nums ${isCmvHigh(cmv) ? 'text-destructive' : 'text-success'}`}>\n {cmv.toFixed(1)}%\n </span>\n )}\n </div>\n </div>\n\n {isCmvHigh(cmv) && (\n <p className=\"flex items-start gap-1.5 text-[11px] text-destructive\">\n <AlertTriangle className=\"h-3.5 w-3.5 shrink-0 mt-px\" />\n {t('inventory.recipeDetail.cmvHigh', { threshold: String(CMV_ALERT_THRESHOLD) })}\n </p>\n )}\n\n {/* Instructions */}\n {recipe.instructions && (\n <div>\n <h3 className=\"text-sm font-semibold text-foreground mb-1\">{t('inventory.recipeDetail.instructions')}</h3>\n <div className=\"rounded-card border bg-card shadow-sm px-4 py-3\">\n <p className=\"text-xs text-muted-foreground whitespace-pre-wrap leading-relaxed\">{recipe.instructions}</p>\n </div>\n </div>\n )}\n\n {/* Dates */}\n <div className=\"flex items-center gap-4 text-[10px] text-muted-foreground/50\">\n <span>{t('inventory.recipeDetail.created')} {recipe.createdAt?.slice(0, 10)}</span>\n <span>{t('inventory.recipeDetail.updated')} {recipe.updatedAt?.slice(0, 10)}</span>\n </div>\n </div>\n\n {/* Right: Ingredients table */}\n <div className=\"lg:col-span-2\">\n <h3 className=\"text-sm font-semibold text-foreground mb-2\">{t('inventory.recipeDetail.ingredientsTitle')}</h3>\n {ingredients.length === 0 ? (\n <div className=\"rounded-xl border p-8 text-center\">\n <p className=\"text-xs text-muted-foreground\">{t('inventory.recipeDetail.noIngredients')}</p>\n </div>\n ) : (\n <>\n <DataTable columns={ingredientColumns} data={ingredients} variant=\"card\" />\n <div className=\"flex items-baseline justify-end gap-3 px-4 py-2 text-sm\">\n <span className=\"text-muted-foreground\">{t('inventory.recipeDetail.totalCost')}</span>\n <span className=\"font-semibold tabular-nums\">{formatCurrency(totalCost, currency)}</span>\n </div>\n </>\n )}\n </div>\n </div>\n </div>\n )\n}\n","import React from 'react'\nimport { SettingsGroup, ToggleRow, useTenantPluginSettings } from '@fayz-ai/admin'\nimport { useTranslation } from '@fayz-ai/core'\n\n// Per-tenant defaults = the values that used to be hardcoded here. Persisted +\n// re-hydrated per tenant; behavioural consumption is a follow-up.\nconst INVENTORY_DEFAULTS = {\n lowStockAlerts: true,\n requireReason: true,\n autoDeduct: false,\n requireSku: false,\n allowNegative: false,\n lowStockEmail: false,\n expiryWarnings: true,\n}\n\nexport function InventoryGeneralSettings() {\n const t = useTranslation()\n const s = useTenantPluginSettings('inventory', INVENTORY_DEFAULTS)\n return (\n <div className=\"space-y-4\">\n <SettingsGroup title={t('inventory.settings.stockManagement')} description={t('inventory.settings.stockManagementDesc')}>\n <ToggleRow label={t('inventory.settings.lowStockAlerts')} description={t('inventory.settings.lowStockAlertsDesc')} checked={s.get('lowStockAlerts')} onChange={(v) => s.set('lowStockAlerts', v)} />\n <ToggleRow label={t('inventory.settings.requireReason')} description={t('inventory.settings.requireReasonDesc')} checked={s.get('requireReason')} onChange={(v) => s.set('requireReason', v)} />\n <ToggleRow label={t('inventory.settings.autoDeduct')} description={t('inventory.settings.autoDeductDesc')} checked={s.get('autoDeduct')} onChange={(v) => s.set('autoDeduct', v)} />\n </SettingsGroup>\n\n <SettingsGroup title={t('inventory.settings.products')} description={t('inventory.settings.productsDesc')}>\n <ToggleRow label={t('inventory.settings.requireSku')} description={t('inventory.settings.requireSkuDesc')} checked={s.get('requireSku')} onChange={(v) => s.set('requireSku', v)} />\n <ToggleRow label={t('inventory.settings.allowNegative')} description={t('inventory.settings.allowNegativeDesc')} checked={s.get('allowNegative')} onChange={(v) => s.set('allowNegative', v)} />\n </SettingsGroup>\n\n <SettingsGroup title={t('inventory.settings.notifications')} description={t('inventory.settings.notificationsDesc')}>\n <ToggleRow label={t('inventory.settings.lowStockEmail')} description={t('inventory.settings.lowStockEmailDesc')} checked={s.get('lowStockEmail')} onChange={(v) => s.set('lowStockEmail', v)} />\n <ToggleRow label={t('inventory.settings.expiryWarnings')} description={t('inventory.settings.expiryWarningsDesc')} checked={s.get('expiryWarnings')} onChange={(v) => s.set('expiryWarnings', v)} />\n </SettingsGroup>\n </div>\n )\n}\n","import React, { useState } from 'react'\nimport { Package, Ruler, MapPin, ChevronRight, Check } from 'lucide-react'\nimport { useTranslation } from '@fayz-ai/core'\nimport { Button } from '@fayz-ai/ui'\n\nconst STEPS = [\n { id: 'welcome', icon: Package, titleKey: 'inventory.onboarding.welcome', descKey: 'inventory.onboarding.description' },\n { id: 'units', icon: Ruler, titleKey: 'inventory.onboarding.units.title', descKey: 'inventory.onboarding.units.description' },\n { id: 'locations', icon: MapPin, titleKey: 'inventory.onboarding.locations.title', descKey: 'inventory.onboarding.locations.description' },\n]\n\nexport function InventoryOnboarding({ onComplete }: { onComplete: () => void }) {\n const t = useTranslation()\n const [step, setStep] = useState(0)\n const current = STEPS[step]\n const isLast = step === STEPS.length - 1\n const Icon = current.icon\n\n return (\n <div className=\"flex items-center justify-center py-12\">\n <div className=\"w-full max-w-lg\">\n <div className=\"flex items-center gap-1 mb-8\">\n {STEPS.map((_, i) => (\n <div key={i} className={`h-1 flex-1 rounded-full transition-colors ${i <= step ? 'bg-primary' : 'bg-muted'}`} />\n ))}\n </div>\n <div className=\"rounded-card border bg-card p-8 text-center space-y-6 shadow-sm\">\n <div className=\"flex justify-center\">\n <div className=\"flex h-16 w-16 items-center justify-center rounded-2xl bg-primary/10\">\n <Icon className=\"h-8 w-8 text-primary\" />\n </div>\n </div>\n <div>\n <h2 className=\"text-xl font-bold\">{t(current.titleKey)}</h2>\n <p className=\"text-sm text-muted-foreground mt-2 max-w-sm mx-auto\">{t(current.descKey)}</p>\n </div>\n <div className=\"flex items-center justify-center gap-3 pt-2\">\n {step > 0 && (\n <Button variant=\"outline\" size=\"lg\" onClick={() => setStep(step - 1)}>{t('common.back')}</Button>\n )}\n {isLast ? (\n <Button variant=\"default\" size=\"lg\" onClick={onComplete}>\n <Check className=\"h-4 w-4\" /> {t('inventory.onboarding.start')}\n </Button>\n ) : (\n <Button variant=\"default\" size=\"lg\" onClick={() => setStep(step + 1)}>\n {step === 0 ? t('inventory.onboarding.getStarted') : t('common.continue')} <ChevronRight className=\"h-4 w-4\" />\n </Button>\n )}\n </div>\n {step === 0 && (\n <button onClick={onComplete} className=\"text-xs text-muted-foreground hover:text-foreground transition-colors\">\n {t('inventory.onboarding.skip')}\n </button>\n )}\n </div>\n </div>\n </div>\n )\n}\n","import React, { useState, useMemo } from 'react'\nimport type { StoreApi } from 'zustand/vanilla'\nimport { ModulePage, PageTransition, type ModuleNavItem } from '@fayz-ai/ui'\nimport { InventoryContextProvider, type ResolvedInventoryConfig } from '../context'\nimport type { InventoryDataProvider } from '../data/types'\nimport type { InventoryUIState } from '../store'\nimport type { PluginRegistryDef, PluginQuickAction } from '@fayz-ai/core'\nimport { useModuleNavigation, ModuleActionBar, createViewRouter, PluginSettingsPanel } from '@fayz-ai/admin'\nimport { useTranslation } from '@fayz-ai/core'\nimport { DashboardView } from './DashboardView'\nimport { ProductListView } from './ProductListView'\nimport { ProductCrudForm } from './ProductCrudForm'\nimport { ProductDetailView } from './ProductDetailView'\nimport { StockMovementView } from './StockMovementView'\nimport { MovementHistoryView } from './MovementHistoryView'\nimport { StockCountsView } from './StockCountsView'\nimport { StockCountFormView } from './StockCountFormView'\nimport { StockCountSessionView } from './StockCountSessionView'\nimport { RecipesView } from './RecipesView'\nimport { RecipeFormView } from './RecipeFormView'\nimport { RecipeDetailView } from './RecipeDetailView'\nimport { InventoryGeneralSettings } from '../components/InventoryGeneralSettings'\nimport { InventoryOnboarding } from '../components/InventoryOnboarding'\n\nfunction buildNav(config: ResolvedInventoryConfig, view: string, navigate: (v: string) => void, t: (key: string) => string): ModuleNavItem[] {\n const items: ModuleNavItem[] = [\n { id: 'dashboard', label: t('inventory.nav.dashboard'), icon: 'BarChart3', active: view === 'dashboard', onClick: () => navigate('dashboard') },\n ...(config.modules.products ? [{\n id: 'products', label: t('inventory.nav.products'), icon: 'Package', active: view.startsWith('products'),\n children: [\n { id: 'products-new', label: t('inventory.nav.new'), active: view === 'products-new', onClick: () => navigate('products-new') },\n { id: 'products-list', label: t('inventory.nav.list'), active: view === 'products-list' || view.startsWith('products-detail:') || view.startsWith('products-stock:'), onClick: () => navigate('products-list') },\n ],\n } as ModuleNavItem] : []),\n {\n id: 'stock', label: t('inventory.nav.stock'), icon: 'ArrowUpCircle',\n children: [\n { id: 'stock-entry', label: t('inventory.nav.entry'), active: view === 'stock-entry', onClick: () => navigate('stock-entry') },\n { id: 'stock-exit', label: t('inventory.nav.exit'), active: view === 'stock-exit', onClick: () => navigate('stock-exit') },\n // Before History on purpose: the parent tab flattens to the LAST child,\n // and \"Stock\" has always landed on History.\n { id: 'stock-counts', label: t('inventory.nav.counts'), active: view === 'stock-counts' || view.startsWith('stock-counts'), onClick: () => navigate('stock-counts') },\n { id: 'stock-history', label: t('inventory.nav.history'), active: view === 'stock-history', onClick: () => navigate('stock-history') },\n ],\n },\n ]\n\n if (config.modules.recipes) {\n items.push({\n id: 'recipes', label: config.labels.recipes, icon: 'BookOpen',\n children: [\n { id: 'recipes-list', label: config.labels.recipesList, active: view === 'recipes-list' || view.startsWith('recipes-detail:'), onClick: () => navigate('recipes-list') },\n { id: 'recipes-new', label: config.labels.recipesNew, active: view === 'recipes-new', onClick: () => navigate('recipes-new') },\n ],\n })\n }\n\n return items\n}\n\nexport function InventoryPage({ config, provider, store, registries }: {\n config: ResolvedInventoryConfig\n provider: InventoryDataProvider\n store: StoreApi<InventoryUIState>\n registries?: PluginRegistryDef[]\n}) {\n const t = useTranslation()\n const { view, direction, navigate } = useModuleNavigation('/inventory', {\n dashboard: 0,\n 'products-list': 0, 'products-new': 1, 'products-detail': 1,\n 'stock-entry': 1, 'stock-exit': 1, 'stock-history': 0, 'stock-counts': 0, 'stock-counts-new': 1,\n 'recipes-list': 0, 'recipes-new': 1, 'recipes-detail': 1,\n settings: 1,\n }, 'dashboard')\n\n const [onboardingComplete, setOnboardingComplete] = useState(() => {\n try { return localStorage.getItem('saas-core:inventory-onboarded') === 'true' } catch { return false }\n })\n\n const isSettings = view === 'settings'\n const isSummary = view === 'dashboard' || view === ''\n const nav = buildNav(config, view, navigate, t)\n\n const quickActions = useMemo<PluginQuickAction[]>(() => {\n const actions: PluginQuickAction[] = [\n // Dropped with the catalogue module: offering \"new product\" while the\n // screen is gone would dead-end the user.\n ...(config.modules.products ? [{\n id: 'new-product',\n label: t('inventory.quickActions.newProduct'),\n icon: 'Package',\n description: t('inventory.quickActions.newProductDesc'),\n action: () => navigate('products-new'),\n } as PluginQuickAction] : []),\n {\n id: 'stock-entry',\n label: t('inventory.quickActions.stockEntry'),\n icon: 'ArrowUpRight',\n description: t('inventory.quickActions.stockEntryDesc'),\n action: () => navigate('stock-entry'),\n },\n {\n id: 'stock-exit',\n label: t('inventory.quickActions.stockExit'),\n icon: 'ArrowDownRight',\n description: t('inventory.quickActions.stockExitDesc'),\n action: () => navigate('stock-exit'),\n },\n ]\n return actions\n }, [])\n\n if (!onboardingComplete) {\n return (\n <InventoryContextProvider config={config} provider={provider} store={store}>\n <InventoryOnboarding onComplete={() => { setOnboardingComplete(true); try { localStorage.setItem('saas-core:inventory-onboarded', 'true') } catch {} }} />\n </InventoryContextProvider>\n )\n }\n\n if (isSettings && registries && registries.length > 0) {\n return (\n <InventoryContextProvider config={config} provider={provider} store={store}>\n <PageTransition transitionKey=\"settings\" direction={direction}>\n <div style={{ padding: '24px' }}>\n <div style={{ marginBottom: '16px' }}>\n <h1 style={{ fontSize: '20px', fontWeight: 600, margin: 0 }}>{t('inventory.settingsPage.title')}</h1>\n <p style={{ color: 'var(--muted-foreground, #6b7280)', margin: '4px 0 0', fontSize: '14px' }}>\n {t('inventory.settingsPage.subtitle')}\n </p>\n </div>\n <PluginSettingsPanel\n title={t('inventory.settingsPage.title')}\n generalSettings={<InventoryGeneralSettings />}\n registries={registries}\n hostPluginId=\"inventory\"\n routeBase=\"/inventory/settings\"\n />\n </div>\n </PageTransition>\n </InventoryContextProvider>\n )\n }\n\n const renderView = createViewRouter([\n // Routes go with the module, not just the nav entry: leaving them mounted\n // keeps a second product form reachable by URL.\n ...(config.modules.products ? [\n { id: 'products', render: () => <ProductListView onNew={() => navigate('products-new')} onOpen={(id: string) => navigate(`products-detail:${id}`)} /> },\n { id: 'products-list', render: () => <ProductListView onNew={() => navigate('products-new')} onOpen={(id: string) => navigate(`products-detail:${id}`)} /> },\n { id: 'products-new', render: () => <ProductCrudForm onSaved={() => navigate('products-list')} /> },\n { id: 'products-edit', render: ({ id }: { id?: string }) => <ProductCrudForm editId={id!} onSaved={() => navigate(`products-detail:${id}`)} /> },\n { id: 'products-detail', render: ({ id }: { id?: string }) => <ProductDetailView productId={id!} onBack={() => navigate('products-list')} onEdit={() => navigate(`products-edit:${id}`)} /> },\n // The tab writes `/products/<id>/stock` into the URL, so that link has to\n // come back to the same page with the tab open.\n { id: 'products-stock', render: ({ id }: { id?: string }) => <ProductDetailView productId={id!} initialTab=\"stock\" onBack={() => navigate('products-list')} onEdit={() => navigate(`products-edit:${id}`)} /> },\n ] : []),\n { id: 'stock-entry', render: () => <StockMovementView defaultType=\"entry\" onSaved={() => navigate('stock-history')} /> },\n { id: 'stock-exit', render: () => <StockMovementView defaultType=\"exit\" onSaved={() => navigate('stock-history')} /> },\n { id: 'stock-history', render: () => <MovementHistoryView onViewDetail={(id) => navigate(`stock-detail:${id}`)} onNew={() => navigate('stock-entry')} onNewExit={() => navigate('stock-exit')} /> },\n { id: 'stock-detail', render: ({ id }) => {\n const movement = store.getState().movements.find((m) => m.id === id)\n return movement\n ? <StockMovementView defaultType={movement.movementType} viewMovement={movement} onSaved={() => navigate('stock-history')} />\n : <MovementHistoryView onViewDetail={(mid) => navigate(`stock-detail:${mid}`)} />\n } },\n // One route id for both: `/inventory/stock/counts/<uuid>` parses back as\n // `stock-counts:<id>`, not `stock-counts-detail:<id>`.\n { id: 'stock-counts', render: ({ id }: { id?: string }) => id\n ? <StockCountSessionView sessionId={id} onBack={() => navigate('stock-counts')} />\n : <StockCountsView onNew={() => navigate('stock-counts-new')} onOpen={(sid) => navigate(`stock-counts:${sid}`)} /> },\n { id: 'stock-counts-new', render: () => <StockCountFormView onOpened={(sid) => navigate(`stock-counts:${sid}`)} onCancel={() => navigate('stock-counts')} /> },\n { id: 'recipes', render: () => <RecipesView onNew={() => navigate('recipes-new')} onView={(id) => navigate(`recipes-detail:${id}`)} onNewForProduct={(pid) => navigate(`recipes-new:${pid}`)} /> },\n { id: 'recipes-list', render: () => <RecipesView onNew={() => navigate('recipes-new')} onView={(id) => navigate(`recipes-detail:${id}`)} onNewForProduct={(pid) => navigate(`recipes-new:${pid}`)} /> },\n { id: 'recipes-new', render: ({ id }: { id?: string }) => <RecipeFormView productId={id} onSaved={(rid) => rid ? navigate(`recipes-detail:${rid}`) : navigate('recipes-list')} /> },\n { id: 'recipes-detail', render: ({ id }) => <RecipeDetailView recipeId={id!} onBack={() => navigate('recipes-list')} /> },\n { id: 'dashboard', render: () => <DashboardView /> },\n ], 'dashboard')\n\n return (\n <InventoryContextProvider config={config} provider={provider} store={store}>\n <ModulePage\n title={config.labels.pageTitle}\n subtitle={config.labels.pageSubtitle}\n nav={nav}\n showHeader={isSummary}\n viewKey={view}\n direction={direction}\n headerAction={\n <ModuleActionBar\n quickActions={quickActions}\n settingsPath={registries && registries.length > 0 ? '/settings/inventory' : undefined}\n settingsLabel=\"Inventory Settings\"\n />\n }\n >\n {renderView(view)}\n </ModulePage>\n </InventoryContextProvider>\n )\n}\n","import React, { useEffect } from 'react'\nimport { ArrowUpRight, ArrowDownRight } from 'lucide-react'\nimport type { StoreApi } from 'zustand'\nimport type { DashboardWidgetDef } from '@fayz-ai/core'\nimport { useTranslation } from '@fayz-ai/core'\nimport {\n KpiCard, Card, CardHeader, CardTitle, CardContent,\n defineKpiWidget, defineCustomWidget,\n} from '@fayz-ai/ui'\nimport { InventoryContextProvider, useInventoryConfig, useInventoryStore, formatCurrency, type ResolvedInventoryConfig } from '../context'\nimport type { InventoryDataProvider } from '../data/types'\nimport type { InventoryUIState } from '../store'\n\nfunction useEnsureSummary() {\n const fetchSummary = useInventoryStore((s) => s.fetchSummary)\n useEffect(() => { void fetchSummary() }, [])\n}\n\nfunction StockValueKpi() {\n const t = useTranslation()\n const { currency } = useInventoryConfig()\n const summary = useInventoryStore((s) => s.summary)\n useEnsureSummary()\n return (\n <KpiCard label={t('inventory.dashboard.stockValue')} icon=\"BarChart3\"\n value={formatCurrency(summary?.totalStockValue ?? 0, currency)} sub={t('inventory.dashboard.totalValue')} />\n )\n}\n\nfunction TotalProductsKpi() {\n const t = useTranslation()\n const summary = useInventoryStore((s) => s.summary)\n useEnsureSummary()\n return <KpiCard label={t('inventory.dashboard.totalProducts')} icon=\"Package\" value={String(summary?.totalProducts ?? 0)} sub={t('inventory.dashboard.activeItems')} />\n}\n\nfunction LowStockKpi() {\n const t = useTranslation()\n const summary = useInventoryStore((s) => s.summary)\n useEnsureSummary()\n return <KpiCard label={t('inventory.dashboard.lowStock')} icon=\"AlertTriangle\" value={String(summary?.lowStockCount ?? 0)} sub={t('inventory.dashboard.belowMinimum')} />\n}\n\nfunction OutOfStockKpi() {\n const t = useTranslation()\n const summary = useInventoryStore((s) => s.summary)\n useEnsureSummary()\n return <KpiCard label={t('inventory.dashboard.outOfStock')} icon=\"TrendingDown\" value={String(summary?.outOfStockCount ?? 0)} sub={t('inventory.dashboard.needRestocking')} />\n}\n\nfunction RecentActivityPanel() {\n const t = useTranslation()\n const summary = useInventoryStore((s) => s.summary)\n useEnsureSummary()\n return (\n <Card>\n <CardHeader><CardTitle>{t('inventory.dashboard.recentActivity')}</CardTitle></CardHeader>\n <CardContent>\n <div className=\"flex items-center gap-4 text-sm\">\n <div className=\"flex items-center gap-1.5\">\n <ArrowUpRight className=\"h-3.5 w-3.5 text-success\" />\n <span className=\"text-muted-foreground\">{t('inventory.dashboard.entries')}</span>\n <span className=\"font-medium\">{summary?.movementsByType?.entry ?? 0}</span>\n </div>\n <div className=\"flex items-center gap-1.5\">\n <ArrowDownRight className=\"h-3.5 w-3.5 text-destructive\" />\n <span className=\"text-muted-foreground\">{t('inventory.dashboard.exits')}</span>\n <span className=\"font-medium\">{summary?.movementsByType?.exit ?? 0}</span>\n </div>\n </div>\n <p className=\"mt-2 text-xs text-muted-foreground\">{t('inventory.dashboard.last7Days')}</p>\n </CardContent>\n </Card>\n )\n}\n\nexport function createInventoryDashboardWidgets(ctx: {\n config: ResolvedInventoryConfig\n provider: InventoryDataProvider\n store: StoreApi<InventoryUIState>\n}): DashboardWidgetDef[] {\n const withCtx = (Inner: React.ComponentType): React.ComponentType<unknown> => {\n const Wrapped = () => (\n <InventoryContextProvider config={ctx.config} provider={ctx.provider} store={ctx.store}>\n <Inner />\n </InventoryContextProvider>\n )\n Wrapped.displayName = `InventoryWidget(${Inner.displayName ?? Inner.name})`\n return Wrapped\n }\n\n return [\n // Stock value is inventory's headline KPI on the global home; the rest are\n // home-hidden by default (shown on the inventory plugin-home, addable via Customize).\n defineKpiWidget({ id: 'inventory.kpi.stock-value', title: 'inventory.dashboard.stockValue', domain: 'inventory', defaultOrder: 0, component: withCtx(StockValueKpi) }),\n defineKpiWidget({ id: 'inventory.kpi.total-products', title: 'inventory.dashboard.totalProducts', domain: 'inventory', defaultOrder: 1, defaultVisible: false, component: withCtx(TotalProductsKpi) }),\n defineKpiWidget({ id: 'inventory.kpi.low-stock', title: 'inventory.dashboard.lowStock', domain: 'inventory', defaultOrder: 2, defaultVisible: false, component: withCtx(LowStockKpi) }),\n defineKpiWidget({ id: 'inventory.kpi.out-of-stock', title: 'inventory.dashboard.outOfStock', domain: 'inventory', defaultOrder: 3, defaultVisible: false, component: withCtx(OutOfStockKpi) }),\n defineCustomWidget({ id: 'inventory.panel.recent-activity', title: 'inventory.dashboard.recentActivity', domain: 'inventory', span: 2, defaultOrder: 10, surfaces: ['plugin-home'], component: withCtx(RecentActivityPanel) }),\n ]\n}\n","import type { InventoryDataProvider } from './types'\nimport type {\n Product, StockMovement, StockPosition, StockLocation, Supplier,\n Recipe, RecipeIngredient, RecipeGroup,\n StockCountSession, StockCountItem, ProductCategory,\n CreateProductInput, CreateStockMovementInput, CreateRecipeInput, CreateRecipeIngredientInput,\n OpenStockCountInput, CloseStockCountResult,\n ProductQuery, MovementQuery,\n PaginatedResult, InventorySummary, MovementType,\n} from '../types'\nimport { isDivergent } from '../lib/stock-count'\n\nlet nextId = 1\nfunction uid(): string { return String(nextId++) }\nfunction now(): string { return new Date().toISOString() }\nfunction today(): string { return new Date().toISOString().slice(0, 10) }\n\nfunction paginate<T>(items: T[], page?: number, pageSize?: number): PaginatedResult<T> {\n const p = page ?? 1\n const ps = pageSize ?? 50\n const start = (p - 1) * ps\n return { data: items.slice(start, start + ps), total: items.length }\n}\n\ninterface MockStore {\n products: Product[]\n movements: StockMovement[]\n positions: StockPosition[]\n locations: StockLocation[]\n suppliers: Supplier[]\n recipes: Recipe[]\n recipeIngredients: RecipeIngredient[]\n recipeGroups: RecipeGroup[]\n countSessions: StockCountSession[]\n countItems: StockCountItem[]\n}\n\nfunction createStore(): MockStore {\n return {\n products: [],\n movements: [],\n positions: [],\n locations: [\n { id: uid(), name: 'Main Storage', description: 'Primary storage area', isActive: true, tenantId: 'mock-tenant', createdAt: now(), updatedAt: now() },\n ],\n suppliers: [\n { id: uid(), name: 'Main Supplier' },\n ],\n recipes: [],\n recipeIngredients: [],\n recipeGroups: [],\n countSessions: [],\n countItems: [],\n }\n}\n\nexport function createMockInventoryProvider(): InventoryDataProvider {\n const store = createStore()\n const tenantId = 'mock-tenant'\n\n /** The produced product's name and price, as the Supabase embed resolves them. */\n function withProduct(recipe: Recipe): Recipe {\n const product = store.products.find((p) => p.id === recipe.productId)\n return { ...recipe, productName: product?.name ?? recipe.productName, productSalePrice: product?.salePrice }\n }\n\n function withCostBasis(ing: RecipeIngredient): RecipeIngredient {\n const product = store.products.find((p) => p.id === ing.productId)\n if (!product) return ing\n return {\n ...ing,\n productName: product.name ?? ing.productName,\n costBasis: {\n cost: product.costPrice ?? 0,\n conversionFactor: product.conversionFactor,\n purchaseUnitId: product.purchaseUnitId,\n },\n }\n }\n\n /** Same slot key the Supabase provider uses: product + location + batch + expiry. */\n /** Mirrors the supabase provider: `set` makes the slot BE `amount`. Returns the effective delta. */\n function applyPositionDelta(\n input: Pick<CreateStockMovementInput, 'productId' | 'unitCost' | 'batchNumber' | 'expirationDate'>,\n locationId: string,\n amount: number,\n mode: 'add' | 'set' = 'add',\n ): number {\n const slot = store.positions.find((p) =>\n p.productId === input.productId &&\n p.stockLocationId === locationId &&\n (p.batchNumber ?? null) === (input.batchNumber ?? null) &&\n (p.expirationDate ?? null) === (input.expirationDate ?? null)\n )\n if (slot) {\n const current = slot.quantity\n slot.quantity = mode === 'set' ? amount : current + amount\n slot.unitCost = input.unitCost ?? slot.unitCost\n slot.updatedAt = now()\n return slot.quantity - current\n }\n store.positions.push({\n id: uid(),\n productId: input.productId,\n quantity: amount,\n unitCost: input.unitCost ?? 0,\n stockLocationId: locationId,\n stockLocationName: store.locations.find((l) => l.id === locationId)?.name,\n batchNumber: input.batchNumber,\n expirationDate: input.expirationDate,\n tenantId,\n createdAt: now(),\n })\n return amount\n }\n\n const provider: InventoryDataProvider = {\n // --- Products ---\n async getProducts(query: ProductQuery): Promise<PaginatedResult<Product>> {\n let results = [...store.products]\n if (query.productType) results = results.filter((p) => p.productType === query.productType)\n if (query.categoryId) results = results.filter((p) => p.categoryId === query.categoryId)\n if (query.isActive !== undefined) results = results.filter((p) => p.isActive === query.isActive)\n if (query.lowStockOnly) results = results.filter((p) => p.currentQuantity <= p.minQuantity)\n if (query.search) {\n const s = query.search.toLowerCase()\n results = results.filter((p) => p.name.toLowerCase().includes(s) || p.sku?.toLowerCase().includes(s) || p.barcode?.includes(s))\n }\n results.sort((a, b) => b.createdAt.localeCompare(a.createdAt))\n return paginate(results, query.page, query.pageSize)\n },\n\n async getProductById(id: string): Promise<Product | null> {\n return store.products.find((p) => p.id === id) ?? null\n },\n\n async createProduct(input: CreateProductInput): Promise<Product> {\n const product: Product = {\n id: uid(),\n name: input.name,\n description: input.description,\n sku: input.sku,\n barcode: input.barcode,\n brand: input.brand,\n categoryId: input.categoryId,\n productType: input.productType,\n purpose: input.purpose,\n currentQuantity: 0,\n minQuantity: input.minQuantity ?? 0,\n maxQuantity: input.maxQuantity,\n costPrice: input.costPrice ?? 0,\n salePrice: input.salePrice,\n measurementUnitId: input.measurementUnitId,\n purchaseUnitId: input.purchaseUnitId,\n conversionFactor: input.conversionFactor ?? 1,\n isActive: true,\n supplierId: input.supplierId,\n defaultLocationId: input.defaultLocationId,\n imageUrl: input.imageUrl,\n metadata: input.metadata,\n tenantId,\n createdAt: now(),\n updatedAt: now(),\n }\n store.products.push(product)\n return product\n },\n\n async updateProduct(id: string, data: Partial<Product>): Promise<Product> {\n const product = store.products.find((p) => p.id === id)\n if (!product) throw new Error(`Product ${id} not found`)\n Object.assign(product, data, { updatedAt: now() })\n return product\n },\n\n // --- Stock Movements ---\n async getMovements(query: MovementQuery): Promise<PaginatedResult<StockMovement>> {\n let results = [...store.movements]\n if (query.productId) results = results.filter((m) => m.productId === query.productId)\n if (query.movementType) {\n const types = Array.isArray(query.movementType) ? query.movementType : [query.movementType]\n results = results.filter((m) => types.includes(m.movementType))\n }\n if (query.stockLocationId) results = results.filter((m) => m.stockLocationId === query.stockLocationId)\n if (query.dateRange) {\n results = results.filter((m) => m.movementDate >= query.dateRange!.from && m.movementDate <= query.dateRange!.to)\n }\n if (query.search) {\n const s = query.search.toLowerCase()\n results = results.filter((m) => m.productName?.toLowerCase().includes(s) || m.notes?.toLowerCase().includes(s))\n }\n results.sort((a, b) => b.movementDate.localeCompare(a.movementDate))\n return paginate(results, query.page, query.pageSize)\n },\n\n async createMovement(input: CreateStockMovementInput): Promise<StockMovement> {\n const product = store.products.find((p) => p.id === input.productId)\n const location = input.stockLocationId ? store.locations.find((l) => l.id === input.stockLocationId) : undefined\n const unitCost = input.unitCost ?? product?.costPrice ?? 0\n\n const movement: StockMovement = {\n id: uid(),\n productId: input.productId,\n productName: product?.name,\n quantity: input.quantity,\n movementType: input.movementType,\n unitCost,\n totalCost: unitCost * input.quantity,\n stockLocationId: input.stockLocationId,\n stockLocationName: location?.name,\n destinationLocationId: input.destinationLocationId,\n supplierId: input.supplierId,\n supplierName: store.suppliers.find((s) => s.id === input.supplierId)?.name,\n documentNumber: input.documentNumber,\n reason: input.reason,\n notes: input.notes,\n batchNumber: input.batchNumber,\n expirationDate: input.expirationDate,\n movementDate: input.movementDate ?? today(),\n tenantId,\n createdAt: now(),\n }\n store.movements.push(movement)\n\n let stockDelta =\n input.movementType === 'entry' ? input.quantity\n : input.movementType === 'exit' || input.movementType === 'loss' ? -input.quantity\n : 0\n\n if (input.stockLocationId) {\n const slot = { ...input, unitCost }\n // `adjustment` declares effect 'set': the quantity is the counted truth,\n // not a delta. It used to be subtracted like an exit.\n const mode = input.movementType === 'adjustment' ? 'set' : 'add'\n const amount = mode === 'set'\n ? input.quantity\n : (input.movementType === 'entry' ? input.quantity : -input.quantity)\n const applied = applyPositionDelta(slot, input.stockLocationId, amount, mode)\n if (input.movementType === 'adjustment') stockDelta = applied\n\n if (input.movementType === 'transfer' && input.destinationLocationId) {\n applyPositionDelta(slot, input.destinationLocationId, input.quantity)\n stockDelta = 0\n }\n } else if (input.movementType === 'adjustment') {\n stockDelta = input.quantity - (product?.currentQuantity ?? 0)\n }\n\n if (product) {\n product.currentQuantity += stockDelta\n product.updatedAt = now()\n }\n\n return movement\n },\n\n async reverseMovement(movementId: string): Promise<void> {\n const index = store.movements.findIndex((m) => m.id === movementId)\n if (index === -1) throw new Error(`Movement ${movementId} not found`)\n const movement = store.movements[index]\n\n const product = store.products.find((p) => p.id === movement.productId)\n if (product) {\n if (movement.movementType === 'entry') product.currentQuantity -= movement.quantity\n else if (movement.movementType === 'exit' || movement.movementType === 'loss') product.currentQuantity += movement.quantity\n product.updatedAt = now()\n }\n\n if (movement.stockLocationId) {\n const slot = {\n productId: movement.productId,\n unitCost: movement.unitCost,\n batchNumber: movement.batchNumber,\n expirationDate: movement.expirationDate,\n }\n applyPositionDelta(slot, movement.stockLocationId, movement.movementType === 'entry' ? -movement.quantity : movement.quantity)\n if (movement.movementType === 'transfer' && movement.destinationLocationId) {\n applyPositionDelta(slot, movement.destinationLocationId, -movement.quantity)\n }\n }\n\n store.movements.splice(index, 1)\n },\n\n // --- Stock Positions ---\n async getPositions(productId: string): Promise<StockPosition[]> {\n return store.positions.filter((p) => p.productId === productId)\n },\n\n // --- Stock Locations ---\n async getLocations(): Promise<StockLocation[]> {\n return store.locations.filter((l) => l.isActive)\n },\n\n async createLocation(data): Promise<StockLocation> {\n const location: StockLocation = {\n id: uid(),\n name: data.name,\n description: data.description,\n isActive: true,\n unitId: data.unitId,\n tenantId,\n createdAt: now(),\n updatedAt: now(),\n }\n store.locations.push(location)\n return location\n },\n\n // --- Suppliers ---\n async getSuppliers(): Promise<Supplier[]> {\n return store.suppliers\n },\n\n // --- Categories ---\n async getCategories(): Promise<ProductCategory[]> {\n const seen = new Map<string, ProductCategory>()\n for (const product of store.products) {\n if (!product.categoryId || seen.has(product.categoryId)) continue\n seen.set(product.categoryId, {\n id: product.categoryId,\n name: product.categoryName ?? product.categoryId,\n isActive: true,\n tenantId,\n createdAt: now(),\n updatedAt: now(),\n })\n }\n return [...seen.values()].sort((a, b) => a.name.localeCompare(b.name))\n },\n\n // --- Stock counts ---\n async getCountSessions(): Promise<StockCountSession[]> {\n return [...store.countSessions]\n .sort((a, b) => b.openedAt.localeCompare(a.openedAt))\n .map((session) => {\n const items = store.countItems.filter((i) => i.sessionId === session.id)\n return {\n ...session,\n itemCount: items.length,\n countedCount: items.filter((i) => i.countedQuantity !== undefined).length,\n divergentCount: items.filter(isDivergent).length,\n }\n })\n },\n\n async getCountSession(id: string): Promise<StockCountSession | null> {\n return store.countSessions.find((s) => s.id === id) ?? null\n },\n\n async getCountItems(sessionId: string): Promise<StockCountItem[]> {\n return store.countItems\n .filter((i) => i.sessionId === sessionId)\n .sort((a, b) => (a.productName ?? '').localeCompare(b.productName ?? ''))\n },\n\n async openCountSession(input: OpenStockCountInput): Promise<StockCountSession> {\n const location = store.locations.find((l) => l.id === input.stockLocationId)\n if (!location) throw new Error(`Stock location ${input.stockLocationId} not found`)\n\n const session: StockCountSession = {\n id: uid(),\n reference: input.reference?.trim() || undefined,\n status: 'open',\n stockLocationId: input.stockLocationId,\n stockLocationName: location.name,\n categoryId: input.categoryId,\n blind: input.blind ?? true,\n notes: input.notes,\n openedAt: now(),\n tenantId,\n createdAt: now(),\n updatedAt: now(),\n }\n store.countSessions.push(session)\n\n // Snapshot AT OPEN: what the system believes now, frozen on the line.\n for (const product of store.products) {\n if (!product.isActive || product.productType === 'asset') continue\n if (input.categoryId && product.categoryId !== input.categoryId) continue\n const slots = store.positions.filter(\n (p) => p.productId === product.id && p.stockLocationId === input.stockLocationId,\n )\n store.countItems.push({\n id: uid(),\n sessionId: session.id,\n productId: product.id,\n productName: product.name,\n productSku: product.sku,\n systemQuantity: slots.reduce((sum, p) => sum + (p.quantity ?? 0), 0),\n unitCost: slots[0]?.unitCost ?? product.costPrice ?? 0,\n tenantId,\n createdAt: now(),\n updatedAt: now(),\n })\n }\n return session\n },\n\n async saveCountEntry(itemId: string, quantity: number | null, notes?: string): Promise<StockCountItem> {\n const item = store.countItems.find((i) => i.id === itemId)\n if (!item) throw new Error(`Count item ${itemId} not found`)\n item.countedQuantity = quantity == null ? undefined : quantity\n item.countedAt = quantity == null ? undefined : now()\n if (notes !== undefined) item.notes = notes || undefined\n item.updatedAt = now()\n\n const session = store.countSessions.find((s) => s.id === item.sessionId)\n if (session && session.status === 'open') session.status = 'counting'\n return item\n },\n\n async closeCountSession(sessionId: string, reason?: string): Promise<CloseStockCountResult> {\n const session = store.countSessions.find((s) => s.id === sessionId)\n if (!session) throw new Error(`Count session ${sessionId} not found`)\n if (session.status === 'closed') {\n return { sessionId, adjustmentsCreated: 0, alreadyClosed: true }\n }\n if (session.status === 'cancelled') throw new Error('This count was cancelled')\n\n let emitted = 0\n for (const item of store.countItems) {\n if (item.sessionId !== sessionId) continue\n // Uncounted lines and lines that already adjusted are both skipped.\n if (!isDivergent(item) || item.movementId) continue\n const counted = item.countedQuantity as number\n const delta = counted - item.systemQuantity\n\n const movement: StockMovement = {\n id: uid(),\n productId: item.productId,\n productName: item.productName,\n quantity: counted,\n movementType: 'adjustment',\n unitCost: item.unitCost,\n totalCost: item.unitCost * counted,\n stockLocationId: session.stockLocationId,\n stockLocationName: session.stockLocationName,\n reason: reason || 'Stock count',\n movementDate: today(),\n metadata: {\n countSessionId: sessionId,\n countItemId: item.id,\n systemQuantity: item.systemQuantity,\n countedQuantity: counted,\n variance: delta,\n },\n tenantId,\n createdAt: now(),\n }\n store.movements.push(movement)\n item.movementId = movement.id\n item.updatedAt = now()\n\n applyPositionDelta({ productId: item.productId, unitCost: item.unitCost }, session.stockLocationId, delta)\n const product = store.products.find((p) => p.id === item.productId)\n if (product) {\n product.currentQuantity += delta\n product.updatedAt = now()\n }\n emitted += 1\n }\n\n session.status = 'closed'\n session.closedAt = now()\n session.updatedAt = now()\n return { sessionId, adjustmentsCreated: emitted, alreadyClosed: false }\n },\n\n async cancelCountSession(sessionId: string): Promise<StockCountSession> {\n const session = store.countSessions.find((s) => s.id === sessionId)\n if (!session) throw new Error(`Count session ${sessionId} not found`)\n if (session.status === 'closed') throw new Error('A closed count cannot be cancelled')\n session.status = 'cancelled'\n session.updatedAt = now()\n return session\n },\n\n // --- Recipes ---\n async getRecipes(): Promise<Recipe[]> {\n return store.recipes.filter((r) => r.isActive).map(withProduct)\n },\n\n async getRecipeById(id: string): Promise<Recipe | null> {\n const recipe = store.recipes.find((r) => r.id === id)\n return recipe ? withProduct(recipe) : null\n },\n\n async getRecipeIngredients(recipeId: string): Promise<RecipeIngredient[]> {\n return store.recipeIngredients\n .filter((ri) => ri.recipeId === recipeId)\n .sort((a, b) => a.displayOrder - b.displayOrder)\n .map(withCostBasis)\n },\n\n async getAllRecipeIngredients(): Promise<RecipeIngredient[]> {\n return store.recipeIngredients.map(withCostBasis)\n },\n\n async getRecipeGroups(recipeId: string): Promise<RecipeGroup[]> {\n return store.recipeGroups.filter((g) => g.recipeId === recipeId).sort((a, b) => a.displayOrder - b.displayOrder)\n },\n\n async createRecipe(input: CreateRecipeInput): Promise<Recipe> {\n const product = store.products.find((p) => p.id === input.productId)\n const recipeId = uid()\n const recipe: Recipe = {\n id: recipeId,\n name: input.name,\n description: input.description,\n productId: input.productId,\n productName: product?.name,\n yieldQuantity: input.yieldQuantity,\n yieldUnitId: input.yieldUnitId,\n preparationTimeMinutes: input.preparationTimeMinutes,\n instructions: input.instructions,\n isActive: true,\n ingredientCount: input.ingredients.length,\n tenantId,\n createdAt: now(),\n updatedAt: now(),\n }\n store.recipes.push(recipe)\n\n for (const ing of input.ingredients) {\n const ingProduct = store.products.find((p) => p.id === ing.productId)\n store.recipeIngredients.push({\n id: uid(),\n recipeId,\n productId: ing.productId,\n productName: ingProduct?.name,\n quantity: ing.quantity,\n unitId: ing.unitId,\n displayOrder: ing.displayOrder ?? 0,\n notes: ing.notes,\n createdAt: now(),\n })\n }\n\n return recipe\n },\n\n async updateRecipe(id: string, patch: Partial<Recipe>): Promise<Recipe> {\n const recipe = store.recipes.find((r) => r.id === id)\n if (!recipe) throw new Error(`Recipe ${id} not found`)\n Object.assign(recipe, patch, { updatedAt: now() })\n return withProduct(recipe)\n },\n\n async addRecipeIngredient(recipeId: string, input: CreateRecipeIngredientInput): Promise<RecipeIngredient> {\n const product = store.products.find((p) => p.id === input.productId)\n const ingredient: RecipeIngredient = {\n id: uid(),\n recipeId,\n productId: input.productId,\n productName: product?.name,\n quantity: input.quantity,\n unitId: input.unitId,\n displayOrder: input.displayOrder ?? store.recipeIngredients.filter((i) => i.recipeId === recipeId).length,\n notes: input.notes,\n createdAt: now(),\n }\n store.recipeIngredients.push(ingredient)\n const recipe = store.recipes.find((r) => r.id === recipeId)\n if (recipe) recipe.ingredientCount = store.recipeIngredients.filter((i) => i.recipeId === recipeId).length\n return withCostBasis(ingredient)\n },\n\n // --- Summary ---\n async getSummary(): Promise<InventorySummary> {\n const active = store.products.filter((p) => p.isActive)\n const lowStock = active.filter((p) => p.currentQuantity <= p.minQuantity && p.currentQuantity > 0)\n const outOfStock = active.filter((p) => p.currentQuantity <= 0)\n const totalValue = active.reduce((sum, p) => sum + p.currentQuantity * p.costPrice, 0)\n\n const weekAgo = new Date()\n weekAgo.setDate(weekAgo.getDate() - 7)\n const weekAgoStr = weekAgo.toISOString().slice(0, 10)\n const recent = store.movements.filter((m) => m.movementDate >= weekAgoStr)\n\n const movementsByType: Record<MovementType, number> = { entry: 0, exit: 0, adjustment: 0, transfer: 0, loss: 0 }\n for (const m of recent) movementsByType[m.movementType]++\n\n return {\n totalProducts: active.length,\n lowStockCount: lowStock.length,\n outOfStockCount: outOfStock.length,\n totalStockValue: totalValue,\n recentMovementCount: recent.length,\n movementsByType,\n }\n },\n }\n\n return provider\n}\n","import type { InventoryDataProvider } from './types'\nimport type {\n Product, StockMovement, StockPosition, StockLocation, Supplier,\n Recipe, RecipeIngredient, RecipeGroup,\n StockCountSession, StockCountItem, ProductCategory,\n CreateProductInput, CreateStockMovementInput, CreateRecipeInput, CreateRecipeIngredientInput,\n OpenStockCountInput, CloseStockCountResult,\n ProductQuery, MovementQuery,\n PaginatedResult, InventorySummary, MovementType,\n} from '../types'\nimport { getSupabaseClientOptional, getActiveTenantId } from '@fayz-ai/core'\nimport { getInventoryTenantId } from '../lib/tenant'\nimport { T } from './tables'\n\nfunction getTenantId(): string | undefined {\n // Local override wins; else use the app's active tenant so writes pass RLS.\n return getInventoryTenantId() ?? getActiveTenantId()\n}\n\nfunction snakeToCamel(obj: Record<string, unknown>): Record<string, unknown> {\n const result: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(obj)) {\n const camelKey = key.replace(/_([a-z])/g, (_, c) => c.toUpperCase())\n result[camelKey] = value\n }\n return result\n}\n\nfunction camelToSnake(obj: Record<string, unknown>): Record<string, unknown> {\n const result: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(obj)) {\n if (key.startsWith('_')) continue\n const snakeKey = key.replace(/[A-Z]/g, (c) => `_${c.toLowerCase()}`)\n result[snakeKey] = value\n }\n return result\n}\n\n/** Embed alias for the 005 satellite — one round trip instead of an N+1. */\nconst PRODUCT_SELECT = `*, ${T.productDetails}(*)`\n\n/** A recipe carries the produced product's name and price for the CMV column. */\nconst RECIPE_SELECT = '*, products(name, price)'\n\n/** An ingredient line carries what costing it needs — see lib/recipe-cost.ts. */\nconst RECIPE_INGREDIENT_SELECT =\n `*, products(name, cost, ${T.productDetails}(conversion_factor, purchase_unit_id))`\n\n/** PostgREST returns a one-to-one embed as an object or a single-element array. */\nfunction embedded(value: unknown): Record<string, any> | undefined {\n const one = Array.isArray(value) ? value[0] : value\n return one && typeof one === 'object' ? (one as Record<string, any>) : undefined\n}\n\n/** The row without its embeds — snakeToCamel would otherwise carry them through\n * under mangled keys (`plgInventoryRecipeGroups`). */\nfunction withoutEmbeds(row: Record<string, any>, keys: string[]): Record<string, any> {\n const copy = { ...row }\n for (const key of keys) delete copy[key]\n return copy\n}\n\nfunction mapRecipeRow(row: Record<string, any>): Recipe {\n const recipe = snakeToCamel(withoutEmbeds(row, ['products'])) as any\n const product = embedded(row.products)\n if (product) {\n recipe.productName = product.name ?? recipe.productName\n recipe.productSalePrice = product.price ?? undefined\n }\n return recipe as Recipe\n}\n\nfunction mapRecipeIngredientRow(row: Record<string, any>): RecipeIngredient {\n const ing = snakeToCamel(withoutEmbeds(row, ['products', T.recipeGroups])) as any\n const group = embedded(row[T.recipeGroups])\n if (group) ing.groupName = group.name\n const product = embedded(row.products)\n if (product) {\n const details = embedded(product[T.productDetails])\n ing.productName = product.name ?? ing.productName\n ing.costBasis = {\n cost: Number(product.cost) || 0,\n conversionFactor: details?.conversion_factor ?? undefined,\n purchaseUnitId: details?.purchase_unit_id ?? undefined,\n }\n }\n return ing as RecipeIngredient\n}\n\n/** A session carries where and what it counts, resolved for the list. */\nconst COUNT_SESSION_SELECT =\n `*, ${T.stockLocations}(name), ${T.productCategories}(name)`\n\nfunction mapCountSessionRow(row: Record<string, any>): StockCountSession {\n const session = snakeToCamel(\n withoutEmbeds(row, [T.stockLocations, T.productCategories]),\n ) as any\n session.stockLocationName = embedded(row[T.stockLocations])?.name\n session.categoryName = embedded(row[T.productCategories])?.name\n session.blind = row.blind ?? true\n return session as StockCountSession\n}\n\nfunction mapCountItemRow(row: Record<string, any>): StockCountItem {\n const item = snakeToCamel(withoutEmbeds(row, ['products'])) as any\n const product = embedded(row.products)\n if (product) {\n item.productName = product.name\n item.productSku = product.sku ?? undefined\n }\n item.systemQuantity = Number(row.system_quantity) || 0\n // NULL stays undefined: nobody counted this line, which is not zero.\n item.countedQuantity = row.counted_quantity == null ? undefined : Number(row.counted_quantity)\n item.unitCost = Number(row.unit_cost) || 0\n return item as StockCountItem\n}\n\n/**\n * Map a public.products row to our Product type.\n *\n * Products are the spine archetype, so anything inventory-specific lives either\n * in `metadata` (free-form attributes) or in plg_inventory_product_details (the\n * things that are foreign keys and need referential integrity).\n */\nfunction mapProductRow(row: Record<string, any>): Product {\n const meta = row.metadata ?? {}\n // PostgREST returns an embedded one-to-one as an object or a single-element\n // array depending on how it inferred the relationship.\n const rawDetails = row[T.productDetails]\n const d = (Array.isArray(rawDetails) ? rawDetails[0] : rawDetails) ?? {}\n return {\n id: row.id,\n name: row.name,\n description: row.description,\n sku: row.sku,\n barcode: meta.barcode,\n brand: meta.brand,\n productType: meta.productType ?? 'sale',\n currentQuantity: row.stock ?? 0,\n minQuantity: row.min_stock ?? 0,\n maxQuantity: meta.maxQuantity,\n costPrice: row.cost ?? 0,\n salePrice: row.price,\n categoryId: d.category_id ?? undefined,\n measurementUnitId: d.measurement_unit_id ?? undefined,\n purchaseUnitId: d.purchase_unit_id ?? undefined,\n conversionFactor: d.conversion_factor ?? undefined,\n supplierId: d.supplier_id ?? undefined,\n defaultLocationId: d.default_location_id ?? undefined,\n purpose: d.purpose ?? undefined,\n isActive: row.is_active ?? true,\n imageUrl: row.image_url,\n metadata: meta,\n tenantId: row.tenant_id,\n createdAt: row.created_at,\n updatedAt: row.updated_at,\n }\n}\n\n/** The satellite columns, or null when the caller touched none of them. */\nfunction productDetailsRow(\n input: Partial<CreateProductInput>,\n): Record<string, unknown> | null {\n const row: Record<string, unknown> = {}\n if (input.categoryId !== undefined) row.category_id = input.categoryId || null\n if (input.measurementUnitId !== undefined) row.measurement_unit_id = input.measurementUnitId || null\n if (input.purchaseUnitId !== undefined) row.purchase_unit_id = input.purchaseUnitId || null\n if (input.conversionFactor !== undefined) row.conversion_factor = input.conversionFactor ?? 1\n if (input.supplierId !== undefined) row.supplier_id = input.supplierId || null\n if (input.defaultLocationId !== undefined) row.default_location_id = input.defaultLocationId || null\n if (input.purpose !== undefined) row.purpose = input.purpose || null\n return Object.keys(row).length > 0 ? row : null\n}\n\n/**\n * Move one (product, location, batch, expiry) slot, and report how much the\n * on-hand total actually changed.\n *\n * `mode: 'add'` shifts the slot by `amount`; `mode: 'set'` makes the slot BE\n * `amount`. The distinction is the movement vocabulary's: an `adjustment`\n * declares `effect: 'set'` — it is the counted truth, not a delta — while entry\n * and exit are deltas. Returning the effective delta is what lets the caller\n * keep `products.stock` in step without re-reading the slot.\n *\n * The slot is identified by the full key of uq_..._slot (006), not just\n * product+location — before that index existed a product could hold several\n * rows per location and this read picked an arbitrary one. On the insert race\n * we retry once against the row the other writer just created; the unique index\n * is what makes that retry correct instead of producing a second row.\n */\nasync function applyPositionDelta(\n pub: any,\n tenantId: string | undefined,\n input: CreateStockMovementInput,\n locationId: string,\n amount: number,\n mode: 'add' | 'set' = 'add',\n): Promise<number> {\n const slot = (qb: any) => qb\n .eq('product_id', input.productId)\n .eq('stock_location_id', locationId)\n .is('batch_number', input.batchNumber ?? null)\n .is('expiration_date', input.expirationDate ?? null)\n\n const bump = async (): Promise<number | null> => {\n const { data: existing, error } = await slot(\n pub.from(T.stockPositions).select('id, quantity'),\n ).maybeSingle()\n if (error) throw new Error(error.message)\n if (!existing) return null\n const current = Number(existing.quantity) || 0\n const next = mode === 'set' ? amount : current + amount\n const { error: updateError } = await pub.from(T.stockPositions)\n .update({ quantity: next, unit_cost: input.unitCost ?? 0 })\n .eq('id', existing.id)\n if (updateError) throw new Error(updateError.message)\n return next - current\n }\n\n const bumped = await bump()\n if (bumped !== null) return bumped\n\n const { error: insertError } = await pub.from(T.stockPositions).insert({\n tenant_id: tenantId,\n product_id: input.productId,\n stock_location_id: locationId,\n quantity: amount,\n unit_cost: input.unitCost ?? 0,\n batch_number: input.batchNumber ?? null,\n expiration_date: input.expirationDate ?? null,\n })\n if (!insertError) return amount\n\n // 23505 = another writer created the slot between our read and our insert.\n if ((insertError as any).code === '23505') {\n const retried = await bump()\n if (retried !== null) return retried\n }\n throw new Error(insertError.message)\n}\n\nexport function createSupabaseInventoryProvider(): InventoryDataProvider {\n // Lazy resolution — Supabase client may not exist at factory time\n // but will be available when methods are called (after createSaasApp initializes it)\n function getClients() {\n const supabase = getSupabaseClientOptional() as any\n if (!supabase) throw new Error('Supabase not initialized')\n return { core: supabase, pub: supabase }\n }\n\n const provider: InventoryDataProvider = {\n // --- Products (public.products) ---\n async getProducts(query: ProductQuery): Promise<PaginatedResult<Product>> {\n const { core, pub } = getClients()\n // `!inner` only when filtering on a satellite column, so products without\n // a details row are not dropped from an unfiltered list.\n const select = query.categoryId ? `*, ${T.productDetails}!inner(*)` : PRODUCT_SELECT\n let qb = core.from('products').select(select, { count: 'exact' })\n if (query.search) qb = qb.ilike('name', `%${query.search}%`)\n // productType lives in the metadata JSON column → filter on metadata->>productType.\n if (query.productType) qb = qb.eq('metadata->>productType', query.productType)\n if (query.categoryId) qb = qb.eq(`${T.productDetails}.category_id`, query.categoryId)\n if (query.isActive !== undefined) qb = qb.eq('is_active', query.isActive)\n if (query.lowStockOnly) qb = qb.lte('stock', 0) // simplified\n const page = query.page ?? 1\n const pageSize = query.pageSize ?? 50\n qb = qb.range((page - 1) * pageSize, page * pageSize - 1).order('created_at', { ascending: false })\n const { data, count } = await qb\n return { data: (data ?? []).map(mapProductRow), total: count ?? 0 }\n },\n\n async getProductById(id: string): Promise<Product | null> {\n const { core } = getClients()\n const { data } = await core.from('products').select(PRODUCT_SELECT).eq('id', id).single()\n return data ? mapProductRow(data) : null\n },\n\n async createProduct(input: CreateProductInput): Promise<Product> {\n const { core } = getClients()\n const tenantId = getTenantId()\n const row: Record<string, unknown> = {\n tenant_id: tenantId,\n name: input.name,\n description: input.description,\n sku: input.sku,\n price: input.salePrice ?? 0,\n cost: input.costPrice ?? 0,\n stock: 0,\n min_stock: input.minQuantity ?? 0,\n is_active: true,\n image_url: input.imageUrl,\n metadata: { productType: input.productType, barcode: input.barcode, brand: input.brand, maxQuantity: input.maxQuantity },\n }\n const { data, error } = await core.from('products').insert(row).select().single()\n if (error) throw new Error(error.message)\n\n const details = productDetailsRow(input)\n if (details) {\n const { error: detailsError } = await core.from(T.productDetails)\n .upsert({ ...details, product_id: data!.id, tenant_id: tenantId }, { onConflict: 'product_id' })\n if (detailsError) throw new Error(detailsError.message)\n }\n return (await provider.getProductById(data!.id)) ?? mapProductRow(data!)\n },\n\n async updateProduct(id: string, partial: Partial<Product>): Promise<Product> {\n const { core } = getClients()\n const tenantId = getTenantId()\n const row: Record<string, unknown> = {}\n if (partial.name !== undefined) row.name = partial.name\n if (partial.description !== undefined) row.description = partial.description\n if (partial.sku !== undefined) row.sku = partial.sku\n if (partial.salePrice !== undefined) row.price = partial.salePrice\n if (partial.costPrice !== undefined) row.cost = partial.costPrice\n if (partial.minQuantity !== undefined) row.min_stock = partial.minQuantity\n if (partial.isActive !== undefined) row.is_active = partial.isActive\n if (partial.imageUrl !== undefined) row.image_url = partial.imageUrl\n\n const metaPatch: Record<string, unknown> = {}\n if (partial.productType !== undefined) metaPatch.productType = partial.productType\n if (partial.barcode !== undefined) metaPatch.barcode = partial.barcode\n if (partial.brand !== undefined) metaPatch.brand = partial.brand\n if (partial.maxQuantity !== undefined) metaPatch.maxQuantity = partial.maxQuantity\n if (Object.keys(metaPatch).length > 0) {\n // Merge, never replace: this used to assign a fresh object, which wiped\n // every key the caller did not happen to mention (maxQuantity most of\n // all) and wrote undefined for the ones it mentioned but left unset.\n const { data: current } = await core.from('products').select('metadata').eq('id', id).single()\n row.metadata = { ...(current?.metadata ?? {}), ...metaPatch }\n }\n\n if (Object.keys(row).length > 0) {\n const { error } = await core.from('products').update(row).eq('id', id)\n if (error) throw new Error(error.message)\n }\n\n const details = productDetailsRow(partial)\n if (details) {\n const { error: detailsError } = await core.from(T.productDetails)\n .upsert({ ...details, product_id: id, tenant_id: tenantId }, { onConflict: 'product_id' })\n if (detailsError) throw new Error(detailsError.message)\n }\n\n const updated = await provider.getProductById(id)\n if (!updated) throw new Error(`Product ${id} not found after update`)\n return updated\n },\n\n // --- Stock Movements (via view with product join — single query) ---\n async getMovements(query: MovementQuery): Promise<PaginatedResult<StockMovement>> {\n const { pub } = getClients()\n // Single query via v_stock_movements view (JOINs with public.products)\n let qb = pub.from('v_stock_movements').select('*', { count: 'exact' })\n if (query.productId) qb = qb.eq('product_id', query.productId)\n if (query.movementType) {\n const types = Array.isArray(query.movementType) ? query.movementType : [query.movementType]\n qb = qb.in('movement_type', types)\n }\n if (query.stockLocationId) qb = qb.eq('stock_location_id', query.stockLocationId)\n if (query.dateRange) qb = qb.gte('movement_date', query.dateRange.from).lte('movement_date', query.dateRange.to)\n if (query.search) qb = qb.ilike('product_name', `%${query.search}%`)\n const page = query.page ?? 1\n const pageSize = query.pageSize ?? 50\n qb = qb.range((page - 1) * pageSize, page * pageSize - 1).order('movement_date', { ascending: false })\n const { data, count } = await qb\n\n const movements = (data ?? []).map((r: any) => {\n const mov = snakeToCamel(r) as any\n mov.productName = r.product_name ?? mov.productName\n mov.productSku = r.product_sku ?? mov.productSku\n // View may include location names if the updated migration has been applied\n mov.stockLocationName = r.stock_location_name ?? mov.stockLocationName\n mov.destinationLocationName = r.destination_location_name ?? mov.destinationLocationName\n return mov as StockMovement\n })\n\n // Resolve location names if not provided by the view\n const needsLocationResolve = movements.some(\n (m: any) => (m.stockLocationId && !m.stockLocationName) || (m.destinationLocationId && !m.destinationLocationName)\n )\n if (needsLocationResolve) {\n const locationIds = new Set<string>()\n for (const m of movements) {\n if (m.stockLocationId && !m.stockLocationName) locationIds.add(m.stockLocationId)\n if (m.destinationLocationId && !m.destinationLocationName) locationIds.add(m.destinationLocationId)\n }\n if (locationIds.size > 0) {\n const { data: locs } = await pub.from(T.stockLocations).select('id, name').in('id', [...locationIds])\n const locMap = new Map((locs ?? []).map((l: any) => [l.id, l.name]))\n for (const m of movements) {\n if (m.stockLocationId && !m.stockLocationName) m.stockLocationName = locMap.get(m.stockLocationId)\n if (m.destinationLocationId && !m.destinationLocationName) m.destinationLocationName = locMap.get(m.destinationLocationId)\n }\n }\n }\n\n return { data: movements, total: count ?? 0 }\n },\n\n async createMovement(input: CreateStockMovementInput): Promise<StockMovement> {\n const { core, pub } = getClients()\n const tenantId = getTenantId()\n const unitCost = input.unitCost ?? 0\n const row = {\n ...camelToSnake(input as any),\n tenant_id: tenantId,\n unit_cost: unitCost,\n total_cost: unitCost * input.quantity,\n movement_date: input.movementDate ?? new Date().toISOString().slice(0, 10),\n }\n const { data, error } = await pub.from(T.stockMovements).insert(row).select().single()\n if (error) throw new Error(error.message)\n\n // Fetch product name + current stock for the response and stock update\n const { data: product } = await core.from('products').select('id, name, stock').eq('id', input.productId).single()\n\n // How much on-hand actually moved. For entry/exit/loss it is the typed\n // quantity signed; for an adjustment it is only known once the slot has\n // been read, because an adjustment SETS the slot rather than shifting it.\n let stockDelta =\n input.movementType === 'entry' ? input.quantity\n : input.movementType === 'exit' || input.movementType === 'loss' ? -input.quantity\n : 0\n\n // Update stock_positions when a location is specified. This is NOT\n // best-effort: it used to swallow every failure behind a console.warn,\n // which meant the ledger and the on-hand balance could silently diverge —\n // the single worst thing an inventory module can do quietly.\n if (input.stockLocationId) {\n // An `adjustment` declares effect 'set' in the movement vocabulary: the\n // quantity is the counted truth. It used to be subtracted like an exit,\n // so counting 10 of something you had 10 of drove the slot to zero.\n const mode = input.movementType === 'adjustment' ? 'set' : 'add'\n const amount = mode === 'set'\n ? input.quantity\n : (input.movementType === 'entry' ? input.quantity : -input.quantity)\n const applied = await applyPositionDelta(pub, tenantId, input, input.stockLocationId, amount, mode)\n if (input.movementType === 'adjustment') stockDelta = applied\n\n // A transfer leaves the origin and arrives at the destination, so the\n // product's total is unchanged.\n if (input.movementType === 'transfer' && input.destinationLocationId) {\n await applyPositionDelta(pub, tenantId, input, input.destinationLocationId, input.quantity)\n stockDelta = 0\n }\n } else if (input.movementType === 'adjustment') {\n // No location to read a slot from — the counted quantity is the total.\n stockDelta = input.quantity - (Number(product?.stock) || 0)\n }\n\n if (product && stockDelta !== 0) {\n await core.from('products').update({ stock: (Number(product.stock) || 0) + stockDelta }).eq('id', input.productId)\n }\n\n const movement = snakeToCamel(data) as any\n movement.productName = product?.name\n // Resolve location name\n if (input.stockLocationId) {\n const { data: loc } = await pub.from(T.stockLocations).select('name').eq('id', input.stockLocationId).single()\n movement.stockLocationName = loc?.name\n }\n if (input.destinationLocationId) {\n const { data: loc } = await pub.from(T.stockLocations).select('name').eq('id', input.destinationLocationId).single()\n movement.destinationLocationName = loc?.name\n }\n if (input.supplierId) {\n const { data: supplier } = await core.from('people').select('name').eq('id', input.supplierId).single()\n movement.supplierName = supplier?.name\n }\n return movement as StockMovement\n },\n\n /**\n * Undo a movement: the ledger row goes and the stock it moved comes back.\n * Position and on-hand are unwound with the same rules createMovement\n * applied, so a reversal cannot leave the two disagreeing.\n */\n async reverseMovement(movementId: string): Promise<void> {\n const { core, pub } = getClients()\n const tenantId = getTenantId()\n const { data: row, error } = await pub.from(T.stockMovements).select('*').eq('id', movementId).single()\n if (error) throw new Error(error.message)\n if (!row) throw new Error(`Movement ${movementId} not found`)\n\n const movementType = row.movement_type as MovementType\n const quantity = Number(row.quantity) || 0\n // Same slot key the movement wrote to; unit_cost follows the undone\n // movement because no earlier cost survives on the position.\n const slot: CreateStockMovementInput = {\n productId: row.product_id,\n quantity,\n movementType,\n unitCost: row.unit_cost ?? 0,\n batchNumber: row.batch_number ?? undefined,\n expirationDate: row.expiration_date ?? undefined,\n }\n\n // The ledger row goes FIRST, and `select()` is what makes a delete the RLS\n // refused fail loudly — PostgREST reports deleting nothing as success, and\n // unwinding the stock behind that would leave the two disagreeing.\n const { data: deleted, error: deleteError } = await pub.from(T.stockMovements)\n .delete().eq('id', movementId).select('id')\n if (deleteError) throw new Error(deleteError.message)\n if (!deleted || deleted.length === 0) throw new Error(`Movement ${movementId} could not be deleted`)\n\n if (movementType !== 'adjustment' && movementType !== 'transfer') {\n const { data: product } = await core.from('products').select('stock').eq('id', row.product_id).single()\n if (product) {\n const delta = movementType === 'entry' ? -quantity : quantity\n await core.from('products').update({ stock: (product.stock ?? 0) + delta }).eq('id', row.product_id)\n }\n }\n\n if (row.stock_location_id) {\n await applyPositionDelta(pub, tenantId, slot, row.stock_location_id, movementType === 'entry' ? -quantity : quantity)\n if (movementType === 'transfer' && row.destination_location_id) {\n await applyPositionDelta(pub, tenantId, slot, row.destination_location_id, -quantity)\n }\n }\n },\n\n // --- Stock Positions ---\n async getPositions(productId: string): Promise<StockPosition[]> {\n const { pub } = getClients()\n const { data } = await pub.from(T.stockPositions).select('*').eq('product_id', productId)\n const positions: StockPosition[] = (data ?? []).map((r: any) => snakeToCamel(r) as unknown as StockPosition)\n\n const locationIds = [...new Set(positions.map((p) => p.stockLocationId).filter(Boolean) as string[])]\n if (locationIds.length > 0) {\n const { data: locs } = await pub.from(T.stockLocations).select('id, name').in('id', locationIds)\n const byId = new Map<string, string>((locs ?? []).map((l: any) => [l.id, l.name]))\n for (const p of positions) {\n if (p.stockLocationId) p.stockLocationName = byId.get(p.stockLocationId)\n }\n }\n return positions\n },\n\n // --- Stock Locations ---\n async getLocations(): Promise<StockLocation[]> {\n const { pub } = getClients()\n const { data } = await pub.from(T.stockLocations).select('*').eq('is_active', true).order('name')\n return (data ?? []).map((r: any) => snakeToCamel(r) as unknown as StockLocation)\n },\n\n async createLocation(input): Promise<StockLocation> {\n const { pub } = getClients()\n const tenantId = getTenantId()\n const { data } = await pub.from(T.stockLocations).insert({ ...camelToSnake(input as any), tenant_id: tenantId }).select().single()\n return snakeToCamel(data!) as unknown as StockLocation\n },\n\n // --- Suppliers (same rows the suppliers registry edits) ---\n async getSuppliers(): Promise<Supplier[]> {\n const { core } = getClients()\n const { data } = await core.from('people')\n .select('id, name, document_number, phone')\n .eq('kind', 'supplier').eq('is_active', true)\n .order('name').limit(200)\n return (data ?? []).map((r: any) => ({\n id: r.id, name: r.name,\n documentNumber: r.document_number ?? undefined,\n phone: r.phone ?? undefined,\n }))\n },\n\n // --- Categories ---\n async getCategories(): Promise<ProductCategory[]> {\n const { pub } = getClients()\n const { data } = await pub.from(T.productCategories).select('*').eq('is_active', true).order('name')\n return (data ?? []).map((r: any) => snakeToCamel(r) as unknown as ProductCategory)\n },\n\n // --- Stock counts ---\n async getCountSessions(): Promise<StockCountSession[]> {\n const { pub } = getClients()\n const { data } = await pub.from(T.countSessions)\n .select(COUNT_SESSION_SELECT).order('opened_at', { ascending: false }).limit(100)\n const sessions: StockCountSession[] = (data ?? []).map(mapCountSessionRow)\n if (sessions.length === 0) return sessions\n\n // The progress columns in one round trip instead of a query per row.\n const { data: lines } = await pub.from(T.countItems)\n .select('session_id, system_quantity, counted_quantity')\n .in('session_id', sessions.map((s) => s.id))\n const tally = new Map<string, { total: number; counted: number; divergent: number }>()\n for (const line of lines ?? []) {\n const bucket = tally.get(line.session_id) ?? { total: 0, counted: 0, divergent: 0 }\n bucket.total += 1\n if (line.counted_quantity != null) {\n bucket.counted += 1\n if (Number(line.counted_quantity) !== Number(line.system_quantity)) bucket.divergent += 1\n }\n tally.set(line.session_id, bucket)\n }\n for (const session of sessions) {\n const bucket = tally.get(session.id)\n session.itemCount = bucket?.total ?? 0\n session.countedCount = bucket?.counted ?? 0\n session.divergentCount = bucket?.divergent ?? 0\n }\n return sessions\n },\n\n async getCountSession(id: string): Promise<StockCountSession | null> {\n const { pub } = getClients()\n const { data } = await pub.from(T.countSessions).select(COUNT_SESSION_SELECT).eq('id', id).maybeSingle()\n return data ? mapCountSessionRow(data) : null\n },\n\n async getCountItems(sessionId: string): Promise<StockCountItem[]> {\n const { pub } = getClients()\n const { data } = await pub.from(T.countItems)\n .select('*, products(name, sku)').eq('session_id', sessionId)\n const items: StockCountItem[] = (data ?? []).map(mapCountItemRow)\n return items.sort((a, b) => (a.productName ?? '').localeCompare(b.productName ?? ''))\n },\n\n async openCountSession(input: OpenStockCountInput): Promise<StockCountSession> {\n const { pub } = getClients()\n // The snapshot has to be one consistent read, so the RPC does both.\n const { data, error } = await pub.rpc('inventory_open_count_session', {\n p_stock_location_id: input.stockLocationId,\n p_category_id: input.categoryId ?? null,\n p_reference: input.reference ?? null,\n p_blind: input.blind ?? true,\n p_notes: input.notes ?? null,\n })\n if (error) throw new Error(error.message)\n const session = await provider.getCountSession(data as string)\n if (!session) throw new Error('Count session could not be read after opening')\n return session\n },\n\n async saveCountEntry(itemId: string, quantity: number | null, notes?: string): Promise<StockCountItem> {\n const { pub } = getClients()\n const row: Record<string, unknown> = {\n counted_quantity: quantity,\n counted_at: quantity == null ? null : new Date().toISOString(),\n updated_at: new Date().toISOString(),\n }\n if (notes !== undefined) row.notes = notes || null\n const { data, error } = await pub.from(T.countItems)\n .update(row).eq('id', itemId).select('*, products(name, sku)').single()\n if (error) throw new Error(error.message)\n\n // The first entry typed is what turns an open session into a count.\n await pub.from(T.countSessions)\n .update({ status: 'counting', updated_at: new Date().toISOString() })\n .eq('id', data.session_id).eq('status', 'open')\n return mapCountItemRow(data)\n },\n\n async closeCountSession(sessionId: string, reason?: string): Promise<CloseStockCountResult> {\n const { pub } = getClients()\n const { data, error } = await pub.rpc('inventory_close_count_session', {\n p_session_id: sessionId,\n p_reason: reason ?? null,\n })\n if (error) throw new Error(error.message)\n const result = (data ?? {}) as Record<string, any>\n if (result.ok === false) throw new Error(result.error ?? 'Could not close the count')\n return {\n sessionId,\n adjustmentsCreated: Number(result.adjustments_created) || 0,\n alreadyClosed: result.already_closed === true,\n }\n },\n\n async cancelCountSession(sessionId: string): Promise<StockCountSession> {\n const { pub } = getClients()\n // `.neq('status','closed')` is the fence: a closed count has already moved\n // stock and cancelling it would claim otherwise.\n const { error } = await pub.from(T.countSessions)\n .update({ status: 'cancelled', updated_at: new Date().toISOString() })\n .eq('id', sessionId).neq('status', 'closed')\n if (error) throw new Error(error.message)\n const session = await provider.getCountSession(sessionId)\n if (!session) throw new Error(`Count session ${sessionId} not found`)\n return session\n },\n\n // --- Recipes ---\n async getRecipes(): Promise<Recipe[]> {\n const { pub } = getClients()\n const { data } = await pub.from(T.recipes).select(RECIPE_SELECT).eq('is_active', true).order('name')\n return (data ?? []).map(mapRecipeRow)\n },\n\n async getRecipeById(id: string): Promise<Recipe | null> {\n const { pub } = getClients()\n const { data } = await pub.from(T.recipes).select(RECIPE_SELECT).eq('id', id).single()\n return data ? mapRecipeRow(data) : null\n },\n\n async getRecipeIngredients(recipeId: string): Promise<RecipeIngredient[]> {\n const { pub } = getClients()\n const { data } = await pub.from(T.recipeIngredients)\n .select(`${RECIPE_INGREDIENT_SELECT}, ${T.recipeGroups}(name)`)\n .eq('recipe_id', recipeId)\n .order('display_order')\n return (data ?? []).map(mapRecipeIngredientRow)\n },\n\n async getAllRecipeIngredients(): Promise<RecipeIngredient[]> {\n const { pub } = getClients()\n const { data } = await pub.from(T.recipeIngredients)\n .select(RECIPE_INGREDIENT_SELECT)\n .order('display_order')\n return (data ?? []).map(mapRecipeIngredientRow)\n },\n\n async getRecipeGroups(recipeId: string): Promise<RecipeGroup[]> {\n const { pub } = getClients()\n const { data } = await pub.from(T.recipeGroups).select('*').eq('recipe_id', recipeId).order('display_order')\n return (data ?? []).map((r: any) => snakeToCamel(r) as unknown as RecipeGroup)\n },\n\n async createRecipe(input: CreateRecipeInput): Promise<Recipe> {\n const { pub } = getClients()\n const tenantId = getTenantId()\n const { ingredients, ...recipeData } = input\n const { data: recipe } = await pub.from(T.recipes).insert({ ...camelToSnake(recipeData as any), tenant_id: tenantId }).select().single()\n if (recipe && ingredients.length > 0) {\n await pub.from(T.recipeIngredients).insert(\n ingredients.map((ing) => ({ ...camelToSnake(ing as any), recipe_id: recipe.id, tenant_id: tenantId }))\n )\n }\n return snakeToCamel(recipe!) as unknown as Recipe\n },\n\n async updateRecipe(id: string, patch: Partial<Recipe>): Promise<Recipe> {\n const { pub } = getClients()\n const row: Record<string, unknown> = {}\n if (patch.name !== undefined) row.name = patch.name\n if (patch.description !== undefined) row.description = patch.description\n if (patch.productId !== undefined) row.product_id = patch.productId || null\n if (patch.yieldQuantity !== undefined) row.yield_quantity = patch.yieldQuantity\n if (patch.preparationTimeMinutes !== undefined) row.preparation_time_minutes = patch.preparationTimeMinutes\n if (patch.instructions !== undefined) row.instructions = patch.instructions\n if (patch.isActive !== undefined) row.is_active = patch.isActive\n if (patch.metadata !== undefined) row.metadata = patch.metadata\n if (Object.keys(row).length > 0) {\n row.updated_at = new Date().toISOString()\n const { error } = await pub.from(T.recipes).update(row).eq('id', id)\n if (error) throw new Error(error.message)\n }\n const updated = await provider.getRecipeById(id)\n if (!updated) throw new Error(`Recipe ${id} not found after update`)\n return updated\n },\n\n async addRecipeIngredient(recipeId: string, input: CreateRecipeIngredientInput): Promise<RecipeIngredient> {\n const { pub } = getClients()\n const tenantId = getTenantId()\n const { data, error } = await pub.from(T.recipeIngredients)\n .insert({ ...camelToSnake(input as any), recipe_id: recipeId, tenant_id: tenantId })\n .select(RECIPE_INGREDIENT_SELECT).single()\n if (error) throw new Error(error.message)\n return mapRecipeIngredientRow(data)\n },\n\n // --- Summary ---\n async getSummary(): Promise<InventorySummary> {\n const { core, pub } = getClients()\n const { data: products } = await core.from('products').select('stock, min_stock, price, is_active').eq('is_active', true)\n const items = products ?? []\n const lowStock = items.filter((p: any) => p.stock > 0 && p.stock <= (p.min_stock ?? 0))\n const outOfStock = items.filter((p: any) => p.stock <= 0)\n const totalValue = items.reduce((sum: number, p: any) => sum + (p.stock ?? 0) * (p.price ?? 0), 0)\n\n const weekAgo = new Date()\n weekAgo.setDate(weekAgo.getDate() - 7)\n const { data: movements } = await pub.from(T.stockMovements).select('movement_type').gte('movement_date', weekAgo.toISOString().slice(0, 10))\n const movs = movements ?? []\n const movementsByType: Record<MovementType, number> = { entry: 0, exit: 0, adjustment: 0, transfer: 0, loss: 0 }\n for (const m of movs) movementsByType[m.movement_type as MovementType]++\n\n return {\n totalProducts: items.length,\n lowStockCount: lowStock.length,\n outOfStockCount: outOfStock.length,\n totalStockValue: totalValue,\n recentMovementCount: movs.length,\n movementsByType,\n }\n },\n }\n\n return provider\n}\n","import { createStore, type StoreApi } from 'zustand/vanilla'\nimport { dedup } from '@fayz-ai/admin'\nimport { toast } from '@fayz-ai/ui'\nimport type { InventoryDataProvider } from './data/types'\nimport type {\n Product, StockMovement, StockLocation, Recipe,\n InventorySummary, ProductQuery, MovementQuery,\n CreateProductInput, CreateStockMovementInput, CreateRecipeInput,\n} from './types'\n\nexport interface InventoryUIState {\n products: Product[]\n productsTotal: number\n productsLoading: boolean\n productQuery: ProductQuery\n\n movements: StockMovement[]\n movementsTotal: number\n movementsLoading: boolean\n\n locations: StockLocation[]\n locationsLoading: boolean\n\n recipes: Recipe[]\n recipesLoading: boolean\n\n summary: InventorySummary | null\n summaryLoading: boolean\n\n fetchSummary(): Promise<void>\n fetchProducts(query: ProductQuery): Promise<void>\n fetchMovements(query: MovementQuery): Promise<void>\n fetchLocations(): Promise<void>\n fetchRecipes(): Promise<void>\n createProduct(input: CreateProductInput): Promise<Product>\n createMovement(input: CreateStockMovementInput): Promise<StockMovement>\n createRecipe(input: CreateRecipeInput): Promise<Recipe>\n}\n\nexport function createInventoryStore(provider: InventoryDataProvider): StoreApi<InventoryUIState> {\n return createStore<InventoryUIState>((set, get) => ({\n products: [], productsTotal: 0, productsLoading: false, productQuery: {},\n movements: [], movementsTotal: 0, movementsLoading: false,\n locations: [], locationsLoading: false,\n recipes: [], recipesLoading: false,\n summary: null, summaryLoading: false,\n\n async fetchSummary() {\n return dedup('inv:summary', async () => {\n set({ summaryLoading: true })\n const summary = await provider.getSummary()\n set({ summary, summaryLoading: false })\n })\n },\n\n async fetchProducts(query) {\n const key = 'inv:products:' + JSON.stringify(query)\n return dedup(key, async () => {\n set({ productsLoading: true, productQuery: query })\n const result = await provider.getProducts(query)\n set({ products: result.data, productsTotal: result.total, productsLoading: false })\n })\n },\n\n async fetchMovements(query) {\n return dedup('inv:movements:' + JSON.stringify(query), async () => {\n set({ movementsLoading: true })\n const result = await provider.getMovements(query)\n set({ movements: result.data, movementsTotal: result.total, movementsLoading: false })\n })\n },\n\n async fetchLocations() {\n return dedup('inv:locations', async () => {\n set({ locationsLoading: true })\n const locations = await provider.getLocations()\n set({ locations, locationsLoading: false })\n })\n },\n\n async fetchRecipes() {\n set({ recipesLoading: true })\n const recipes = await provider.getRecipes()\n set({ recipes, recipesLoading: false })\n },\n\n async createProduct(input) {\n try {\n const product = await provider.createProduct(input)\n const query = get().productQuery\n const [result, summary] = await Promise.all([provider.getProducts(query), provider.getSummary()])\n set({ products: result.data, productsTotal: result.total, summary })\n toast.success('Product created')\n return product\n } catch (err: any) {\n toast.error('Failed to create product', { description: err?.message })\n throw err\n }\n },\n\n async createMovement(input) {\n try {\n const movement = await provider.createMovement(input)\n const [summary] = await Promise.all([provider.getSummary()])\n set({ summary })\n toast.success('Stock movement recorded')\n return movement\n } catch (err: any) {\n toast.error('Failed to record movement', { description: err?.message })\n throw err\n }\n },\n\n async createRecipe(input) {\n try {\n const recipe = await provider.createRecipe(input)\n const recipes = await provider.getRecipes()\n set({ recipes })\n toast.success('Recipe created')\n return recipe\n } catch (err: any) {\n toast.error('Failed to create recipe', { description: err?.message })\n throw err\n }\n },\n }))\n}\n","import type { PluginRegistryDef } from '@fayz-ai/core'\nimport type { EntityDef } from '@fayz-ai/core'\nimport { T } from './tables'\n\nconst supplierEntity: EntityDef = {\n name: 'Supplier',\n namePlural: 'Suppliers',\n icon: 'Building2',\n layout: 'person',\n displayField: 'name',\n defaultSort: 'name',\n fields: [\n { key: 'name', label: 'Name', type: 'text', required: true, showInTable: true, searchable: true },\n { key: 'phone', label: 'Phone', type: 'phone', showInTable: true },\n { key: 'email', label: 'Email', type: 'email', showInTable: true },\n { key: 'documentNumber', label: 'Tax ID', type: 'text', showInTable: true },\n // No address field: a supplier has as many as the operation needs (the\n // office that invoices, the warehouse the goods leave from). `layout:\n // 'person'` gives the record an \"Addresses\" tab backed by public.addresses,\n // which is the same relation clients and patients already use.\n { key: 'notes', label: 'Notes', type: 'textarea' },\n { key: 'isActive', label: 'Active', type: 'boolean', showInTable: true, defaultValue: true },\n ],\n data: {\n table: 'people',\n tenantScoped: true,\n filters: { kind: 'supplier' },\n defaults: { kind: 'supplier' },\n },\n}\n\nconst measurementUnitEntity: EntityDef = {\n name: 'Measurement Unit',\n namePlural: 'Measurement Units',\n icon: 'Ruler',\n displayField: 'name',\n defaultSort: 'name',\n fields: [\n { key: 'name', label: 'Name', type: 'text', required: true, showInTable: true },\n { key: 'abbreviation', label: 'Abbreviation', type: 'text', required: true, showInTable: true },\n { key: 'isActive', label: 'Active', type: 'boolean', showInTable: true, defaultValue: true },\n ],\n data: { table: T.measurementUnits, tenantScoped: true },\n}\n\nconst productCategoryEntity: EntityDef = {\n name: 'Product Category',\n namePlural: 'Product Categories',\n icon: 'Tag',\n displayField: 'name',\n defaultSort: 'name',\n fields: [\n { key: 'name', label: 'Name', type: 'text', required: true, showInTable: true },\n { key: 'parentId', label: 'Parent', type: 'text', showInTable: false },\n { key: 'isActive', label: 'Active', type: 'boolean', showInTable: true, defaultValue: true },\n ],\n data: { table: T.productCategories, tenantScoped: true },\n}\n\nconst stockLocationEntity: EntityDef = {\n name: 'Stock Location',\n namePlural: 'Stock Locations',\n icon: 'Warehouse',\n displayField: 'name',\n defaultSort: 'name',\n fields: [\n { key: 'name', label: 'Name', type: 'text', required: true, showInTable: true },\n { key: 'description', label: 'Description', type: 'textarea', showInTable: true },\n { key: 'isActive', label: 'Active', type: 'boolean', showInTable: true, defaultValue: true },\n ],\n data: { table: T.stockLocations, tenantScoped: true },\n}\n\nexport const inventoryRegistries: PluginRegistryDef[] = [\n // --- Editable ---\n {\n id: 'suppliers',\n entity: supplierEntity,\n icon: 'Building2',\n description: 'Manage your product and material suppliers',\n display: 'table',\n },\n {\n id: 'product-categories',\n entity: productCategoryEntity,\n icon: 'Tag',\n description: 'Product categories for organization',\n display: 'table',\n },\n {\n id: 'stock-locations',\n entity: stockLocationEntity,\n icon: 'Warehouse',\n description: 'Physical storage locations for inventory',\n display: 'table',\n },\n // --- Read-only (system / seeded) ---\n {\n id: 'measurement-units',\n entity: measurementUnitEntity,\n icon: 'Ruler',\n description: 'Standard units of measure',\n display: 'table',\n readOnly: true,\n seedData: [\n { id: 'mu-unit', name: 'Unit', abbreviation: 'un', isActive: true },\n { id: 'mu-box', name: 'Box', abbreviation: 'box', isActive: true },\n { id: 'mu-kg', name: 'Kilogram', abbreviation: 'kg', isActive: true },\n { id: 'mu-g', name: 'Gram', abbreviation: 'g', isActive: true },\n { id: 'mu-l', name: 'Liter', abbreviation: 'L', isActive: true },\n { id: 'mu-ml', name: 'Milliliter', abbreviation: 'mL', isActive: true },\n ],\n },\n]\n","// inventory.* — merged plugin-own + saas-core central i18n\nexport const en: Record<string, string> = {\n \"inventory.dashboard.activeItems\": \"Active items\",\n \"inventory.dashboard.belowMinimum\": \"Below minimum\",\n \"inventory.dashboard.entries\": \"Entries:\",\n \"inventory.dashboard.exits\": \"Exits:\",\n \"inventory.dashboard.last7Days\": \"Last 7 days\",\n \"inventory.dashboard.lowStock\": \"Low Stock\",\n \"inventory.dashboard.needRestocking\": \"Need restocking\",\n \"inventory.dashboard.outOfStock\": \"Out of Stock\",\n \"inventory.dashboard.quickActions\": \"Quick Actions\",\n \"inventory.dashboard.quickActionsDesc\": \"Use the sidebar to record stock entries, exits, or manage products.\",\n \"inventory.dashboard.recentActivity\": \"Recent Activity\",\n \"inventory.dashboard.stockValue\": \"Stock Value\",\n \"inventory.dashboard.totalProducts\": \"Total Products\",\n \"inventory.dashboard.totalValue\": \"Total inventory value\",\n \"inventory.history.noMovements\": \"No movements recorded\",\n \"inventory.history.columnDate\": \"Date\",\n \"inventory.history.columnProduct\": \"Product\",\n \"inventory.history.columnType\": \"Type\",\n \"inventory.history.columnLocation\": \"Location\",\n \"inventory.history.columnQty\": \"Qty\",\n \"inventory.history.columnTotal\": \"Total\",\n \"inventory.history.newEntry\": \"New entry\",\n \"inventory.history.newExit\": \"Exit\",\n \"inventory.nav.recipes\": \"Recipes\",\n \"registry.suppliers\": \"Suppliers\",\n \"registry.suppliers.description\": \"Who you buy from\",\n \"registry.product-categories\": \"Categories\",\n \"registry.product-categories.description\": \"How the catalogue is grouped\",\n \"registry.stock-locations\": \"Stock locations\",\n \"registry.stock-locations.description\": \"Where stock physically sits — cold room, dry store, freezer\",\n \"registry.measurement-units\": \"Units of measure\",\n \"registry.measurement-units.description\": \"How each item is counted\",\n \"inventory.history.searchPlaceholder\": \"Search movements...\",\n \"inventory.history.subtitle\": \"All stock movements\",\n \"inventory.history.title\": \"Stock History\",\n \"inventory.nav.dashboard\": \"Dashboard\",\n \"inventory.nav.entry\": \"Entry\",\n \"inventory.nav.exit\": \"Exit\",\n \"inventory.nav.history\": \"History\",\n \"inventory.nav.list\": \"List\",\n \"inventory.nav.new\": \"New\",\n \"inventory.nav.products\": \"Products\",\n \"inventory.nav.stock\": \"Stock\",\n \"inventory.page.newProduct\": \"New Product\",\n \"inventory.page.newProductDesc\": \"Add a product to your catalog\",\n \"inventory.page.settingsSubtitle\": \"Preferences, suppliers, categories, and units\",\n \"inventory.page.settingsTitle\": \"Inventory Settings\",\n \"inventory.page.stockEntry\": \"Stock Entry\",\n \"inventory.page.stockEntryDesc\": \"Record goods received\",\n \"inventory.page.stockExit\": \"Stock Exit\",\n \"inventory.page.stockExitDesc\": \"Record goods used or sold\",\n \"inventory.recipeDetail.active\": \"Active\",\n \"inventory.recipeDetail.backToList\": \"Back to list\",\n \"inventory.recipeDetail.inactive\": \"Inactive\",\n \"inventory.recipeDetail.ingredientCount\": \"Ingredients\",\n \"inventory.recipeDetail.ingredientsTitle\": \"Ingredients\",\n \"inventory.recipeDetail.instructions\": \"Instructions\",\n \"inventory.recipeDetail.noIngredients\": \"No ingredients defined\",\n \"inventory.recipeDetail.notFound\": \"Recipe not found\",\n \"inventory.recipeDetail.prepTime\": \"Prep time\",\n \"inventory.recipeDetail.produces\": \"Produces\",\n \"inventory.recipeDetail.recipes\": \"Recipes\",\n \"inventory.recipeDetail.yield\": \"Yield\",\n \"inventory.recipes.createFirst\": \"Create your first recipe\",\n \"inventory.recipes.ingredients\": \"Ingredients\",\n \"inventory.recipes.newRecipe\": \"New Recipe\",\n \"inventory.recipes.noRecipes\": \"No recipes yet\",\n \"inventory.recipes.produces\": \"Produces:\",\n \"inventory.recipes.productionFormulas\": \"{{count}} production formulas\",\n \"inventory.recipes.recipesDesc\": \"Recipes define how to produce products from ingredients\",\n \"inventory.recipes.title\": \"Recipes\",\n \"inventory.recipes.yield\": \"Yield\",\n \"inventory.stock.additionalDetails\": \"Additional details (optional)\",\n \"inventory.stock.adjustmentDesc\": \"Count correction\",\n \"inventory.stock.adjustmentLabel\": \"Adjustment\",\n \"inventory.stock.back\": \"Back\",\n \"inventory.stock.batchNumber\": \"Batch Number\",\n \"inventory.stock.currentStock\": \"Current Stock\",\n \"inventory.stock.destination\": \"Destination\",\n \"inventory.stock.document\": \"Document\",\n \"inventory.stock.documentNumber\": \"Document Number\",\n \"inventory.stock.entry\": \"Stock Entry\",\n \"inventory.stock.entryDesc\": \"Receiving goods\",\n \"inventory.stock.entryLabel\": \"Entry\",\n \"inventory.stock.exit\": \"Stock Exit\",\n \"inventory.stock.exitDesc\": \"Using or selling\",\n \"inventory.stock.exitLabel\": \"Exit\",\n \"inventory.stock.expirationDate\": \"Expiration Date\",\n \"inventory.stock.fromLocation\": \"From Location\",\n \"inventory.stock.locationLabel\": \"Location\",\n \"inventory.stock.lossDesc\": \"Waste or damage\",\n \"inventory.stock.lossLabel\": \"Loss\",\n \"inventory.stock.movement\": \"Stock Movement\",\n \"inventory.stock.movementDetails\": \"Movement Details\",\n \"inventory.stock.movementType\": \"Movement type\",\n \"inventory.stock.next\": \"Next\",\n \"inventory.stock.notes\": \"Notes\",\n \"inventory.stock.product\": \"Product\",\n \"inventory.stock.quantity\": \"Quantity *\",\n \"inventory.stock.quantityLabel\": \"Quantity\",\n \"inventory.stock.reason\": \"Reason *\",\n \"inventory.stock.reasonLabel\": \"Reason\",\n \"inventory.stock.recordMovement\": \"Record Movement\",\n \"inventory.stock.recorded\": \"Recorded\",\n \"inventory.stock.recording\": \"Recording...\",\n \"inventory.stock.searchProduct\": \"Search by name, SKU, or barcode...\",\n \"inventory.stock.stepOf\": \"Step {{step}} of 3\",\n \"inventory.stock.supplier\": \"Supplier\",\n \"inventory.stock.toLocation\": \"To Location *\",\n \"inventory.stock.total\": \"Total\",\n \"inventory.stock.totalCost\": \"Total Cost\",\n \"inventory.stock.transferDesc\": \"Between locations\",\n \"inventory.stock.transferLabel\": \"Transfer\",\n \"inventory.stock.unitCost\": \"Unit Cost\",\n \"inventory.stock.unitCostLabel\": \"Unit Cost\",\n \"inventory.stock.searchSupplier\": \"Search supplier...\",\n \"inventory.stock.noSuppliers\": \"No supplier registered\",\n \"inventory.productDetail.stockTab\": \"Stock\",\n \"inventory.productDetail.positionsTitle\": \"Stock by location\",\n \"inventory.productDetail.onHand\": \"On hand\",\n \"inventory.productDetail.noPositions\": \"No stock in any location\",\n \"inventory.productDetail.historyTitle\": \"Movement history\",\n \"inventory.productDetail.undoLast\": \"Undo last movement\",\n \"inventory.productDetail.undoTitle\": \"Undo the last movement?\",\n \"inventory.productDetail.undoDescription\": \"{{type}} of {{quantity}} on {{date}} leaves the history, and the stock it moved goes back.\",\n \"inventory.productDetail.undoConfirm\": \"Undo\",\n \"inventory.productDetail.undone\": \"Movement undone\",\n \"inventory.productDetail.undoFailed\": \"Could not undo the movement\",\n \"inventory.productDetail.notFound\": \"Product not found\",\n \"inventory.productDetail.backToList\": \"Back to products\",\n \"inventory.onboarding.welcome\": \"Welcome to Inventory\",\n \"inventory.onboarding.description\": \"Track products, manage stock levels, and monitor movements across your business.\",\n \"inventory.onboarding.skip\": \"Skip setup\",\n \"inventory.onboarding.getStarted\": \"Get Started\",\n \"inventory.onboarding.units.title\": \"Measurement Units\",\n \"inventory.onboarding.units.description\": \"Default units (Unit, Box, Kg, L, etc.) are ready. Customize them anytime in Settings.\",\n \"inventory.onboarding.locations.title\": \"Stock Locations\",\n \"inventory.onboarding.locations.description\": \"A default storage location has been created. Add more for multi-location tracking.\",\n \"inventory.onboarding.start\": \"Start using Inventory\",\n \"inventory.quickActions.newProduct\": \"New Product\",\n \"inventory.quickActions.newProductDesc\": \"Add a product to your catalog\",\n \"inventory.quickActions.stockEntry\": \"Stock Entry\",\n \"inventory.quickActions.stockEntryDesc\": \"Record goods received\",\n \"inventory.quickActions.stockExit\": \"Stock Exit\",\n \"inventory.quickActions.stockExitDesc\": \"Record goods used or sold\",\n \"inventory.settingsPage.title\": \"Inventory Settings\",\n \"inventory.settingsPage.subtitle\": \"Manage units, categories, and stock locations\",\n \"inventory.settings.stockManagement\": \"Stock Management\",\n \"inventory.settings.stockManagementDesc\": \"How stock levels are tracked\",\n \"inventory.settings.lowStockAlerts\": \"Low stock alerts\",\n \"inventory.settings.lowStockAlertsDesc\": \"Show warnings when products fall below minimum quantity\",\n \"inventory.settings.requireReason\": \"Require reason for adjustments\",\n \"inventory.settings.requireReasonDesc\": \"Make reason mandatory for stock adjustments and losses\",\n \"inventory.settings.autoDeduct\": \"Auto-deduct on service\",\n \"inventory.settings.autoDeductDesc\": \"Automatically deduct products when a service is executed\",\n \"inventory.settings.products\": \"Products\",\n \"inventory.settings.productsDesc\": \"Product catalog behavior\",\n \"inventory.settings.requireSku\": \"Require SKU\",\n \"inventory.settings.requireSkuDesc\": \"Make SKU mandatory when creating products\",\n \"inventory.settings.allowNegative\": \"Allow negative stock\",\n \"inventory.settings.allowNegativeDesc\": \"Allow stock quantities to go below zero\",\n \"inventory.settings.notifications\": \"Notifications\",\n \"inventory.settings.notificationsDesc\": \"Alerts and reminders\",\n \"inventory.settings.lowStockEmail\": \"Low stock email alerts\",\n \"inventory.settings.lowStockEmailDesc\": \"Send email when products reach minimum quantity\",\n \"inventory.settings.expiryWarnings\": \"Expiry date warnings\",\n \"inventory.settings.expiryWarningsDesc\": \"Alert before products expire (batch tracking)\",\n \"inventory.productForm.newProduct\": \"New Product\",\n \"inventory.productForm.editProduct\": \"Edit Product\",\n \"inventory.productForm.updateDetails\": \"Update product details\",\n \"inventory.productForm.addToCatalog\": \"Add a product to your catalog\",\n \"inventory.productForm.cancel\": \"Cancel\",\n \"inventory.productForm.save\": \"Save\",\n \"inventory.productForm.saving\": \"Saving...\",\n \"inventory.productForm.generalInfo\": \"General Information\",\n \"inventory.productForm.name\": \"Name\",\n \"inventory.productForm.namePlaceholder\": \"Product name\",\n \"inventory.productForm.brand\": \"Brand\",\n \"inventory.productForm.brandPlaceholder\": \"Brand name\",\n \"inventory.productForm.sku\": \"SKU\",\n \"inventory.productForm.skuPlaceholder\": \"Internal code\",\n \"inventory.productForm.barcode\": \"Barcode\",\n \"inventory.productForm.barcodePlaceholder\": \"EAN / UPC\",\n \"inventory.productForm.description\": \"Description\",\n \"inventory.productForm.descriptionPlaceholder\": \"Additional information about the product\",\n \"inventory.productForm.classification\": \"Classification\",\n \"inventory.productForm.classificationDesc\": \"How this product is used in your business\",\n \"inventory.productForm.typeIngredient\": \"Raw material used in production or services\",\n \"inventory.productForm.typeSale\": \"Sold directly to customers\",\n \"inventory.productForm.typeIntermediate\": \"Produced internally from other items\",\n \"inventory.productForm.typeAsset\": \"Fixed asset for patrimony tracking\",\n \"inventory.productForm.pricing\": \"Pricing\",\n \"inventory.productForm.costPrice\": \"Cost Price\",\n \"inventory.productForm.salePrice\": \"Sale Price\",\n \"inventory.productForm.margin\": \"Margin\",\n \"inventory.productForm.stockLevels\": \"Stock Levels\",\n \"inventory.productForm.stockLevelsDesc\": \"Minimum and maximum thresholds for alerts\",\n \"inventory.productForm.minQuantity\": \"Minimum Quantity\",\n \"inventory.productForm.minQuantityHint\": \"Alert when stock falls below this\",\n \"inventory.productForm.maxQuantity\": \"Maximum Quantity\",\n \"inventory.productForm.maxQuantityHint\": \"Max capacity for this product\",\n \"inventory.productForm.optional\": \"Optional\",\n \"inventory.productForm.organization\": \"Organisation\",\n \"inventory.productForm.organizationDesc\": \"Category, unit, supplier and default storage location\",\n \"inventory.productForm.category\": \"Category\",\n \"inventory.productForm.measurementUnit\": \"Unit of measure\",\n \"inventory.productForm.measurementUnitHint\": \"How this item is counted in stock\",\n \"inventory.productForm.supplier\": \"Default supplier\",\n \"inventory.productForm.defaultLocation\": \"Default location\",\n \"inventory.movementType.entry\": \"Entry\",\n \"inventory.movementType.exit\": \"Exit\",\n \"inventory.movementType.adjustment\": \"Adjustment\",\n \"inventory.movementType.transfer\": \"Transfer\",\n \"inventory.movementType.loss\": \"Loss\",\n \"inventory.recipeForm.group\": \"Stage\",\n \"inventory.recipeForm.ungrouped\": \"No stage\",\n \"inventory.productList.bulkActivate\": \"Activate\",\n \"inventory.productList.bulkActivated\": \"{{count}} product(s) activated\",\n \"inventory.productList.bulkDeactivate\": \"Deactivate\",\n \"inventory.productList.bulkDeactivated\": \"{{count}} product(s) deactivated\",\n \"inventory.productList.bulkFailed\": \"{{count}} product(s) could not be updated\",\n \"inventory.productList.bulkNothingToDo\": \"The selected products are already in that state.\",\n \"inventory.productList.filterActive\": \"Active\",\n \"inventory.productList.filterAllStatuses\": \"Active and inactive\",\n \"inventory.productList.filterInactive\": \"Inactive\",\n \"inventory.productList.filterStatus\": \"Status\",\n \"inventory.productList.inactive\": \"Inactive\",\n \"inventory.productList.title\": \"Products\",\n \"inventory.productList.subtitle\": \"{{count}} products\",\n \"inventory.productList.product\": \"Product\",\n \"inventory.productList.type\": \"Type\",\n \"inventory.productList.stock\": \"Stock\",\n \"inventory.productList.cost\": \"Cost\",\n \"inventory.productList.value\": \"Value\",\n \"inventory.productList.searchPlaceholder\": \"Search products...\",\n 'inventory.productList.aiHint': 'Describe the product and I create it.',\n 'inventory.productList.askPlaceholder': 'Describe the product…',\n 'inventory.productList.askPersona': 'Product intake',\n 'inventory.productList.askPitch': 'Tell me the product you want to add.',\n 'inventory.productList.askDescription': 'Name, price, cost, SKU, kind — tell me what you know, however you say it, and I fill in the rest sensibly. You check before it saves.',\n 'inventory.productList.askSuggestion.0': 'Black tee S/M/L, $79, cost $28',\n 'inventory.productList.askSuggestion.1': 'Add 5 sample products so I can test the store',\n 'inventory.productList.askSuggestion.2': 'A bundle of the two best sellers',\n \"inventory.productList.newProduct\": \"New Product\",\n \"inventory.productList.empty\": \"No products yet\",\n \"inventory.productList.createFirst\": \"Create your first product\",\n \"inventory.stock.unknownProduct\": \"Unknown Product\",\n \"inventory.stock.reasonLossPlaceholder\": \"e.g. Expired, damaged\",\n \"inventory.stock.reasonAdjustPlaceholder\": \"e.g. Physical count correction\",\n \"inventory.stock.documentPlaceholder\": \"Invoice, receipt, PO...\",\n \"inventory.stock.batchPlaceholder\": \"e.g. LOT001\",\n \"inventory.stock.notesPlaceholder\": \"Additional notes...\",\n \"inventory.recipeDetail.loading\": \"Loading...\",\n \"inventory.recipeDetail.ingredient\": \"Ingredient\",\n \"inventory.recipeDetail.quantity\": \"Quantity\",\n \"inventory.recipeDetail.unit\": \"Unit\",\n \"inventory.recipeDetail.notes\": \"Notes\",\n \"inventory.recipeDetail.created\": \"Created\",\n \"inventory.recipeDetail.updated\": \"Updated\",\n \"inventory.recipeForm.newRecipe\": \"New Recipe\",\n \"inventory.recipeForm.subtitle\": \"Define a production formula\",\n \"inventory.recipeForm.cancel\": \"Cancel\",\n \"inventory.recipeForm.saveRecipe\": \"Save Recipe\",\n \"inventory.recipeForm.saving\": \"Saving...\",\n \"inventory.recipeForm.recipeDetails\": \"Recipe Details\",\n \"inventory.recipeForm.recipeName\": \"Recipe Name\",\n \"inventory.recipeForm.recipeNamePlaceholder\": \"e.g. Tomato Sauce\",\n \"inventory.recipeForm.description\": \"Description\",\n \"inventory.recipeForm.descriptionPlaceholder\": \"Brief description...\",\n \"inventory.recipeForm.produces\": \"Produces (Product)\",\n \"inventory.recipeForm.searchProduct\": \"Search product...\",\n \"inventory.recipeForm.createProduct\": \"Create product\",\n \"inventory.recipeForm.yieldQuantity\": \"Yield Quantity\",\n \"inventory.recipeForm.prepTime\": \"Prep Time (min)\",\n \"inventory.recipeForm.instructions\": \"Instructions\",\n \"inventory.recipeForm.instructionsPlaceholder\": \"Step-by-step preparation instructions...\",\n \"inventory.recipeForm.ingredients\": \"Ingredients\",\n \"inventory.recipeForm.addIngredient\": \"Add Ingredient\",\n \"inventory.recipeForm.noIngredients\": \"No ingredients added\",\n \"inventory.recipeForm.addFirstIngredient\": \"Add your first ingredient\",\n \"inventory.recipeForm.ingredient\": \"Ingredient\",\n \"inventory.recipeForm.quantity\": \"Quantity\",\n \"inventory.recipeForm.notes\": \"Notes\",\n \"inventory.recipeForm.searchIngredient\": \"Search ingredient...\",\n \"inventory.recipeForm.createIngredient\": \"Create ingredient\",\n \"inventory.recipeForm.notesPlaceholder\": \"e.g. diced, fresh\",\n \"inventory.recipeForm.ingredientsConfigured\": \"{{configured}} of {{total}} ingredients configured\",\n \"inventory.title\": \"Inventory\",\n \"inventory.stock.title\": \"Stock\",\n \"inventory.stock.minStock\": \"Min. Stock\",\n \"inventory.stock.adjust\": \"Adjust Stock\",\n \"inventory.stock.lowStock\": \"Low Stock\",\n \"inventory.products.title\": \"Products\",\n \"inventory.products.create\": \"New Product\",\n \"inventory.recipes.create\": \"New Recipe\",\n \"inventory.recipes.addIngredient\": \"Add Ingredient\",\n \"inventory.recipes.cost\": \"Cost\",\n \"inventory.recipes.loading\": \"Loading...\",\n \"inventory.suppliers.title\": \"Suppliers\",\n \"inventory.suppliers.create\": \"New Supplier\",\n \"inventory.movements.title\": \"Movements\",\n \"inventory.movements.in\": \"Stock In\",\n \"inventory.movements.out\": \"Stock Out\",\n \"inventory.settings.title\": \"Inventory Settings\",\n\n \"inventory.recipeDetail.cost\": \"Cost\",\n \"inventory.recipeDetail.unitCost\": \"Unit cost\",\n \"inventory.recipeDetail.totalCost\": \"Recipe cost\",\n \"inventory.recipeDetail.costPerYield\": \"Cost per unit produced\",\n \"inventory.recipeDetail.salePrice\": \"Sale price\",\n \"inventory.recipeDetail.cmv\": \"Food cost %\",\n \"inventory.recipeDetail.cmvUnknown\": \"No sale price\",\n \"inventory.recipeDetail.cmvHigh\": \"Above {{threshold}}% — this dish is eating the margin.\",\n\n \"inventory.recipeGaps.title\": \"Not linked to your catalogue\",\n \"inventory.recipeGaps.description\": \"The assistant suggested these but could not match them. Pick the equivalent item or create it.\",\n \"inventory.recipeGaps.produces\": \"Produces:\",\n \"inventory.recipeGaps.unnamed\": \"Unnamed ingredient\",\n \"inventory.recipeGaps.linkFailed\": \"Could not link this item\",\n \"inventory.recipeGaps.createFailed\": \"Could not create the product\",\n\n \"inventory.recipes.entity\": \"Recipe\",\n \"inventory.recipes.colProduct\": \"Product\",\n \"inventory.recipes.colIngredients\": \"Ingredients\",\n \"inventory.recipes.colYield\": \"Yield\",\n \"inventory.recipes.colPrep\": \"Prep\",\n \"inventory.recipes.colCost\": \"Cost\",\n \"inventory.recipes.colSale\": \"Sale\",\n \"inventory.recipes.colCmv\": \"Food cost %\",\n \"inventory.recipes.noSheet\": \"No recipe sheet\",\n \"inventory.recipes.searchPlaceholder\": \"Search menu items...\",\n \"inventory.recipes.newByHand\": \"Fill it in by hand\",\n \"inventory.recipes.newByHandHint\": \"Open the form and enter the ingredients yourself\",\n \"inventory.recipes.aiHint\": \"Describe the dish and get the sheet built with your own ingredients\",\n \"inventory.recipes.askPlaceholder\": \"e.g. recipe for smoked hump with cheese, 400g, serves 3\",\n \"inventory.recipes.askPersona\": \"Recipe sheets\",\n \"inventory.recipes.askPitch\": \"Let's cost your menu\",\n \"inventory.recipes.askDescription\": \"Describe the dish and I build the sheet from the ingredients you already have, with cost and food cost %.\",\n \"inventory.recipes.askSuggestion.0\": \"Build the recipe sheet for the smoked hump with cheese\",\n \"inventory.recipes.askSuggestion.1\": \"Which menu items still have no recipe sheet?\",\n \"inventory.recipes.askSuggestion.2\": \"Which dishes are above 35% food cost?\",\n\n \"inventory.nav.counts\": \"Counts\",\n \"inventory.counts.title\": \"Stock counts\",\n \"inventory.counts.entity\": \"Stock count\",\n \"inventory.counts.colReference\": \"Count\",\n \"inventory.counts.colOpened\": \"Opened\",\n \"inventory.counts.colStatus\": \"Status\",\n \"inventory.counts.colProgress\": \"Counted\",\n \"inventory.counts.colDivergent\": \"Divergences\",\n \"inventory.counts.status.open\": \"Open\",\n \"inventory.counts.status.counting\": \"Counting\",\n \"inventory.counts.status.closed\": \"Closed\",\n \"inventory.counts.status.cancelled\": \"Cancelled\",\n \"inventory.counts.progress\": \"{{counted}} of {{total}}\",\n \"inventory.counts.newCount\": \"New count\",\n \"inventory.counts.searchPlaceholder\": \"Search counts...\",\n \"inventory.counts.empty\": \"No counts yet\",\n \"inventory.counts.formTitle\": \"Open a count\",\n \"inventory.counts.formSubtitle\": \"What the system believes is frozen the moment you open it — the variance describes the shelf, not the clock.\",\n \"inventory.counts.location\": \"Stock location\",\n \"inventory.counts.pickLocation\": \"Pick a location\",\n \"inventory.counts.category\": \"Category\",\n \"inventory.counts.allCategories\": \"Every category\",\n \"inventory.counts.reference\": \"Name\",\n \"inventory.counts.referencePlaceholder\": \"e.g. Cold room, end of August\",\n \"inventory.counts.blind\": \"Blind count\",\n \"inventory.counts.blindHint\": \"Hides the system quantity while counting, so you write what is on the shelf instead of confirming what is on the screen.\",\n \"inventory.counts.blindLine\": \"Blind — system quantity hidden\",\n \"inventory.counts.notes\": \"Notes\",\n \"inventory.counts.notesPlaceholder\": \"Anything the next person should know\",\n \"inventory.counts.open\": \"Open the count\",\n \"inventory.counts.opening\": \"Opening...\",\n \"inventory.counts.openFailed\": \"Could not open the count\",\n \"inventory.counts.cancel\": \"Cancel\",\n \"inventory.counts.notFound\": \"Count not found\",\n \"inventory.counts.noItems\": \"This count has no products\",\n \"inventory.counts.systemQty\": \"System:\",\n \"inventory.counts.notCounted\": \"Not counted\",\n \"inventory.counts.counted\": \"Counted\",\n \"inventory.counts.divergent\": \"Divergences\",\n \"inventory.counts.varianceValue\": \"Variance\",\n \"inventory.counts.saveFailed\": \"Could not save this line\",\n \"inventory.counts.close\": \"Close the count\",\n \"inventory.counts.closeTitle\": \"Close the count?\",\n \"inventory.counts.closeDescription\": \"{{divergent}} line(s) differ from the system and will get an adjustment. {{uncounted}} line(s) were never counted and are left exactly as they are.\",\n \"inventory.counts.closeConfirm\": \"Close and adjust\",\n \"inventory.counts.closed\": \"Count closed — {{count}} adjustment(s) recorded\",\n \"inventory.counts.alreadyClosed\": \"This count was already closed\",\n \"inventory.counts.closeFailed\": \"Could not close the count\",\n \"inventory.counts.cancelCount\": \"Cancel count\",\n \"inventory.counts.cancelTitle\": \"Cancel this count?\",\n \"inventory.counts.cancelDescription\": \"The count is filed away and nothing is adjusted. What you typed stays on record.\",\n \"inventory.counts.cancelConfirm\": \"Cancel the count\",\n \"inventory.counts.cancelled\": \"Count cancelled\",\n \"inventory.counts.cancelFailed\": \"Could not cancel the count\",\n \"inventory.counts.adjustmentReason\": \"Stock count {{reference}}\",\n}\n","// inventory.* — merged plugin-own + saas-core central i18n\nexport const ptBR: Record<string, string> = {\n \"inventory.dashboard.activeItems\": \"Itens ativos\",\n \"inventory.dashboard.belowMinimum\": \"Abaixo do mínimo\",\n \"inventory.dashboard.entries\": \"Entradas:\",\n \"inventory.dashboard.exits\": \"Saídas:\",\n \"inventory.dashboard.last7Days\": \"Últimos 7 dias\",\n \"inventory.dashboard.lowStock\": \"Estoque Baixo\",\n \"inventory.dashboard.needRestocking\": \"Precisam reposição\",\n \"inventory.dashboard.outOfStock\": \"Sem Estoque\",\n \"inventory.dashboard.quickActions\": \"Ações Rápidas\",\n \"inventory.dashboard.quickActionsDesc\": \"Use a barra lateral para registrar entradas, saídas ou gerenciar produtos.\",\n \"inventory.dashboard.recentActivity\": \"Atividade Recente\",\n \"inventory.dashboard.stockValue\": \"Valor do Estoque\",\n \"inventory.dashboard.totalProducts\": \"Total de Produtos\",\n \"inventory.dashboard.totalValue\": \"Valor total do estoque\",\n \"inventory.history.noMovements\": \"Nenhuma movimentação registrada\",\n \"inventory.history.columnDate\": \"Data\",\n \"inventory.history.columnProduct\": \"Produto\",\n \"inventory.history.columnType\": \"Tipo\",\n \"inventory.history.columnLocation\": \"Local\",\n \"inventory.history.columnQty\": \"Qtd\",\n \"inventory.history.columnTotal\": \"Total\",\n \"inventory.history.newEntry\": \"Nova entrada\",\n \"inventory.history.newExit\": \"Saída\",\n \"inventory.nav.recipes\": \"Receitas\",\n \"registry.suppliers\": \"Fornecedores\",\n \"registry.suppliers.description\": \"De quem você compra\",\n \"registry.product-categories\": \"Categorias\",\n \"registry.product-categories.description\": \"Como o catálogo é agrupado\",\n \"registry.stock-locations\": \"Locais de estoque\",\n \"registry.stock-locations.description\": \"Onde o estoque fica de fato — câmara fria, estoque seco, freezer\",\n \"registry.measurement-units\": \"Unidades de medida\",\n \"registry.measurement-units.description\": \"Como cada item é contado\",\n \"inventory.history.searchPlaceholder\": \"Buscar movimentações...\",\n \"inventory.history.subtitle\": \"Todas as movimentações de estoque\",\n \"inventory.history.title\": \"Histórico de Estoque\",\n \"inventory.nav.dashboard\": \"Painel\",\n \"inventory.nav.entry\": \"Entrada\",\n \"inventory.nav.exit\": \"Saída\",\n \"inventory.nav.history\": \"Histórico\",\n \"inventory.nav.list\": \"Lista\",\n \"inventory.nav.new\": \"Novo\",\n \"inventory.nav.products\": \"Produtos\",\n \"inventory.nav.stock\": \"Estoque\",\n \"inventory.page.newProduct\": \"Novo Produto\",\n \"inventory.page.newProductDesc\": \"Adicionar um produto ao seu catálogo\",\n \"inventory.page.settingsSubtitle\": \"Preferências, fornecedores, categorias e unidades\",\n \"inventory.page.settingsTitle\": \"Configurações de Estoque\",\n \"inventory.page.stockEntry\": \"Entrada de Estoque\",\n \"inventory.page.stockEntryDesc\": \"Registrar mercadorias recebidas\",\n \"inventory.page.stockExit\": \"Saída de Estoque\",\n \"inventory.page.stockExitDesc\": \"Registrar mercadorias usadas ou vendidas\",\n \"inventory.recipeDetail.active\": \"Ativa\",\n \"inventory.recipeDetail.backToList\": \"Voltar à lista\",\n \"inventory.recipeDetail.inactive\": \"Inativa\",\n \"inventory.recipeDetail.ingredientCount\": \"Ingredientes\",\n \"inventory.recipeDetail.ingredientsTitle\": \"Ingredientes\",\n \"inventory.recipeDetail.instructions\": \"Instruções\",\n \"inventory.recipeDetail.noIngredients\": \"Nenhum ingrediente definido\",\n \"inventory.recipeDetail.notFound\": \"Receita não encontrada\",\n \"inventory.recipeDetail.prepTime\": \"Tempo de preparo\",\n \"inventory.recipeDetail.produces\": \"Produz\",\n \"inventory.recipeDetail.recipes\": \"Receitas\",\n \"inventory.recipeDetail.yield\": \"Rendimento\",\n \"inventory.recipes.createFirst\": \"Crie sua primeira receita\",\n \"inventory.recipes.ingredients\": \"Ingredientes\",\n \"inventory.recipes.newRecipe\": \"Nova Receita\",\n \"inventory.recipes.noRecipes\": \"Nenhuma receita ainda\",\n \"inventory.recipes.produces\": \"Produz:\",\n \"inventory.recipes.productionFormulas\": \"{{count}} fórmulas de produção\",\n \"inventory.recipes.recipesDesc\": \"Receitas definem como produzir produtos a partir de ingredientes\",\n \"inventory.recipes.title\": \"Receitas\",\n \"inventory.recipes.yield\": \"Rendimento\",\n \"inventory.stock.additionalDetails\": \"Detalhes adicionais (opcional)\",\n \"inventory.stock.adjustmentDesc\": \"Correção de contagem\",\n \"inventory.stock.adjustmentLabel\": \"Ajuste\",\n \"inventory.stock.back\": \"Voltar\",\n \"inventory.stock.batchNumber\": \"Número do Lote\",\n \"inventory.stock.currentStock\": \"Estoque Atual\",\n \"inventory.stock.destination\": \"Destino\",\n \"inventory.stock.document\": \"Documento\",\n \"inventory.stock.documentNumber\": \"Número do Documento\",\n \"inventory.stock.entry\": \"Entrada de Estoque\",\n \"inventory.stock.entryDesc\": \"Recebimento de mercadorias\",\n \"inventory.stock.entryLabel\": \"Entrada\",\n \"inventory.stock.exit\": \"Saída de Estoque\",\n \"inventory.stock.exitDesc\": \"Uso ou venda\",\n \"inventory.stock.exitLabel\": \"Saída\",\n \"inventory.stock.expirationDate\": \"Data de Validade\",\n \"inventory.stock.fromLocation\": \"Local de Origem\",\n \"inventory.stock.locationLabel\": \"Local\",\n \"inventory.stock.lossDesc\": \"Desperdício ou dano\",\n \"inventory.stock.lossLabel\": \"Perda\",\n \"inventory.stock.movement\": \"Movimentação de Estoque\",\n \"inventory.stock.movementDetails\": \"Detalhes da Movimentação\",\n \"inventory.stock.movementType\": \"Tipo de movimentação\",\n \"inventory.stock.next\": \"Próximo\",\n \"inventory.stock.notes\": \"Observações\",\n \"inventory.stock.product\": \"Produto\",\n \"inventory.stock.quantity\": \"Quantidade *\",\n \"inventory.stock.quantityLabel\": \"Quantidade\",\n \"inventory.stock.reason\": \"Motivo *\",\n \"inventory.stock.reasonLabel\": \"Motivo\",\n \"inventory.stock.recordMovement\": \"Registrar Movimentação\",\n \"inventory.stock.recorded\": \"Registrado\",\n \"inventory.stock.recording\": \"Registrando...\",\n \"inventory.stock.searchProduct\": \"Buscar por nome, SKU ou código de barras...\",\n \"inventory.stock.stepOf\": \"Etapa {{step}} de 3\",\n \"inventory.stock.supplier\": \"Fornecedor\",\n \"inventory.stock.toLocation\": \"Local de Destino *\",\n \"inventory.stock.total\": \"Total\",\n \"inventory.stock.totalCost\": \"Custo Total\",\n \"inventory.stock.transferDesc\": \"Entre locais\",\n \"inventory.stock.transferLabel\": \"Transferência\",\n \"inventory.stock.unitCost\": \"Custo Unitário\",\n \"inventory.stock.unitCostLabel\": \"Custo Unitário\",\n \"inventory.stock.searchSupplier\": \"Buscar fornecedor...\",\n \"inventory.stock.noSuppliers\": \"Nenhum fornecedor cadastrado\",\n \"inventory.productDetail.stockTab\": \"Estoque\",\n \"inventory.productDetail.positionsTitle\": \"Estoque por local\",\n \"inventory.productDetail.onHand\": \"Em estoque\",\n \"inventory.productDetail.noPositions\": \"Sem estoque em nenhum local\",\n \"inventory.productDetail.historyTitle\": \"Movimentação\",\n \"inventory.productDetail.undoLast\": \"Desfazer último movimento\",\n \"inventory.productDetail.undoTitle\": \"Desfazer o último movimento?\",\n \"inventory.productDetail.undoDescription\": \"{{type}} de {{quantity}} em {{date}} sai do histórico, e o estoque que ele moveu volta.\",\n \"inventory.productDetail.undoConfirm\": \"Desfazer\",\n \"inventory.productDetail.undone\": \"Movimento desfeito\",\n \"inventory.productDetail.undoFailed\": \"Não foi possível desfazer o movimento\",\n \"inventory.productDetail.notFound\": \"Produto não encontrado\",\n \"inventory.productDetail.backToList\": \"Voltar para produtos\",\n \"inventory.onboarding.welcome\": \"Bem-vindo ao Estoque\",\n \"inventory.onboarding.description\": \"Acompanhe produtos, gerencie níveis de estoque e monitore movimentações do seu negócio.\",\n \"inventory.onboarding.skip\": \"Pular configuração\",\n \"inventory.onboarding.getStarted\": \"Começar\",\n \"inventory.onboarding.units.title\": \"Unidades de Medida\",\n \"inventory.onboarding.units.description\": \"Unidades padrão (Unidade, Caixa, Kg, L, etc.) estão prontas. Personalize-as a qualquer momento em Configurações.\",\n \"inventory.onboarding.locations.title\": \"Locais de Estoque\",\n \"inventory.onboarding.locations.description\": \"Um local de armazenamento padrão foi criado. Adicione mais para controle multi-local.\",\n \"inventory.onboarding.start\": \"Começar a usar Estoque\",\n \"inventory.quickActions.newProduct\": \"Novo Produto\",\n \"inventory.quickActions.newProductDesc\": \"Adicionar um produto ao catálogo\",\n \"inventory.quickActions.stockEntry\": \"Entrada de Estoque\",\n \"inventory.quickActions.stockEntryDesc\": \"Registrar mercadorias recebidas\",\n \"inventory.quickActions.stockExit\": \"Saída de Estoque\",\n \"inventory.quickActions.stockExitDesc\": \"Registrar mercadorias usadas ou vendidas\",\n \"inventory.settingsPage.title\": \"Configurações de Estoque\",\n \"inventory.settingsPage.subtitle\": \"Gerenciar unidades, categorias e locais de estoque\",\n \"inventory.settings.stockManagement\": \"Gestão de Estoque\",\n \"inventory.settings.stockManagementDesc\": \"Como os níveis de estoque são rastreados\",\n \"inventory.settings.lowStockAlerts\": \"Alertas de estoque baixo\",\n \"inventory.settings.lowStockAlertsDesc\": \"Mostrar avisos quando produtos ficarem abaixo da quantidade mínima\",\n \"inventory.settings.requireReason\": \"Exigir motivo para ajustes\",\n \"inventory.settings.requireReasonDesc\": \"Tornar obrigatório o motivo para ajustes e perdas de estoque\",\n \"inventory.settings.autoDeduct\": \"Auto-deduzir no serviço\",\n \"inventory.settings.autoDeductDesc\": \"Deduzir automaticamente produtos quando um serviço é executado\",\n \"inventory.settings.products\": \"Produtos\",\n \"inventory.settings.productsDesc\": \"Comportamento do catálogo de produtos\",\n \"inventory.settings.requireSku\": \"Exigir SKU\",\n \"inventory.settings.requireSkuDesc\": \"Tornar SKU obrigatório ao criar produtos\",\n \"inventory.settings.allowNegative\": \"Permitir estoque negativo\",\n \"inventory.settings.allowNegativeDesc\": \"Permitir que quantidades de estoque fiquem abaixo de zero\",\n \"inventory.settings.notifications\": \"Notificações\",\n \"inventory.settings.notificationsDesc\": \"Alertas e lembretes\",\n \"inventory.settings.lowStockEmail\": \"Alertas de estoque baixo por e-mail\",\n \"inventory.settings.lowStockEmailDesc\": \"Enviar e-mail quando produtos atingirem a quantidade mínima\",\n \"inventory.settings.expiryWarnings\": \"Avisos de validade\",\n \"inventory.settings.expiryWarningsDesc\": \"Alertar antes de produtos vencerem (rastreamento de lotes)\",\n \"inventory.productForm.newProduct\": \"Novo Produto\",\n \"inventory.productForm.editProduct\": \"Editar Produto\",\n \"inventory.productForm.updateDetails\": \"Atualizar detalhes do produto\",\n \"inventory.productForm.addToCatalog\": \"Adicionar um produto ao seu catálogo\",\n \"inventory.productForm.cancel\": \"Cancelar\",\n \"inventory.productForm.save\": \"Salvar\",\n \"inventory.productForm.saving\": \"Salvando...\",\n \"inventory.productForm.generalInfo\": \"Informações Gerais\",\n \"inventory.productForm.name\": \"Nome\",\n \"inventory.productForm.namePlaceholder\": \"Nome do produto\",\n \"inventory.productForm.brand\": \"Marca\",\n \"inventory.productForm.brandPlaceholder\": \"Nome da marca\",\n \"inventory.productForm.sku\": \"SKU\",\n \"inventory.productForm.skuPlaceholder\": \"Código interno\",\n \"inventory.productForm.barcode\": \"Código de Barras\",\n \"inventory.productForm.barcodePlaceholder\": \"EAN / UPC\",\n \"inventory.productForm.description\": \"Descrição\",\n \"inventory.productForm.descriptionPlaceholder\": \"Informações adicionais sobre o produto\",\n \"inventory.productForm.classification\": \"Classificação\",\n \"inventory.productForm.classificationDesc\": \"Como este produto é usado no seu negócio\",\n \"inventory.productForm.typeIngredient\": \"Matéria-prima usada na produção ou serviços\",\n \"inventory.productForm.typeSale\": \"Vendido diretamente aos clientes\",\n \"inventory.productForm.typeIntermediate\": \"Produzido internamente a partir de outros itens\",\n \"inventory.productForm.typeAsset\": \"Ativo fixo para controle patrimonial\",\n \"inventory.productForm.pricing\": \"Preços\",\n \"inventory.productForm.costPrice\": \"Preço de Custo\",\n \"inventory.productForm.salePrice\": \"Preço de Venda\",\n \"inventory.productForm.margin\": \"Margem\",\n \"inventory.productForm.stockLevels\": \"Níveis de Estoque\",\n \"inventory.productForm.stockLevelsDesc\": \"Limites mínimo e máximo para alertas\",\n \"inventory.productForm.minQuantity\": \"Quantidade Mínima\",\n \"inventory.productForm.minQuantityHint\": \"Alertar quando o estoque ficar abaixo deste valor\",\n \"inventory.productForm.maxQuantity\": \"Quantidade Máxima\",\n \"inventory.productForm.maxQuantityHint\": \"Capacidade máxima para este produto\",\n \"inventory.productForm.optional\": \"Opcional\",\n \"inventory.productForm.organization\": \"Organização\",\n \"inventory.productForm.organizationDesc\": \"Categoria, unidade, fornecedor e local padrão de estoque\",\n \"inventory.productForm.category\": \"Categoria\",\n \"inventory.productForm.measurementUnit\": \"Unidade de medida\",\n \"inventory.productForm.measurementUnitHint\": \"Como este item é contado no estoque\",\n \"inventory.productForm.supplier\": \"Fornecedor padrão\",\n \"inventory.productForm.defaultLocation\": \"Local padrão\",\n \"inventory.movementType.entry\": \"Entrada\",\n \"inventory.movementType.exit\": \"Saída\",\n \"inventory.movementType.adjustment\": \"Ajuste\",\n \"inventory.movementType.transfer\": \"Transferência\",\n \"inventory.movementType.loss\": \"Perda\",\n \"inventory.recipeForm.group\": \"Etapa\",\n \"inventory.recipeForm.ungrouped\": \"Sem etapa\",\n \"inventory.productList.bulkActivate\": \"Ativar\",\n \"inventory.productList.bulkActivated\": \"{{count}} produto(s) ativado(s)\",\n \"inventory.productList.bulkDeactivate\": \"Desativar\",\n \"inventory.productList.bulkDeactivated\": \"{{count}} produto(s) desativado(s)\",\n \"inventory.productList.bulkFailed\": \"{{count}} produto(s) não puderam ser atualizados\",\n \"inventory.productList.bulkNothingToDo\": \"Os produtos selecionados já estão nesse estado.\",\n \"inventory.productList.filterActive\": \"Ativos\",\n \"inventory.productList.filterAllStatuses\": \"Ativos e inativos\",\n \"inventory.productList.filterInactive\": \"Inativos\",\n \"inventory.productList.filterStatus\": \"Situação\",\n \"inventory.productList.inactive\": \"Inativo\",\n \"inventory.productList.title\": \"Produtos\",\n \"inventory.productList.subtitle\": \"{{count}} produtos\",\n \"inventory.productList.product\": \"Produto\",\n \"inventory.productList.type\": \"Tipo\",\n \"inventory.productList.stock\": \"Estoque\",\n \"inventory.productList.cost\": \"Custo\",\n \"inventory.productList.value\": \"Valor\",\n \"inventory.productList.searchPlaceholder\": \"Buscar produtos...\",\n 'inventory.productList.aiHint': 'Descreva o produto e eu cadastro.',\n 'inventory.productList.askPlaceholder': 'Descreva o produto…',\n 'inventory.productList.askPersona': 'Cadastro de produtos',\n 'inventory.productList.askPitch': 'Diga o produto que você quer cadastrar.',\n 'inventory.productList.askDescription': 'Nome, preço, custo, SKU, tipo — diga o que souber, do jeito que falar, e eu preencho o resto com o que faz sentido. Você confere antes de salvar.',\n 'inventory.productList.askSuggestion.0': 'Camiseta preta P/M/G, R$ 79, custo R$ 28',\n 'inventory.productList.askSuggestion.1': 'Cadastre 5 produtos de exemplo para eu testar a loja',\n 'inventory.productList.askSuggestion.2': 'Um combo com os dois itens mais vendidos',\n \"inventory.productList.newProduct\": \"Novo Produto\",\n \"inventory.productList.empty\": \"Nenhum produto ainda\",\n \"inventory.productList.createFirst\": \"Crie seu primeiro produto\",\n \"inventory.stock.unknownProduct\": \"Produto Desconhecido\",\n \"inventory.stock.reasonLossPlaceholder\": \"ex. Vencido, danificado\",\n \"inventory.stock.reasonAdjustPlaceholder\": \"ex. Correção de contagem física\",\n \"inventory.stock.documentPlaceholder\": \"Nota fiscal, recibo, PO...\",\n \"inventory.stock.batchPlaceholder\": \"ex. LOT001\",\n \"inventory.stock.notesPlaceholder\": \"Observações adicionais...\",\n \"inventory.recipeDetail.loading\": \"Carregando...\",\n \"inventory.recipeDetail.ingredient\": \"Ingrediente\",\n \"inventory.recipeDetail.quantity\": \"Quantidade\",\n \"inventory.recipeDetail.unit\": \"Unidade\",\n \"inventory.recipeDetail.notes\": \"Observações\",\n \"inventory.recipeDetail.created\": \"Criado\",\n \"inventory.recipeDetail.updated\": \"Atualizado\",\n \"inventory.recipeForm.newRecipe\": \"Nova Receita\",\n \"inventory.recipeForm.subtitle\": \"Definir uma fórmula de produção\",\n \"inventory.recipeForm.cancel\": \"Cancelar\",\n \"inventory.recipeForm.saveRecipe\": \"Salvar Receita\",\n \"inventory.recipeForm.saving\": \"Salvando...\",\n \"inventory.recipeForm.recipeDetails\": \"Detalhes da Receita\",\n \"inventory.recipeForm.recipeName\": \"Nome da Receita\",\n \"inventory.recipeForm.recipeNamePlaceholder\": \"ex. Molho de Tomate\",\n \"inventory.recipeForm.description\": \"Descrição\",\n \"inventory.recipeForm.descriptionPlaceholder\": \"Breve descrição...\",\n \"inventory.recipeForm.produces\": \"Produz (Produto)\",\n \"inventory.recipeForm.searchProduct\": \"Buscar produto...\",\n \"inventory.recipeForm.createProduct\": \"Criar produto\",\n \"inventory.recipeForm.yieldQuantity\": \"Quantidade de Rendimento\",\n \"inventory.recipeForm.prepTime\": \"Tempo de Preparo (min)\",\n \"inventory.recipeForm.instructions\": \"Instruções\",\n \"inventory.recipeForm.instructionsPlaceholder\": \"Instruções de preparo passo a passo...\",\n \"inventory.recipeForm.ingredients\": \"Ingredientes\",\n \"inventory.recipeForm.addIngredient\": \"Adicionar Ingrediente\",\n \"inventory.recipeForm.noIngredients\": \"Nenhum ingrediente adicionado\",\n \"inventory.recipeForm.addFirstIngredient\": \"Adicione seu primeiro ingrediente\",\n \"inventory.recipeForm.ingredient\": \"Ingrediente\",\n \"inventory.recipeForm.quantity\": \"Quantidade\",\n \"inventory.recipeForm.notes\": \"Observações\",\n \"inventory.recipeForm.searchIngredient\": \"Buscar ingrediente...\",\n \"inventory.recipeForm.createIngredient\": \"Criar ingrediente\",\n \"inventory.recipeForm.notesPlaceholder\": \"ex. picado, fresco\",\n \"inventory.recipeForm.ingredientsConfigured\": \"{{configured}} de {{total}} ingredientes configurados\",\n \"inventory.title\": \"Estoque\",\n \"inventory.stock.title\": \"Estoque\",\n \"inventory.stock.minStock\": \"Estoque Mín.\",\n \"inventory.stock.adjust\": \"Ajustar Estoque\",\n \"inventory.stock.lowStock\": \"Estoque Baixo\",\n \"inventory.products.title\": \"Produtos\",\n \"inventory.products.create\": \"Novo Produto\",\n \"inventory.recipes.create\": \"Nova Receita\",\n \"inventory.recipes.addIngredient\": \"Adicionar Ingrediente\",\n \"inventory.recipes.cost\": \"Custo\",\n \"inventory.recipes.loading\": \"Carregando...\",\n \"inventory.suppliers.title\": \"Fornecedores\",\n \"inventory.suppliers.create\": \"Novo Fornecedor\",\n \"inventory.movements.title\": \"Movimentações\",\n \"inventory.movements.in\": \"Entrada\",\n \"inventory.movements.out\": \"Saída\",\n \"inventory.settings.title\": \"Configurações de Estoque\",\n\n \"inventory.recipeDetail.cost\": \"Custo\",\n \"inventory.recipeDetail.unitCost\": \"Custo unitário\",\n \"inventory.recipeDetail.totalCost\": \"Custo da ficha\",\n \"inventory.recipeDetail.costPerYield\": \"Custo por unidade produzida\",\n \"inventory.recipeDetail.salePrice\": \"Preço de venda\",\n \"inventory.recipeDetail.cmv\": \"CMV\",\n \"inventory.recipeDetail.cmvUnknown\": \"Sem preço de venda\",\n \"inventory.recipeDetail.cmvHigh\": \"Acima de {{threshold}}% — este prato está comendo a margem.\",\n\n \"inventory.recipeGaps.title\": \"Falta ligar ao seu catálogo\",\n \"inventory.recipeGaps.description\": \"A assistente sugeriu estes itens mas não achou equivalente. Escolha o insumo certo ou cadastre.\",\n \"inventory.recipeGaps.produces\": \"Produz:\",\n \"inventory.recipeGaps.unnamed\": \"Ingrediente sem nome\",\n \"inventory.recipeGaps.linkFailed\": \"Não foi possível ligar este item\",\n \"inventory.recipeGaps.createFailed\": \"Não foi possível cadastrar o produto\",\n\n \"inventory.recipes.entity\": \"Ficha técnica\",\n \"inventory.recipes.colProduct\": \"Produto\",\n \"inventory.recipes.colIngredients\": \"Insumos\",\n \"inventory.recipes.colYield\": \"Rendimento\",\n \"inventory.recipes.colPrep\": \"Preparo\",\n \"inventory.recipes.colCost\": \"Custo\",\n \"inventory.recipes.colSale\": \"Venda\",\n \"inventory.recipes.colCmv\": \"CMV\",\n \"inventory.recipes.noSheet\": \"Sem ficha técnica\",\n \"inventory.recipes.searchPlaceholder\": \"Buscar item do cardápio...\",\n \"inventory.recipes.newByHand\": \"Preencher à mão\",\n \"inventory.recipes.newByHandHint\": \"Abrir o formulário e lançar os insumos você mesmo\",\n \"inventory.recipes.aiHint\": \"Descreva o prato e receba a ficha montada com os seus insumos\",\n \"inventory.recipes.askPlaceholder\": \"ex. ficha técnica do cupim defumado com queijo, 400g, serve 3\",\n \"inventory.recipes.askPersona\": \"Fichas técnicas\",\n \"inventory.recipes.askPitch\": \"Vamos custear o seu cardápio\",\n \"inventory.recipes.askDescription\": \"Descreva o prato que eu monto a ficha com os insumos que você já tem, com custo e CMV.\",\n \"inventory.recipes.askSuggestion.0\": \"Monte a ficha técnica do cupim defumado com queijo\",\n \"inventory.recipes.askSuggestion.1\": \"Quais itens do cardápio ainda não têm ficha técnica?\",\n \"inventory.recipes.askSuggestion.2\": \"Quais pratos estão acima de 35% de CMV?\",\n\n \"inventory.nav.counts\": \"Contagens\",\n \"inventory.counts.title\": \"Contagens de estoque\",\n \"inventory.counts.entity\": \"Contagem\",\n \"inventory.counts.colReference\": \"Contagem\",\n \"inventory.counts.colOpened\": \"Aberta em\",\n \"inventory.counts.colStatus\": \"Situação\",\n \"inventory.counts.colProgress\": \"Contados\",\n \"inventory.counts.colDivergent\": \"Divergências\",\n \"inventory.counts.status.open\": \"Aberta\",\n \"inventory.counts.status.counting\": \"Contando\",\n \"inventory.counts.status.closed\": \"Fechada\",\n \"inventory.counts.status.cancelled\": \"Cancelada\",\n \"inventory.counts.progress\": \"{{counted}} de {{total}}\",\n \"inventory.counts.newCount\": \"Nova contagem\",\n \"inventory.counts.searchPlaceholder\": \"Buscar contagem...\",\n \"inventory.counts.empty\": \"Nenhuma contagem ainda\",\n \"inventory.counts.formTitle\": \"Abrir uma contagem\",\n \"inventory.counts.formSubtitle\": \"O que o sistema acredita é congelado na hora em que você abre — a variação fala da prateleira, não do relógio.\",\n \"inventory.counts.location\": \"Local de estoque\",\n \"inventory.counts.pickLocation\": \"Escolha um local\",\n \"inventory.counts.category\": \"Categoria\",\n \"inventory.counts.allCategories\": \"Todas as categorias\",\n \"inventory.counts.reference\": \"Nome\",\n \"inventory.counts.referencePlaceholder\": \"ex. Câmara fria, fim de agosto\",\n \"inventory.counts.blind\": \"Contagem cega\",\n \"inventory.counts.blindHint\": \"Esconde a quantidade do sistema enquanto você conta, para escrever o que está na prateleira em vez de confirmar o que está na tela.\",\n \"inventory.counts.blindLine\": \"Cega — quantidade do sistema oculta\",\n \"inventory.counts.notes\": \"Observações\",\n \"inventory.counts.notesPlaceholder\": \"O que a próxima pessoa precisa saber\",\n \"inventory.counts.open\": \"Abrir a contagem\",\n \"inventory.counts.opening\": \"Abrindo...\",\n \"inventory.counts.openFailed\": \"Não foi possível abrir a contagem\",\n \"inventory.counts.cancel\": \"Cancelar\",\n \"inventory.counts.notFound\": \"Contagem não encontrada\",\n \"inventory.counts.noItems\": \"Esta contagem não tem produtos\",\n \"inventory.counts.systemQty\": \"Sistema:\",\n \"inventory.counts.notCounted\": \"Não contado\",\n \"inventory.counts.counted\": \"Contados\",\n \"inventory.counts.divergent\": \"Divergências\",\n \"inventory.counts.varianceValue\": \"Variação\",\n \"inventory.counts.saveFailed\": \"Não foi possível salvar esta linha\",\n \"inventory.counts.close\": \"Fechar a contagem\",\n \"inventory.counts.closeTitle\": \"Fechar a contagem?\",\n \"inventory.counts.closeDescription\": \"{{divergent}} linha(s) divergem do sistema e vão receber um ajuste. {{uncounted}} linha(s) ninguém contou e ficam exatamente como estão.\",\n \"inventory.counts.closeConfirm\": \"Fechar e ajustar\",\n \"inventory.counts.closed\": \"Contagem fechada — {{count}} ajuste(s) lançado(s)\",\n \"inventory.counts.alreadyClosed\": \"Esta contagem já estava fechada\",\n \"inventory.counts.closeFailed\": \"Não foi possível fechar a contagem\",\n \"inventory.counts.cancelCount\": \"Cancelar contagem\",\n \"inventory.counts.cancelTitle\": \"Cancelar esta contagem?\",\n \"inventory.counts.cancelDescription\": \"A contagem é arquivada e nada é ajustado. O que você digitou fica registrado.\",\n \"inventory.counts.cancelConfirm\": \"Cancelar a contagem\",\n \"inventory.counts.cancelled\": \"Contagem cancelada\",\n \"inventory.counts.cancelFailed\": \"Não foi possível cancelar a contagem\",\n \"inventory.counts.adjustmentReason\": \"Contagem de estoque {{reference}}\",\n}\n","import { en } from './en'\nimport { ptBR } from './pt-BR'\n\nexport const inventoryLocales: Record<string, Record<string, string>> = {\n en,\n 'pt-BR': ptBR,\n}\n","import React from 'react'\nimport type { PluginManifest, PluginScope, VerticalId } from '@fayz-ai/core'\nimport { InventoryPage } from './views/InventoryPage'\nimport { createInventoryDashboardWidgets } from './views/dashboardWidgets'\nimport type { ResolvedInventoryConfig } from './context'\nimport type { InventoryDataProvider } from './data/types'\nimport { createMockInventoryProvider } from './data/mock'\nimport { createSupabaseInventoryProvider } from './data/supabase'\nimport { createSafeDataProvider, registerTranslations } from '@fayz-ai/core'\nimport { PluginSettingsPanel } from '@fayz-ai/admin'\nimport { createInventoryStore } from './store'\nimport { inventoryRegistries } from './data/registries'\nimport { inventoryLocales } from './locales'\nimport { InventoryGeneralSettings } from './components/InventoryGeneralSettings'\nimport { upsertRecipeTool } from './lib/agent-tools'\n\n// ---------------------------------------------------------------------------\n// Public types\n// ---------------------------------------------------------------------------\n\nexport interface InventoryPluginLabels {\n pageTitle: string\n pageSubtitle: string\n dashboard: string\n products: string\n productsNew: string\n productsList: string\n stock: string\n stockEntry: string\n stockExit: string\n stockHistory: string\n recipes: string\n recipesNew: string\n recipesList: string\n}\n\nexport interface InventoryPluginOptions {\n modules?: {\n recipes?: boolean\n stockLocations?: boolean\n batchTracking?: boolean\n /**\n * The product catalogue screens (list + form). Defaults on. Turn OFF when the\n * host already owns product registration elsewhere — an e-commerce app\n * manages products in the shop plugin, and two competing product CRUDs is\n * how the same product ends up entered twice, differently.\n * Stock entry/exit/history stay available either way.\n */\n products?: boolean\n }\n labels?: Partial<InventoryPluginLabels>\n productTypes?: Array<{ value: string; label: string }>\n currency?: { code?: string; locale?: string; symbol?: string }\n navPosition?: number\n navSection?: 'main' | 'secondary'\n scope?: PluginScope\n verticalId?: VerticalId\n dataProvider?: InventoryDataProvider\n locations?: Array<{ id: string; name: string; isHQ?: boolean }>\n}\n\n// ---------------------------------------------------------------------------\n// Defaults\n// ---------------------------------------------------------------------------\n\nconst DEFAULT_LABELS: InventoryPluginLabels = {\n pageTitle: 'Inventory',\n pageSubtitle: 'Product catalog and stock management',\n dashboard: 'Dashboard',\n products: 'Products',\n productsNew: 'New',\n productsList: 'List',\n stock: 'Stock',\n stockEntry: 'Entry',\n stockExit: 'Exit',\n stockHistory: 'History',\n recipes: 'Recipes',\n recipesNew: 'New',\n recipesList: 'List',\n}\n\nconst DEFAULT_CURRENCY = { code: 'BRL', locale: 'pt-BR', symbol: 'R$' }\n\nconst DEFAULT_PRODUCT_TYPES = [\n { value: 'ingredient', label: 'Ingredient' },\n { value: 'sale', label: 'For Sale' },\n { value: 'intermediate', label: 'Intermediate' },\n { value: 'asset', label: 'Asset' },\n]\n\n// ---------------------------------------------------------------------------\n// Config resolver\n// ---------------------------------------------------------------------------\n\nfunction resolveConfig(options?: InventoryPluginOptions): ResolvedInventoryConfig {\n return {\n modules: {\n products: options?.modules?.products !== false,\n recipes: options?.modules?.recipes !== false,\n stockLocations: options?.modules?.stockLocations !== false,\n batchTracking: options?.modules?.batchTracking ?? false,\n },\n labels: { ...DEFAULT_LABELS, ...options?.labels },\n currency: { ...DEFAULT_CURRENCY, ...options?.currency },\n productTypes: options?.productTypes ?? DEFAULT_PRODUCT_TYPES,\n locations: options?.locations ?? [],\n }\n}\n\n// ---------------------------------------------------------------------------\n// Factory\n// ---------------------------------------------------------------------------\n\nexport function createInventoryPlugin(options?: InventoryPluginOptions): PluginManifest {\n const config = resolveConfig(options)\n registerTranslations(inventoryLocales)\n const provider = options?.dataProvider ?? createSafeDataProvider(\n () => createSupabaseInventoryProvider(),\n () => createMockInventoryProvider(),\n )\n const store = createInventoryStore(provider)\n const dashboardWidgets = createInventoryDashboardWidgets({ config, provider, store })\n\n const PageComponent: React.FC<any> = () =>\n React.createElement(InventoryPage, { config, provider, store, registries: inventoryRegistries })\n\n return {\n id: 'inventory',\n defaultAgentRole: 'operations',\n name: config.labels.pageTitle,\n icon: 'Package',\n version: '1.0.0',\n scope: options?.scope ?? 'universal',\n verticalId: options?.verticalId,\n defaultEnabled: true,\n dependencies: [],\n declaredFeatures: [\n { id: 'inventory', label: config.labels.pageTitle, group: config.labels.pageTitle },\n ...(config.modules.recipes ? [{ id: 'inventory.recipes', label: config.labels.recipes ?? 'Recipes', group: config.labels.pageTitle }] : []),\n ],\n queryEntities: [\n {\n key: 'inventory:products',\n writable: true,\n entity: {\n name: 'Product',\n namePlural: 'Products',\n icon: 'Package',\n limitKey: 'products',\n permission: { feature: 'inventory', action: 'read' },\n fields: [\n { key: 'name', label: 'Name', type: 'text', required: true, searchable: true },\n { key: 'kind', label: 'Kind (sale/ingredient/asset)', type: 'text' },\n { key: 'price', label: 'Price', type: 'number' },\n { key: 'cost', label: 'Cost', type: 'number' },\n { key: 'sku', label: 'SKU', type: 'text', searchable: true },\n { key: 'isActive', label: 'Active', type: 'boolean' },\n { key: 'createdAt', label: 'Created at', type: 'text' },\n ],\n data: {\n table: 'products',\n tenantScoped: true,\n archetype: 'product',\n archetypeKind: 'sale',\n searchColumns: ['name', 'sku'],\n defaults: { kind: 'sale', status: 'active', is_active: true },\n },\n },\n },\n ],\n declaredLimits: [\n { key: 'products', label: 'Products', table: 'products' },\n ...(config.modules.recipes ? [{ key: 'recipes', label: config.labels.recipes ?? 'Recipes', table: 'plg_inventory_recipes' }] : []),\n ],\n navigation: [\n {\n section: options?.navSection ?? 'main',\n position: options?.navPosition ?? 4,\n label: config.labels.pageTitle,\n route: '/inventory',\n icon: 'Package',\n permission: { feature: 'inventory', action: 'read' as const },\n },\n ],\n routes: [\n {\n path: '/inventory',\n component: PageComponent,\n permission: { feature: 'inventory', action: 'read' as const },\n // Products live on this hand-built page, not a CRUD route, so nothing\n // would register them and a product the assistant just created would\n // resolve to no page at all.\n entityRoutes: ['product:sale', 'product'],\n },\n ],\n widgets: [],\n dashboardWidgets,\n aiTools: [\n {\n id: 'inventory.low-stock',\n name: 'getLowStock',\n description: 'Lists products with stock below minimum threshold.',\n icon: 'AlertTriangle',\n mode: 'read' as const,\n category: 'Inventory',\n parameters: {\n type: 'object' as const,\n properties: {\n threshold: { type: 'number' as const, description: 'Custom stock threshold' },\n },\n },\n suggestions: [\n { label: 'Which products are running low?' },\n { label: 'What ingredients need restocking?', verticalId: 'food' as const },\n { label: 'Show me a stock summary' },\n { label: 'What are my most used products?' },\n ],\n permission: { feature: 'inventory', action: 'read' as const },\n },\n // `role: 'finance'` is on the tool itself — the plugin defaults to\n // 'operations' and cost per dish belongs to the finance colleague.\n ...(config.modules.recipes ? [upsertRecipeTool] : []),\n ],\n declaredRpcs: [\n ...(config.modules.recipes ? [{\n name: 'agent_inventory_upsert_recipe',\n kind: 'write' as const,\n description:\n 'Guarded recipe upsert: agent_guard (role→plan→recipes cap), ingredient names resolved to products.id inside SQL, unmatched ones returned and stored for the screen to recover, audited.',\n audits: true,\n }] : []),\n ],\n registries: inventoryRegistries,\n settings: [\n {\n id: 'inventory',\n label: 'Inventory',\n icon: 'Package',\n // PluginSettingsPanel, not the toggles component directly. Declaring\n // `registries` does nothing for settings on its own — the panel is the\n // only thing that turns them into screens, which is why Stock Locations,\n // Categories, Units and Suppliers all existed in code and appeared\n // nowhere. financial and crm already render through it.\n component: (() => {\n const Tab: React.FC = () => React.createElement(PluginSettingsPanel, {\n title: config.labels.pageTitle,\n generalSettings: React.createElement(InventoryGeneralSettings),\n registries: inventoryRegistries,\n hostPluginId: 'inventory',\n routeBase: '/settings/inventory',\n })\n Tab.displayName = 'InventorySettingsTab'\n return Tab\n })() as unknown as React.ComponentType<unknown>,\n order: 11,\n permission: { feature: 'inventory', action: 'read' as const },\n },\n ],\n locales: inventoryLocales,\n }\n}\n\nexport type { InventoryDataProvider } from './data/types'\nexport type { ResolvedInventoryConfig } from './context'\n\n// The movement vocabulary is exported so data importers map onto the same list\n// the UI renders, instead of keeping a private copy that drifts.\nexport {\n MOVEMENT_TYPES,\n MOVEMENT_TYPE_VALUES,\n LEGACY_PT_MOVEMENT_TYPE,\n movementTypeSpec,\n normalizeMovementType,\n} from './lib/movement-vocabulary'\nexport type { MovementTypeSpec } from './lib/movement-vocabulary'\n"]}
|