优化
This commit is contained in:
@@ -3,6 +3,8 @@ import type {
|
||||
InboundMeasurementDetail,
|
||||
InboundMeasurementDraftSaved,
|
||||
InboundMeasurementSubmitted,
|
||||
CartonMeasurementResult,
|
||||
ConfirmedPackageCountRequest,
|
||||
SaveInboundMeasurementDraftRequest,
|
||||
SubmitInboundMeasurementRequest,
|
||||
} from './types'
|
||||
@@ -11,11 +13,27 @@ function measurementPath(inboundId: string) {
|
||||
return `/platform/v1/first-leg/inbounds/${encodeURIComponent(inboundId)}/measurement`
|
||||
}
|
||||
|
||||
export async function updateConfirmedPackageCount(
|
||||
customerId: string,
|
||||
inboundId: string,
|
||||
itemId: string,
|
||||
payload: ConfirmedPackageCountRequest,
|
||||
) {
|
||||
const response = await http.put<ApiEnvelope<CartonMeasurementResult>, ApiEnvelope<CartonMeasurementResult>>(
|
||||
`${measurementPath(inboundId)}/items/${segment(itemId)}/confirmed-package-count`,
|
||||
payload,
|
||||
{ params: { tenantId: customerId } },
|
||||
)
|
||||
return unwrapApiResponse(response)
|
||||
}
|
||||
|
||||
function segment(value: string) {
|
||||
return encodeURIComponent(value)
|
||||
}
|
||||
|
||||
export async function getInboundMeasurement(customerId: string, inboundId: string) {
|
||||
// Device-scanned fields expected from the backend: originalPackageCount and
|
||||
// items[].boxCode, machineNo, measuredAt. Keep this compatibility mapping here.
|
||||
const response = await http.get<ApiEnvelope<InboundMeasurementDetail>, ApiEnvelope<InboundMeasurementDetail>>(
|
||||
measurementPath(inboundId),
|
||||
{ params: { tenantId: customerId } },
|
||||
|
||||
Reference in New Issue
Block a user