2026-10-09 22:04:49 +08:00
|
|
|
package com.baiyue.lastleg.appointmentplanning;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/** Implemented by the external-booking owner; planning must not query Fleet's persistence directly. */
|
|
|
|
|
public interface AppointmentExternalSourceGateway {
|
|
|
|
|
record SourceRef(String customerId, String bookingNo) { }
|
2026-10-10 10:38:06 +08:00
|
|
|
record OrderRef(String customerId, Long orderId) { }
|
2026-10-09 22:04:49 +08:00
|
|
|
record Source(String customerId, String bookingNo, String tripNo, String bookingStatus,
|
|
|
|
|
String warehouseId, String destinationKey, Long orderId, Integer packageCount, Long recordVersion) { }
|
|
|
|
|
List<Source> resolve(List<SourceRef> sources);
|
2026-10-10 10:38:06 +08:00
|
|
|
/** Returns existing original bookings only, for canonicalizing post-receipt selections. Never creates a booking. */
|
|
|
|
|
List<Source> resolveOrders(List<OrderRef> orders);
|
|
|
|
|
/** Inside the caller transaction, lock original booking rows in stable order before validating an appointment write. */
|
|
|
|
|
void lockForAppointment(List<SourceRef> sources);
|
2026-10-09 22:04:49 +08:00
|
|
|
}
|