import type { DeliveryTask } from '@/types/delivery'

export async function mockDeliveries(): Promise<DeliveryTask[]> {
  await new Promise((r) => setTimeout(r, 60))
  return [
    {
      id: 101,
      missionId: 1,
      missionName: '链式搬运',
      missionTypeName: 'FengTianChainedDeliveryMission',
      srcSiteId: 1,
      srcLabel: '1-取货台 A',
      dstSiteId: 8,
      dstLabel: '8-放货台 B',
      status: '执行中',
      statusCode: 'Fetching',
      carId: 1,
      carName: 'AGV-01',
      priority: 1,
      createTime: new Date().toISOString(),
      overdue: false
    },
    {
      id: 102,
      missionId: 1,
      missionName: '链式搬运',
      missionTypeName: 'FengTianChainedDeliveryMission',
      srcSiteId: 3,
      srcLabel: '3-缓存区',
      dstSiteId: 12,
      dstLabel: '12-工位 W2',
      status: '已下发',
      statusCode: 'Waiting',
      carId: null,
      carName: null,
      priority: 0,
      createTime: new Date(Date.now() - 45 * 60_000).toISOString(),
      overdue: true
    },
    {
      id: 99,
      missionId: 1,
      missionName: '链式搬运',
      missionTypeName: 'FengTianChainedDeliveryMission',
      srcSiteId: 2,
      srcLabel: '2-原料区',
      dstSiteId: 5,
      dstLabel: '5-成品区',
      status: '已完成',
      statusCode: 'Finished',
      carId: 2,
      carName: 'AGV-02',
      priority: 1,
      createTime: new Date(Date.now() - 3600_000).toISOString(),
      overdue: false
    }
  ]
}
