test(admin): unwrap container workbench details

This commit is contained in:
2026-09-09 01:52:59 +08:00
parent c5d73b8e8f
commit 04c056f744
3 changed files with 8 additions and 4 deletions
@@ -25,6 +25,7 @@ function failure(response) {
return [400, 401, 403, 404, 409, 503].includes(response?.http)
|| (response?.http === 200 && codeOf(response) !== '200')
}
function containerRecord(value) { return value?.container || value }
async function ensureMatsonSupplier(context, records) {
const existing = records.find((value) => value?.id && value?.name === MATSON_SUPPLIER_NAME)
@@ -507,7 +508,7 @@ export async function run(context) {
`bookingId=${bookingId || 'missing'}, status=${bookingConfirmed?.oceanBooking?.status || 'missing'}`, OPTIONS)
if (!bookingId || !requirement?.id || !frozenTransportMatches) return
const latestContainerResponse = await context.request('GET', `/api/platform/v1/containers/domestic/${containerBookingId}`)
const latestContainer = context.apiSuccess(MODULE, '合并前读取模拟柜最新版本', latestContainerResponse, '', OPTIONS)
const latestContainer = containerRecord(context.apiSuccess(MODULE, '合并前读取模拟柜最新版本', latestContainerResponse, '', OPTIONS))
const linkResponse = await request(context, 'POST', `/api/platform/v1/containers/${containerBookingId}/ocean-booking-link`, {
oceanBookingId: bookingId, requirementId: id(requirement.id),
...(LATE_CONTAINER_GATE_ONLY ? {} : { containerNo }),