import { LoadingWorksheet, LoadingWorksheetDetails } from './loading-worksheet-type'
import { DeliveryOrderInfoList } from './delivery-order-info-list'
import { LoadingAssignmentStatus } from './loading-assignment'

export const Query = `
  findLoadableReleaseGood(orderNo: String!, tabName: String!): [ReleaseGood] @transaction
  findLoadableReleaseGoodByBin(orderNo: String!): LoadingWorksheet @transaction
  loadingWorksheetv2(orderNo: String!, filter: String): LoadingWorksheet @transaction
  getDeliveryOrders(releaseGoodNo: String!): DeliveryOrderInfoList 
  myLoadingAssignmentStatus: LoadingAssignmentStatus
`

export const Mutation = `
  getLoadingTask: LoadingWorksheet @privilege(category: "worksheet_control", privilege: "mutation") @transaction
  sortItem(
    releaseGoodNo: String!
    productBarcode: String!
    qty: Float!
    worksheetDetails: [Object!]
    toteNo: String
  ): Boolean @transaction
  unsortItem(
    orderToteItemId: String!
    reason: String
  ): Boolean @transaction
  loadByQty(worksheetDetailPatch: LoadingWorksheetDetails): Boolean @transaction
  undoLoad(doId: String!): Boolean @transaction
  warehouseReturn (releaseGoodNo: String!, worksheetDetails: [Object!]): Worksheet @privilege(category: "worksheet_control", privilege: "mutation") @transaction
  completeLoad(orderId: String!, worksheetId: String!): Boolean @transaction
  completeLoadPartially(orderId: String!, worksheetId: String!): Boolean @transaction
`

export const Types = [LoadingWorksheet, LoadingWorksheetDetails, DeliveryOrderInfoList, LoadingAssignmentStatus]
