feat(appointments): support scoped receiving and stable trip continuation

This commit is contained in:
2026-10-16 15:43:04 +08:00
parent 4e2ea89403
commit 30f48bd926
84 changed files with 4879 additions and 136 deletions
@@ -7,6 +7,19 @@ import java.util.regex.Pattern;
import static org.junit.jupiter.api.Assertions.*;
class AppointmentWorkSchemaContractTest {
@Test void receivingCoverageSchemaMatchesBothInitializationEntriesWithoutLegacyHeaderUniqueness() throws Exception {
String source=Files.readString(Path.of("src/main/resources/db/appointment-receiving.sql"));
for(String path:List.of("src/main/resources/db/lastleg.sql","../deploy/sql/海外区域统一增量-MySQL8.sql")) {
String target=Files.readString(Path.of(path));
for(String table:List.of("ll_fba_receiving_agreement","ll_fba_receiving_member","ll_fba_receiving_change","ll_fba_receiving_revision","ll_fba_receiving_plan"))
assertEquals(definition(source,table),definition(target,table),path+" differs for "+table);
assertFalse(target.contains("uk_ll_fba_external_confirmation"),"An aggregate header cannot own independently confirmed customer appointments");
}
String reset=Files.readString(Path.of("../deploy/sql/reset-test-fba-appointments.sql"));
int guardEnd=reset.indexOf("CALL assert_test_appointment_reset_preconditions()");
for(String table:List.of("ll_fba_receiving_agreement","ll_fba_receiving_member","ll_fba_receiving_change","ll_fba_receiving_revision","ll_fba_receiving_plan"))
assertTrue(reset.substring(0,guardEnd).contains("'"+table+"'"),"Old reset must refuse receiving history: "+table);
}
@Test void completeWorkAndPhysicalAllocationSchemaMatchesBothInitializationEntries() throws Exception {
String source=Files.readString(Path.of("src/main/resources/db/appointment-work.sql"));
for(String path:List.of("src/main/resources/db/lastleg.sql","../deploy/sql/海外区域统一增量-MySQL8.sql")) {