test(phase4): provision overseas lifecycle fixtures
This commit is contained in:
+8
-1
@@ -27,7 +27,7 @@ public class RelabelApplicationController {
|
||||
public ApiResponse<RelabelResponses.Detail> create(@AuthenticationPrincipal AuthenticatedUser user,
|
||||
@Valid @RequestBody RelabelRequests.Create request) {
|
||||
requirePlatform(user);
|
||||
return ApiResponse.success(service.create("0", operator(user), request));
|
||||
return ApiResponse.success(service.create(requiredCustomer(request.customerId()), operator(user), request));
|
||||
}
|
||||
@GetMapping
|
||||
@PreAuthorize("hasAuthority('" + OverseasPermissions.RELABEL_ORDER_LIST + "')")
|
||||
@@ -60,5 +60,12 @@ public class RelabelApplicationController {
|
||||
throw new ResponseStatusException(HttpStatus.FORBIDDEN, "Platform application required");
|
||||
}
|
||||
}
|
||||
private String requiredCustomer(String customerId) {
|
||||
String value = customerId == null ? null : customerId.trim();
|
||||
if (value == null || value.isEmpty() || "0".equals(value)) {
|
||||
throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Target customerId is required");
|
||||
}
|
||||
return value;
|
||||
}
|
||||
private String operator(AuthenticatedUser user) { return user.userId() == null ? user.username() : String.valueOf(user.userId()); }
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ public final class RelabelRequests {
|
||||
private RelabelRequests() {}
|
||||
|
||||
public record Create(
|
||||
@Size(max = 32) String customerId,
|
||||
@NotBlank @Size(max = 128) String customerOrderNo,
|
||||
@NotBlank @Size(max = 128) String overseasWarehouseId,
|
||||
@NotNull LocalDateTime labelDeadline,
|
||||
|
||||
Reference in New Issue
Block a user