Files
baiyue-firstleg/lastleg-service/src/main/java/com/baiyue/lastleg/appointmentplanning/AppointmentExternalSourceGateway.java
T

21 lines
1.3 KiB
Java

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 Candidate(String customerId, String customerName, String bookingNo, String tripNo, String destinationKey) { }
record CandidateQuery(int page, int size, List<String> originIds, List<String> destinationCodes,
String warehouseId, String destination, String keyword) { }
com.baiyue.common.core.api.PageResult<Candidate> candidates(CandidateQuery query);
record SourceRef(String customerId, String bookingNo) { }
record OrderRef(String customerId, Long orderId) { }
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);
/** 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);
}