feat(logistics): Shipment — expedicion de carga entre nodos (backend #106)#133
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Backend de #106. Anade el agregado Shipment al contexto logistics (junto a TransportCapacity): el trabajo de mover carga entre nodos, con maquina de estados planned->assigned->in_transit->delivered (->failed/cancelled), items, manifiesto, capacidad asignada (ref #105) y carrier opcional.
Decision clave (#106): UN solo agregado con carrier opcional — traslado interno de inventario = Shipment sin carrier; expedicion con tercero = carrierPrincipal + assignedCapacityId. No se duplican agregados. Generaliza F07.
Casos de uso: CreateShipment, AssignCapacity, MarkInTransit, ConfirmDelivery, CancelShipment, ListShipments, GetMyShipments. Evento de dominio ShipmentDelivered (para futuras recepciones #67/inventario; emitido via el kernel compartido + BullMQ, no integrado aun). Endpoints POST /logistics/shipments (+ assign-capacity/in-transit/deliver/cancel), GET /emergencies/{id}/logistics/shipments, GET /logistics/shipments/mine. Permisos shipment:create/assign/update/read reconciliados con el scope DAG de #108 (preserva 'track' de transportista/hub_manager). Carrier-marca-lo-suyo via check owner-o-coordinador (como el withdraw de #105). Migracion 0029_shipment. gen:api regenerado (7 paths /logistics/shipments). TDD: dominio (27) + casos de uso + integracion. Gate verde: 967/967 tests.
Parte de #106 (el frontend de coordinacion de expediciones + vista transportista va en PR aparte). Junto con #105 desbloquea #107 (matching).