feat: gate overseas receiving and harden phase4 workflows

This commit is contained in:
2026-08-25 10:31:04 +08:00
parent cb78bc6b41
commit 52b9fc382f
93 changed files with 2779 additions and 201 deletions
@@ -50,6 +50,19 @@ class WarehouseResourceServiceTest {
.isEqualTo(IdType.ASSIGN_ID);
}
@Test
void resolvesOnlyPublicLocationInsideBoundWarehouse() {
WarehouseLocationEntity location = new WarehouseLocationEntity(); location.setId(30001L);
location.setWarehouseId(WAREHOUSE); location.setCustomerId(0L); location.setLocationCode("A-01");
location.setLocationType("STORAGE"); location.setMaxLoadKg(new BigDecimal("1000")); location.setStatus("IDLE");
when(repository.findLocationByCode(0L, WAREHOUSE, "A-01")).thenReturn(location);
var result = service.resolvePublicLocation(WAREHOUSE, " A-01 ");
assertThat(result.locationId()).isEqualTo(30001L);
assertThat(result.locationCode()).isEqualTo("A-01");
}
@Test
void createsLocationWithSnowflakeAssignedByMapper() {
when(repository.warehouseOwned(TENANT, WAREHOUSE)).thenReturn(true);