优化
This commit is contained in:
@@ -111,12 +111,10 @@ export function portScheduleFieldGaps(record) {
|
||||
}
|
||||
|
||||
export function truckAppointmentFieldGaps(record) {
|
||||
return gaps(record, {
|
||||
const result = gaps(record, {
|
||||
id: isPositiveId,
|
||||
appointmentNo: isNonBlank,
|
||||
oceanBookingId: isPositiveId,
|
||||
containerBookingId: isPositiveId,
|
||||
loadingPlanId: (value) => value == null || isPositiveId(value),
|
||||
warehouseId: (value) => value == null || isPositiveId(value),
|
||||
plannedLoadingAt: isIsoDateTime,
|
||||
status: isNonBlank,
|
||||
@@ -126,6 +124,10 @@ export function truckAppointmentFieldGaps(record) {
|
||||
currency: (value) => value === 'RMB' || value === 'USD',
|
||||
attachmentCount: isNonNegativeNumber,
|
||||
})
|
||||
for (const field of ['containerBookingId', 'loadingPlanId', 'containerNo', 'cabinetNo', 'containers']) {
|
||||
if (Object.hasOwn(record || {}, field)) result.push(`forbidden:${field}`)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
export function customsCaseFieldGaps(record) {
|
||||
|
||||
Reference in New Issue
Block a user