fix: support multi-customer overseas receiving containers
This commit is contained in:
+3
-3
@@ -44,7 +44,7 @@ public class CarrierScheduleNodeOutboxService {
|
||||
}
|
||||
ZoneId zone = ZoneId.of(scheduleZone);
|
||||
var payload = new FirstLegContainerShippingNodeRecordedV1(
|
||||
string(query.getId()), string(query.getCustomerId()), string(query.getOceanBookingId()),
|
||||
string(query.getId()), string(query.getOceanBookingId()),
|
||||
string(query.getContainerBookingId()), normalizedContainerNo,
|
||||
fact.getStandardNode(), fact.getNodeSequence(),
|
||||
fact.getObservedAt().atZone(zone).toInstant(), fact.getActualAt().atZone(zone).toInstant(),
|
||||
@@ -57,12 +57,12 @@ public class CarrierScheduleNodeOutboxService {
|
||||
EventEnvelope envelope = new EventEnvelope(EventIdentifiers.newUuid(),
|
||||
EventTypes.FIRST_LEG_CONTAINER_SHIPPING_NODE_RECORDED, 1,
|
||||
fact.getActualAt().atZone(zone).toInstant(), RegionCode.CN, RegionCode.OVERSEAS,
|
||||
string(query.getCustomerId()), "CONTAINER_BOOKING", string(query.getContainerBookingId()),
|
||||
"0", "CONTAINER_BOOKING", string(query.getContainerBookingId()),
|
||||
aggregateVersion, aggregateVersion + 1, EventIdentifiers.newUuid(), eventKey, null,
|
||||
payloadNode, payloadHash).requireValid();
|
||||
|
||||
InboundOutboxEntity row = new InboundOutboxEntity();
|
||||
row.setId(IdWorker.getId()); row.setTenantId(query.getCustomerId());
|
||||
row.setId(IdWorker.getId()); row.setTenantId(0L);
|
||||
row.setAggregateType(envelope.aggregateType()); row.setAggregateId(query.getContainerBookingId());
|
||||
row.setEventType(envelope.eventType()); row.setEventKey(eventKey); row.setEventVersion(1);
|
||||
row.setAggregateSequence(Math.toIntExact(aggregateVersion)); row.setPayloadHash(payloadHash);
|
||||
|
||||
+3
@@ -50,6 +50,8 @@ class CarrierScheduleNodeOutboxServiceTest {
|
||||
assertThat(row.getEventType()).isEqualTo(EventTypes.FIRST_LEG_CONTAINER_SHIPPING_NODE_RECORDED);
|
||||
assertThat(envelope.eventVersion()).isEqualTo(1);
|
||||
assertThat(envelope.aggregateType()).isEqualTo("CONTAINER_BOOKING");
|
||||
assertThat(envelope.tenantId()).isEqualTo("0");
|
||||
assertThat(row.getTenantId()).isZero();
|
||||
assertThat(envelope.aggregateId()).isEqualTo("2088000000000000003");
|
||||
assertThat(envelope.aggregateVersion()).isEqualTo(7);
|
||||
assertThat(envelope.handoverVersion()).isEqualTo(8);
|
||||
@@ -57,6 +59,7 @@ class CarrierScheduleNodeOutboxServiceTest {
|
||||
assertThat(envelope.payload().path("sourceContainerBookingId").asText())
|
||||
.isEqualTo("2088000000000000003");
|
||||
assertThat(envelope.payload().has("containerBookingId")).isFalse();
|
||||
assertThat(envelope.payload().has("customerId")).isFalse();
|
||||
assertThat(envelope.payload().path("actualAt").asText()).isEqualTo("2026-08-25T01:00:00Z");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user