Saltar al contenido
HubHub

Inventario

Controla tus existencias en todos los almacenes: niveles, transferencias, ajustes, movimientos y surtido, ligados a tu catálogo de productos. Sirve igual para retail, restaurantes, manufactura, llanteras y farmacias.

Por AstebyComercio

Se instala desde tu panel, en un click. ¿Aún no tienes plataforma? Pruébala 1 mes gratis

Qué puedes hacer

  • Niveles de existencias multialmacén
  • Catálogo de productos con SKU único por organización
  • Movimientos de existencias con bitácora de auditoría
  • Transferencias entre almacenes (varios pasos)
  • Ajustes manuales de inventario
  • Órdenes de surtido
  • Emisión de eventos de bajo stock para suscriptores aguas abajo

Vista previa

Este addon todavía no tiene capturas publicadas.

Lo verás en acción en cuanto lo instales en tu plataforma.

Más información

@asteby/addon-inventory

Foundation addon for inventory management across the Asteby ecosystem. Universal across retail, restaurant, manufacturing, tire shops and pharmacy verticals.

Status

Wave 2.2 (real-code import from ops/backend/core/inventory/). See /ROADMAP.md at the repo root.

Contents

| Path | What | |---|---| | manifest.json | Module Contract v3 addon manifest (8 models, RBAC, events, settings). | | backend/ | Go module (github.com/asteby-hq/addons/packages/inventory/backend) — handlers, services, models migrated from ops core. | | backend/internal/models/ | Local copy of ops meta-core/models registry helpers. TODO: move these to metacore-kernel so addons don't duplicate the registry. | | backend/internal/database/ | Local copy of ops meta-core/database Fiber audit-context helper. TODO: same as above. | | frontend/ | Vite + React bundle (@asteby/addon-inventory-ui) — currently stub routes (src/routes/*.tsx) + the real ops screens parked in src/routes/ops/ as reference for Wave 2.3 wiring. | | locales/ | i18n bundles (es-MX, en-US). | | schemas/ | JSON Schemas for events (stockchanged, lowstockdetected) and settings. | | migrations/ | DDL bootstrap (001init.up.sql). | | assets/ | Icon + screenshots. |

Backend models migrated

13 .go files / 1,911 LOC, imported from ops/backend/core/inventory/ with zero rewrites — cp + import-path edits only.

  • adjustment.go — InventoryAdjustment, InventoryAdjustmentLine
  • fulfillment.go — FulfillmentOrder, FulfillmentOrderItem
  • fulfillmentroutes.go, fulfillmentservice.go — fulfillment lifecycle
  • kardex_routes.go — stock ledger + CSV export
  • productattribute.go, productcategory.go, product_variant.go
  • receipt_service.go — goods receipt confirmation + weighted-avg cost
  • register.go — models.RegisterModel(...) calls (init time)
  • stock.go — StockLevel, StockMovement
  • transfer.go — WarehouseTransfer, WarehouseTransferItem
  • warehouse.go — Warehouse, WarehouseLocation

Kardex conventions

  • inventorymovements.balanceafter is the stock of the cell (product, variant, warehouse) AFTER the movement, for every writer (sale, customerreturn, adjustment, warehousepick and its reversal). The DB trigger (migration 024) stamps it from the stock row at INSERT time, so a writer must apply its stock delta BEFORE inserting the movement (inside the same transaction when it uses data_batch).
  • inventory_movements.notes carries the why: the note (or reason) of an adjustment, the sale number of a warehouse pick.
  • Oversell debt (inventorydebts, #2584): whoever takes the stock out registers the debt when the cell ends negative and the next receipt / adjustment pays it FIFO. With warehouse installed that is the PICK (warehouse); without it, inventory's onsale_line. Both use the same deterministic debt id, so a line never owes twice.

Build

From the monorepo root:

pnpm install
pnpm -w run typecheck
pnpm -w run build
cd packages/inventory/backend && go build ./...

Wave 2.3 follow-up

  • Promote internal/models + internal/database helpers into metacore-kernel (or metacore-sdk) so other addons don't duplicate the registry.
  • Promote @/components/dynamic/* (DynamicTable, ProductCreateDialog, ProductViewDialog) from ops/frontend into @asteby/metacore-runtime-react.
  • Wire src/routes/ops/* into the addon's federated entry (src/index.ts) once the shared components above are reusable.
  • Replace direct-DB cross-package coupling in receiptservice.updatePurchaseOrderState() and fulfillmentservice.CreateFulfillmentOrder() with the kernel event bus (PRs #75–77 mergeados).
  • Backfill unit tests (none in ops today).
  • Replace inline Spanish status labels in transfer.go (Borrador, Confirmado, etc.) with i18n keys served from locales/.