export type OutboundOrderStatus = "draft" | "approved" | "picking" | "dispatched" | "delivered" | "closed" | "cancelled"

export type OutboundOrder = {
  id: string
  outbound_order_no: string
  source_type: string
  source_id: string
  status: OutboundOrderStatus
  target_vault_id: string | null
  target_branch_id: string | null
  bar_count: number
  total_weight_grams: string
  carrier_name: string | null
  tracking_no: string | null
  proof_of_delivery_url: string | null
  proof_uploaded: boolean
  approved_by: string | null
  approved_at: string | null
  picked_by: string | null
  picked_at: string | null
  dispatched_at: string | null
  delivered_at: string | null
  closed_at: string | null
  cancelled_at: string | null
  notes: string | null
  created_by: string | null
  created_at: string
  updated_at: string
}

export type PurchaseReturnStatus = "draft" | "approved" | "prepare_dispatch" | "posted" | "closed" | "cancelled" | "reversed"

export type PurchaseReturn = {
  id: string
  return_no: string
  purchase_order_id: string | null
  supplier_id: string | null
  receiving_order_id: string | null
  source_inventory: string
  status: PurchaseReturnStatus
  bar_count: number
  total_weight_grams: string
  total_value: string
  reason: string | null
  notes: string | null
  approved_by: string | null
  approved_at: string | null
  dispatched_at: string | null
  posted_at: string | null
  closed_at: string | null
  cancelled_at: string | null
  created_by: string | null
  created_at: string
  updated_at: string
}

export type PlatformAllocationStatus = "draft" | "approved" | "posted" | "withdrawn" | "closed" | "cancelled"

export type PlatformAllocation = {
  id: string
  allocation_no: string
  status: PlatformAllocationStatus
  source_vault_id: string | null
  target_vault_id: string | null
  sale_channel: string | null
  reference_offer_price: string | null
  bar_count: number
  total_weight_grams: string
  approved_by: string | null
  approved_at: string | null
  posted_at: string | null
  closed_at: string | null
  notes: string | null
  created_by: string | null
  created_at: string
  updated_at: string
}