feat(order): expose cargo shipment binding

This commit is contained in:
2026-09-08 17:17:57 +08:00
parent 2e60f2cd77
commit e597bebafd
3 changed files with 53 additions and 3 deletions
@@ -89,6 +89,8 @@ class InternalOrderCargoControllerTest {
void listsCargoInRepositoryOrderForStableCartonAllocation() {
OrderCargoEntity first = cargo(31L, 1, 3, "60", "40", "30");
OrderCargoEntity second = cargo(32L, 2, 2, "50", "30", "20");
first.setShipmentId("FBA-SHIPMENT-31");
second.setShipmentId("FBA-SHIPMENT-32");
when(orders.findCargoInheritedByOrder(11L, 21L)).thenReturn(List.of(first, second));
var response = controller.listForCartonLabels("internal-token", 11L, 21L);
@@ -98,6 +100,8 @@ class InternalOrderCargoControllerTest {
.containsExactly(31L, 32L);
assertThat(response.data().get(0).packageCount()).isEqualTo(3);
assertThat(response.data().get(0).lengthCm()).isEqualByComparingTo("60");
assertThat(response.data()).extracting(InternalOrderCargoController.CargoLabelBinding::shipmentId)
.containsExactly("FBA-SHIPMENT-31", "FBA-SHIPMENT-32");
verify(orders).findCargoInheritedByOrder(11L, 21L);
}