feat(wms): vehículo = Warehouse(kind=vehicle) + maxCapacity + Capacity→kernel (Inc 2 flota)#413
Merged
Merged
Conversation
Mueve Capacity + CapacityProps y sus errores (CapacityMustHaveWeightOrVolumeError, InvalidCapacityAmountError) al kernel, para que inventory y logistics lo compartan sin dependencia cruzada. logistics/capacity.ts y transport-capacity-errors.ts pasan a re-exportar desde el kernel, sin romper a sus consumidores.
Añade WarehouseKind y la carga útil máxima (maxCapacity: Capacity | null) al agregado Warehouse. Invariantes: sólo un vehículo puede declarar maxCapacity (un almacén fijo con capacidad es error); un vehículo puede tenerla sin declarar (null); la capacidad puede ser parcial (sólo peso o sólo volumen). Mutador setMaxCapacity y round-trip por snapshot.
Añade WarehouseNotEmptyError y la función pura assertWarehouseCanBeArchived, que lanza si el almacén todavía tiene StockItems a bordo. El conteo lo aporta el host; el paquete aporta la política, precondición del port de archivado.
Migración wms_0002_vehicles añade a wms.warehouses las columnas kind (CHECK fixed|vehicle, default fixed) y max_weight_kg/max_volume_m3 (numeric null), idempotente. Schema Drizzle, mappers y repo hacen round-trip de kind + maxCapacity (numeric string ↔ number, CapacityProps null si ambas columnas nulas). Int-tests del round-trip de vehículo (capacidad parcial/completa) y del almacén fijo.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #412 · Incremento 2 del EPIC #409. El vehículo como almacén móvil con capacidad. Todo en el paquete (dominio + persistencia), sin HTTP/auth.
Qué incluye
Capacitypromovido delogisticsalkernel(lo comparten inventory y logistics sin dependencia cruzada).logistics/capacity.tsytransport-capacity-errors.tsquedan como re-exports puros →TransportCapacity/window-overlapintactos,instanceofpreservado (misma clase).Warehouseganakind(fixed|vehicle, default fixed) +maxCapacity: Capacity | null(carga útil/payload). InvariantebuildMaxCapacity: solo un vehículo declara capacidad (fijo+capacidad → error); capacidad parcial (solo peso o solo volumen) permitida; vehículo sin declarar (null) ok. MutadorsetMaxCapacity. Round-trip por snapshot.WarehouseNotEmptyError+assertWarehouseCanBeArchived(stockItemCount)puro (el conteo lo aporta el host; el paquete da el guard).wms_0002_vehicles.sql(runner del paquete;kindtext CHECK +max_weight_kg/max_volume_m3numeric, idempotente con guardpg_constraint) + schema + mapper round-trip + int-tests.Verificación (local, por mí)
warehouse-core build + 186 tests · api build + clean typecheck 0 errores (el re-export de Capacity no rompe el host) · warehouse-postgres build + 32 int-tests (contra Postgres local) · prettier packages · api-client + web · frozen-lockfile — todo verde.
Spec §1 · runner de migraciones del paquete valida en el step CI
Test.