fix(appointments): include destination timezone in batch preview

This commit is contained in:
2026-10-10 18:37:38 +08:00
parent c6471d06ff
commit 15ab355dc2
3 changed files with 16 additions and 3 deletions
@@ -16,7 +16,7 @@ public class AppointmentBatchPreviewService {
this.sources=sources;this.mapper=mapper;
}
public record Preview(AppointmentPlanningPolicy.Group group,String originWarehouseName,
String destinationWarehouseCode,List<AppointmentSourceService.Source> sources,
String destinationWarehouseCode,String destinationTimezone,List<AppointmentSourceService.Source> sources,
List<String> missingFields) { }
public Preview preview(List<AppointmentCoverageService.SourceRef> refs) {
var resolved=sources.resolveBatch(refs);
@@ -38,7 +38,8 @@ public class AppointmentBatchPreviewService {
}).toList();
try {
var group=AppointmentPlanningPolicy.group(cargo);
return new Preview(group,resolved.get(0).originWarehouseName(),resolved.get(0).destinationWarehouseCode(),resolved,
return new Preview(group,resolved.get(0).originWarehouseName(),resolved.get(0).destinationWarehouseCode(),
sources.destinationTimezone(resolved.get(0).destinationWarehouseCode()),resolved,
group.unknownQuantitySources()>0?List.of("READY_WINDOW_UNVERIFIED","CARGO_QUANTITY_REVIEW"):List.of("READY_WINDOW_UNVERIFIED"));
} catch(IllegalArgumentException error) {
throw new ResponseStatusException(HttpStatus.BAD_REQUEST,error.getMessage(),error);