fix(firstleg): instantiate PDA progress projection
This commit is contained in:
@@ -48,12 +48,23 @@ public interface LoadingPickItemMapper extends BaseMapper<LoadingPickItemEntity>
|
|||||||
InboundProgress selectInboundProgress(@Param("tenantId") long tenantId,
|
InboundProgress selectInboundProgress(@Param("tenantId") long tenantId,
|
||||||
@Param("inboundId") long inboundId);
|
@Param("inboundId") long inboundId);
|
||||||
|
|
||||||
interface InboundProgress {
|
class InboundProgress {
|
||||||
Integer getExpectedCount();
|
private Integer expectedCount;
|
||||||
Integer getPickedCount();
|
private Integer pickedCount;
|
||||||
Integer getTaskCount();
|
private Integer taskCount;
|
||||||
Integer getCompletedTaskCount();
|
private Integer completedTaskCount;
|
||||||
Integer getUnresolvedCount();
|
private Integer unresolvedCount;
|
||||||
|
|
||||||
|
public Integer getExpectedCount() { return expectedCount; }
|
||||||
|
public void setExpectedCount(Integer expectedCount) { this.expectedCount = expectedCount; }
|
||||||
|
public Integer getPickedCount() { return pickedCount; }
|
||||||
|
public void setPickedCount(Integer pickedCount) { this.pickedCount = pickedCount; }
|
||||||
|
public Integer getTaskCount() { return taskCount; }
|
||||||
|
public void setTaskCount(Integer taskCount) { this.taskCount = taskCount; }
|
||||||
|
public Integer getCompletedTaskCount() { return completedTaskCount; }
|
||||||
|
public void setCompletedTaskCount(Integer completedTaskCount) { this.completedTaskCount = completedTaskCount; }
|
||||||
|
public Integer getUnresolvedCount() { return unresolvedCount; }
|
||||||
|
public void setUnresolvedCount(Integer unresolvedCount) { this.unresolvedCount = unresolvedCount; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@Select("""
|
@Select("""
|
||||||
|
|||||||
+19
@@ -10,6 +10,25 @@ import java.lang.reflect.Method;
|
|||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
class LoadingPickItemMapperContractTest {
|
class LoadingPickItemMapperContractTest {
|
||||||
|
@Test
|
||||||
|
void inboundProgressProjectionCanBeInstantiatedByMyBatis() throws Exception {
|
||||||
|
LoadingPickItemMapper.InboundProgress progress = LoadingPickItemMapper.InboundProgress.class
|
||||||
|
.getDeclaredConstructor().newInstance();
|
||||||
|
|
||||||
|
progress.setExpectedCount(5);
|
||||||
|
progress.setPickedCount(3);
|
||||||
|
progress.setTaskCount(2);
|
||||||
|
progress.setCompletedTaskCount(1);
|
||||||
|
progress.setUnresolvedCount(1);
|
||||||
|
|
||||||
|
assertThat(LoadingPickItemMapper.InboundProgress.class).isNotInterface();
|
||||||
|
assertThat(progress.getExpectedCount()).isEqualTo(5);
|
||||||
|
assertThat(progress.getPickedCount()).isEqualTo(3);
|
||||||
|
assertThat(progress.getTaskCount()).isEqualTo(2);
|
||||||
|
assertThat(progress.getCompletedTaskCount()).isEqualTo(1);
|
||||||
|
assertThat(progress.getUnresolvedCount()).isEqualTo(1);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void completionCheckCoversAllActivePlanItems() throws Exception {
|
void completionCheckCoversAllActivePlanItems() throws Exception {
|
||||||
Method method = LoadingPickItemMapper.class.getDeclaredMethod("unfinishedCount", long.class);
|
Method method = LoadingPickItemMapper.class.getDeclaredMethod("unfinishedCount", long.class);
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
const MODULE = 'phase3-order-splitting'
|
const MODULE = 'phase3-order-splitting'
|
||||||
const SCENARIO = 'parent-child-multi-container-consolidation'
|
const SCENARIO = 'parent-child-multi-container-consolidation'
|
||||||
const OPTIONS = { scenario: SCENARIO, deploymentBlocker: true }
|
const OPTIONS = { scenario: SCENARIO, deploymentBlocker: true }
|
||||||
|
const MERCHANT_USERNAME = process.env.MERCHANT_TEST_USERNAME || 'merchant_admin'
|
||||||
|
const MERCHANT_PASSWORD = process.env.MERCHANT_TEST_PASSWORD || 'ChangeMe123!'
|
||||||
|
|
||||||
function id(value) { return value == null ? '' : String(value) }
|
function id(value) { return value == null ? '' : String(value) }
|
||||||
function codeOf(response) { return response?.body?.code == null ? 'missing' : String(response.body.code) }
|
function codeOf(response) { return response?.body?.code == null ? 'missing' : String(response.body.code) }
|
||||||
@@ -71,7 +73,7 @@ export async function run(context) {
|
|||||||
// Re-query through the real merchant contract as well. The customer scope is
|
// Re-query through the real merchant contract as well. The customer scope is
|
||||||
// taken from the token; no tenant/customer id is accepted by this endpoint.
|
// taken from the token; no tenant/customer id is accepted by this endpoint.
|
||||||
const merchantLogin = await context.request('POST', '/api/auth/login', {
|
const merchantLogin = await context.request('POST', '/api/auth/login', {
|
||||||
username: 'merchant_admin', password: 'ChangeMe123!',
|
username: MERCHANT_USERNAME, password: MERCHANT_PASSWORD,
|
||||||
}, '')
|
}, '')
|
||||||
const merchantAuth = context.apiSuccess(MODULE, '客户账号登录以验证履约树隔离', merchantLogin, '', OPTIONS)
|
const merchantAuth = context.apiSuccess(MODULE, '客户账号登录以验证履约树隔离', merchantLogin, '', OPTIONS)
|
||||||
const merchantToken = merchantAuth?.accessToken
|
const merchantToken = merchantAuth?.accessToken
|
||||||
|
|||||||
Reference in New Issue
Block a user