优化
This commit is contained in:
@@ -146,12 +146,7 @@ export function customsCaseFieldGaps(record) {
|
||||
|
||||
export function outboundAggregateFieldGaps(record) {
|
||||
const aggregate = record?.aggregate ?? record
|
||||
return gaps(aggregate, {
|
||||
orderId: isPositiveId,
|
||||
inboundId: isPositiveId,
|
||||
inboundCode: isNonBlank,
|
||||
customerId: isPositiveId,
|
||||
customerName: isNonBlank,
|
||||
const result = gaps(aggregate, {
|
||||
containerBookingId: isPositiveId,
|
||||
containerNo: isNonBlank,
|
||||
loadingPlanId: isPositiveId,
|
||||
@@ -162,6 +157,14 @@ export function outboundAggregateFieldGaps(record) {
|
||||
oceanBookingStatus: isNonBlank,
|
||||
dispatchStatus: isNonBlank,
|
||||
version: isNonNegativeNumber,
|
||||
'gate.items': (value) => Array.isArray(value),
|
||||
inbounds: (value) => Array.isArray(value) && value.length > 0,
|
||||
'gate.inbounds': (value) => Array.isArray(value) && value.length > 0,
|
||||
})
|
||||
for (const [index, inbound] of (Array.isArray(aggregate?.inbounds) ? aggregate.inbounds : []).entries()) {
|
||||
result.push(...gaps(inbound, {
|
||||
orderId: isPositiveId, inboundId: isPositiveId, inboundCode: isNonBlank,
|
||||
tenantId: isPositiveId, inboundStatus: isNonBlank,
|
||||
}).map((field) => `inbounds[${index}].${field}`))
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user